From b65353bc3cd90ccce84c328058818d2bb12380ff Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 4 Dec 2021 18:12:03 +0900 Subject: [PATCH 01/43] =?UTF-8?q?fix(client):=20pages=E3=81=A7=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=82=92=E5=AE=9A=E7=BE=A9=E3=81=A7=E3=81=8D=E3=81=AA?= =?UTF-8?q?=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/src/pages/page-editor/page-editor.script-block.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/pages/page-editor/page-editor.script-block.vue b/packages/client/src/pages/page-editor/page-editor.script-block.vue index 1d3dc25d4b..ded9368b89 100644 --- a/packages/client/src/pages/page-editor/page-editor.script-block.vue +++ b/packages/client/src/pages/page-editor/page-editor.script-block.vue @@ -45,10 +45,10 @@ - +
- +
From e42e9530cb8c0b218a013719de9cae3e804680db Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 4 Dec 2021 18:27:31 +0900 Subject: [PATCH 02/43] fix(client): tweak style --- packages/client/src/pages/about.vue | 5 +-- packages/client/src/pages/api-console.vue | 44 ++++++++++--------- .../src/pages/page-editor/page-editor.vue | 10 ++--- packages/client/src/ui/_common_/sidebar.vue | 4 ++ 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/packages/client/src/pages/about.vue b/packages/client/src/pages/about.vue index a3a3d3cfb7..04f68b7201 100644 --- a/packages/client/src/pages/about.vue +++ b/packages/client/src/pages/about.vue @@ -24,7 +24,7 @@ -
+
@@ -34,10 +34,9 @@
+ {{ $ts.tos }} - {{ $ts.tos }} - diff --git a/packages/client/src/pages/api-console.vue b/packages/client/src/pages/api-console.vue index 1c41315d21..594778e539 100644 --- a/packages/client/src/pages/api-console.vue +++ b/packages/client/src/pages/api-console.vue @@ -1,26 +1,28 @@ diff --git a/packages/client/src/os.ts b/packages/client/src/os.ts index 1c3c6d3e59..0f86a8520b 100644 --- a/packages/client/src/os.ts +++ b/packages/client/src/os.ts @@ -172,7 +172,6 @@ export async function popup(component: Component | typeof import('*.vue') | Prom const id = ++popupIdCount; const dispose = () => { - if (_DEV_) console.log('os:popup close', id, component, props, events); // このsetTimeoutが無いと挙動がおかしくなる(autocompleteが閉じなくなる)。Vueのバグ? setTimeout(() => { popups.value = popups.value.filter(popup => popup.id !== id); @@ -188,7 +187,6 @@ export async function popup(component: Component | typeof import('*.vue') | Prom id, }; - if (_DEV_) console.log('os:popup open', id, component, props, events); popups.value.push(state); return { From e804a299e068afcbfb2fe36cc429b9a502a7b2d9 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 5 Dec 2021 20:01:52 +0900 Subject: [PATCH 09/43] fix(client): better hover detection --- .../client/src/components/notification.vue | 8 +-- .../components/reactions-viewer.reaction.vue | 8 +-- .../client/src/components/renote-button.vue | 8 +-- packages/client/src/scripts/use-tooltip.ts | 49 ++++++++++++++----- 4 files changed, 41 insertions(+), 32 deletions(-) diff --git a/packages/client/src/components/notification.vue b/packages/client/src/components/notification.vue index 15d36f5a64..37a88edc64 100644 --- a/packages/client/src/components/notification.vue +++ b/packages/client/src/components/notification.vue @@ -19,10 +19,6 @@ :reaction="notification.reaction ? notification.reaction.replace(/^:(\w+):$/, ':$1@.:') : notification.reaction" :custom-emojis="notification.note.emojis" :no-style="true" - @touchstart.passive="onReactionMouseover" - @mouseover="onReactionMouseover" - @mouseleave="onReactionMouseleave" - @touchend="onReactionMouseleave" />
@@ -151,7 +147,7 @@ export default defineComponent({ os.api('users/groups/invitations/reject', { invitationId: props.notification.invitation.id }); }; - const { onMouseover: onReactionMouseover, onMouseleave: onReactionMouseleave } = useTooltip((showing) => { + useTooltip(reactionRef, (showing) => { os.popup(XReactionTooltip, { showing, reaction: props.notification.reaction ? props.notification.reaction.replace(/^:(\w+):$/, ':$1@.:') : props.notification.reaction, @@ -170,8 +166,6 @@ export default defineComponent({ rejectFollowRequest, acceptGroupInvitation, rejectGroupInvitation, - onReactionMouseover, - onReactionMouseleave, elRef, reactionRef, }; diff --git a/packages/client/src/components/reactions-viewer.reaction.vue b/packages/client/src/components/reactions-viewer.reaction.vue index 44c6e98093..a1de99f018 100644 --- a/packages/client/src/components/reactions-viewer.reaction.vue +++ b/packages/client/src/components/reactions-viewer.reaction.vue @@ -6,10 +6,6 @@ class="hkzvhatu _button" :class="{ reacted: note.myReaction == reaction, canToggle }" @click="toggleReaction()" - @touchstart.passive="onMouseover" - @mouseover="onMouseover" - @mouseleave="onMouseleave" - @touchend="onMouseleave" > {{ count }} @@ -90,7 +86,7 @@ export default defineComponent({ if (!props.isInitial) anime(); }); - const { onMouseover, onMouseleave } = useTooltip(async (showing) => { + useTooltip(buttonRef, async (showing) => { const reactions = await os.api('notes/reactions', { noteId: props.note.id, type: props.reaction, @@ -113,8 +109,6 @@ export default defineComponent({ buttonRef, canToggle, toggleReaction, - onMouseover, - onMouseleave, }; }, }); diff --git a/packages/client/src/components/renote-button.vue b/packages/client/src/components/renote-button.vue index 280283ec67..446686de10 100644 --- a/packages/client/src/components/renote-button.vue +++ b/packages/client/src/components/renote-button.vue @@ -3,10 +3,6 @@ ref="buttonRef" class="eddddedb _button canRenote" @click="renote()" - @touchstart.passive="onMouseover" - @mouseover="onMouseover" - @mouseleave="onMouseleave" - @touchend="onMouseleave" >

{{ count }}

@@ -42,7 +38,7 @@ export default defineComponent({ const canRenote = computed(() => ['public', 'home'].includes(props.note.visibility) || props.note.userId === $i.id); - const { onMouseover, onMouseleave } = useTooltip(async (showing) => { + useTooltip(buttonRef, async (showing) => { const renotes = await os.api('notes/renotes', { noteId: props.note.id, limit: 11 @@ -87,8 +83,6 @@ export default defineComponent({ buttonRef, canRenote, renote, - onMouseover, - onMouseleave, }; }, }); diff --git a/packages/client/src/scripts/use-tooltip.ts b/packages/client/src/scripts/use-tooltip.ts index f72dcb162d..0df4baca7b 100644 --- a/packages/client/src/scripts/use-tooltip.ts +++ b/packages/client/src/scripts/use-tooltip.ts @@ -1,8 +1,16 @@ -import { Ref, ref } from 'vue'; -import { isScreenTouching, isTouchUsing } from './touch'; +import { Ref, ref, watch } from 'vue'; -export function useTooltip(onShow: (showing: Ref) => void) { +export function useTooltip( + elRef: Ref, + onShow: (showing: Ref) => void, +): void { let isHovering = false; + + // iOS(Androidも?)では、要素をタップした直後に(おせっかいで)mouseoverイベントを発火させたりするため、それを無視するためのフラグ + // 無視しないと、画面に触れてないのにツールチップが出たりし、ユーザビリティが損なわれる + // TODO: 一度でもタップすると二度とマウスでツールチップ出せなくなるのをどうにかする 定期的にfalseに戻すとか...? + let shouldIgnoreMouseover = false; + let timeoutId: number; let changeShowingState: (() => void) | null; @@ -11,11 +19,6 @@ export function useTooltip(onShow: (showing: Ref) => void) { close(); if (!isHovering) return; - // iOS(Androidも?)では、要素をタップした直後に(おせっかいで)mouseoverイベントを発火させたりするため、その対策 - // これが無いと、画面に触れてないのにツールチップが出たりしてしまう - // TODO: タッチとマウス両方使っている環境では、マウス操作でツールチップ出せなくなるのをどうにかする - if (isTouchUsing && !isScreenTouching) return; - const showing = ref(true); onShow(showing); changeShowingState = () => { @@ -32,6 +35,7 @@ export function useTooltip(onShow: (showing: Ref) => void) { const onMouseover = () => { if (isHovering) return; + if (shouldIgnoreMouseover) return; isHovering = true; timeoutId = window.setTimeout(open, 300); }; @@ -43,8 +47,31 @@ export function useTooltip(onShow: (showing: Ref) => void) { close(); }; - return { - onMouseover, - onMouseleave, + const onTouchstart = () => { + shouldIgnoreMouseover = true; + if (isHovering) return; + isHovering = true; + timeoutId = window.setTimeout(open, 300); }; + + const onTouchend = () => { + if (!isHovering) return; + isHovering = false; + window.clearTimeout(timeoutId); + close(); + }; + + const stop = watch(elRef, () => { + if (elRef.value) { + stop(); + const el = elRef.value instanceof Element ? elRef.value : elRef.value.$el; + el.addEventListener('mouseover', onMouseover, { passive: true }); + el.addEventListener('mouseleave', onMouseleave, { passive: true }); + el.addEventListener('touchstart', onTouchstart, { passive: true }); + el.addEventListener('touchend', onTouchend, { passive: true }); + } + }, { + immediate: true, + flush: 'post', + }); } From 7eedb9b19b1386d5b07bc6639a6a0170e83b8bdd Mon Sep 17 00:00:00 2001 From: futchitwo <74236683+futchitwo@users.noreply.github.com> Date: Sun, 5 Dec 2021 21:52:57 +0900 Subject: [PATCH 10/43] =?UTF-8?q?Fix(client):=20i=E3=82=92=E3=83=91?= =?UTF-8?q?=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E3=83=BC=E3=81=AB=E5=90=AB?= =?UTF-8?q?=E3=82=81=E3=81=A6=E3=82=82=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB?= =?UTF-8?q?=E3=83=88=E3=81=AEi=E3=81=8C=E4=BB=98=E4=B8=8E=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20(#8039?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/client/src/pages/api-console.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/pages/api-console.vue b/packages/client/src/pages/api-console.vue index 16018be712..142a3bee2e 100644 --- a/packages/client/src/pages/api-console.vue +++ b/packages/client/src/pages/api-console.vue @@ -67,7 +67,7 @@ export default defineComponent({ send() { this.sending = true; const body = JSON5.parse(this.body); - os.api(this.endpoint, body, body.i || this.withCredential ? undefined : null).then(res => { + os.api(this.endpoint, body, body.i || (this.withCredential ? undefined : null)).then(res => { this.sending = false; this.res = JSON5.stringify(res, null, 2); }, err => { From a60bd33cfc4ccad3d6a0aca88ea04ec278d4899f Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 9 Dec 2021 21:30:02 +0900 Subject: [PATCH 11/43] Update about-misskey.vue --- packages/client/src/pages/about-misskey.vue | 72 ++++++++++++++------- 1 file changed, 47 insertions(+), 25 deletions(-) diff --git a/packages/client/src/pages/about-misskey.vue b/packages/client/src/pages/about-misskey.vue index d1d4c54af5..855a21e493 100644 --- a/packages/client/src/pages/about-misskey.vue +++ b/packages/client/src/pages/about-misskey.vue @@ -67,60 +67,82 @@ import { physics } from '@/scripts/physics'; import * as symbols from '@/symbols'; const patrons = [ - 'Satsuki Yanagi', - 'noellabo', + 'まっちゃとーにゅ', 'mametsuko', + 'noellabo', 'AureoleArk', 'Gargron', 'Nokotaro Takeda', 'Suji Yan', - 'Hekovic', - 'Gitmo Life Services', - 'nenohi', - 'naga_rus', - 'Melilot', - 'Efertone', 'oi_yekssim', - 'nanami kan', + 'regtan', + 'Hekovic', + 'nenohi', + 'Gitmo Life Services', + 'naga_rus', + 'Efertone', + 'Melilot', 'motcha', - 'dansup', + 'nanami kan', + 'sevvie Rose', + 'Hayato Ishikawa', + 'Puniko', + 'skehmatics', 'Quinton Macejkovic', 'YUKIMOCHI', + 'dansup', 'mewl hayabusa', + 'Emilis', + 'Fristi', 'makokunsan', + 'chidori ninokura', 'Peter G.', - 'Nesakko', - 'regtan', '見当かなみ', 'natalie', - 'Jerry', + 'Maronu', + 'Steffen K9', 'takimura', 'sikyosyounin', + 'Nesakko', 'YuzuRyo61', + 'blackskye', 'sheeta.s', 'osapon', - 'mkatze', + 'public_yusuke', 'CG', + '吴浥', + 't_w', + 'Jerry', 'nafuchoco', 'Takumi Sugita', - 'chidori ninokura', - 'mydarkstar', - 'kiritan', + 'GLaTAN', + 'mkatze', 'kabo2468y', - 'weepjp', - 'Liaizon Wakest', - 'Steffen K9', + 'mydarkstar', 'Roujo', + 'DignifiedSilence', 'uroco @99', 'totokoro', - 'public_yusuke', + 'うし', + 'kiritan', + 'weepjp', + 'Liaizon Wakest', + 'Duponin', + 'Blue', + 'Naoki Hirayama', 'wara', - 'S Y', + 'Wataru Manji (manji0)', + 'みなしま', + 'kanoy', + 'xianon', 'Denshi', 'Osushimaru', - '吴浥', - 'DignifiedSilence', - 't_w', + 'にょんへら', + 'おのだい', + 'Leni', + 'oss', + 'Weeble', + '蝉暮せせせ', ]; export default defineComponent({ From b9095995eb82ec8f583394138fe407caad1f737d Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 9 Dec 2021 21:31:36 +0900 Subject: [PATCH 12/43] update deps --- packages/backend/package.json | 5 +- packages/backend/yarn.lock | 58 +- packages/client/package.json | 74 +- packages/client/yarn.lock | 1301 +++++++++++---------------------- 4 files changed, 443 insertions(+), 995 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index d7738e75a8..5c6ffca3b0 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -46,10 +46,8 @@ "@types/node": "16.11.7", "@types/node-fetch": "2.5.12", "@types/nodemailer": "6.4.4", - "@types/nprogress": "0.2.0", "@types/oauth": "0.9.1", - "@types/parse5": "6.0.2", - "@types/parsimmon": "1.10.6", + "@types/parse5": "6.0.3", "@types/portscanner": "2.1.1", "@types/pug": "2.0.5", "@types/punycode": "2.1.0", @@ -93,7 +91,6 @@ "chartjs-plugin-zoom": "1.1.1", "cli-highlight": "2.1.11", "compare-versions": "3.6.0", - "concurrently": "6.3.0", "content-disposition": "0.5.3", "crc-32": "1.2.0", "css-loader": "6.5.1", diff --git a/packages/backend/yarn.lock b/packages/backend/yarn.lock index defe9b8922..821d21d6f1 100644 --- a/packages/backend/yarn.lock +++ b/packages/backend/yarn.lock @@ -645,11 +645,6 @@ dependencies: "@types/node" "*" -"@types/nprogress@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@types/nprogress/-/nprogress-0.2.0.tgz#86c593682d4199212a0509cc3c4d562bbbd6e45f" - integrity sha512-1cYJrqq9GezNFPsWTZpFut/d4CjpZqA0vhqDUPFWYKF1oIyBz5qnoYMzR+0C/T96t3ebLAC1SSnwrVOm5/j74A== - "@types/oauth@0.9.1": version "0.9.1" resolved "https://registry.yarnpkg.com/@types/oauth/-/oauth-0.9.1.tgz#e17221e7f7936b0459ae7d006255dff61adca305" @@ -662,15 +657,10 @@ resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109" integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw== -"@types/parse5@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.2.tgz#99f6b72d82e34cea03a4d8f2ed72114d909c1c61" - integrity sha512-+hQX+WyJAOne7Fh3zF5CxPemILIbuhNcqHHodzK9caYOLnC8pD5efmPleRnw0z++LfKUC/sVNMwk0Gap+B0baA== - -"@types/parsimmon@1.10.6": - version "1.10.6" - resolved "https://registry.yarnpkg.com/@types/parsimmon/-/parsimmon-1.10.6.tgz#8fcf95990514d2a7624aa5f630c13bf2427f9cdd" - integrity sha512-FwAQwMRbkhx0J6YELkwIpciVzCcgEqXEbIrIn3a2P5d3kGEHQ3wVhlN3YdVepYP+bZzCYO6OjmD4o9TGOZ40rA== +"@types/parse5@6.0.3": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.3.tgz#705bb349e789efa06f43f128cef51240753424cb" + integrity sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g== "@types/portscanner@2.1.1": version "2.1.1" @@ -2192,20 +2182,6 @@ concat-stream@^1.5.2: readable-stream "^2.2.2" typedarray "^0.0.6" -concurrently@6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-6.3.0.tgz#63128cb4a6ed54d3c0ed8528728590a5fe54582a" - integrity sha512-k4k1jQGHHKsfbqzkUszVf29qECBrkvBKkcPJEUDTyVR7tZd1G/JOfnst4g1sYbFvJ4UjHZisj1aWQR8yLKpGPw== - dependencies: - chalk "^4.1.0" - date-fns "^2.16.1" - lodash "^4.17.21" - rxjs "^6.6.3" - spawn-command "^0.0.2-1" - supports-color "^8.1.0" - tree-kill "^1.2.2" - yargs "^16.2.0" - condense-newlines@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/condense-newlines/-/condense-newlines-0.2.1.tgz#3de985553139475d32502c83b02f60684d24c55f" @@ -2488,11 +2464,6 @@ date-fns@2.25.0: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.25.0.tgz#8c5c8f1d958be3809a9a03f4b742eba894fc5680" integrity sha512-ovYRFnTrbGPD4nqaEqescPEv1mNwvt+UTqI3Ay9SzNtey9NZnYu6E2qCcBBgJ6/2VF1zGGygpyTDITqpQQ5e+w== -date-fns@^2.16.1: - version "2.19.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.19.0.tgz#65193348635a28d5d916c43ec7ce6fbd145059e1" - integrity sha512-X3bf2iTPgCAQp9wvjOQytnf5vO5rESYRXlPIVcgSbtT5OTScPcsf9eZU+B/YIkKAtYr5WeCii58BgATrNitlWg== - dateformat@4.5.1: version "4.5.1" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-4.5.1.tgz#c20e7a9ca77d147906b6dc2261a8be0a5bd2173c" @@ -7048,13 +7019,6 @@ run-parallel@^1.1.9: resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679" integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== -rxjs@^6.6.3: - version "6.6.6" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.6.tgz#14d8417aa5a07c5e633995b525e1e3c0dec03b70" - integrity sha512-/oTwee4N4iWzAMAL9xdGKjkEHmIwupR3oXbQjCKywF1BeFohswF3vZdogbmEF6pZkOsXTzWkrZszrWpQTByYVg== - dependencies: - tslib "^1.9.0" - s-age@1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/s-age/-/s-age-1.1.2.tgz#c0cf15233ccc93f41de92ea42c36d957977d1ea2" @@ -7323,11 +7287,6 @@ source-map@~0.7.2: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== -spawn-command@^0.0.2-1: - version "0.0.2-1" - resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" - integrity sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A= - speakeasy@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/speakeasy/-/speakeasy-2.0.0.tgz#85c91a071b09a5cb8642590d983566165f57613a" @@ -7618,7 +7577,7 @@ summaly@2.4.1: require-all "3.0.0" trace-redirect "1.0.6" -supports-color@8.1.1, supports-color@^8.1.0: +supports-color@8.1.1: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== @@ -7866,11 +7825,6 @@ trace-redirect@1.0.6: resolved "https://registry.yarnpkg.com/trace-redirect/-/trace-redirect-1.0.6.tgz#ac629b5bf8247d30dde5a35fe9811b811075b504" integrity sha512-UUfa1DjjU5flcjMdaFIiIEGDTyu2y/IiMjOX4uGXa7meKBS4vD4f2Uy/tken9Qkd4Jsm4sRsfZcIIPqrRVF3Mg== -tree-kill@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" - integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== - ts-jest@^25.2.1: version "25.5.1" resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-25.5.1.tgz#2913afd08f28385d54f2f4e828be4d261f4337c7" @@ -8560,7 +8514,7 @@ yargs-unparser@2.0.0: flat "^5.0.2" is-plain-obj "^2.1.0" -yargs@16.2.0, yargs@^16.0.0, yargs@^16.2.0: +yargs@16.2.0, yargs@^16.0.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== diff --git a/packages/client/package.json b/packages/client/package.json index 911dadceee..681e222082 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -11,10 +11,8 @@ }, "dependencies": { "@discordapp/twemoji": "13.1.0", - "@elastic/elasticsearch": "7.11.0", "@sentry/browser": "5.29.2", "@sentry/tracing": "5.29.2", - "@sinonjs/fake-timers": "7.1.2", "@syuilo/aiscript": "0.11.1", "@types/dateformat": "3.0.1", "@types/escape-regexp": "0.0.0", @@ -22,70 +20,56 @@ "@types/gulp": "4.0.9", "@types/gulp-rename": "2.0.1", "@types/is-url": "1.2.30", - "@types/js-yaml": "4.0.4", "@types/katex": "0.11.1", "@types/matter-js": "0.17.6", "@types/mocha": "8.2.3", - "@types/node": "16.11.7", - "@types/node-fetch": "2.5.12", - "@types/nodemailer": "6.4.4", - "@types/nprogress": "0.2.0", + "@types/node": "16.11.12", "@types/oauth": "0.9.1", - "@types/parse5": "6.0.2", - "@types/parsimmon": "1.10.6", - "@types/portscanner": "2.1.1", - "@types/pug": "2.0.5", + "@types/parse5": "6.0.3", "@types/punycode": "2.1.0", "@types/qrcode": "1.4.1", "@types/random-seed": "0.3.3", - "@types/rename": "1.0.4", "@types/request-stats": "3.0.0", "@types/seedrandom": "2.4.28", - "@types/sinonjs__fake-timers": "6.0.4", - "@types/speakeasy": "2.0.6", "@types/throttle-debounce": "2.1.0", "@types/tinycolor2": "1.4.3", "@types/tmp": "0.2.2", - "@types/uuid": "8.3.1", + "@types/uuid": "8.3.3", "@types/web-push": "3.3.2", "@types/webpack": "5.28.0", "@types/webpack-stream": "3.2.12", "@types/websocket": "1.0.4", - "@types/ws": "8.2.0", - "@typescript-eslint/parser": "5.1.0", - "@vue/compiler-sfc": "3.2.21", + "@types/ws": "8.2.2", + "@typescript-eslint/parser": "5.6.0", + "@vue/compiler-sfc": "3.2.24", "abort-controller": "3.0.0", "autobind-decorator": "2.4.0", "autosize": "4.0.4", "autwh": "0.1.0", "blurhash": "1.1.4", - "broadcast-channel": "4.5.0", - "chart.js": "3.6.0", + "broadcast-channel": "4.7.0", + "chart.js": "3.6.2", "chartjs-adapter-date-fns": "2.0.0", - "chartjs-plugin-zoom": "1.1.1", + "chartjs-plugin-zoom": "1.2.0", "compare-versions": "3.6.0", - "concurrently": "6.3.0", "content-disposition": "0.5.3", "crc-32": "1.2.0", "css-loader": "6.5.1", - "cssnano": "5.0.10", - "date-fns": "2.25.0", + "cssnano": "5.0.12", + "date-fns": "2.27.0", "dateformat": "4.5.1", "escape-regexp": "0.0.1", - "eslint": "8.2.0", - "eslint-plugin-vue": "8.1.1", + "eslint": "8.4.1", + "eslint-plugin-vue": "8.2.0", "eventemitter3": "4.0.7", "feed": "4.2.2", "glob": "7.2.0", - "got": "11.8.2", "idb-keyval": "5.1.3", "insert-text-at-cursor": "0.3.0", "ip-cidr": "3.0.4", - "is-svg": "4.3.1", - "js-yaml": "4.1.0", "json5": "2.2.0", "json5-loader": "4.0.1", - "katex": "0.13.18", + "katex": "0.15.1", "langmap": "0.0.16", "matter-js": "0.17.1", "mfm-js": "0.20.0", @@ -93,32 +77,26 @@ "mocha": "8.4.0", "ms": "2.1.3", "nested-property": "4.0.0", - "node-fetch": "2.6.1", "parse5": "6.0.1", "photoswipe": "git://github.com/dimsemenov/photoswipe#v5-beta", "portscanner": "2.2.0", - "postcss": "8.3.11", - "postcss-loader": "6.2.0", + "postcss": "8.4.4", + "postcss-loader": "6.2.1", "prismjs": "1.25.0", "private-ip": "2.3.3", - "probe-image-size": "7.2.1", "promise-limit": "2.7.0", "pug": "3.0.2", "punycode": "2.1.1", - "pureimage": "0.3.5", - "qrcode": "1.4.4", + "qrcode": "1.5.0", "querystring": "0.2.1", "random-seed": "0.3.0", - "ratelimiter": "3.4.1", "reflect-metadata": "0.1.13", - "rename": "1.0.4", "request-stats": "3.0.0", "rndstr": "1.0.0", "s-age": "1.1.2", - "sass": "1.43.4", - "sass-loader": "12.3.0", + "sass": "1.44.0", + "sass-loader": "12.4.0", "seedrandom": "3.0.5", - "speakeasy": "2.0.0", "strict-event-emitter-types": "2.0.0", "stringz": "2.1.0", "style-loader": "3.3.1", @@ -130,25 +108,25 @@ "tmp": "0.2.1", "ts-loader": "9.2.6", "ts-node": "10.4.0", - "tsc-alias": "1.3.10", - "tsconfig-paths": "3.11.0", + "tsc-alias": "1.4.2", + "tsconfig-paths": "3.12.0", "twemoji-parser": "13.1.0", - "typescript": "4.4.4", + "typescript": "4.5.2", "uuid": "8.3.2", "v-debounce": "0.1.2", "vanilla-tilt": "1.7.2", - "vue": "3.2.21", - "vue-loader": "16.7.0", + "vue": "3.2.24", + "vue-loader": "16.8.3", "vue-prism-editor": "2.0.0-alpha.2", "vue-router": "4.0.5", "vue-style-loader": "4.1.3", "vue-svg-loader": "0.17.0-beta.2", "vuedraggable": "4.0.1", "web-push": "3.4.5", - "webpack": "5.63.0", + "webpack": "5.65.0", "webpack-cli": "4.9.1", "websocket": "1.0.34", - "ws": "8.2.3" + "ws": "8.3.0" }, "devDependencies": { "@redocly/openapi-core": "1.0.0-beta.54", diff --git a/packages/client/yarn.lock b/packages/client/yarn.lock index 68d299935d..949c8bab43 100644 --- a/packages/client/yarn.lock +++ b/packages/client/yarn.lock @@ -116,25 +116,14 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz#8f03a22a04de437254e8ce8cc84ba39689288752" integrity sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg== -"@elastic/elasticsearch@7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@elastic/elasticsearch/-/elasticsearch-7.11.0.tgz#e196243d0ed026742fc160d72cc5b4b5b6c7807d" - integrity sha512-AFVVuANIdbV1qYjuOi4hnsX/DehWYG+bbhQO4amq9K4/NnzU7mpGWOPgVlRQTiX+vBfBkx7SL6h4QEjIlM3ztA== - dependencies: - debug "^4.1.1" - hpagent "^0.1.1" - ms "^2.1.1" - pump "^3.0.0" - secure-json-parse "^2.1.0" - -"@eslint/eslintrc@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.4.tgz#dfe0ff7ba270848d10c5add0715e04964c034b31" - integrity sha512-h8Vx6MdxwWI2WM8/zREHMoqdgLNXEL4QX3MWSVMdyNJGvXVOs+6lp+m2hc3FnuMHDc4poxFNI20vCk0OmI4G0Q== +"@eslint/eslintrc@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318" + integrity sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.0.0" + espree "^9.2.0" globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" @@ -154,35 +143,19 @@ dependencies: "@hapi/hoek" "^9.0.0" -"@humanwhocodes/config-array@^0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.6.0.tgz#b5621fdb3b32309d2d16575456cbc277fa8f021a" - integrity sha512-JQlEKbcgEUjBFhLIF4iqM7u/9lwgHRBcpHrmUNCALK0Q3amXN6lxdoXLnF0sm11E9VqTmBALR87IlUg1bZ8A9A== +"@humanwhocodes/config-array@^0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914" + integrity sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA== dependencies: - "@humanwhocodes/object-schema" "^1.2.0" + "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" minimatch "^3.0.4" -"@humanwhocodes/object-schema@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" - integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== - -"@jfonx/console-utils@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@jfonx/console-utils/-/console-utils-1.0.3.tgz#cbb7f911e4191a4a2fe1ba4807d29f100b5d099f" - integrity sha512-/XbnqjWc7yNZVLAJJO9rimfIz9DYte+cj3EF9hwhIv7vw6ok2t3cjl0huYsmD89srKH03vWjeqAcIH86CuYj3g== - dependencies: - colors "^1.3.3" - -"@jfonx/file-utils@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@jfonx/file-utils/-/file-utils-3.0.1.tgz#8d3d6e931a283420fe29802ea71c28dd397cd8d3" - integrity sha512-qwH0CuzWmghtTHGMyuPHj6SJPQgWeiXFJBfrxCWMbzxVCa3aLZPEfzSdlSnC/UABsk6feRkNdHXw59rVshNPqw== - dependencies: - "@jfonx/console-utils" "^1.0.3" - comment-json "^4.1.0" - find-up "^4.1.0" +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== "@nodelib/fs.scandir@2.1.3": version "2.1.3" @@ -310,25 +283,6 @@ resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== -"@sindresorhus/is@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.0.0.tgz#2ff674e9611b45b528896d820d3d7a812de2f0e4" - integrity sha512-FyD2meJpDPjyNQejSjvnhpgI/azsQkA4lGbuu5BQZfjvJ9cbRZXzeWL2HceCekW4lixO9JPesIIQkSoLjeJHNQ== - -"@sinonjs/commons@^1.7.0": - version "1.7.2" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.7.2.tgz#505f55c74e0272b43f6c52d81946bed7058fc0e2" - integrity sha512-+DUO6pnp3udV/v2VfUWgaY5BIE1IfT7lLfeDzPVeMT1XKkaAp9LgSI9x5RtrFQoZ9Oi0PgXQQHPaoKu7dCjVxw== - dependencies: - type-detect "4.0.8" - -"@sinonjs/fake-timers@7.1.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz#2524eae70c4910edccf99b2f4e6efc5894aff7b5" - integrity sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg== - dependencies: - "@sinonjs/commons" "^1.7.0" - "@syuilo/aiscript@0.11.1": version "0.11.1" resolved "https://registry.yarnpkg.com/@syuilo/aiscript/-/aiscript-0.11.1.tgz#52c14692113c58d1d62e6ae696352ba49abdf2eb" @@ -340,13 +294,6 @@ stringz "2.1.0" uuid "7.0.3" -"@szmarczak/http-timer@^4.0.5": - version "4.0.5" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.5.tgz#bfbd50211e9dfa51ba07da58a14cdfd333205152" - integrity sha512-PyRA9sm1Yayuj5OIoJ1hGt2YISX45w9WcFbh6ddT0Z/0yaFxOtGLInr4jUfU1EAFVs0Yfyfev4RNwBlUaHdlDQ== - dependencies: - defer-to-connect "^2.0.0" - "@trysound/sax@0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" @@ -377,16 +324,6 @@ resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a" integrity sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA== -"@types/cacheable-request@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.1.tgz#5d22f3dded1fd3a84c0bbeb5039a7419c2c91976" - integrity sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ== - dependencies: - "@types/http-cache-semantics" "*" - "@types/keyv" "*" - "@types/node" "*" - "@types/responselike" "*" - "@types/color-name@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" @@ -487,21 +424,11 @@ "@types/vinyl-fs" "*" chokidar "^3.3.1" -"@types/http-cache-semantics@*": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a" - integrity sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A== - "@types/is-url@1.2.30": version "1.2.30" resolved "https://registry.yarnpkg.com/@types/is-url/-/is-url-1.2.30.tgz#85567e8bee4fee69202bc3448f9fb34b0d56c50a" integrity sha512-AnlNFwjzC8XLda5VjRl4ItSd8qp8pSNowvsut0WwQyBWHpOxjxRJm8iO6uETWqEyLdYdb9/1j+Qd9gQ4l5I4fw== -"@types/js-yaml@4.0.4": - version "4.0.4" - resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.4.tgz#cc38781257612581a1a0eb25f1709d2b06812fce" - integrity sha512-AuHubXUmg0AzkXH0Mx6sIxeY/1C110mm/EkE/gB1sTRz3h2dao2W/63q42SlVST+lICxz5Oki2hzYA6+KnnieQ== - "@types/json-schema@*": version "7.0.5" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd" @@ -532,13 +459,6 @@ resolved "https://registry.yarnpkg.com/@types/katex/-/katex-0.11.1.tgz#34de04477dcf79e2ef6c8d23b41a3d81f9ebeaf5" integrity sha512-DUlIj2nk0YnJdlWgsFuVKcX27MLW0KbKmGVoUHmFr+74FYYNUDAaj9ZqTADvsbE8rfxuVmSFc7KczYn5Y09ozg== -"@types/keyv@*": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7" - integrity sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw== - dependencies: - "@types/node" "*" - "@types/matter-js@0.17.6": version "0.17.6" resolved "https://registry.yarnpkg.com/@types/matter-js/-/matter-js-0.17.6.tgz#525bb33a7289105e1981ef51b987972fa9739011" @@ -554,41 +474,21 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.2.3.tgz#bbeb55fbc73f28ea6de601fbfa4613f58d785323" integrity sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw== -"@types/node-fetch@2.5.12": - version "2.5.12" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.12.tgz#8a6f779b1d4e60b7a57fb6fd48d84fb545b9cc66" - integrity sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw== - dependencies: - "@types/node" "*" - form-data "^3.0.0" - "@types/node@*": version "16.6.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.6.2.tgz#331b7b9f8621c638284787c5559423822fdffc50" integrity sha512-LSw8TZt12ZudbpHc6EkIyDM3nHVWKYrAvGy6EAJfNfjusbwnThqjqxUKKRwuV3iWYeW/LYMzNgaq3MaLffQ2xA== -"@types/node@16.11.7": - version "16.11.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.7.tgz#36820945061326978c42a01e56b61cd223dfdc42" - integrity sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw== +"@types/node@16.11.12": + version "16.11.12" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.12.tgz#ac7fb693ac587ee182c3780c26eb65546a1a3c10" + integrity sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw== "@types/node@^14.11.8", "@types/node@^14.14.31": version "14.17.9" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.9.tgz#b97c057e6138adb7b720df2bd0264b03c9f504fd" integrity sha512-CMjgRNsks27IDwI785YMY0KLt3co/c0cQ5foxHYv/shC2w8oOnVwz5Ubq1QG5KzrcW+AXk6gzdnxIkDnTvzu3g== -"@types/nodemailer@6.4.4": - version "6.4.4" - resolved "https://registry.yarnpkg.com/@types/nodemailer/-/nodemailer-6.4.4.tgz#c265f7e7a51df587597b3a49a023acaf0c741f4b" - integrity sha512-Ksw4t7iliXeYGvIQcSIgWQ5BLuC/mljIEbjf615svhZL10PE9t+ei8O9gDaD3FPCasUJn9KTLwz2JFJyiiyuqw== - dependencies: - "@types/node" "*" - -"@types/nprogress@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@types/nprogress/-/nprogress-0.2.0.tgz#86c593682d4199212a0509cc3c4d562bbbd6e45f" - integrity sha512-1cYJrqq9GezNFPsWTZpFut/d4CjpZqA0vhqDUPFWYKF1oIyBz5qnoYMzR+0C/T96t3ebLAC1SSnwrVOm5/j74A== - "@types/oauth@0.9.1": version "0.9.1" resolved "https://registry.yarnpkg.com/@types/oauth/-/oauth-0.9.1.tgz#e17221e7f7936b0459ae7d006255dff61adca305" @@ -601,25 +501,10 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== -"@types/parse5@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.2.tgz#99f6b72d82e34cea03a4d8f2ed72114d909c1c61" - integrity sha512-+hQX+WyJAOne7Fh3zF5CxPemILIbuhNcqHHodzK9caYOLnC8pD5efmPleRnw0z++LfKUC/sVNMwk0Gap+B0baA== - -"@types/parsimmon@1.10.6": - version "1.10.6" - resolved "https://registry.yarnpkg.com/@types/parsimmon/-/parsimmon-1.10.6.tgz#8fcf95990514d2a7624aa5f630c13bf2427f9cdd" - integrity sha512-FwAQwMRbkhx0J6YELkwIpciVzCcgEqXEbIrIn3a2P5d3kGEHQ3wVhlN3YdVepYP+bZzCYO6OjmD4o9TGOZ40rA== - -"@types/portscanner@2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@types/portscanner/-/portscanner-2.1.1.tgz#89d5094e16f3d941f20f3889dfa5d3a164b3dd3b" - integrity sha512-1NsVIbgBKvrqxwtMN0V6CLji1ERwKSI/RWz0J3y++CzSwYNGBStCfpIFgxV3ZwxsDR5PoZqoUWhwraDm+Ztn0Q== - -"@types/pug@2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@types/pug/-/pug-2.0.5.tgz#69bc700934dd473c7ab97270bd2dbacefe562231" - integrity sha512-LOnASQoeNZMkzexRuyqcBBDZ6rS+rQxUMkmj5A0PkhhiSZivLIuz6Hxyr1mkGoEZEkk66faROmpMi4fFkrKsBA== +"@types/parse5@6.0.3": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.3.tgz#705bb349e789efa06f43f128cef51240753424cb" + integrity sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g== "@types/punycode@2.1.0": version "2.1.0" @@ -643,11 +528,6 @@ resolved "https://registry.yarnpkg.com/@types/random-seed/-/random-seed-0.3.3.tgz#7741f7b0a4513198a9396ce4ad25832f799a6727" integrity sha512-kHsCbIRHNXJo6EN5W8EA5b4i1hdT6jaZke5crBPLUcLqaLdZ0QBq8QVMbafHzhjFF83Cl9qlee2dChD18d/kPg== -"@types/rename@1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@types/rename/-/rename-1.0.4.tgz#30c6f0306042591a560361ea02639e89647dd173" - integrity sha512-eV81+6bVv2mdCBahkMefjEUwAjKDAP3AuyhqWCWRxcRaeVdUeHUBaoq2zSz+5HNHF2jzTajMcfLvJsy4K3cbwA== - "@types/request-stats@3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/request-stats/-/request-stats-3.0.0.tgz#d3909a9f778b8ae0b42fb8c1ed20cb936ed95f99" @@ -655,23 +535,11 @@ dependencies: "@types/node" "*" -"@types/responselike@*", "@types/responselike@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" - integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== - dependencies: - "@types/node" "*" - "@types/seedrandom@2.4.28": version "2.4.28" resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-2.4.28.tgz#9ce8fa048c1e8c85cb71d7fe4d704e000226036f" integrity sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA== -"@types/sinonjs__fake-timers@6.0.4": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.4.tgz#0ecc1b9259b76598ef01942f547904ce61a6a77d" - integrity sha512-IFQTJARgMUBF+xVd2b+hIgXWrZEjND3vJtRCvIelcFB5SIXfjV4bOHbHJ0eXKh+0COrBRc8MqteKAz/j88rE0A== - "@types/sinonjs__fake-timers@^6.0.2": version "6.0.3" resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.3.tgz#79df6f358ae8f79e628fe35a63608a0ea8e7cf08" @@ -687,13 +555,6 @@ resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA== -"@types/speakeasy@2.0.6": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@types/speakeasy/-/speakeasy-2.0.6.tgz#12540f7b64d08180393ae2c5c8c280866a85da61" - integrity sha512-2wIXZp5yJUddhsSZarYCZIakCvzwQgTVdtT29DYVdFzc0cHttanaQx9THRhtjY4kDqVaF2jhyFOEofozOioFdQ== - dependencies: - "@types/node" "*" - "@types/tapable@^1": version "1.0.7" resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.7.tgz#545158342f949e8fd3bfd813224971ecddc3fac4" @@ -733,10 +594,10 @@ dependencies: "@types/undertaker-registry" "*" -"@types/uuid@8.3.1": - version "8.3.1" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.1.tgz#1a32969cf8f0364b3d8c8af9cc3555b7805df14f" - integrity sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg== +"@types/uuid@8.3.3": + version "8.3.3" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.3.tgz#c6a60686d953dbd1b1d45e66f4ecdbd5d471b4d0" + integrity sha512-0LbEEx1zxrYB3pgpd1M5lEhLcXjKJnYghvhTRgaBeUivLHMDM1TzF3IJ6hXU2+8uA4Xz+5BA63mtZo5DjVT8iA== "@types/vinyl-fs@*": version "2.4.11" @@ -807,10 +668,10 @@ dependencies: "@types/node" "*" -"@types/ws@8.2.0": - version "8.2.0" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.2.0.tgz#75faefbe2328f3b833cb8dc640658328990d04f3" - integrity sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg== +"@types/ws@8.2.2": + version "8.2.2" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.2.2.tgz#7c5be4decb19500ae6b3d563043cd407bf366c21" + integrity sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg== dependencies: "@types/node" "*" @@ -847,24 +708,16 @@ eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/parser@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.1.0.tgz#6c7f837d210d2bc0a811e7ea742af414f4e00908" - integrity sha512-vx1P+mhCtYw3+bRHmbalq/VKP2Y3gnzNgxGxfEWc6OFpuEL7iQdAeq11Ke3Rhy8NjgB+AHsIWEwni3e+Y7djKA== +"@typescript-eslint/parser@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.6.0.tgz#11677324659641400d653253c03dcfbed468d199" + integrity sha512-YVK49NgdUPQ8SpCZaOpiq1kLkYRPMv9U5gcMrywzI8brtwZjr/tG3sZpuHyODt76W/A0SufNjYt9ZOgrC4tLIQ== dependencies: - "@typescript-eslint/scope-manager" "5.1.0" - "@typescript-eslint/types" "5.1.0" - "@typescript-eslint/typescript-estree" "5.1.0" + "@typescript-eslint/scope-manager" "5.6.0" + "@typescript-eslint/types" "5.6.0" + "@typescript-eslint/typescript-estree" "5.6.0" debug "^4.3.2" -"@typescript-eslint/scope-manager@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.1.0.tgz#6f1f26ad66a8f71bbb33b635e74fec43f76b44df" - integrity sha512-yYlyVjvn5lvwCL37i4hPsa1s0ORsjkauhTqbb8MnpvUs7xykmcjGqwlNZ2Q5QpoqkJ1odlM2bqHqJwa28qV6Tw== - dependencies: - "@typescript-eslint/types" "5.1.0" - "@typescript-eslint/visitor-keys" "5.1.0" - "@typescript-eslint/scope-manager@5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.4.0.tgz#aaab08415f4a9cf32b870c7750ae8ba4607126a1" @@ -873,28 +726,23 @@ "@typescript-eslint/types" "5.4.0" "@typescript-eslint/visitor-keys" "5.4.0" -"@typescript-eslint/types@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.1.0.tgz#a8a75ddfc611660de6be17d3ad950302385607a9" - integrity sha512-sEwNINVxcB4ZgC6Fe6rUyMlvsB2jvVdgxjZEjQUQVlaSPMNamDOwO6/TB98kFt4sYYfNhdhTPBEQqNQZjMMswA== +"@typescript-eslint/scope-manager@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.6.0.tgz#9dd7f007dc8f3a34cdff6f79f5eaab27ae05157e" + integrity sha512-1U1G77Hw2jsGWVsO2w6eVCbOg0HZ5WxL/cozVSTfqnL/eB9muhb8THsP0G3w+BB5xAHv9KptwdfYFAUfzcIh4A== + dependencies: + "@typescript-eslint/types" "5.6.0" + "@typescript-eslint/visitor-keys" "5.6.0" "@typescript-eslint/types@5.4.0": version "5.4.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.4.0.tgz#b1c130f4b381b77bec19696c6e3366f9781ce8f2" integrity sha512-GjXNpmn+n1LvnttarX+sPD6+S7giO+9LxDIGlRl4wK3a7qMWALOHYuVSZpPTfEIklYjaWuMtfKdeByx0AcaThA== -"@typescript-eslint/typescript-estree@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.1.0.tgz#132aea34372df09decda961cb42457433aa6e83d" - integrity sha512-SSz+l9YrIIsW4s0ZqaEfnjl156XQ4VRmJsbA0ZE1XkXrD3cRpzuZSVCyqeCMR3EBjF27IisWakbBDGhGNIOvfQ== - dependencies: - "@typescript-eslint/types" "5.1.0" - "@typescript-eslint/visitor-keys" "5.1.0" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" +"@typescript-eslint/types@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.6.0.tgz#745cb1b59daadcc1f32f7be95f0f68accf38afdd" + integrity sha512-OIZffked7mXv4mXzWU5MgAEbCf9ecNJBKi+Si6/I9PpTaj+cf2x58h2oHW5/P/yTnPkKaayfjhLvx+crnl5ubA== "@typescript-eslint/typescript-estree@5.4.0": version "5.4.0" @@ -909,13 +757,18 @@ semver "^7.3.5" tsutils "^3.21.0" -"@typescript-eslint/visitor-keys@5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.1.0.tgz#e01a01b27eb173092705ae983aa1451bd1842630" - integrity sha512-uqNXepKBg81JVwjuqAxYrXa1Ql/YDzM+8g/pS+TCPxba0wZttl8m5DkrasbfnmJGHs4lQ2jTbcZ5azGhI7kK+w== +"@typescript-eslint/typescript-estree@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.6.0.tgz#dfbb19c9307fdd81bd9c650c67e8397821d7faf0" + integrity sha512-92vK5tQaE81rK7fOmuWMrSQtK1IMonESR+RJR2Tlc7w4o0MeEdjgidY/uO2Gobh7z4Q1hhS94Cr7r021fMVEeA== dependencies: - "@typescript-eslint/types" "5.1.0" - eslint-visitor-keys "^3.0.0" + "@typescript-eslint/types" "5.6.0" + "@typescript-eslint/visitor-keys" "5.6.0" + debug "^4.3.2" + globby "^11.0.4" + is-glob "^4.0.3" + semver "^7.3.5" + tsutils "^3.21.0" "@typescript-eslint/visitor-keys@5.4.0": version "5.4.0" @@ -925,100 +778,108 @@ "@typescript-eslint/types" "5.4.0" eslint-visitor-keys "^3.0.0" +"@typescript-eslint/visitor-keys@5.6.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.6.0.tgz#3e36509e103fe9713d8f035ac977235fd63cb6e6" + integrity sha512-1p7hDp5cpRFUyE3+lvA74egs+RWSgumrBpzBCDzfTFv0aQ7lIeay80yU0hIxgAhwQ6PcasW35kaOCyDOv6O/Ng== + dependencies: + "@typescript-eslint/types" "5.6.0" + eslint-visitor-keys "^3.0.0" + "@ungap/promise-all-settled@1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== -"@vue/compiler-core@3.2.21": - version "3.2.21" - resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.21.tgz#26566c32b2ad838199d471ef5df620a83846f24e" - integrity sha512-NhhiQZNG71KNq1h5pMW/fAXdTF7lJRaSI7LDm2edhHXVz1ROMICo8SreUmQnSf4Fet0UPBVqJ988eF4+936iDQ== +"@vue/compiler-core@3.2.24": + version "3.2.24" + resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.24.tgz#cadcda0e026e7f1cd453ce87160be51a5f313fe0" + integrity sha512-A0SxB2HAggKzP57LDin5gfgWOTwFyGCtQ5MTMNBADnfQYALWnYuC8kMI0DhRSplGTWRvn9Z2DAnG8f35BnojuA== dependencies: "@babel/parser" "^7.15.0" - "@vue/shared" "3.2.21" + "@vue/shared" "3.2.24" estree-walker "^2.0.2" source-map "^0.6.1" -"@vue/compiler-dom@3.2.21": - version "3.2.21" - resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.21.tgz#d6f6c85364ef8888f9c4e9122bfba11e78fb398c" - integrity sha512-gsJD3DpYZSYquiA7UIPsMDSlAooYWDvHPq9VRsqzJEk2PZtFvLvHPb4aaMD8Ufd62xzYn32cnnkzsEOJhyGilA== +"@vue/compiler-dom@3.2.24": + version "3.2.24" + resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.24.tgz#32235cb444660245be5cc58f4beb76747400505c" + integrity sha512-KQEm8r0JFsrNNIfbD28pcwMvHpcJcwjVR1XWFcD0yyQ8eREd7IXhT7J6j7iNCSE/TIo78NOvkwbyX+lnIm836w== dependencies: - "@vue/compiler-core" "3.2.21" - "@vue/shared" "3.2.21" + "@vue/compiler-core" "3.2.24" + "@vue/shared" "3.2.24" -"@vue/compiler-sfc@3.2.21": - version "3.2.21" - resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.21.tgz#42639ee49e725afb7d8f1d1940e75dc17a56002c" - integrity sha512-+yDlUSebKpz/ovxM2vLRRx7w/gVfY767pOfYTgbIhAs+ogvIV2BsIt4fpxlThnlCNChJ+yE0ERUNoROv2kEGEQ== +"@vue/compiler-sfc@3.2.24": + version "3.2.24" + resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.24.tgz#803a309e1935fc85981218d88fd4fb5db05afdb1" + integrity sha512-YGPcIvVJp2qTPkuT6kT43Eo1xjstyY4bmuiSV31my4bQMBFVR26ANmifUSt759Blok71gK0WzfIZHbcOKYOeKA== dependencies: "@babel/parser" "^7.15.0" - "@vue/compiler-core" "3.2.21" - "@vue/compiler-dom" "3.2.21" - "@vue/compiler-ssr" "3.2.21" - "@vue/ref-transform" "3.2.21" - "@vue/shared" "3.2.21" + "@vue/compiler-core" "3.2.24" + "@vue/compiler-dom" "3.2.24" + "@vue/compiler-ssr" "3.2.24" + "@vue/ref-transform" "3.2.24" + "@vue/shared" "3.2.24" estree-walker "^2.0.2" magic-string "^0.25.7" postcss "^8.1.10" source-map "^0.6.1" -"@vue/compiler-ssr@3.2.21": - version "3.2.21" - resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.21.tgz#37d124f89e8adef9fd56b85775de4b5310a0436e" - integrity sha512-eU+A0iWYy+1zAo2CRIJ0zSVlv1iuGAIbNRCnllSJ31pV1lX3jypJYzGbJlSRAbB7VP6E+tYveVT1Oq8JKewa3g== +"@vue/compiler-ssr@3.2.24": + version "3.2.24" + resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.24.tgz#edd0b7e7cd28d6c2578bb770ce0128bfdef9c948" + integrity sha512-E1HHShNsGVWXxs68LDOUuI+Bzak9W/Ier/366aKDBFuwvfwgruwq6abhMfj6pSDZpwZ/PXnfliyl/m7qBSq6gw== dependencies: - "@vue/compiler-dom" "3.2.21" - "@vue/shared" "3.2.21" + "@vue/compiler-dom" "3.2.24" + "@vue/shared" "3.2.24" -"@vue/reactivity@3.2.21": - version "3.2.21" - resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.2.21.tgz#073ad144192ed78a07e151e95a3baa515e4099a2" - integrity sha512-7C57zFm/5E3SSTUhVuYj1InDwuJ+GIVQ/z+H43C9sST85gIThGXVhksl1yWTAadf8Yz4T5lSbqi5Ds8U/ueWcw== +"@vue/reactivity@3.2.24": + version "3.2.24" + resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.2.24.tgz#4b24301ff7af0607c49a1e6976a22b4f62eab1a4" + integrity sha512-5eVsO9wfQ5erCMSRBjpqLkkI+LglJS7E0oLZJs2gsChpvOjH2Uwt3Hk1nVv0ywStnWg71Ykn3SyQwtnl7PknOQ== dependencies: - "@vue/shared" "3.2.21" + "@vue/shared" "3.2.24" -"@vue/ref-transform@3.2.21": - version "3.2.21" - resolved "https://registry.yarnpkg.com/@vue/ref-transform/-/ref-transform-3.2.21.tgz#b0c554c9f640c3f005f77e676066aa0faba90984" - integrity sha512-uiEWWBsrGeun9O7dQExYWzXO3rHm/YdtFNXDVqCSoPypzOVxWxdiL+8hHeWzxMB58fVuV2sT80aUtIVyaBVZgQ== +"@vue/ref-transform@3.2.24": + version "3.2.24" + resolved "https://registry.yarnpkg.com/@vue/ref-transform/-/ref-transform-3.2.24.tgz#335bf06e0b25be16e7056cc4117c51a79f0c9122" + integrity sha512-j6oNbsGLvea2rF8GQB9w6q7UFL1So7J+t6ducaMeWPSyjYZ+slWpwPVK6mmyghg5oGqC41R+HC5BV036Y0KhXQ== dependencies: "@babel/parser" "^7.15.0" - "@vue/compiler-core" "3.2.21" - "@vue/shared" "3.2.21" + "@vue/compiler-core" "3.2.24" + "@vue/shared" "3.2.24" estree-walker "^2.0.2" magic-string "^0.25.7" -"@vue/runtime-core@3.2.21": - version "3.2.21" - resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.2.21.tgz#e12dac8c3893b7aebfc37e32066718d8aa686ac5" - integrity sha512-7oOxKaU0D2IunOAMOOHZgJVrHg63xwng8BZx3fbgmakqEIMwHhQcp+5GV1sOg/sWW7R4UhaRDIUCukO2GRVK2Q== +"@vue/runtime-core@3.2.24": + version "3.2.24" + resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.2.24.tgz#b3e433587442910d90f78f61ce3c5faf6fb3f355" + integrity sha512-ReI06vGgYuW0G8FlOcAOzMklVDJSxKuRhYzT8j+a8BTfs1945kxo1Th28BPvasyYx8J+LMeZ0HqpPH9yGXvWvg== dependencies: - "@vue/reactivity" "3.2.21" - "@vue/shared" "3.2.21" + "@vue/reactivity" "3.2.24" + "@vue/shared" "3.2.24" -"@vue/runtime-dom@3.2.21": - version "3.2.21" - resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.2.21.tgz#33dd15bc85281e773177a30dc6931c294bd77aa1" - integrity sha512-apBdriD6QsI4ywbllY8kjr9/0scGuStDuvLbJULPQkFPtHzntd51bP5PQTQVAEIc9kwnTozmj6x6ZdX/cwo7xA== +"@vue/runtime-dom@3.2.24": + version "3.2.24" + resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.2.24.tgz#14b462514cdb01d9de6c09ecf1d5d5d55a58e1e3" + integrity sha512-piqsabtIEUKkMGSJlOyKUonZEDtdwOpR6teQ8EKbH8PX9sxfAt9snLnFJldUhhyYrLIyDtnjwajfJ7/XtpD4JA== dependencies: - "@vue/runtime-core" "3.2.21" - "@vue/shared" "3.2.21" + "@vue/runtime-core" "3.2.24" + "@vue/shared" "3.2.24" csstype "^2.6.8" -"@vue/server-renderer@3.2.21": - version "3.2.21" - resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.2.21.tgz#887d0a44de76f72313cff2686a24c0315231d634" - integrity sha512-QBgYqVgI7XCSBCqGa4LduV9vpfQFdZBOodFmq5Txk5W/v1KrJ1LoOh2Q0RHiRgtoK/UR9uyvRVcYqOmwHkZNEg== +"@vue/server-renderer@3.2.24": + version "3.2.24" + resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.2.24.tgz#8009b1e52293fd4efc71b90452baf502ecb9dc03" + integrity sha512-DqiCRDxTbv67Hw5ImiqnLIQbPGtIwWLLfEcVHoEnu1f21EMTB6LfoS69EQddd8VyfN5kfX3Fmz27/hrFPpRaMQ== dependencies: - "@vue/compiler-ssr" "3.2.21" - "@vue/shared" "3.2.21" + "@vue/compiler-ssr" "3.2.24" + "@vue/shared" "3.2.24" -"@vue/shared@3.2.21": - version "3.2.21" - resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.21.tgz#4cd80c0e62cf65a7adab2449e86b6f0cb33a130b" - integrity sha512-5EQmIPK6gw4UVYUbM959B0uPsJ58+xoMESCZs3N89XyvJ9e+fX4pqEPrOGV8OroIk3SbEvJcC+eYc8BH9JQrHA== +"@vue/shared@3.2.24": + version "3.2.24" + resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.24.tgz#d74615e856013b17fb60b19b09d712729ad5e090" + integrity sha512-BUgRiZCkCrqDps5aQ9av05xcge3rn092ztKIh17tHkeEFgP4zfXMQWBA2zfdoCdCEdBL26xtOv+FZYiOp9RUDA== "@webassemblyjs/ast@1.11.0": version "1.11.0" @@ -1331,6 +1192,11 @@ acorn@^8.5.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== +acorn@^8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" + integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== + agent-base@6: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -1383,11 +1249,6 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - ansi-regex@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" @@ -1398,7 +1259,7 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.0, ansi-styles@^3.2.1: +ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -1454,11 +1315,6 @@ array-includes@^3.1.4: get-intrinsic "^1.1.1" is-string "^1.0.7" -array-timsort@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-timsort/-/array-timsort-1.0.3.tgz#3c9e4199e54fb2b9c3fe5976396a21614ef0d926" - integrity sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ== - array-union@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" @@ -1578,16 +1434,6 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base32.js@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/base32.js/-/base32.js-0.0.1.tgz#d045736a57b1f6c139f0c7df42518a84e91bb2ba" - integrity sha1-0EVzalex9sE58MffQlGKhOkbsro= - -base64-js@^1.0.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" - integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== - bcrypt-pbkdf@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" @@ -1650,16 +1496,17 @@ braces@^3.0.1, braces@~3.0.2: dependencies: fill-range "^7.0.1" -broadcast-channel@4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/broadcast-channel/-/broadcast-channel-4.5.0.tgz#d4717c493e219908fcb7f2f9078fe0baf95b77c1" - integrity sha512-jp+VPlQ1HyR0CM3uIYUrdpXupBvhTMFRkjR6mEmt5W4HaGDPFEzrO2Jqvi2PZ6zCC4zwLeco7CC5EUJPrVH8Tw== +broadcast-channel@4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/broadcast-channel/-/broadcast-channel-4.7.0.tgz#4f5c31982f627eae4ffe463623ba36a9e7da1992" + integrity sha512-1C7wDPqeiKkwpScqFP044MsPAtxxDNKZzOnJmkHaTuOlUdaMLo11op56NrCOMiRh8dzktstcNsiHELGeTMKnNQ== dependencies: "@babel/runtime" "^7.16.0" detect-node "^2.1.0" microseconds "0.2.0" nano-time "1.0.0" oblivious-set "1.0.0" + p-queue "6.6.2" rimraf "3.0.2" unload "2.3.1" @@ -1701,19 +1548,6 @@ browserslist@^4.16.6: escalade "^3.1.1" node-releases "^1.1.71" -buffer-alloc-unsafe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" - integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== - -buffer-alloc@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" - integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== - dependencies: - buffer-alloc-unsafe "^1.1.0" - buffer-fill "^1.0.0" - buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" @@ -1724,24 +1558,11 @@ buffer-equal-constant-time@1.0.1: resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= -buffer-fill@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" - integrity sha1-+PeLdniYiO858gXNY39o5wISKyw= - -buffer-from@^1.0.0, buffer-from@^1.1.1: +buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== -buffer@^5.4.3: - version "5.6.0" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.0.tgz#a31749dc7d81d84db08abf937b6b8c4033f62786" - integrity sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - bufferutil@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.1.tgz#3a177e8e5819a1243fe16b63a199951a7ad8d4a7" @@ -1749,24 +1570,6 @@ bufferutil@^4.0.1: dependencies: node-gyp-build "~3.7.0" -cacheable-lookup@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.3.tgz#049fdc59dffdd4fc285e8f4f82936591bd59fec3" - integrity sha512-W+JBqF9SWe18A72XFzN/V/CULFzPm7sBXzzR6ekkE+3tLG72wFZrBiBZhrZuDoYexop4PHJVdFAKb/Nj9+tm9w== - -cacheable-request@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.1.tgz#062031c2856232782ed694a257fa35da93942a58" - integrity sha512-lt0mJ6YAnsrBErpTMWeu5kl/tg9xMAWjavYTN6VQXM1A/teBITuNcccXsCxF0tDQQJf9DfAaX5O4e0zp0KlfZw== - dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^4.0.0" - lowercase-keys "^2.0.0" - normalize-url "^4.1.0" - responselike "^2.0.0" - cachedir@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.3.0.tgz#0c75892a052198f0b21c7c1804d8331edfcae0e8" @@ -1852,20 +1655,20 @@ character-parser@^2.2.0: dependencies: is-regex "^1.0.3" -chart.js@3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-3.6.0.tgz#a87fce8431d4e7c5523d721f487f53aada1e42fe" - integrity sha512-iOzzDKePL+bj+ccIsVAgWQehCXv8xOKGbaU2fO/myivH736zcx535PGJzQGanvcSGVOqX6yuLZsN3ygcQ35UgQ== +chart.js@3.6.2: + version "3.6.2" + resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-3.6.2.tgz#47342c551f688ffdda2cd53b534cb7e461ecec33" + integrity sha512-Xz7f/fgtVltfQYWq0zL1Xbv7N2inpG+B54p3D5FSvpCdy3sM+oZhbqa42eNuYXltaVvajgX5UpKCU2GeeJIgxg== chartjs-adapter-date-fns@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/chartjs-adapter-date-fns/-/chartjs-adapter-date-fns-2.0.0.tgz#5e53b2f660b993698f936f509c86dddf9ed44c6b" integrity sha512-rmZINGLe+9IiiEB0kb57vH3UugAtYw33anRiw5kS2Tu87agpetDDoouquycWc9pRsKtQo5j+vLsYHyr8etAvFw== -chartjs-plugin-zoom@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chartjs-plugin-zoom/-/chartjs-plugin-zoom-1.1.1.tgz#8a28923a17fcb5eb57a0dc94c5113bf402677647" - integrity sha512-1q54WOzK7FtAjkbemQeqvmFUV0btNYIQny2HbQ6Awq9wUtCz7Zmj6vIgp3C1DYMQwN0nqgpC3vnApqiwI7cSdQ== +chartjs-plugin-zoom@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/chartjs-plugin-zoom/-/chartjs-plugin-zoom-1.2.0.tgz#dad0861b2d171bca1f6d11b3e3e917bc12b950ff" + integrity sha512-cLYKUHHx4bevuZQDpEKdjpvZ6HGu6NF8laTThgA0I9af+PV1N4qVTRZmyDNh0SAzsHZPtDOhuO3I7B4CF1lstw== dependencies: hammerjs "^2.0.8" @@ -1874,7 +1677,7 @@ check-more-types@2.24.0, check-more-types@^2.24.0: resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" integrity sha1-FCD/sQ/URNz8ebQ4kbv//TKoRgA= -chokidar@3.5.1, "chokidar@>=3.0.0 <4.0.0", chokidar@^3.3.1, chokidar@^3.5.0: +chokidar@3.5.1, "chokidar@>=3.0.0 <4.0.0", chokidar@^3.3.1, chokidar@^3.5.2: version "3.3.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.1.tgz#c84e5b3d18d9a4d77558fef466b1bf16bbeb3450" integrity sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg== @@ -1931,14 +1734,14 @@ cli-truncate@^2.1.0: slice-ansi "^3.0.0" string-width "^4.2.0" -cliui@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" - integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== dependencies: - string-width "^3.1.0" - strip-ansi "^5.2.0" - wrap-ansi "^5.1.0" + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" cliui@^7.0.2: version "7.0.4" @@ -1958,13 +1761,6 @@ clone-deep@^4.0.1: kind-of "^6.0.2" shallow-clone "^3.0.0" -clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= - dependencies: - mimic-response "^1.0.0" - coa@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/coa/-/coa-2.0.2.tgz#43f6c21151b4ef2bf57187db0d73de229e3e7ec3" @@ -2013,12 +1809,12 @@ colorette@^2.0.14: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.15.tgz#8e634aa0429b110d24be82eac4d42f5ea65ab2d5" integrity sha512-lIFQhufWaVvwi4wOlX9Gx5b0Nmw3XAZ8HzHNH9dfxhe+JaKNTmX6QLk4o7UHyI+tUY8ClvyfaHUm5bf61O3psA== -colors@^1.1.2, colors@^1.3.3: +colors@^1.1.2: version "1.4.0" resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== -combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -2035,11 +1831,6 @@ commander@^5.1.0: resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== -commander@^6.0.0, commander@^6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" - integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== - commander@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/commander/-/commander-7.0.0.tgz#3e2bbfd8bb6724760980988fb5b22b7ee6b71ab2" @@ -2050,16 +1841,10 @@ commander@^7.2.0: resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== -comment-json@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/comment-json/-/comment-json-4.1.1.tgz#49df4948704bebb1cc0ffa6910e25669b668b7c5" - integrity sha512-v8gmtPvxhBlhdRBLwdHSjGy9BgA23t9H1FctdQKyUrErPjSrJcdDMqBq9B4Irtm7w3TNYLQJNH6ARKnpyag1sA== - dependencies: - array-timsort "^1.0.3" - core-util-is "^1.0.2" - esprima "^4.0.1" - has-own-prop "^2.0.0" - repeat-string "^1.6.1" +commander@^8.0.0, commander@^8.2.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== common-tags@^1.8.0: version "1.8.0" @@ -2076,20 +1861,6 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -concurrently@6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-6.3.0.tgz#63128cb4a6ed54d3c0ed8528728590a5fe54582a" - integrity sha512-k4k1jQGHHKsfbqzkUszVf29qECBrkvBKkcPJEUDTyVR7tZd1G/JOfnst4g1sYbFvJ4UjHZisj1aWQR8yLKpGPw== - dependencies: - chalk "^4.1.0" - date-fns "^2.16.1" - lodash "^4.17.21" - rxjs "^6.6.3" - spawn-command "^0.0.2-1" - supports-color "^8.1.0" - tree-kill "^1.2.2" - yargs "^16.2.0" - constantinople@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/constantinople/-/constantinople-4.0.1.tgz#0def113fa0e4dc8de83331a5cf79c8b325213151" @@ -2110,11 +1881,6 @@ core-util-is@1.0.2: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -core-util-is@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - cosmiconfig@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.0.tgz#ef9b44d773959cae63ddecd122de23853b60f8d3" @@ -2155,11 +1921,6 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -css-color-names@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-1.0.1.tgz#6ff7ee81a823ad46e020fa2fd6ab40a887e2ba67" - integrity sha512-/loXYOch1qU1biStIFsHH8SxTmOseh1IJqFvy8IujXOm1h+QjUdDhkzOrR5HG8K8mlxREj0yfi8ewCHx0eMxzA== - css-declaration-sorter@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-6.0.3.tgz#9dfd8ea0df4cc7846827876fafb52314890c21a9" @@ -2246,10 +2007,10 @@ cssesc@^3.0.0: resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== -cssnano-preset-default@^5.1.6: - version "5.1.6" - resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-5.1.6.tgz#1bdb83be6a6b1fee6dc5e9ec2e61286bcadcc7a6" - integrity sha512-X2nDeNGBXc0486oHjT2vSj+TdeyVsxRvJUxaOH50hOM6vSDLkKd0+59YXpSZRInJ4sNtBOykS4KsPfhdrU/35w== +cssnano-preset-default@^5.1.8: + version "5.1.8" + resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-5.1.8.tgz#7525feb1b72f7b06e57f55064cbdae341d79dea2" + integrity sha512-zWMlP0+AMPBVE852SqTrP0DnhTcTA2C1wAF92TKZ3Va+aUVqLIhkqKlnJIXXdqXD7RN+S1ujuWmNpvrJBiM/vg== dependencies: css-declaration-sorter "^6.0.3" cssnano-utils "^2.0.1" @@ -2260,11 +2021,11 @@ cssnano-preset-default@^5.1.6: postcss-discard-duplicates "^5.0.1" postcss-discard-empty "^5.0.1" postcss-discard-overridden "^5.0.1" - postcss-merge-longhand "^5.0.3" - postcss-merge-rules "^5.0.2" + postcss-merge-longhand "^5.0.4" + postcss-merge-rules "^5.0.3" postcss-minify-font-values "^5.0.1" postcss-minify-gradients "^5.0.3" - postcss-minify-params "^5.0.1" + postcss-minify-params "^5.0.2" postcss-minify-selectors "^5.1.0" postcss-normalize-charset "^5.0.1" postcss-normalize-display-values "^5.0.1" @@ -2273,25 +2034,25 @@ cssnano-preset-default@^5.1.6: postcss-normalize-string "^5.0.1" postcss-normalize-timing-functions "^5.0.1" postcss-normalize-unicode "^5.0.1" - postcss-normalize-url "^5.0.2" + postcss-normalize-url "^5.0.3" postcss-normalize-whitespace "^5.0.1" postcss-ordered-values "^5.0.2" - postcss-reduce-initial "^5.0.1" + postcss-reduce-initial "^5.0.2" postcss-reduce-transforms "^5.0.1" postcss-svgo "^5.0.3" - postcss-unique-selectors "^5.0.1" + postcss-unique-selectors "^5.0.2" cssnano-utils@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/cssnano-utils/-/cssnano-utils-2.0.1.tgz#8660aa2b37ed869d2e2f22918196a9a8b6498ce2" integrity sha512-i8vLRZTnEH9ubIyfdZCAdIdgnHAUeQeByEeQ2I7oTilvP9oHO6RScpeq3GsFUVqeB8uZgOQ9pw8utofNn32hhQ== -cssnano@5.0.10: - version "5.0.10" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.0.10.tgz#92207eb7c9c6dc08d318050726f9fad0adf7220b" - integrity sha512-YfNhVJJ04imffOpbPbXP2zjIoByf0m8E2c/s/HnvSvjXgzXMfgopVjAEGvxYOjkOpWuRQDg/OZFjO7WW94Ri8w== +cssnano@5.0.12: + version "5.0.12" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.0.12.tgz#2c083a1c786fc9dc2d5522bd3c0e331b7cd302ab" + integrity sha512-U38V4x2iJ3ijPdeWqUrEr4eKBB5PbEKsNP5T8xcik2Au3LeMtiMHX0i2Hu9k51FcKofNZumbrcdC6+a521IUHg== dependencies: - cssnano-preset-default "^5.1.6" + cssnano-preset-default "^5.1.8" is-resolvable "^1.1.0" lilconfig "^2.0.3" yaml "^1.10.2" @@ -2378,15 +2139,10 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -date-fns@2.25.0: - version "2.25.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.25.0.tgz#8c5c8f1d958be3809a9a03f4b742eba894fc5680" - integrity sha512-ovYRFnTrbGPD4nqaEqescPEv1mNwvt+UTqI3Ay9SzNtey9NZnYu6E2qCcBBgJ6/2VF1zGGygpyTDITqpQQ5e+w== - -date-fns@^2.16.1: - version "2.19.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.19.0.tgz#65193348635a28d5d916c43ec7ce6fbd145059e1" - integrity sha512-X3bf2iTPgCAQp9wvjOQytnf5vO5rESYRXlPIVcgSbtT5OTScPcsf9eZU+B/YIkKAtYr5WeCii58BgATrNitlWg== +date-fns@2.27.0: + version "2.27.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.27.0.tgz#e1ff3c3ddbbab8a2eaadbb6106be2929a5a2d92b" + integrity sha512-sj+J0Mo2p2X1e306MHq282WS4/A8Pz/95GIFcsPNMPMZVI3EUrAdSv90al1k+p74WGLCruMXk23bfEDZa71X9Q== dateformat@4.5.1: version "4.5.1" @@ -2398,13 +2154,6 @@ dayjs@^1.10.4: resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.6.tgz#288b2aa82f2d8418a6c9d4df5898c0737ad02a63" integrity sha512-AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw== -debug@2, debug@^2.2.0, debug@^2.5.2, debug@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - debug@4, debug@4.3.1, debug@^4.1.1: version "4.3.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" @@ -2419,6 +2168,13 @@ debug@4.3.2, debug@^4.3.2: dependencies: ms "2.1.2" +debug@^2.2.0, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + debug@^3.1.0, debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" @@ -2426,13 +2182,6 @@ debug@^3.1.0, debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -2443,23 +2192,11 @@ decamelize@^4.0.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== -decompress-response@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" - integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== - dependencies: - mimic-response "^3.1.0" - deep-is@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -defer-to-connect@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.0.tgz#83d6b199db041593ac84d781b5222308ccf4c2c1" - integrity sha512-bYL2d05vOSf1JEZNx5vSAtPuBMkX8K9EUutg7zlKvTqKXHt7RhWJFbmd7qakVuf13i+IkGmp6FwSsONOf6VYIg== - define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" @@ -2621,11 +2358,6 @@ electron-to-chromium@^1.3.723: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.742.tgz#7223215acbbd3a5284962ebcb6df85d88b95f200" integrity sha512-ihL14knI9FikJmH2XUIDdZFWJxvr14rPSdOhJ7PpS27xbz8qmaRwCwyg/bmFwjWKmWK9QyamiCZVCvXm5CH//Q== -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -2636,6 +2368,11 @@ emojis-list@^3.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== +encode-utf8@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/encode-utf8/-/encode-utf8-1.0.3.tgz#f30fdd31da07fb596f281beb2f6b027851994cda" + integrity sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw== + end-of-stream@^1.1.0: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" @@ -2835,10 +2572,10 @@ eslint-plugin-import@2.25.3: resolve "^1.20.0" tsconfig-paths "^3.11.0" -eslint-plugin-vue@8.1.1: - version "8.1.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-8.1.1.tgz#8bb0a40520880cdd076b4a6faf8bc29110997a8c" - integrity sha512-rx64IrlhdfPya6u2V5ukOGiLCTgaCBdMSpczLVqyo8A0l+Vbo+lzvIfEUfAQ2auj+MF6y0TwxLorzdCIzHunnw== +eslint-plugin-vue@8.2.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-8.2.0.tgz#b404bc10e3f43b2b7aad4ebb3b38090a58040202" + integrity sha512-cLIdTuOAMXyHeQ4drYKcZfoyzdwdBpH279X8/N0DgmotEI9yFKb5O/cAgoie/CkQZCH/MOmh0xw/KEfS90zY2A== dependencies: eslint-utils "^3.0.0" natural-compare "^1.4.0" @@ -2861,6 +2598,14 @@ eslint-scope@^6.0.0: esrecurse "^4.3.0" estraverse "^5.2.0" +eslint-scope@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153" + integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + eslint-utils@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" @@ -2878,13 +2623,18 @@ eslint-visitor-keys@^3.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz#e32e99c6cdc2eb063f204eda5db67bfe58bb4186" integrity sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q== -eslint@8.2.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.2.0.tgz#44d3fb506d0f866a506d97a0fc0e90ee6d06a815" - integrity sha512-erw7XmM+CLxTOickrimJ1SiF55jiNlVSp2qqm0NuBWPtHYQCegD5ZMaW0c3i5ytPqL+SSLaCxdvQXFPLJn+ABw== +eslint-visitor-keys@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" + integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== + +eslint@8.4.1: + version "8.4.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.4.1.tgz#d6531bbf3e598dffd7c0c7d35ec52a0b30fdfa2d" + integrity sha512-TxU/p7LB1KxQ6+7aztTnO7K0i+h0tDi81YRY9VzB6Id71kNz+fFYnf5HD5UOQmxkzcoa0TlVZf9dpMtUv0GpWg== dependencies: - "@eslint/eslintrc" "^1.0.4" - "@humanwhocodes/config-array" "^0.6.0" + "@eslint/eslintrc" "^1.0.5" + "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" @@ -2892,10 +2642,10 @@ eslint@8.2.0: doctrine "^3.0.0" enquirer "^2.3.5" escape-string-regexp "^4.0.0" - eslint-scope "^6.0.0" + eslint-scope "^7.1.0" eslint-utils "^3.0.0" - eslint-visitor-keys "^3.0.0" - espree "^9.0.0" + eslint-visitor-keys "^3.1.0" + espree "^9.2.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -2931,7 +2681,16 @@ espree@^9.0.0: acorn-jsx "^5.3.1" eslint-visitor-keys "^3.0.0" -esprima@^4.0.0, esprima@^4.0.1: +espree@^9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.2.0.tgz#c50814e01611c2d0f8bd4daa83c369eabba80dbc" + integrity sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg== + dependencies: + acorn "^8.6.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^3.1.0" + +esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== @@ -2998,7 +2757,7 @@ eventemitter2@^6.4.3: resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.4.tgz#aa96e8275c4dbeb017a5d0e03780c65612a1202b" integrity sha512-HLU3NDY6wARrLCEwyGKRBvuWYyvW6mHYv72SJJAH3iJN3a6eVUvkjFkcxah1bcTgGVBBrFdIopBJPhCQFMLyXw== -eventemitter3@4.0.7, eventemitter3@^4.0.7: +eventemitter3@4.0.7, eventemitter3@^4.0.4, eventemitter3@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== @@ -3137,11 +2896,6 @@ fast-levenshtein@^2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -fast-xml-parser@^3.19.0: - version "3.19.0" - resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-3.19.0.tgz#cb637ec3f3999f51406dd8ff0e6fc4d83e520d01" - integrity sha512-4pXwmBplsCPv8FOY1WRakF970TjNGnGnfbOnLqjlYvMiF1SR3yOHyxMR/YCXpPTOspNF5gwudqktIP4VsWkvBg== - fastest-levenshtein@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2" @@ -3189,7 +2943,7 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -find-node-modules@^2.1.0: +find-node-modules@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/find-node-modules/-/find-node-modules-2.1.2.tgz#57565a3455baf671b835bc6b2134a9b938b9c53c" integrity sha512-x+3P4mbtRPlSiVE1Qco0Z4YLU8WFiFcuWTf3m75OV9Uzcfs2Bg+O9N+r/K0AnmINBW06KpfqKwYJbFlFq4qNug== @@ -3212,13 +2966,6 @@ find-up@^2.1.0: dependencies: locate-path "^2.0.0" -find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" @@ -3265,15 +3012,6 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= -form-data@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.0.tgz#31b7e39c85f1355b7139ee0c647cf0de7f83c682" - integrity sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -3459,7 +3197,7 @@ globals@^13.9.0: dependencies: type-fest "^0.20.2" -globby@^11.0.2, globby@^11.0.4: +globby@^11.0.4: version "11.0.4" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== @@ -3471,23 +3209,6 @@ globby@^11.0.2, globby@^11.0.4: merge2 "^1.3.0" slash "^3.0.0" -got@11.8.2: - version "11.8.2" - resolved "https://registry.yarnpkg.com/got/-/got-11.8.2.tgz#7abb3959ea28c31f3576f1576c1effce23f33599" - integrity sha512-D0QywKgIe30ODs+fm8wMZiAcZjypcCodPNuMz5H9Mny7RJ+IjJ10BdmGW7OM7fHXP+O7r6ZwapQ/YQmMSvB0UQ== - dependencies: - "@sindresorhus/is" "^4.0.0" - "@szmarczak/http-timer" "^4.0.5" - "@types/cacheable-request" "^6.0.1" - "@types/responselike" "^1.0.0" - cacheable-lookup "^5.0.3" - cacheable-request "^7.0.1" - decompress-response "^6.0.0" - http2-wrapper "^1.0.0-beta.5.2" - lowercase-keys "^2.0.0" - p-cancelable "^2.0.0" - responselike "^2.0.0" - graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.4: version "4.2.4" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" @@ -3536,11 +3257,6 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-own-prop@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-own-prop/-/has-own-prop-2.0.0.tgz#f0f95d58f65804f5d218db32563bb85b8e0417af" - integrity sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ== - has-symbols@^1.0.0, has-symbols@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" @@ -3587,16 +3303,6 @@ homedir-polyfill@^1.0.1: dependencies: parse-passwd "^1.0.0" -hpagent@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/hpagent/-/hpagent-0.1.1.tgz#66f67f16e5c7a8b59a068e40c2658c2c749ad5e2" - integrity sha512-IxJWQiY0vmEjetHdoE9HZjD4Cx+mYTr25tR7JCxXaiI3QxW0YqYyM11KyZbHufoa/piWhMb2+D3FGpMgmA2cFQ== - -http-cache-semantics@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== - http-headers@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/http-headers/-/http-headers-3.0.2.tgz#5147771292f0b39d6778d930a3a59a76fc7ef44d" @@ -3613,14 +3319,6 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -http2-wrapper@^1.0.0-beta.5.2: - version "1.0.0-beta.5.2" - resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.0-beta.5.2.tgz#8b923deb90144aea65cf834b016a340fc98556f3" - integrity sha512-xYz9goEyBnC8XwXDTuC/MZ6t+MrKVQZOk4s7+PaDkwIsQd8IwqvM+0M6bA/2lvG8GHXcPdf+MejTUeO2LCPCeQ== - dependencies: - quick-lru "^5.1.1" - resolve-alpn "^1.0.0" - http_ece@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/http_ece/-/http_ece-1.1.0.tgz#74780c6eb32d8ddfe9e36a83abcd81fe0cd4fb75" @@ -3646,13 +3344,6 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== -iconv-lite@^0.4.4: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - icss-utils@^5.0.0, icss-utils@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" @@ -3665,11 +3356,6 @@ idb-keyval@5.1.3: dependencies: safari-14-idb-fix "^1.0.4" -ieee754@^1.1.4: - version "1.1.13" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" - integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== - ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" @@ -3685,6 +3371,11 @@ ignore@^5.1.8: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.9.tgz#9ec1a5cbe8e1446ec60d4420060d43aa6e7382fb" integrity sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ== +immutable@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.0.0.tgz#b86f78de6adef3608395efb269a91462797e2c23" + integrity sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw== + import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" @@ -3994,13 +3685,6 @@ is-string@^1.0.5, is-string@^1.0.7: dependencies: has-tostringtag "^1.0.0" -is-svg@4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-4.3.1.tgz#8c63ec8c67c8c7f0a8de0a71c8c7d58eccf4406b" - integrity sha512-h2CGs+yPUyvkgTJQS9cJzo9lYK06WgRiXUqBBHtglSzVKAuH4/oWsqk7LGfbSa1hGk9QcZ0SyQtVggvBA8LZXA== - dependencies: - fast-xml-parser "^3.19.0" - is-symbol@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" @@ -4037,11 +3721,6 @@ is-windows@^1.0.1: resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== -isarray@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" - integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -4086,11 +3765,6 @@ joi@^17.4.0: "@sideway/formula" "^3.0.0" "@sideway/pinpoint" "^2.0.0" -jpeg-js@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.1.tgz#937a3ae911eb6427f151760f8123f04c8bfe6ef7" - integrity sha512-jA55yJiB5tCXEddos8JBbvW+IMrqY0y1tjjx9KNVtA+QPmu7ND5j0zkKopClpUTsaETL135uOM2XfcYG4XRjmw== - js-levenshtein@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" @@ -4113,13 +3787,6 @@ js-yaml@4.0.0: dependencies: argparse "^2.0.1" -js-yaml@4.1.0, js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - js-yaml@^3.13.1, js-yaml@^3.14.1: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" @@ -4128,6 +3795,13 @@ js-yaml@^3.13.1, js-yaml@^3.14.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + jsbn@1.1.0, jsbn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-1.1.0.tgz#b01307cb29b618a1ed26ec79e911f803c4da0040" @@ -4138,11 +3812,6 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= -json-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" - integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== - json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -4268,19 +3937,12 @@ jws@^4.0.0: jwa "^2.0.0" safe-buffer "^5.0.1" -katex@0.13.18: - version "0.13.18" - resolved "https://registry.yarnpkg.com/katex/-/katex-0.13.18.tgz#ba89e8e4b70cc2325e25e019a62b9fe71e5c2931" - integrity sha512-a3dC4NSVSDU3O1WZbTnOiA8rVNJ2lSiomOl0kmckCIGObccIHXof7gAseIY0o1gjEspe+34ZeSEX2D1ChFKIvA== +katex@0.15.1: + version "0.15.1" + resolved "https://registry.yarnpkg.com/katex/-/katex-0.15.1.tgz#cf4ce2fa1257c3279cc7a7fe0c8d1fab40800893" + integrity sha512-KIk+gizli0gl1XaJlCYS8/donGMbzXYTka6BbH3AgvDJTOwyDY4hJ+YmzJ1F0y/3XzX5B9ED8AqB2Hmn2AZ0uA== dependencies: - commander "^6.0.0" - -keyv@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.0.3.tgz#4f3aa98de254803cafcd2896734108daa35e4254" - integrity sha512-zdGa2TOpSZPq5mU6iowDARnMBZgtCqJ11dJROFi6tg6kTn4nuUdU09lFyLFSaHrWqpIJ+EBq4E8/Dc0Vx5vLdA== - dependencies: - json-buffer "3.0.1" + commander "^8.0.0" kind-of@^6.0.2: version "6.0.3" @@ -4292,6 +3954,11 @@ klona@^2.0.4: resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.4.tgz#7bb1e3affb0cb8624547ef7e8f6708ea2e39dfc0" integrity sha512-ZRbnvdg/NxqzC7L9Uyqzf4psi1OM4Cuc+sJAkQPjO6XkQIJTNbfK2Rsmbw8fx1p2mkZdp2FZYo2+LwXYY/uwIA== +klona@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.5.tgz#d166574d90076395d9963aa7a928fabb8d76afbc" + integrity sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ== + langmap@0.0.16: version "0.0.16" resolved "https://registry.yarnpkg.com/langmap/-/langmap-0.0.16.tgz#2fe3e98a531fec0fec546624ebe168c2855bab56" @@ -4364,14 +4031,6 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - locate-path@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" @@ -4446,11 +4105,6 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" -lowercase-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" - integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== - lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -4547,16 +4201,6 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -mimic-response@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== - -mimic-response@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" - integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== - minimalistic-assert@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -4636,6 +4280,11 @@ ms@2.1.3, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== +mylas@^2.1.4: + version "2.1.6" + resolved "https://registry.yarnpkg.com/mylas/-/mylas-2.1.6.tgz#40f3ac6faf77b966c2c2f7b9c0d21ea65b3d9800" + integrity sha512-5ggCu4hVRJZE6NpQ309y6ArykK5vujK6LfSAXvsrmBNSX/9Gfq7D9zjxhHyjSR/sbFzCe2hI9LO1EY9KXv/XkQ== + nano-time@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/nano-time/-/nano-time-1.0.0.tgz#b0554f69ad89e22d0907f7a12b0993a5d96137ef" @@ -4663,15 +4312,6 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= -needle@^2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.5.2.tgz#cf1a8fce382b5a280108bba90a14993c00e4010a" - integrity sha512-LbRIwS9BfkPvNwNHlsA41Q29kL2L/6VaOJ0qisM5lLWsTV3nP15abO5ITL6L81zqFhzjRKDAYjpcBcwM0AVvLQ== - dependencies: - debug "^3.2.6" - iconv-lite "^0.4.4" - sax "^1.2.4" - neo-async@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" @@ -4697,7 +4337,7 @@ next-tick@~1.0.0: resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= -node-fetch@2.6.1, node-fetch@^2.6.1: +node-fetch@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== @@ -4717,11 +4357,6 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -normalize-url@^4.1.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" - integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== - normalize-url@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" @@ -4839,11 +4474,6 @@ onetime@^5.1.0, onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -opentype.js@^0.4.3: - version "0.4.11" - resolved "https://registry.yarnpkg.com/opentype.js/-/opentype.js-0.4.11.tgz#281a2390639cc15931c955d8d63c14a7c7772b41" - integrity sha1-KBojkGOcwVkxyVXY1jwUp8d3K0E= - optionator@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" @@ -4861,10 +4491,10 @@ ospath@^1.2.2: resolved "https://registry.yarnpkg.com/ospath/-/ospath-1.2.2.tgz#1276639774a3f8ef2572f7fe4280e0ea4550c07b" integrity sha1-EnZjl3Sj+O8lcvf+QoDg6kVQwHs= -p-cancelable@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.0.0.tgz#4a3740f5bdaf5ed5d7c3e34882c6fb5d6b266a6e" - integrity sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg== +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= p-limit@^1.1.0: version "1.3.0" @@ -4873,7 +4503,7 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" -p-limit@^2.0.0, p-limit@^2.2.0: +p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== @@ -4901,13 +4531,6 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - p-locate@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" @@ -4929,6 +4552,21 @@ p-map@^4.0.0: dependencies: aggregate-error "^3.0.0" +p-queue@6.6.2: + version "6.6.2" + resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-6.6.2.tgz#2068a9dcf8e67dd0ec3e7a2bcb76810faa85e426" + integrity sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ== + dependencies: + eventemitter3 "^4.0.4" + p-timeout "^3.2.0" + +p-timeout@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" + integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== + dependencies: + p-finally "^1.0.0" + p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" @@ -5046,10 +4684,10 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -pngjs@^3.3.0, pngjs@^3.3.1: - version "3.4.0" - resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.4.0.tgz#99ca7d725965fb655814eaf65f38f12bbdbf555f" - integrity sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w== +pngjs@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-5.0.0.tgz#e79dd2b215767fd9c04561c01236df960bce7fbb" + integrity sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw== portscanner@2.2.0: version "2.2.0" @@ -5104,34 +4742,32 @@ postcss-discard-overridden@^5.0.1: resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-5.0.1.tgz#454b41f707300b98109a75005ca4ab0ff2743ac6" integrity sha512-Y28H7y93L2BpJhrdUR2SR2fnSsT+3TVx1NmVQLbcnZWwIUpJ7mfcTC6Za9M2PG6w8j7UQRfzxqn8jU2VwFxo3Q== -postcss-loader@6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-6.2.0.tgz#714370a3f567141cf4cadcdf9575f5234d186bc5" - integrity sha512-H9hv447QjQJVDbHj3OUdciyAXY3v5+UDduzEytAlZCVHCpNAAg/mCSwhYYqZr9BiGYhmYspU8QXxZwiHTLn3yA== +postcss-loader@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-6.2.1.tgz#0895f7346b1702103d30fdc66e4d494a93c008ef" + integrity sha512-WbbYpmAaKcux/P66bZ40bpWsBucjx/TTgVVzRZ9yUO8yQfVBlameJ0ZGVaPfH64hNSBh63a+ICP5nqOpBA0w+Q== dependencies: cosmiconfig "^7.0.0" - klona "^2.0.4" + klona "^2.0.5" semver "^7.3.5" -postcss-merge-longhand@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-5.0.3.tgz#42194a5ffbaa5513edbf606ef79c44958564658b" - integrity sha512-kmB+1TjMTj/bPw6MCDUiqSA5e/x4fvLffiAdthra3a0m2/IjTrWsTmD3FdSskzUjEwkj5ZHBDEbv5dOcqD7CMQ== +postcss-merge-longhand@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-5.0.4.tgz#41f4f3270282ea1a145ece078b7679f0cef21c32" + integrity sha512-2lZrOVD+d81aoYkZDpWu6+3dTAAGkCKbV5DoRhnIR7KOULVrI/R7bcMjhrH9KTRy6iiHKqmtG+n/MMj1WmqHFw== dependencies: - css-color-names "^1.0.1" postcss-value-parser "^4.1.0" stylehacks "^5.0.1" -postcss-merge-rules@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-5.0.2.tgz#d6e4d65018badbdb7dcc789c4f39b941305d410a" - integrity sha512-5K+Md7S3GwBewfB4rjDeol6V/RZ8S+v4B66Zk2gChRqLTCC8yjnHQ601omj9TKftS19OPGqZ/XzoqpzNQQLwbg== +postcss-merge-rules@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-5.0.3.tgz#b5cae31f53129812a77e3eb1eeee448f8cf1a1db" + integrity sha512-cEKTMEbWazVa5NXd8deLdCnXl+6cYG7m2am+1HzqH0EnTdy8fRysatkaXb2dEnR+fdaDxTvuZ5zoBdv6efF6hg== dependencies: browserslist "^4.16.6" caniuse-api "^3.0.0" cssnano-utils "^2.0.1" postcss-selector-parser "^6.0.5" - vendors "^1.0.3" postcss-minify-font-values@^5.0.1: version "5.0.1" @@ -5149,16 +4785,15 @@ postcss-minify-gradients@^5.0.3: cssnano-utils "^2.0.1" postcss-value-parser "^4.1.0" -postcss-minify-params@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-5.0.1.tgz#371153ba164b9d8562842fdcd929c98abd9e5b6c" - integrity sha512-4RUC4k2A/Q9mGco1Z8ODc7h+A0z7L7X2ypO1B6V8057eVK6mZ6xwz6QN64nHuHLbqbclkX1wyzRnIrdZehTEHw== +postcss-minify-params@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-5.0.2.tgz#1b644da903473fbbb18fbe07b8e239883684b85c" + integrity sha512-qJAPuBzxO1yhLad7h2Dzk/F7n1vPyfHfCCh5grjGfjhi1ttCnq4ZXGIW77GSrEbh9Hus9Lc/e/+tB4vh3/GpDg== dependencies: alphanum-sort "^1.0.2" - browserslist "^4.16.0" + browserslist "^4.16.6" cssnano-utils "^2.0.1" postcss-value-parser "^4.1.0" - uniqs "^2.0.0" postcss-minify-selectors@^5.1.0: version "5.1.0" @@ -5247,10 +4882,10 @@ postcss-normalize-unicode@^5.0.1: browserslist "^4.16.0" postcss-value-parser "^4.1.0" -postcss-normalize-url@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-5.0.2.tgz#ddcdfb7cede1270740cf3e4dfc6008bd96abc763" - integrity sha512-k4jLTPUxREQ5bpajFQZpx8bCF2UrlqOTzP9kEqcEnOfwsRshWs2+oAFIHfDQB8GO2PaUaSE0NlTAYtbluZTlHQ== +postcss-normalize-url@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-5.0.3.tgz#42eca6ede57fe69075fab0f88ac8e48916ef931c" + integrity sha512-qWiUMbvkRx3kc1Dp5opzUwc7MBWZcSDK2yofCmdvFBCpx+zFPkxBC1FASQ59Pt+flYfj/nTZSkmF56+XG5elSg== dependencies: is-absolute-url "^3.0.3" normalize-url "^6.0.1" @@ -5271,12 +4906,12 @@ postcss-ordered-values@^5.0.2: cssnano-utils "^2.0.1" postcss-value-parser "^4.1.0" -postcss-reduce-initial@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-5.0.1.tgz#9d6369865b0f6f6f6b165a0ef5dc1a4856c7e946" - integrity sha512-zlCZPKLLTMAqA3ZWH57HlbCjkD55LX9dsRyxlls+wfuRfqCi5mSlZVan0heX5cHr154Dq9AfbH70LyhrSAezJw== +postcss-reduce-initial@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-5.0.2.tgz#fa424ce8aa88a89bc0b6d0f94871b24abe94c048" + integrity sha512-v/kbAAQ+S1V5v9TJvbGkV98V2ERPdU6XvMcKMjqAlYiJ2NtsHGlKYLPjWWcXlaTKNxooId7BGxeraK8qXvzKtw== dependencies: - browserslist "^4.16.0" + browserslist "^4.16.6" caniuse-api "^3.0.0" postcss-reduce-transforms@^5.0.1: @@ -5313,28 +4948,27 @@ postcss-svgo@^5.0.3: postcss-value-parser "^4.1.0" svgo "^2.7.0" -postcss-unique-selectors@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-5.0.1.tgz#3be5c1d7363352eff838bd62b0b07a0abad43bfc" - integrity sha512-gwi1NhHV4FMmPn+qwBNuot1sG1t2OmacLQ/AX29lzyggnjd+MnVD5uqQmpXO3J17KGL2WAxQruj1qTd3H0gG/w== +postcss-unique-selectors@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-5.0.2.tgz#5d6893daf534ae52626708e0d62250890108c0c1" + integrity sha512-w3zBVlrtZm7loQWRPVC0yjUwwpty7OM6DnEHkxcSQXO1bMS3RJ+JUS5LFMSDZHJcvGsRwhZinCWVqn8Kej4EDA== dependencies: alphanum-sort "^1.0.2" postcss-selector-parser "^6.0.5" - uniqs "^2.0.0" postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== -postcss@8.3.11: - version "8.3.11" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.11.tgz#c3beca7ea811cd5e1c4a3ec6d2e7599ef1f8f858" - integrity sha512-hCmlUAIlUiav8Xdqw3Io4LcpA1DOt7h3LSTAC4G6JGHFFaWzI6qvFt9oilvl8BmkbBRX1IhM90ZAmpk68zccQA== +postcss@8.4.4: + version "8.4.4" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.4.tgz#d53d4ec6a75fd62557a66bb41978bf47ff0c2869" + integrity sha512-joU6fBsN6EIer28Lj6GDFoC/5yOZzLCfn0zHAn/MYXI7aPt4m4hK5KC5ovEZXy+lnCjmYIbQWngvju2ddyEr8Q== dependencies: nanoid "^3.1.30" picocolors "^1.0.0" - source-map-js "^0.6.2" + source-map-js "^1.0.1" postcss@^8.1.10: version "8.2.8" @@ -5384,15 +5018,6 @@ private-ip@2.3.3: is-ip "^3.1.0" netmask "^2.0.2" -probe-image-size@7.2.1: - version "7.2.1" - resolved "https://registry.yarnpkg.com/probe-image-size/-/probe-image-size-7.2.1.tgz#df0c924e67e247bc94f8fcb0fad7f0081061fc44" - integrity sha512-d+6L3NvQBCNt4peRDoEfA7r9bPm6/qy18FnLKwg4NWBC5JrJm0pMLRg1kF4XNsPe1bUdt3WIMonPJzQWN2HXjQ== - dependencies: - lodash.merge "^4.6.2" - needle "^2.5.2" - stream-parser "~0.3.1" - progress@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" @@ -5548,32 +5173,20 @@ punycode@2.1.1, punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -pureimage@0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/pureimage/-/pureimage-0.3.5.tgz#cd5e91f7b6409fcf4880297aaa3e7fc0afc24d5e" - integrity sha512-+CFUEpoX6GemlKlHihI7Ii4IqKqF5KZjd682sAxwzbc4t4zU4Gwhxd4W3UMZW94nJzf0n4nA9zJrwTR4jZB4TA== - dependencies: - jpeg-js "^0.4.1" - opentype.js "^0.4.3" - pngjs "^3.3.1" - q@^1.1.2: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= -qrcode@1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/qrcode/-/qrcode-1.4.4.tgz#f0c43568a7e7510a55efc3b88d9602f71963ea83" - integrity sha512-oLzEC5+NKFou9P0bMj5+v6Z40evexeE29Z9cummZXZ9QXyMr3lphkURzxjXgPJC5azpxcshoDWV1xE46z+/c3Q== +qrcode@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/qrcode/-/qrcode-1.5.0.tgz#95abb8a91fdafd86f8190f2836abbfc500c72d1b" + integrity sha512-9MgRpgVc+/+47dFvQeD6U2s0Z92EsKzcHogtum4QB+UNd025WOJSHvn/hjk9xmzj7Stj95CyUAs31mrjxliEsQ== dependencies: - buffer "^5.4.3" - buffer-alloc "^1.2.0" - buffer-from "^1.1.1" dijkstrajs "^1.0.1" - isarray "^2.0.1" - pngjs "^3.3.0" - yargs "^13.2.4" + encode-utf8 "^1.0.3" + pngjs "^5.0.0" + yargs "^15.3.1" qs@~6.5.2: version "6.5.2" @@ -5590,11 +5203,6 @@ querystring@0.2.1: resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== -quick-lru@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" - integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== - ramda@~0.27.1: version "0.27.1" resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.1.tgz#66fc2df3ef873874ffc2da6aa8984658abacf5c9" @@ -5619,11 +5227,6 @@ rangestr@0.0.1: resolved "https://registry.yarnpkg.com/rangestr/-/rangestr-0.0.1.tgz#f72ff9246f10f2a7d7c16e14616f617be2c2635a" integrity sha1-9y/5JG8Q8qfXwW4UYW9he+LCY1o= -ratelimiter@3.4.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/ratelimiter/-/ratelimiter-3.4.1.tgz#fa69e94937413382a926aaa17aaeaa6263af4659" - integrity sha512-5FJbRW/Jkkdk29ksedAfWFkQkhbUrMx3QJGwMKAypeIiQf4yrLW+gtPKZiaWt4zPrtw1uGufOjGO7UGM6VllsQ== - readdirp@~3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.3.0.tgz#984458d13a1e42e2e9f5841b129e162f369aff17" @@ -5658,18 +5261,6 @@ regexpp@^3.2.0: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== -rename@1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/rename/-/rename-1.0.4.tgz#a0f25078fa4195e650f73050c7c12ccf689f430b" - integrity sha1-oPJQePpBleZQ9zBQx8Esz2ifQws= - dependencies: - debug "^2.5.2" - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - request-progress@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/request-progress/-/request-progress-3.0.0.tgz#4ca754081c7fec63f505e4faa825aa06cd669dbe" @@ -5700,11 +5291,6 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== -resolve-alpn@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.0.0.tgz#745ad60b3d6aff4b4a48e01b8c0bdc70959e0e8c" - integrity sha512-rTuiIEqFmGxne4IovivKSDzld2lWW9QCjqv80SYjPgf+gS35eaCAjaP54CCwGAwBtnCsvNLYtqxe1Nw+i6JEmA== - resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" @@ -5746,13 +5332,6 @@ resolve@^1.9.0: is-core-module "^2.0.0" path-parse "^1.0.6" -responselike@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.0.tgz#26391bcc3174f750f9a79eacc40a12a5c42d7723" - integrity sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw== - dependencies: - lowercase-keys "^2.0.0" - restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -5786,13 +5365,6 @@ run-parallel@^1.1.9: resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679" integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== -rxjs@^6.6.3: - version "6.6.6" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.6.tgz#14d8417aa5a07c5e633995b525e1e3c0dec03b70" - integrity sha512-/oTwee4N4iWzAMAL9xdGKjkEHmIwupR3oXbQjCKywF1BeFohswF3vZdogbmEF6pZkOsXTzWkrZszrWpQTByYVg== - dependencies: - tslib "^1.9.0" - rxjs@^6.6.7: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" @@ -5827,25 +5399,26 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sass-loader@12.3.0: - version "12.3.0" - resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-12.3.0.tgz#93278981c189c36a58cbfc37d4b9cef0cdc02871" - integrity sha512-6l9qwhdOb7qSrtOu96QQ81LVl8v6Dp9j1w3akOm0aWHyrTYtagDt5+kS32N4yq4hHk3M+rdqoRMH+lIdqvW6HA== +sass-loader@12.4.0: + version "12.4.0" + resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-12.4.0.tgz#260b0d51a8a373bb8e88efc11f6ba5583fea0bcf" + integrity sha512-7xN+8khDIzym1oL9XyS6zP6Ges+Bo2B2xbPrjdMHEYyV3AQYhd/wXeru++3ODHF0zMjYmVadblSKrPrjEkL8mg== dependencies: klona "^2.0.4" neo-async "^2.6.2" -sass@1.43.4: - version "1.43.4" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.43.4.tgz#68c7d6a1b004bef49af0d9caf750e9b252105d1f" - integrity sha512-/ptG7KE9lxpGSYiXn7Ar+lKOv37xfWsZRtFYal2QHNigyVQDx685VFT/h7ejVr+R8w7H4tmUgtulsKl5YpveOg== +sass@1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.44.0.tgz#619aa0a2275c097f9af5e6b8fe8a95e3056430fb" + integrity sha512-0hLREbHFXGQqls/K8X+koeP+ogFRPF4ZqetVB19b7Cst9Er8cOR0rc6RU7MaI4W1JmUShd1BPgPoeqmmgMMYFw== dependencies: chokidar ">=3.0.0 <4.0.0" + immutable "^4.0.0" sax@^1.2.4, sax@~1.2.4: version "1.2.4" @@ -5870,11 +5443,6 @@ schema-utils@^3.1.0: ajv "^6.12.5" ajv-keywords "^3.5.2" -secure-json-parse@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/secure-json-parse/-/secure-json-parse-2.1.0.tgz#ae76f5624256b5c497af887090a5d9e156c9fb20" - integrity sha512-GckO+MS/wT4UogDyoI/H/S1L0MCcKS1XX/vp48wfmU7Nw4woBmb8mIpu4zPBQjKlRT88/bt9xdoV4111jPpNJA== - seedrandom@2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-2.4.2.tgz#18d78c41287d13aff8eadb29e235938b248aa9ff" @@ -5989,6 +5557,11 @@ source-map-js@^0.6.2: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-0.6.2.tgz#0bb5de631b41cfbda6cfba8bd05a80efdfd2385e" integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug== +source-map-js@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.1.tgz#a1741c131e3c77d048252adfa24e23b908670caf" + integrity sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA== + source-map-support@~0.5.19: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" @@ -6012,18 +5585,6 @@ sourcemap-codec@^1.4.4: resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== -spawn-command@^0.0.2-1: - version "0.0.2-1" - resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" - integrity sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A= - -speakeasy@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/speakeasy/-/speakeasy-2.0.0.tgz#85c91a071b09a5cb8642590d983566165f57613a" - integrity sha1-hckaBxsJpcuGQlkNmDVmFl9XYTo= - dependencies: - base32.js "0.0.1" - split@0.3: version "0.3.3" resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" @@ -6081,13 +5642,6 @@ stream-combiner@~0.0.4: dependencies: duplexer "~0.1.1" -stream-parser@~0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/stream-parser/-/stream-parser-0.3.1.tgz#1618548694420021a1182ff0af1911c129761773" - integrity sha1-FhhUhpRCACGhGC/wrxkRwSl2F3M= - dependencies: - debug "2" - strict-event-emitter-types@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-event-emitter-types/-/strict-event-emitter-types-2.0.0.tgz#05e15549cb4da1694478a53543e4e2f4abcf277f" @@ -6101,15 +5655,6 @@ strict-event-emitter-types@2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^3.0.0, string-width@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - string-width@^4.1.0, string-width@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" @@ -6183,13 +5728,6 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - strip-ansi@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" @@ -6232,7 +5770,7 @@ stylehacks@^5.0.1: browserslist "^4.16.0" postcss-selector-parser "^6.0.4" -supports-color@8.1.1, supports-color@^8.0.0, supports-color@^8.1.0, supports-color@^8.1.1: +supports-color@8.1.1, supports-color@^8.0.0, supports-color@^8.1.1: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== @@ -6409,11 +5947,6 @@ tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" -tree-kill@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" - integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== - ts-loader@9.2.6: version "9.2.6" resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.2.6.tgz#9937c4dd0a1e3dbbb5e433f8102a6601c6615d74" @@ -6442,20 +5975,29 @@ ts-node@10.4.0: make-error "^1.1.1" yn "3.1.1" -tsc-alias@1.3.10: - version "1.3.10" - resolved "https://registry.yarnpkg.com/tsc-alias/-/tsc-alias-1.3.10.tgz#6ccf81c644092387ab9be3a3a75549a95eeffd80" - integrity sha512-7SF56qiV7Oh/bON+XjF/uAzEFqbmwCuEIHQyoTyVJAK80WnxaIyhO9TBwD/x8InIMU8lnvExQBOrgKkRPsHH+w== +tsc-alias@1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/tsc-alias/-/tsc-alias-1.4.2.tgz#80bac036f8d163a34a734a6772a57291313e084f" + integrity sha512-6OyipS3p1E7679vk9c55zfQm9JtBAMK1MfgoKXucT4oyTL7TdFgQRcRT/urdWC9JaAtahr3aYqyEI22T82UFuA== dependencies: - "@jfonx/console-utils" "^1.0.3" - "@jfonx/file-utils" "^3.0.1" - chokidar "^3.5.0" - commander "^6.2.1" - find-node-modules "^2.1.0" - globby "^11.0.2" + chokidar "^3.5.2" + commander "^8.2.0" + find-node-modules "^2.1.2" + globby "^11.0.4" + mylas "^2.1.4" normalize-path "^3.0.0" -tsconfig-paths@3.11.0, tsconfig-paths@^3.11.0: +tsconfig-paths@3.12.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" + integrity sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.0" + strip-bom "^3.0.0" + +tsconfig-paths@^3.11.0: version "3.11.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz#954c1fe973da6339c78e06b03ce2e48810b65f36" integrity sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA== @@ -6511,11 +6053,6 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-detect@4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - type-fest@^0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" @@ -6543,10 +6080,10 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@4.4.4: - version "4.4.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" - integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== +typescript@4.5.2: + version "4.5.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998" + integrity sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw== unbox-primitive@^1.0.1: version "1.0.1" @@ -6563,11 +6100,6 @@ uniq@^1.0.1: resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" integrity sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8= -uniqs@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" - integrity sha1-/+3ks2slKQaW5uFl1KWe25mOawI= - universalify@^0.1.0, universalify@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -6663,11 +6195,6 @@ vanilla-tilt@1.7.2: resolved "https://registry.yarnpkg.com/vanilla-tilt/-/vanilla-tilt-1.7.2.tgz#59a5565d9f1f6d392a36969f223fb600dd101a81" integrity sha512-arf2wY2Y65rP6Zxve9PnUUnRl9nQ1KenPNae6QRaVq/PEvaIto2bC4jYirNJ19U7nLkzI1H9O+nYtcQlX7BTsA== -vendors@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/vendors/-/vendors-1.0.4.tgz#e2b800a53e7a29b93506c3cf41100d16c4c4ad8e" - integrity sha512-/juG65kTL4Cy2su4P8HjtkTxk6VmJDiOPBufWniqQ6wknac6jNiXS9vU+hO3wgusiyqWlzTbVHi0dyJqRONg3w== - verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -6695,10 +6222,10 @@ vue-eslint-parser@^8.0.1: lodash "^4.17.21" semver "^7.3.5" -vue-loader@16.7.0: - version "16.7.0" - resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-16.7.0.tgz#ee161b2f6c27b0b459264c3c23d34068b471d574" - integrity sha512-43I0grWtwSCE8fiH/hAwFK+6sNlmvDuHhXScYH8HVSVAMS81IM66tgUOcxbPCeqhhz/1BE51YPxX59eZKGallQ== +vue-loader@16.8.3: + version "16.8.3" + resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-16.8.3.tgz#d43e675def5ba9345d6c7f05914c13d861997087" + integrity sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA== dependencies: chalk "^4.1.0" hash-sum "^2.0.0" @@ -6731,16 +6258,16 @@ vue-svg-loader@0.17.0-beta.2: semver "^7.3.2" svgo "^1.3.2" -vue@3.2.21: - version "3.2.21" - resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.21.tgz#55f5665172d95cf97e806b9aad0a375180be23a1" - integrity sha512-jpy7ckXdyclfRzqLjL4mtq81AkzQleE54KjZsJg/9OorNVurAxdlU5XpD49GpjKdnftuffKUvx2C5jDOrgc/zg== +vue@3.2.24: + version "3.2.24" + resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.24.tgz#6de7b01e55740dc37c0a5dbd45e70eed49f95189" + integrity sha512-PvCklXNfcUMyeP/a9nME27C32IipwUDoS45rDyKn5+RQrWyjL+0JAJtf98HL6y9bfqQRTlYjSowWEB1nXxvG5Q== dependencies: - "@vue/compiler-dom" "3.2.21" - "@vue/compiler-sfc" "3.2.21" - "@vue/runtime-dom" "3.2.21" - "@vue/server-renderer" "3.2.21" - "@vue/shared" "3.2.21" + "@vue/compiler-dom" "3.2.24" + "@vue/compiler-sfc" "3.2.24" + "@vue/runtime-dom" "3.2.24" + "@vue/server-renderer" "3.2.24" + "@vue/shared" "3.2.24" vuedraggable@4.0.1: version "4.0.1" @@ -6768,10 +6295,10 @@ watchpack@^2.0.0: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" -watchpack@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.2.0.tgz#47d78f5415fe550ecd740f99fe2882323a58b1ce" - integrity sha512-up4YAn/XHgZHIxFBVCdlMiWDj6WaLKpwVeGQk2I5thdYxF/KmF0aaz6TfJZ/hfl1h/XlcDr7k1KH7ThDagpFaA== +watchpack@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.3.1.tgz#4200d9447b401156eeca7767ee610f8809bc9d25" + integrity sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -6822,15 +6349,15 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack-sources@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.0.tgz#b16973bcf844ebcdb3afde32eda1c04d0b90f89d" - integrity sha512-fahN08Et7P9trej8xz/Z7eRu8ltyiygEo/hnRi9KqBUs80KeDcnf96ZJo++ewWd84fEf3xSX9bp4ZS9hbw0OBw== +webpack-sources@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.2.tgz#d88e3741833efec57c4c789b6010db9977545260" + integrity sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw== -webpack@5.63.0: - version "5.63.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.63.0.tgz#4b074115800e0526d85112985e46c64b95e04aaf" - integrity sha512-HYrw6bkj/MDmphAXvqLEvn2fVoDZsYu6O638WjK6lSNgIpjb5jl/KtOrqJyU9EC/ZV9mLUmZW5h4mASB+CVA4A== +webpack@5.65.0: + version "5.65.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.65.0.tgz#ed2891d9145ba1f0d318e4ea4f89c3fa18e6f9be" + integrity sha512-Q5or2o6EKs7+oKmJo7LaqZaMOlDWQse9Tm5l1WAfU/ujLGN5Pb0SqGeVkN/4bpPmEqEP5RnVhiqsOtWtUVwGRw== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.50" @@ -6854,8 +6381,8 @@ webpack@5.63.0: schema-utils "^3.1.0" tapable "^2.1.1" terser-webpack-plugin "^5.1.3" - watchpack "^2.2.0" - webpack-sources "^3.2.0" + watchpack "^2.3.1" + webpack-sources "^3.2.2" webpack@^5: version "5.33.2" @@ -6960,15 +6487,6 @@ workerpool@6.1.0: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.0.tgz#a8e038b4c94569596852de7a8ea4228eefdeb37b" integrity sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg== -wrap-ansi@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" - integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== - dependencies: - ansi-styles "^3.2.0" - string-width "^3.0.0" - strip-ansi "^5.0.0" - wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -6992,10 +6510,10 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -ws@8.2.3: - version "8.2.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.2.3.tgz#63a56456db1b04367d0b721a0b80cae6d8becbba" - integrity sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA== +ws@8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.3.0.tgz#7185e252c8973a60d57170175ff55fdbd116070d" + integrity sha512-Gs5EZtpqZzLvmIM59w4igITU57lrtYVFneaa434VROv4thzJyV6UjIL3D42lslWlI+D4KzLYnxSwtfuiO79sNw== xml-js@^1.6.11: version "1.6.11" @@ -7044,10 +6562,10 @@ yargs-parser@20.2.4, yargs-parser@^20.2.2: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== -yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== +yargs-parser@^18.1.2: + version "18.1.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== dependencies: camelcase "^5.0.0" decamelize "^1.2.0" @@ -7062,7 +6580,7 @@ yargs-unparser@2.0.0: flat "^5.0.2" is-plain-obj "^2.1.0" -yargs@16.2.0, yargs@^16.2.0: +yargs@16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== @@ -7075,21 +6593,22 @@ yargs@16.2.0, yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^13.2.4: - version "13.3.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== +yargs@^15.3.1: + version "15.4.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" + integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== dependencies: - cliui "^5.0.0" - find-up "^3.0.0" + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" get-caller-file "^2.0.1" require-directory "^2.1.1" require-main-filename "^2.0.0" set-blocking "^2.0.0" - string-width "^3.0.0" + string-width "^4.2.0" which-module "^2.0.0" y18n "^4.0.0" - yargs-parser "^13.1.2" + yargs-parser "^18.1.2" yauzl@^2.10.0: version "2.10.0" From 054417354c88061cf02bb7db7f3fbb3a1eda5473 Mon Sep 17 00:00:00 2001 From: romaboo <80708836+puff-fan-420@users.noreply.github.com> Date: Thu, 9 Dec 2021 12:38:56 +0000 Subject: [PATCH 13/43] feat: user-level instance mute (#7712) * Update ja-JP.yml * Added settable config for muted instances * added psql query for removal of muted notes * Added filtering and trimming for instance mutes * cleaned up filtering of bad instance mutes and added a refresh at the end for the list on the client * Added notification & streaming timeline muting * Updated changelog * Added missing semicolon * Apply japanese string suggestions from robflop Co-authored-by: Robin B. * Changed Ja-JP instance mute title string to one suggested by sousuke Co-authored-by: sousuke0422 * Update ja-JP instanceMuteDescription based on sousuke's suggestion Co-authored-by: sousuke0422 * added notification mute * added notification and note children muting * Fixed a bug where local notifications were getting filtered on cold start * Fixed instance mute imports * Fixed not saving/loading instance mutes * removed en-US translations for instance mute * moved instance mute migration to js * changed settings index back to spaces * removed destructuring assignment from notification stream in instance mute check call Co-authored-by: tamaina * added .note accessor for checking note data instead of notification data * changed note to use Packed<'Note'> instead of any and removed usage of snake case Co-authored-by: tamaina * changed notification mute check to check specifically for notification host * changed to using single quotes * moved @click to the end for the linter * revert unnecessary changes * restored newlines * whitespace removal Co-authored-by: syuilo Co-authored-by: Robin B. Co-authored-by: sousuke0422 Co-authored-by: puffaboo Co-authored-by: tamaina --- CHANGELOG.md | 3 + locales/ja-JP.yml | 7 ++ .../1629968054000_userInstanceBlocks.js | 15 ++++ .../backend/src/misc/is-instance-muted.ts | 15 ++++ .../src/models/entities/user-profile.ts | 5 ++ .../backend/src/models/repositories/user.ts | 5 ++ .../common/generate-muted-instance-query.ts | 40 +++++++++ .../server/api/endpoints/i/notifications.ts | 3 + .../src/server/api/endpoints/i/update.ts | 5 ++ .../server/api/endpoints/notes/children.ts | 2 + .../api/endpoints/notes/global-timeline.ts | 2 + .../api/endpoints/notes/hybrid-timeline.ts | 2 + .../server/api/endpoints/notes/timeline.ts | 2 + .../src/server/api/endpoints/users/notes.ts | 2 + .../api/stream/channels/global-timeline.ts | 4 + .../api/stream/channels/home-timeline.ts | 4 + .../api/stream/channels/hybrid-timeline.ts | 4 + .../src/server/api/stream/channels/main.ts | 5 ++ packages/client/src/pages/settings/index.vue | 6 ++ .../src/pages/settings/instance-mute.vue | 83 +++++++++++++++++++ 20 files changed, 214 insertions(+) create mode 100644 packages/backend/migration/1629968054000_userInstanceBlocks.js create mode 100644 packages/backend/src/misc/is-instance-muted.ts create mode 100644 packages/backend/src/server/api/common/generate-muted-instance-query.ts create mode 100644 packages/client/src/pages/settings/instance-mute.vue diff --git a/CHANGELOG.md b/CHANGELOG.md index a46f9c7c89..12a73a4c7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -234,6 +234,9 @@ ## 12.89.1 (2021/08/24) +### Features +- Added a user-level instance mute in user settings + ### Improvements - クライアントのデザインの調整 diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index d5c009bbcf..2a8d0bd9e8 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -592,6 +592,7 @@ smtpSecure: "SMTP 接続に暗黙的なSSL/TLSを使用する" smtpSecureInfo: "STARTTLS使用時はオフにします。" testEmail: "配信テスト" wordMute: "ワードミュート" +instanceMute: "インスタンスミュート" userSaysSomething: "{name}が何かを言いました" makeActive: "アクティブにする" display: "表示" @@ -1021,6 +1022,12 @@ _wordMute: hard: "ハード" mutedNotes: "ミュートされたノート" +_instanceMute: + instanceMuteDescription: "ミュートしたインスタンスのユーザーからの返信を含めて、設定したインスタンスの全てのノートとRenoteをミュートします。" + instanceMuteDescription2: "改行で区切って設定します" + title: "設定したインスタンスのノートを隠します。" + heading: "ミュートするインスタンス" + _theme: explore: "テーマを探す" install: "テーマのインストール" diff --git a/packages/backend/migration/1629968054000_userInstanceBlocks.js b/packages/backend/migration/1629968054000_userInstanceBlocks.js new file mode 100644 index 0000000000..5703ff0b00 --- /dev/null +++ b/packages/backend/migration/1629968054000_userInstanceBlocks.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class userInstanceBlocks1629968054000 { + constructor() { + this.name = 'userInstanceBlocks1629968054000'; + } + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_profile" ADD "mutedInstances" jsonb NOT NULL DEFAULT '[]'`); + await queryRunner.query(`COMMENT ON COLUMN "user_profile"."mutedInstances" IS 'List of instances muted by the user.'`); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "mutedInstances"`); + } +} +exports.userInstanceBlocks1629968054000 = userInstanceBlocks1629968054000; diff --git a/packages/backend/src/misc/is-instance-muted.ts b/packages/backend/src/misc/is-instance-muted.ts new file mode 100644 index 0000000000..2e1785b517 --- /dev/null +++ b/packages/backend/src/misc/is-instance-muted.ts @@ -0,0 +1,15 @@ +import { Packed } from "./schema"; + +export function isInstanceMuted(note: Packed<'Note'>, mutedInstances: Set): boolean { + if (mutedInstances.has(note?.user?.host ?? '')) return true; + if (mutedInstances.has(note?.reply?.user?.host ?? '')) return true; + if (mutedInstances.has(note?.renote?.user?.host ?? '')) return true; + + return false; +} + +export function isUserFromMutedInstance(notif: Packed<'Notification'>, mutedInstances: Set): boolean { + if (mutedInstances.has(notif?.user?.host ?? '')) return true; + + return false; +} diff --git a/packages/backend/src/models/entities/user-profile.ts b/packages/backend/src/models/entities/user-profile.ts index 8a8cacfd52..60e16820f4 100644 --- a/packages/backend/src/models/entities/user-profile.ts +++ b/packages/backend/src/models/entities/user-profile.ts @@ -189,6 +189,11 @@ export class UserProfile { }) public mutedWords: string[][]; + @Column('jsonb', { + default: [] + }) + public mutedInstances: string[]; + @Column('enum', { enum: notificationTypes, array: true, diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index 81468d6de2..2f6c150d39 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -288,6 +288,7 @@ export class UserRepository extends Repository { hasPendingReceivedFollowRequest: this.getHasPendingReceivedFollowRequest(user.id), integrations: profile!.integrations, mutedWords: profile!.mutedWords, + mutedInstances: profile!.mutedInstances, mutingNotificationTypes: profile!.mutingNotificationTypes, emailNotificationTypes: profile!.emailNotificationTypes, } : {}), @@ -623,6 +624,10 @@ export const packedUserSchema = { type: 'array' as const, nullable: false as const, optional: true as const }, + mutedInstances: { + type: 'array' as const, + nullable: false as const, optional: true as const + }, mutingNotificationTypes: { type: 'array' as const, nullable: false as const, optional: true as const diff --git a/packages/backend/src/server/api/common/generate-muted-instance-query.ts b/packages/backend/src/server/api/common/generate-muted-instance-query.ts new file mode 100644 index 0000000000..dbc9fc98f1 --- /dev/null +++ b/packages/backend/src/server/api/common/generate-muted-instance-query.ts @@ -0,0 +1,40 @@ +import { User } from '@/models/entities/user'; +import { id } from '@/models/id'; +import { UserProfiles } from '@/models/index'; +import { SelectQueryBuilder, Brackets } from 'typeorm'; + +function createMutesQuery(id: string) { + return UserProfiles.createQueryBuilder('user_profile') + .select('user_profile.mutedInstances') + .where('user_profile.userId = :muterId', { muterId: id }); +} + +export function generateMutedInstanceQuery(q: SelectQueryBuilder, me: { id: User['id'] }) { + const mutingQuery = createMutesQuery(me.id); + + q + .andWhere(new Brackets(qb => { qb + .andWhere('note.userHost IS NULL') + .orWhere(`NOT((${ mutingQuery.getQuery() })::jsonb ? note.userHost)`); + })) + .andWhere(new Brackets(qb => { qb + .where(`note.replyUserHost IS NULL`) + .orWhere(`NOT ((${ mutingQuery.getQuery() })::jsonb ? note.replyUserHost)`); + })) + .andWhere(new Brackets(qb => { qb + .where(`note.renoteUserHost IS NULL`) + .orWhere(`NOT ((${ mutingQuery.getQuery() })::jsonb ? note.renoteUserHost)`); + })); + q.setParameters(mutingQuery.getParameters()); +} + +export function generateMutedInstanceNotificationQuery(q: SelectQueryBuilder, me: { id: User['id'] }) { + const mutingQuery = createMutesQuery(me.id); + + q.andWhere(new Brackets(qb => { qb + .andWhere('notifier.host IS NULL') + .orWhere(`NOT (( ${mutingQuery.getQuery()} )::jsonb ? notifier.host)`); + })); + + q.setParameters(mutingQuery.getParameters()); +} diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts index 56668d03b7..a85637d8a0 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications.ts @@ -3,6 +3,7 @@ import { ID } from '@/misc/cafy-id'; import { readNotification } from '../../common/read-notification'; import define from '../../define'; import { makePaginationQuery } from '../../common/make-pagination-query'; +import { generateMutedInstanceNotificationQuery } from '../../common/generate-muted-instance-query'; import { Notifications, Followings, Mutings, Users } from '@/models/index'; import { notificationTypes } from '@/types'; import read from '@/services/note/read'; @@ -101,6 +102,8 @@ export default define(meta, async (ps, user) => { })); query.setParameters(mutingQuery.getParameters()); + generateMutedInstanceNotificationQuery(query, user); + query.andWhere(new Brackets(qb => { qb .where(`notification.notifierId NOT IN (${ suspendedQuery.getQuery() })`) .orWhere('notification.notifierId IS NULL'); diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index d0f201ab60..4c5a4da622 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -116,6 +116,10 @@ export const meta = { validator: $.optional.arr($.arr($.str)) }, + mutedInstances: { + validator: $.optional.arr($.str) + }, + mutingNotificationTypes: { validator: $.optional.arr($.str.or(notificationTypes as unknown as string[])) }, @@ -185,6 +189,7 @@ export default define(meta, async (ps, _user, token) => { profileUpdates.mutedWords = ps.mutedWords; profileUpdates.enableWordMute = ps.mutedWords.length > 0; } + if (ps.mutedInstances !== undefined) profileUpdates.mutedInstances = ps.mutedInstances; if (ps.mutingNotificationTypes !== undefined) profileUpdates.mutingNotificationTypes = ps.mutingNotificationTypes as typeof notificationTypes[number][]; if (typeof ps.isLocked === 'boolean') updates.isLocked = ps.isLocked; if (typeof ps.isExplorable === 'boolean') updates.isExplorable = ps.isExplorable; diff --git a/packages/backend/src/server/api/endpoints/notes/children.ts b/packages/backend/src/server/api/endpoints/notes/children.ts index 68881fda9e..49e5a2f84d 100644 --- a/packages/backend/src/server/api/endpoints/notes/children.ts +++ b/packages/backend/src/server/api/endpoints/notes/children.ts @@ -7,6 +7,7 @@ import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; import { Brackets } from 'typeorm'; import { Notes } from '@/models/index'; import { generateBlockedUserQuery } from '../../common/generate-block-query'; +import { generateMutedInstanceQuery } from '../../common/generate-muted-instance-query'; export const meta = { tags: ['notes'], @@ -65,6 +66,7 @@ export default define(meta, async (ps, user) => { generateVisibilityQuery(query, user); if (user) generateMutedUserQuery(query, user); if (user) generateBlockedUserQuery(query, user); + if (user) generateMutedInstanceQuery(query, user); const notes = await query.take(ps.limit!).getMany(); diff --git a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts index 5902c0415c..7c80153b42 100644 --- a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts @@ -6,6 +6,7 @@ import { ApiError } from '../../error'; import { makePaginationQuery } from '../../common/make-pagination-query'; import { Notes } from '@/models/index'; import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { generateMutedInstanceQuery } from '../../common/generate-muted-instance-query'; import { activeUsersChart } from '@/services/chart/index'; import { generateRepliesQuery } from '../../common/generate-replies-query'; import { generateMutedNoteQuery } from '../../common/generate-muted-note-query'; @@ -83,6 +84,7 @@ export default define(meta, async (ps, user) => { if (user) generateMutedUserQuery(query, user); if (user) generateMutedNoteQuery(query, user); if (user) generateBlockedUserQuery(query, user); + if (user) generateMutedInstanceQuery(query, user); if (ps.withFiles) { query.andWhere('note.fileIds != \'{}\''); diff --git a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts index 47f08f208b..22babb5d0c 100644 --- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -8,6 +8,7 @@ import { Followings, Notes } from '@/models/index'; import { Brackets } from 'typeorm'; import { generateVisibilityQuery } from '../../common/generate-visibility-query'; import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { generateMutedInstanceQuery } from '../../common/generate-muted-instance-query'; import { activeUsersChart } from '@/services/chart/index'; import { generateRepliesQuery } from '../../common/generate-replies-query'; import { generateMutedNoteQuery } from '../../common/generate-muted-note-query'; @@ -108,6 +109,7 @@ export default define(meta, async (ps, user) => { generateRepliesQuery(query, user); generateVisibilityQuery(query, user); generateMutedUserQuery(query, user); + generateMutedInstanceQuery(query, user); generateMutedNoteQuery(query, user); generateBlockedUserQuery(query, user); diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index 1bd0e57d34..7a69b1590d 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -5,6 +5,7 @@ import { makePaginationQuery } from '../../common/make-pagination-query'; import { Notes, Followings } from '@/models/index'; import { generateVisibilityQuery } from '../../common/generate-visibility-query'; import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; +import { generateMutedInstanceQuery } from '../../common/generate-muted-instance-query'; import { activeUsersChart } from '@/services/chart/index'; import { Brackets } from 'typeorm'; import { generateRepliesQuery } from '../../common/generate-replies-query'; @@ -100,6 +101,7 @@ export default define(meta, async (ps, user) => { generateRepliesQuery(query, user); generateVisibilityQuery(query, user); generateMutedUserQuery(query, user); + generateMutedInstanceQuery(query, user); generateMutedNoteQuery(query, user); generateBlockedUserQuery(query, user); diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index 0afbad9d04..e461672534 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -9,6 +9,7 @@ import { Notes } from '@/models/index'; import { generateMutedUserQuery } from '../../common/generate-muted-user-query'; import { Brackets } from 'typeorm'; import { generateBlockedUserQuery } from '../../common/generate-block-query'; +import { generateMutedInstanceQuery } from '../../common/generate-muted-instance-query'; export const meta = { tags: ['users', 'notes'], @@ -102,6 +103,7 @@ export default define(meta, async (ps, me) => { generateVisibilityQuery(query, me); if (me) generateMutedUserQuery(query, me, user); if (me) generateBlockedUserQuery(query, me); + if (me) generateMutedInstanceQuery(query, me); if (ps.withFiles) { query.andWhere('note.fileIds != \'{}\''); diff --git a/packages/backend/src/server/api/stream/channels/global-timeline.ts b/packages/backend/src/server/api/stream/channels/global-timeline.ts index f5983ab472..3c37b16dd7 100644 --- a/packages/backend/src/server/api/stream/channels/global-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts @@ -5,6 +5,7 @@ import { fetchMeta } from '@/misc/fetch-meta'; import { Notes } from '@/models/index'; import { checkWordMute } from '@/misc/check-word-mute'; import { isBlockerUserRelated } from '@/misc/is-blocker-user-related'; +import { isInstanceMuted } from '@/misc/is-instance-muted'; import { Packed } from '@/misc/schema'; export default class extends Channel { @@ -48,6 +49,9 @@ export default class extends Channel { if (reply.userId !== this.user!.id && note.userId !== this.user!.id && reply.userId !== note.userId) return; } + // Ignore notes from instances the user has muted + if (isInstanceMuted(note, new Set(this.userProfile?.mutedInstances ?? []))) return; + // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する if (isMutedUserRelated(note, this.muting)) return; // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する diff --git a/packages/backend/src/server/api/stream/channels/home-timeline.ts b/packages/backend/src/server/api/stream/channels/home-timeline.ts index 52e9aec250..24fb3bd40b 100644 --- a/packages/backend/src/server/api/stream/channels/home-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts @@ -4,6 +4,7 @@ import Channel from '../channel'; import { Notes } from '@/models/index'; import { checkWordMute } from '@/misc/check-word-mute'; import { isBlockerUserRelated } from '@/misc/is-blocker-user-related'; +import { isInstanceMuted } from '@/misc/is-instance-muted'; import { Packed } from '@/misc/schema'; export default class extends Channel { @@ -26,6 +27,9 @@ export default class extends Channel { if ((this.user!.id !== note.userId) && !this.following.has(note.userId)) return; } + // Ignore notes from instances the user has muted + if (isInstanceMuted(note, new Set(this.userProfile?.mutedInstances ?? []))) return; + if (['followers', 'specified'].includes(note.visibility)) { note = await Notes.pack(note.id, this.user!, { detail: true diff --git a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts index 51f95fc0cd..615cc4540f 100644 --- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts @@ -5,6 +5,7 @@ import { fetchMeta } from '@/misc/fetch-meta'; import { Notes } from '@/models/index'; import { checkWordMute } from '@/misc/check-word-mute'; import { isBlockerUserRelated } from '@/misc/is-blocker-user-related'; +import { isInstanceMuted } from '@/misc/is-instance-muted'; import { Packed } from '@/misc/schema'; export default class extends Channel { @@ -57,6 +58,9 @@ export default class extends Channel { } } + // Ignore notes from instances the user has muted + if (isInstanceMuted(note, new Set(this.userProfile?.mutedInstances ?? []))) return; + // 関係ない返信は除外 if (note.reply) { const reply = note.reply; diff --git a/packages/backend/src/server/api/stream/channels/main.ts b/packages/backend/src/server/api/stream/channels/main.ts index 131ac30472..925263aef0 100644 --- a/packages/backend/src/server/api/stream/channels/main.ts +++ b/packages/backend/src/server/api/stream/channels/main.ts @@ -1,6 +1,7 @@ import autobind from 'autobind-decorator'; import Channel from '../channel'; import { Notes } from '@/models/index'; +import { isInstanceMuted, isUserFromMutedInstance } from '@/misc/is-instance-muted'; export default class extends Channel { public readonly chName = 'main'; @@ -13,6 +14,8 @@ export default class extends Channel { this.subscriber.on(`mainStream:${this.user!.id}`, async data => { switch (data.type) { case 'notification': { + // Ignore notifications from instances the user has muted + if (isUserFromMutedInstance(data.body, new Set(this.userProfile?.mutedInstances ?? []))) return; if (data.body.userId && this.muting.has(data.body.userId)) return; if (data.body.note && data.body.note.isHidden) { @@ -25,6 +28,8 @@ export default class extends Channel { break; } case 'mention': { + if (isInstanceMuted(data.body, new Set(this.userProfile?.mutedInstances ?? []))) return; + if (this.muting.has(data.body.userId)) return; if (data.body.isHidden) { const note = await Notes.pack(data.body.id, this.user, { diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index bfac1be77d..2e26870d8b 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -136,6 +136,11 @@ export default defineComponent({ text: i18n.locale.importAndExport, to: '/settings/import-export', active: page.value === 'import-export', + }, { + icon: 'fas fa-volume-mute', + text: i18n.locale.instanceMute, + to: '/settings/instance-mute', + active: page.value === 'instance-mute', }, { icon: 'fas fa-ban', text: i18n.locale.muteAndBlock, @@ -190,6 +195,7 @@ export default defineComponent({ case 'notifications': return defineAsyncComponent(() => import('./notifications.vue')); case 'mute-block': return defineAsyncComponent(() => import('./mute-block.vue')); case 'word-mute': return defineAsyncComponent(() => import('./word-mute.vue')); + case 'instance-mute': return defineAsyncComponent(() => import('./instance-mute.vue')); case 'integration': return defineAsyncComponent(() => import('./integration.vue')); case 'security': return defineAsyncComponent(() => import('./security.vue')); case '2fa': return defineAsyncComponent(() => import('./2fa.vue')); diff --git a/packages/client/src/pages/settings/instance-mute.vue b/packages/client/src/pages/settings/instance-mute.vue new file mode 100644 index 0000000000..813d2a0441 --- /dev/null +++ b/packages/client/src/pages/settings/instance-mute.vue @@ -0,0 +1,83 @@ + + + From 4341c4ccccd4024c9f7eed3e304a4b61e4cedc16 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 9 Dec 2021 21:40:15 +0900 Subject: [PATCH 14/43] Update CHANGELOG.md --- CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12a73a4c7c..a5f505dc2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ## 12.x.x (unreleased) ### Improvements +- Added a user-level instance mute in user settings ### Bugfixes - クライアント: タッチ機能付きディスプレイを使っていてマウス操作をしている場合に一部機能が動作しない問題を修正 @@ -234,9 +235,6 @@ ## 12.89.1 (2021/08/24) -### Features -- Added a user-level instance mute in user settings - ### Improvements - クライアントのデザインの調整 From caf0a219a65fa13ccd46f361e1209b0d12064cdc Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 9 Dec 2021 21:45:14 +0900 Subject: [PATCH 15/43] Update instance-mute.vue --- .../src/pages/settings/instance-mute.vue | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/packages/client/src/pages/settings/instance-mute.vue b/packages/client/src/pages/settings/instance-mute.vue index 813d2a0441..fe5ff89434 100644 --- a/packages/client/src/pages/settings/instance-mute.vue +++ b/packages/client/src/pages/settings/instance-mute.vue @@ -1,36 +1,28 @@ From c69b72e1999578cba15e34677ebd366482cba734 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 9 Dec 2021 23:58:30 +0900 Subject: [PATCH 17/43] fix lint --- packages/backend/src/daemons/janitor.ts | 2 +- packages/backend/src/daemons/queue-stats.ts | 4 +- packages/backend/src/daemons/server-stats.ts | 2 +- packages/backend/src/db/elasticsearch.ts | 20 +- packages/backend/src/db/postgre.ts | 8 +- packages/backend/src/db/redis.ts | 2 +- packages/backend/src/games/reversi/core.ts | 4 +- packages/backend/src/games/reversi/maps.ts | 206 ++++++++--------- packages/backend/src/mfm/to-html.ts | 2 +- packages/backend/src/misc/cache.ts | 2 +- packages/backend/src/misc/captcha.ts | 6 +- .../backend/src/misc/check-hit-antenna.ts | 4 +- packages/backend/src/misc/download-url.ts | 2 +- packages/backend/src/misc/fetch-meta.ts | 6 +- packages/backend/src/misc/fetch.ts | 12 +- packages/backend/src/misc/gen-key-pair.ts | 12 +- packages/backend/src/misc/get-file-info.ts | 6 +- packages/backend/src/misc/reaction-lib.ts | 4 +- .../src/models/entities/abuse-user-report.ts | 16 +- .../src/models/entities/access-token.ts | 24 +- packages/backend/src/models/entities/ad.ts | 16 +- .../src/models/entities/announcement-read.ts | 6 +- .../src/models/entities/announcement.ts | 10 +- .../src/models/entities/antenna-note.ts | 10 +- .../backend/src/models/entities/antenna.ts | 26 +-- packages/backend/src/models/entities/app.ts | 14 +- .../models/entities/attestation-challenge.ts | 8 +- .../src/models/entities/auth-session.ts | 10 +- .../backend/src/models/entities/blocking.ts | 10 +- .../src/models/entities/channel-following.ts | 10 +- .../models/entities/channel-note-pining.ts | 6 +- .../backend/src/models/entities/channel.ts | 20 +- .../backend/src/models/entities/clip-note.ts | 8 +- packages/backend/src/models/entities/clip.ts | 12 +- .../backend/src/models/entities/drive-file.ts | 38 ++-- .../src/models/entities/drive-folder.ts | 12 +- packages/backend/src/models/entities/emoji.ts | 14 +- .../src/models/entities/follow-request.ts | 24 +- .../backend/src/models/entities/following.ts | 22 +- .../src/models/entities/gallery-like.ts | 4 +- .../src/models/entities/gallery-post.ts | 18 +- .../src/models/entities/games/reversi/game.ts | 16 +- .../models/entities/games/reversi/matching.ts | 6 +- .../backend/src/models/entities/hashtag.ts | 14 +- .../backend/src/models/entities/instance.ts | 14 +- .../src/models/entities/messaging-message.ts | 20 +- packages/backend/src/models/entities/meta.ts | 100 ++++----- .../src/models/entities/moderation-log.ts | 4 +- .../backend/src/models/entities/muted-note.ts | 10 +- .../backend/src/models/entities/muting.ts | 10 +- .../src/models/entities/note-favorite.ts | 6 +- .../src/models/entities/note-reaction.ts | 8 +- .../src/models/entities/note-thread-muting.ts | 2 +- .../src/models/entities/note-unread.ts | 8 +- .../src/models/entities/note-watching.ts | 12 +- packages/backend/src/models/entities/note.ts | 66 +++--- .../src/models/entities/notification.ts | 40 ++-- .../backend/src/models/entities/page-like.ts | 4 +- packages/backend/src/models/entities/page.ts | 24 +- .../models/entities/password-reset-request.ts | 2 +- .../backend/src/models/entities/poll-vote.ts | 6 +- packages/backend/src/models/entities/poll.ts | 12 +- .../backend/src/models/entities/promo-note.ts | 4 +- .../backend/src/models/entities/promo-read.ts | 6 +- .../src/models/entities/registry-item.ts | 16 +- .../backend/src/models/entities/signin.ts | 4 +- .../src/models/entities/sw-subscription.ts | 2 +- .../models/entities/user-group-invitation.ts | 10 +- .../src/models/entities/user-group-joining.ts | 10 +- .../backend/src/models/entities/user-group.ts | 6 +- .../src/models/entities/user-keypair.ts | 2 +- .../src/models/entities/user-list-joining.ts | 10 +- .../backend/src/models/entities/user-list.ts | 8 +- .../src/models/entities/user-note-pining.ts | 6 +- .../src/models/entities/user-profile.ts | 34 +-- .../src/models/entities/user-publickey.ts | 2 +- .../src/models/entities/user-security-key.ts | 10 +- packages/backend/src/models/entities/user.ts | 64 +++--- packages/backend/src/models/id.ts | 2 +- .../models/repositories/abuse-user-report.ts | 6 +- .../src/models/repositories/antenna.ts | 42 ++-- .../backend/src/models/repositories/app.ts | 24 +- .../src/models/repositories/auth-session.ts | 2 +- .../src/models/repositories/blocking.ts | 6 +- .../src/models/repositories/channel.ts | 2 +- .../src/models/repositories/drive-file.ts | 34 +-- .../src/models/repositories/drive-folder.ts | 14 +- .../backend/src/models/repositories/emoji.ts | 2 +- .../repositories/federation-instance.ts | 48 ++-- .../src/models/repositories/following.ts | 6 +- .../src/models/repositories/gallery-post.ts | 10 +- .../models/repositories/games/reversi/game.ts | 16 +- .../repositories/games/reversi/matching.ts | 8 +- .../src/models/repositories/hashtag.ts | 2 +- .../models/repositories/messaging-message.ts | 4 +- .../models/repositories/moderation-logs.ts | 2 +- .../backend/src/models/repositories/muting.ts | 6 +- .../src/models/repositories/note-reaction.ts | 2 +- .../backend/src/models/repositories/note.ts | 44 ++-- .../src/models/repositories/notification.ts | 22 +- .../backend/src/models/repositories/page.ts | 6 +- .../backend/src/models/repositories/queue.ts | 16 +- .../src/models/repositories/user-group.ts | 6 +- .../src/models/repositories/user-list.ts | 6 +- .../backend/src/models/repositories/user.ts | 144 ++++++------ packages/backend/src/prelude/maybe.ts | 2 +- packages/backend/src/prelude/xml.ts | 2 +- packages/backend/src/queue/index.ts | 68 +++--- packages/backend/src/queue/initialize.ts | 8 +- .../src/queue/processors/db/delete-account.ts | 12 +- .../queue/processors/db/delete-drive-files.ts | 6 +- .../queue/processors/db/export-blocking.ts | 6 +- .../queue/processors/db/export-following.ts | 6 +- .../src/queue/processors/db/export-mute.ts | 6 +- .../queue/processors/db/export-user-lists.ts | 4 +- .../queue/processors/db/import-blocking.ts | 6 +- .../queue/processors/db/import-following.ts | 6 +- .../src/queue/processors/db/import-muting.ts | 6 +- .../queue/processors/db/import-user-lists.ts | 10 +- .../backend/src/queue/processors/deliver.ts | 6 +- .../backend/src/queue/processors/inbox.ts | 2 +- .../object-storage/clean-remote-files.ts | 6 +- .../src/remote/activitypub/audience.ts | 8 +- .../src/remote/activitypub/db-resolver.ts | 22 +- .../src/remote/activitypub/deliver-manager.ts | 6 +- .../activitypub/kernel/announce/note.ts | 2 +- .../remote/activitypub/kernel/flag/index.ts | 4 +- .../remote/activitypub/kernel/undo/accept.ts | 2 +- .../activitypub/kernel/undo/announce.ts | 2 +- .../remote/activitypub/kernel/undo/follow.ts | 4 +- .../remote/activitypub/misc/ld-signature.ts | 14 +- .../src/remote/activitypub/models/image.ts | 2 +- .../src/remote/activitypub/models/note.ts | 16 +- .../src/remote/activitypub/models/person.ts | 4 +- .../src/remote/activitypub/models/question.ts | 6 +- .../src/remote/activitypub/renderer/accept.ts | 2 +- .../src/remote/activitypub/renderer/add.ts | 2 +- .../remote/activitypub/renderer/announce.ts | 2 +- .../src/remote/activitypub/renderer/block.ts | 2 +- .../src/remote/activitypub/renderer/create.ts | 2 +- .../src/remote/activitypub/renderer/emoji.ts | 4 +- .../activitypub/renderer/follow-relay.ts | 2 +- .../src/remote/activitypub/renderer/follow.ts | 2 +- .../remote/activitypub/renderer/hashtag.ts | 2 +- .../src/remote/activitypub/renderer/image.ts | 2 +- .../src/remote/activitypub/renderer/index.ts | 4 +- .../src/remote/activitypub/renderer/key.ts | 4 +- .../src/remote/activitypub/renderer/like.ts | 4 +- .../src/remote/activitypub/renderer/note.ts | 18 +- .../renderer/ordered-collection-page.ts | 2 +- .../src/remote/activitypub/renderer/person.ts | 6 +- .../remote/activitypub/renderer/question.ts | 6 +- .../src/remote/activitypub/renderer/read.ts | 2 +- .../src/remote/activitypub/renderer/reject.ts | 2 +- .../src/remote/activitypub/renderer/remove.ts | 2 +- .../remote/activitypub/renderer/tombstone.ts | 2 +- .../src/remote/activitypub/renderer/vote.ts | 4 +- .../backend/src/remote/activitypub/request.ts | 10 +- packages/backend/src/remote/resolve-user.ts | 4 +- packages/backend/src/server/activitypub.ts | 12 +- .../src/server/activitypub/featured.ts | 4 +- .../src/server/activitypub/followers.ts | 10 +- .../src/server/activitypub/following.ts | 10 +- .../backend/src/server/activitypub/outbox.ts | 8 +- packages/backend/src/server/api/2fa.ts | 2 +- .../backend/src/server/api/api-handler.ts | 6 +- .../backend/src/server/api/authenticate.ts | 8 +- packages/backend/src/server/api/call.ts | 18 +- .../src/server/api/common/inject-promo.ts | 2 +- .../api/common/read-messaging-message.ts | 14 +- .../server/api/common/read-notification.ts | 8 +- .../backend/src/server/api/common/signin.ts | 6 +- .../backend/src/server/api/common/signup.ts | 10 +- packages/backend/src/server/api/define.ts | 2 +- packages/backend/src/server/api/endpoints.ts | 4 +- .../api/endpoints/admin/abuse-user-reports.ts | 22 +- .../api/endpoints/admin/accounts/create.ts | 10 +- .../api/endpoints/admin/accounts/delete.ts | 6 +- .../server/api/endpoints/admin/ad/create.ts | 16 +- .../server/api/endpoints/admin/ad/delete.ts | 10 +- .../src/server/api/endpoints/admin/ad/list.ts | 2 +- .../server/api/endpoints/admin/ad/update.ts | 22 +- .../endpoints/admin/announcements/create.ts | 14 +- .../endpoints/admin/announcements/delete.ts | 10 +- .../api/endpoints/admin/announcements/list.ts | 12 +- .../endpoints/admin/announcements/update.ts | 16 +- .../admin/delete-all-files-of-a-user.ts | 4 +- .../api/endpoints/admin/drive/cleanup.ts | 2 +- .../server/api/endpoints/admin/drive/files.ts | 14 +- .../api/endpoints/admin/drive/show-file.ts | 50 ++--- .../server/api/endpoints/admin/emoji/add.ts | 14 +- .../server/api/endpoints/admin/emoji/copy.ts | 16 +- .../api/endpoints/admin/emoji/list-remote.ts | 20 +- .../server/api/endpoints/admin/emoji/list.ts | 18 +- .../api/endpoints/admin/emoji/remove.ts | 12 +- .../api/endpoints/admin/emoji/update.ts | 16 +- .../admin/federation/delete-all-files.ts | 8 +- .../refresh-remote-instance-metadata.ts | 4 +- .../admin/federation/remove-all-following.ts | 10 +- .../admin/federation/update-instance.ts | 8 +- .../api/endpoints/admin/get-table-stats.ts | 6 +- .../src/server/api/endpoints/admin/invite.ts | 8 +- .../api/endpoints/admin/moderators/add.ts | 4 +- .../api/endpoints/admin/moderators/remove.ts | 4 +- .../api/endpoints/admin/promo/create.ts | 8 +- .../server/api/endpoints/admin/queue/clear.ts | 2 +- .../endpoints/admin/queue/deliver-delayed.ts | 12 +- .../endpoints/admin/queue/inbox-delayed.ts | 12 +- .../server/api/endpoints/admin/queue/jobs.ts | 20 +- .../server/api/endpoints/admin/queue/stats.ts | 14 +- .../server/api/endpoints/admin/relays/add.ts | 18 +- .../server/api/endpoints/admin/relays/list.ts | 16 +- .../api/endpoints/admin/relays/remove.ts | 2 +- .../api/endpoints/admin/reset-password.ts | 14 +- .../admin/resolve-abuse-user-report.ts | 2 +- .../server/api/endpoints/admin/send-email.ts | 2 +- .../server/api/endpoints/admin/server-info.ts | 34 +-- .../endpoints/admin/show-moderation-logs.ts | 22 +- .../server/api/endpoints/admin/show-user.ts | 68 +++--- .../server/api/endpoints/admin/show-users.ts | 20 +- .../api/endpoints/admin/silence-user.ts | 4 +- .../api/endpoints/admin/suspend-user.ts | 10 +- .../api/endpoints/admin/unsilence-user.ts | 4 +- .../api/endpoints/admin/unsuspend-user.ts | 4 +- .../server/api/endpoints/admin/update-meta.ts | 32 +-- .../src/server/api/endpoints/admin/vacuum.ts | 2 +- .../src/server/api/endpoints/announcements.ts | 14 +- .../server/api/endpoints/antennas/create.ts | 30 +-- .../server/api/endpoints/antennas/delete.ts | 10 +- .../src/server/api/endpoints/antennas/list.ts | 6 +- .../server/api/endpoints/antennas/notes.ts | 14 +- .../src/server/api/endpoints/antennas/show.ts | 6 +- .../server/api/endpoints/antennas/update.ts | 34 +-- .../src/server/api/endpoints/ap/get.ts | 4 +- .../src/server/api/endpoints/ap/show.ts | 36 +-- .../src/server/api/endpoints/app/create.ts | 4 +- .../src/server/api/endpoints/app/show.ts | 10 +- .../src/server/api/endpoints/auth/accept.ts | 12 +- .../api/endpoints/auth/session/generate.ts | 16 +- .../server/api/endpoints/auth/session/show.ts | 20 +- .../api/endpoints/auth/session/userkey.ts | 24 +- .../server/api/endpoints/blocking/create.ts | 20 +- .../server/api/endpoints/blocking/delete.ts | 14 +- .../src/server/api/endpoints/blocking/list.ts | 4 +- .../server/api/endpoints/channels/create.ts | 12 +- .../server/api/endpoints/channels/featured.ts | 2 +- .../server/api/endpoints/channels/follow.ts | 4 +- .../server/api/endpoints/channels/followed.ts | 4 +- .../server/api/endpoints/channels/owned.ts | 4 +- .../src/server/api/endpoints/channels/show.ts | 4 +- .../server/api/endpoints/channels/timeline.ts | 8 +- .../server/api/endpoints/channels/unfollow.ts | 4 +- .../server/api/endpoints/channels/update.ts | 16 +- .../server/api/endpoints/charts/instance.ts | 2 +- .../server/api/endpoints/charts/user/drive.ts | 2 +- .../api/endpoints/charts/user/following.ts | 2 +- .../server/api/endpoints/charts/user/notes.ts | 2 +- .../api/endpoints/charts/user/reactions.ts | 2 +- .../server/api/endpoints/clips/add-note.ts | 14 +- .../src/server/api/endpoints/clips/create.ts | 12 +- .../src/server/api/endpoints/clips/delete.ts | 10 +- .../src/server/api/endpoints/clips/list.ts | 6 +- .../src/server/api/endpoints/clips/notes.ts | 12 +- .../src/server/api/endpoints/clips/show.ts | 6 +- .../src/server/api/endpoints/clips/update.ts | 14 +- .../backend/src/server/api/endpoints/drive.ts | 8 +- .../src/server/api/endpoints/drive/files.ts | 8 +- .../endpoints/drive/files/attached-notes.ts | 10 +- .../endpoints/drive/files/check-existence.ts | 2 +- .../api/endpoints/drive/files/create.ts | 10 +- .../api/endpoints/drive/files/delete.ts | 8 +- .../api/endpoints/drive/files/find-by-hash.ts | 4 +- .../server/api/endpoints/drive/files/find.ts | 6 +- .../server/api/endpoints/drive/files/show.ts | 20 +- .../api/endpoints/drive/files/update.ts | 16 +- .../endpoints/drive/files/upload-from-url.ts | 8 +- .../src/server/api/endpoints/drive/folders.ts | 6 +- .../api/endpoints/drive/folders/create.ts | 12 +- .../api/endpoints/drive/folders/delete.ts | 12 +- .../api/endpoints/drive/folders/find.ts | 6 +- .../api/endpoints/drive/folders/show.ts | 10 +- .../api/endpoints/drive/folders/update.ts | 20 +- .../src/server/api/endpoints/drive/stream.ts | 8 +- .../api/endpoints/email-address/available.ts | 8 +- .../src/server/api/endpoints/endpoint.ts | 6 +- .../src/server/api/endpoints/endpoints.ts | 8 +- .../server/api/endpoints/federation/dns.ts | 4 +- .../api/endpoints/federation/followers.ts | 6 +- .../api/endpoints/federation/following.ts | 6 +- .../api/endpoints/federation/instances.ts | 12 +- .../api/endpoints/federation/show-instance.ts | 8 +- .../federation/update-remote-user.ts | 2 +- .../server/api/endpoints/federation/users.ts | 6 +- .../server/api/endpoints/following/create.ts | 20 +- .../server/api/endpoints/following/delete.ts | 16 +- .../api/endpoints/following/invalidate.ts | 16 +- .../endpoints/following/requests/accept.ts | 8 +- .../endpoints/following/requests/cancel.ts | 10 +- .../api/endpoints/following/requests/list.ts | 16 +- .../endpoints/following/requests/reject.ts | 6 +- .../server/api/endpoints/gallery/featured.ts | 2 +- .../server/api/endpoints/gallery/popular.ts | 2 +- .../src/server/api/endpoints/gallery/posts.ts | 4 +- .../api/endpoints/gallery/posts/create.ts | 8 +- .../api/endpoints/gallery/posts/delete.ts | 4 +- .../api/endpoints/gallery/posts/like.ts | 14 +- .../api/endpoints/gallery/posts/show.ts | 6 +- .../api/endpoints/gallery/posts/unlike.ts | 10 +- .../api/endpoints/gallery/posts/update.ts | 8 +- .../api/endpoints/games/reversi/games.ts | 56 ++--- .../api/endpoints/games/reversi/games/show.ts | 60 ++--- .../games/reversi/games/surrender.ts | 14 +- .../endpoints/games/reversi/invitations.ts | 22 +- .../api/endpoints/games/reversi/match.ts | 16 +- .../endpoints/games/reversi/match/cancel.ts | 4 +- .../api/endpoints/get-online-users-count.ts | 6 +- .../src/server/api/endpoints/hashtags/list.ts | 10 +- .../server/api/endpoints/hashtags/search.ts | 4 +- .../src/server/api/endpoints/hashtags/show.ts | 8 +- .../server/api/endpoints/hashtags/trend.ts | 14 +- .../server/api/endpoints/hashtags/users.ts | 12 +- .../backend/src/server/api/endpoints/i.ts | 2 +- .../src/server/api/endpoints/i/2fa/done.ts | 10 +- .../server/api/endpoints/i/2fa/key-done.ts | 28 +-- .../api/endpoints/i/2fa/password-less.ts | 8 +- .../api/endpoints/i/2fa/register-key.ts | 10 +- .../server/api/endpoints/i/2fa/register.ts | 14 +- .../server/api/endpoints/i/2fa/remove-key.ts | 10 +- .../server/api/endpoints/i/2fa/unregister.ts | 8 +- .../src/server/api/endpoints/i/apps.ts | 2 +- .../server/api/endpoints/i/authorized-apps.ts | 12 +- .../server/api/endpoints/i/change-password.ts | 10 +- .../server/api/endpoints/i/delete-account.ts | 6 +- .../src/server/api/endpoints/i/favorites.ts | 4 +- .../server/api/endpoints/i/gallery/likes.ts | 12 +- .../server/api/endpoints/i/gallery/posts.ts | 8 +- .../endpoints/i/get-word-muted-notes-count.ts | 12 +- .../server/api/endpoints/i/import-blocking.ts | 12 +- .../api/endpoints/i/import-following.ts | 12 +- .../server/api/endpoints/i/import-muting.ts | 12 +- .../api/endpoints/i/import-user-lists.ts | 12 +- .../server/api/endpoints/i/notifications.ts | 12 +- .../src/server/api/endpoints/i/page-likes.ts | 12 +- .../src/server/api/endpoints/i/pages.ts | 8 +- .../backend/src/server/api/endpoints/i/pin.ts | 14 +- .../i/read-all-messaging-messages.ts | 8 +- .../api/endpoints/i/read-all-unread-notes.ts | 4 +- .../api/endpoints/i/read-announcement.ts | 6 +- .../api/endpoints/i/regenerate-token.ts | 8 +- .../api/endpoints/i/registry/get-all.ts | 2 +- .../api/endpoints/i/registry/get-detail.ts | 4 +- .../server/api/endpoints/i/registry/get.ts | 4 +- .../endpoints/i/registry/keys-with-type.ts | 2 +- .../server/api/endpoints/i/registry/keys.ts | 2 +- .../server/api/endpoints/i/registry/remove.ts | 4 +- .../server/api/endpoints/i/registry/scopes.ts | 2 +- .../server/api/endpoints/i/registry/set.ts | 12 +- .../server/api/endpoints/i/revoke-token.ts | 6 +- .../server/api/endpoints/i/signin-history.ts | 6 +- .../src/server/api/endpoints/i/unpin.ts | 10 +- .../server/api/endpoints/i/update-email.ts | 18 +- .../src/server/api/endpoints/i/update.ts | 24 +- .../api/endpoints/i/user-group-invites.ts | 14 +- .../server/api/endpoints/messaging/history.ts | 8 +- .../api/endpoints/messaging/messages.ts | 22 +- .../endpoints/messaging/messages/create.ts | 24 +- .../endpoints/messaging/messages/delete.ts | 10 +- .../api/endpoints/messaging/messages/read.ts | 6 +- .../backend/src/server/api/endpoints/meta.ts | 212 +++++++++--------- .../server/api/endpoints/miauth/gen-token.ts | 14 +- .../src/server/api/endpoints/mute/create.ts | 12 +- .../src/server/api/endpoints/mute/delete.ts | 12 +- .../src/server/api/endpoints/mute/list.ts | 4 +- .../src/server/api/endpoints/my/apps.ts | 38 ++-- .../backend/src/server/api/endpoints/notes.ts | 4 +- .../server/api/endpoints/notes/children.ts | 4 +- .../src/server/api/endpoints/notes/clips.ts | 10 +- .../api/endpoints/notes/conversation.ts | 12 +- .../src/server/api/endpoints/notes/create.ts | 36 +-- .../src/server/api/endpoints/notes/delete.ts | 12 +- .../api/endpoints/notes/favorites/create.ts | 12 +- .../api/endpoints/notes/favorites/delete.ts | 10 +- .../server/api/endpoints/notes/featured.ts | 4 +- .../api/endpoints/notes/global-timeline.ts | 12 +- .../api/endpoints/notes/hybrid-timeline.ts | 6 +- .../api/endpoints/notes/local-timeline.ts | 8 +- .../server/api/endpoints/notes/mentions.ts | 6 +- .../endpoints/notes/polls/recommendation.ts | 16 +- .../server/api/endpoints/notes/polls/vote.ts | 26 +-- .../server/api/endpoints/notes/reactions.ts | 18 +- .../api/endpoints/notes/reactions/create.ts | 10 +- .../api/endpoints/notes/reactions/delete.ts | 8 +- .../src/server/api/endpoints/notes/renotes.ts | 12 +- .../src/server/api/endpoints/notes/replies.ts | 4 +- .../api/endpoints/notes/search-by-tag.ts | 4 +- .../src/server/api/endpoints/notes/search.ts | 48 ++-- .../src/server/api/endpoints/notes/show.ts | 10 +- .../src/server/api/endpoints/notes/state.ts | 18 +- .../endpoints/notes/thread-muting/create.ts | 8 +- .../endpoints/notes/thread-muting/delete.ts | 8 +- .../server/api/endpoints/notes/timeline.ts | 4 +- .../server/api/endpoints/notes/translate.ts | 10 +- .../server/api/endpoints/notes/unrenote.ts | 10 +- .../api/endpoints/notes/user-list-timeline.ts | 10 +- .../api/endpoints/notes/watching/create.ts | 8 +- .../api/endpoints/notes/watching/delete.ts | 8 +- .../api/endpoints/notifications/create.ts | 8 +- .../notifications/mark-all-as-read.ts | 4 +- .../api/endpoints/notifications/read.ts | 2 +- .../src/server/api/endpoints/page-push.ts | 18 +- .../src/server/api/endpoints/pages/create.ts | 26 +-- .../src/server/api/endpoints/pages/delete.ts | 6 +- .../server/api/endpoints/pages/featured.ts | 2 +- .../src/server/api/endpoints/pages/like.ts | 14 +- .../src/server/api/endpoints/pages/show.ts | 10 +- .../src/server/api/endpoints/pages/unlike.ts | 10 +- .../src/server/api/endpoints/pages/update.ts | 22 +- .../backend/src/server/api/endpoints/ping.ts | 4 +- .../src/server/api/endpoints/pinned-users.ts | 2 +- .../src/server/api/endpoints/promo/read.ts | 10 +- .../api/endpoints/request-reset-password.ts | 12 +- .../src/server/api/endpoints/reset-db.ts | 2 +- .../server/api/endpoints/reset-password.ts | 10 +- .../src/server/api/endpoints/room/show.ts | 60 ++--- .../src/server/api/endpoints/room/update.ts | 8 +- .../src/server/api/endpoints/server-info.ts | 4 +- .../backend/src/server/api/endpoints/stats.ts | 14 +- .../src/server/api/endpoints/sw/register.ts | 24 +- .../src/server/api/endpoints/sw/unregister.ts | 4 +- .../api/endpoints/username/available.ts | 14 +- .../backend/src/server/api/endpoints/users.ts | 14 +- .../src/server/api/endpoints/users/clips.ts | 4 +- .../server/api/endpoints/users/followers.ts | 14 +- .../server/api/endpoints/users/following.ts | 14 +- .../api/endpoints/users/gallery/posts.ts | 4 +- .../users/get-frequently-replied-users.ts | 20 +- .../api/endpoints/users/groups/create.ts | 6 +- .../api/endpoints/users/groups/delete.ts | 10 +- .../users/groups/invitations/accept.ts | 6 +- .../users/groups/invitations/reject.ts | 4 +- .../api/endpoints/users/groups/invite.ts | 20 +- .../api/endpoints/users/groups/joined.ts | 6 +- .../api/endpoints/users/groups/leave.ts | 6 +- .../api/endpoints/users/groups/owned.ts | 2 +- .../server/api/endpoints/users/groups/pull.ts | 8 +- .../server/api/endpoints/users/groups/show.ts | 6 +- .../api/endpoints/users/groups/transfer.ts | 12 +- .../api/endpoints/users/groups/update.ts | 10 +- .../api/endpoints/users/lists/create.ts | 4 +- .../api/endpoints/users/lists/delete.ts | 10 +- .../server/api/endpoints/users/lists/list.ts | 2 +- .../server/api/endpoints/users/lists/pull.ts | 8 +- .../server/api/endpoints/users/lists/push.ts | 12 +- .../server/api/endpoints/users/lists/show.ts | 4 +- .../api/endpoints/users/lists/update.ts | 10 +- .../src/server/api/endpoints/users/notes.ts | 8 +- .../src/server/api/endpoints/users/pages.ts | 4 +- .../server/api/endpoints/users/reactions.ts | 6 +- .../api/endpoints/users/recommendation.ts | 8 +- .../server/api/endpoints/users/relation.ts | 50 ++--- .../users/search-by-username-and-host.ts | 2 +- .../src/server/api/endpoints/users/search.ts | 2 +- .../src/server/api/endpoints/users/show.ts | 20 +- .../src/server/api/endpoints/users/stats.ts | 4 +- packages/backend/src/server/api/error.ts | 2 +- packages/backend/src/server/api/index.ts | 14 +- packages/backend/src/server/api/limiter.ts | 4 +- .../backend/src/server/api/openapi/errors.ts | 38 ++-- .../src/server/api/openapi/gen-spec.ts | 104 ++++----- .../backend/src/server/api/openapi/schemas.ts | 6 +- .../backend/src/server/api/private/signin.ts | 42 ++-- .../backend/src/server/api/private/signup.ts | 6 +- .../backend/src/server/api/service/discord.ts | 32 +-- .../backend/src/server/api/service/github.ts | 20 +- .../backend/src/server/api/service/twitter.ts | 14 +- .../backend/src/server/api/stream/channel.ts | 2 +- .../src/server/api/stream/channels/channel.ts | 4 +- .../api/stream/channels/games/reversi-game.ts | 44 ++-- .../api/stream/channels/games/reversi.ts | 2 +- .../api/stream/channels/global-timeline.ts | 4 +- .../src/server/api/stream/channels/hashtag.ts | 2 +- .../api/stream/channels/home-timeline.ts | 6 +- .../api/stream/channels/hybrid-timeline.ts | 6 +- .../src/server/api/stream/channels/index.ts | 2 +- .../api/stream/channels/local-timeline.ts | 4 +- .../src/server/api/stream/channels/main.ts | 4 +- .../server/api/stream/channels/messaging.ts | 2 +- .../server/api/stream/channels/queue-stats.ts | 2 +- .../api/stream/channels/server-stats.ts | 2 +- .../server/api/stream/channels/user-list.ts | 10 +- .../backend/src/server/api/stream/index.ts | 26 +-- packages/backend/src/server/api/streaming.ts | 2 +- .../src/server/file/send-drive-file.ts | 2 +- packages/backend/src/server/index.ts | 10 +- packages/backend/src/server/nodeinfo.ts | 10 +- packages/backend/src/server/web/feed.ts | 12 +- packages/backend/src/server/web/index.ts | 38 ++-- .../backend/src/server/web/url-preview.ts | 6 +- packages/backend/src/server/well-known.ts | 12 +- .../src/services/add-note-to-antenna.ts | 6 +- .../backend/src/services/blocking/create.ts | 12 +- .../backend/src/services/blocking/delete.ts | 2 +- .../chart/charts/classes/active-users.ts | 4 +- .../services/chart/charts/classes/drive.ts | 8 +- .../chart/charts/classes/federation.ts | 8 +- .../services/chart/charts/classes/hashtag.ts | 4 +- .../services/chart/charts/classes/instance.ts | 24 +- .../services/chart/charts/classes/network.ts | 2 +- .../services/chart/charts/classes/notes.ts | 10 +- .../chart/charts/classes/per-user-drive.ts | 2 +- .../charts/classes/per-user-following.ts | 20 +- .../chart/charts/classes/per-user-notes.ts | 2 +- .../charts/classes/per-user-reactions.ts | 2 +- .../chart/charts/classes/test-grouped.ts | 2 +- .../chart/charts/classes/test-unique.ts | 2 +- .../src/services/chart/charts/classes/test.ts | 4 +- .../services/chart/charts/classes/users.ts | 8 +- .../chart/charts/schemas/active-users.ts | 8 +- .../services/chart/charts/schemas/drive.ts | 6 +- .../chart/charts/schemas/federation.ts | 6 +- .../services/chart/charts/schemas/hashtag.ts | 8 +- .../services/chart/charts/schemas/instance.ts | 16 +- .../services/chart/charts/schemas/network.ts | 2 +- .../services/chart/charts/schemas/notes.ts | 8 +- .../chart/charts/schemas/per-user-drive.ts | 2 +- .../charts/schemas/per-user-following.ts | 10 +- .../chart/charts/schemas/per-user-notes.ts | 4 +- .../charts/schemas/per-user-reactions.ts | 6 +- .../chart/charts/schemas/test-grouped.ts | 6 +- .../chart/charts/schemas/test-unique.ts | 4 +- .../src/services/chart/charts/schemas/test.ts | 6 +- .../services/chart/charts/schemas/users.ts | 6 +- packages/backend/src/services/chart/core.ts | 32 +-- .../backend/src/services/chart/entities.ts | 2 +- .../src/services/create-notification.ts | 4 +- .../src/services/create-system-user.ts | 4 +- .../backend/src/services/drive/add-file.ts | 18 +- .../backend/src/services/drive/delete-file.ts | 2 +- .../drive/generate-video-thumbnail.ts | 4 +- .../src/services/drive/image-processor.ts | 16 +- packages/backend/src/services/drive/s3.ts | 4 +- .../src/services/drive/upload-from-url.ts | 2 +- .../backend/src/services/following/create.ts | 16 +- .../backend/src/services/following/delete.ts | 4 +- .../backend/src/services/following/reject.ts | 8 +- .../services/following/requests/accept-all.ts | 2 +- .../src/services/following/requests/accept.ts | 4 +- .../src/services/following/requests/cancel.ts | 6 +- .../src/services/following/requests/create.ts | 8 +- packages/backend/src/services/i/pin.ts | 8 +- .../src/services/insert-moderation-log.ts | 2 +- .../backend/src/services/instance-actor.ts | 2 +- packages/backend/src/services/logger.ts | 2 +- .../backend/src/services/messages/create.ts | 4 +- packages/backend/src/services/note/create.ts | 26 +-- packages/backend/src/services/note/delete.ts | 10 +- .../backend/src/services/note/polls/vote.ts | 10 +- .../src/services/note/reaction/create.ts | 18 +- .../src/services/note/reaction/delete.ts | 2 +- packages/backend/src/services/note/read.ts | 20 +- packages/backend/src/services/note/unread.ts | 2 +- packages/backend/src/services/note/unwatch.ts | 2 +- packages/backend/src/services/note/watch.ts | 2 +- .../backend/src/services/push-notification.ts | 12 +- packages/backend/src/services/relay.ts | 12 +- packages/backend/src/services/stream.ts | 6 +- packages/backend/src/services/suspend-user.ts | 4 +- .../backend/src/services/unsuspend-user.ts | 4 +- .../backend/src/services/user-list/push.ts | 2 +- packages/backend/src/tools/add-emoji.ts | 2 +- packages/backend/src/tools/demote-admin.ts | 4 +- packages/backend/src/tools/mark-admin.ts | 4 +- .../backend/src/tools/show-signin-history.ts | 2 +- 573 files changed, 3318 insertions(+), 3318 deletions(-) diff --git a/packages/backend/src/daemons/janitor.ts b/packages/backend/src/daemons/janitor.ts index 72568cfe18..115c1fe380 100644 --- a/packages/backend/src/daemons/janitor.ts +++ b/packages/backend/src/daemons/janitor.ts @@ -10,7 +10,7 @@ import { LessThan } from 'typeorm'; export default function() { async function tick() { await AttestationChallenges.delete({ - createdAt: LessThan(new Date(new Date().getTime() - 5 * 60 * 1000)) + createdAt: LessThan(new Date(new Date().getTime() - 5 * 60 * 1000)), }); } diff --git a/packages/backend/src/daemons/queue-stats.ts b/packages/backend/src/daemons/queue-stats.ts index 77f09b18d6..5faa16ee44 100644 --- a/packages/backend/src/daemons/queue-stats.ts +++ b/packages/backend/src/daemons/queue-stats.ts @@ -35,13 +35,13 @@ export default function() { activeSincePrevTick: activeDeliverJobs, active: deliverJobCounts.active, waiting: deliverJobCounts.waiting, - delayed: deliverJobCounts.delayed + delayed: deliverJobCounts.delayed, }, inbox: { activeSincePrevTick: activeInboxJobs, active: inboxJobCounts.active, waiting: inboxJobCounts.waiting, - delayed: inboxJobCounts.delayed + delayed: inboxJobCounts.delayed, }, }; diff --git a/packages/backend/src/daemons/server-stats.ts b/packages/backend/src/daemons/server-stats.ts index 8dfa946250..47c46042eb 100644 --- a/packages/backend/src/daemons/server-stats.ts +++ b/packages/backend/src/daemons/server-stats.ts @@ -38,7 +38,7 @@ export default function() { fs: { r: round(Math.max(0, fsStats.rIO_sec)), w: round(Math.max(0, fsStats.wIO_sec)), - } + }, }; ev.emit('serverStats', stats); log.unshift(stats); diff --git a/packages/backend/src/db/elasticsearch.ts b/packages/backend/src/db/elasticsearch.ts index c99183007a..60a4061d44 100644 --- a/packages/backend/src/db/elasticsearch.ts +++ b/packages/backend/src/db/elasticsearch.ts @@ -6,10 +6,10 @@ const index = { analysis: { analyzer: { ngram: { - tokenizer: 'ngram' - } - } - } + tokenizer: 'ngram', + }, + }, + }, }, mappings: { properties: { @@ -25,9 +25,9 @@ const index = { userHost: { type: 'keyword', index: true, - } - } - } + }, + }, + }, }; // Init ElasticSearch connection @@ -35,9 +35,9 @@ const client = config.elasticsearch ? new elasticsearch.Client({ node: `${config.elasticsearch.ssl ? 'https://' : 'http://'}${config.elasticsearch.host}:${config.elasticsearch.port}`, auth: (config.elasticsearch.user && config.elasticsearch.pass) ? { username: config.elasticsearch.user, - password: config.elasticsearch.pass + password: config.elasticsearch.pass, } : undefined, - pingTimeout: 30000 + pingTimeout: 30000, }) : null; if (client) { @@ -47,7 +47,7 @@ if (client) { if (!exist.body) { client.indices.create({ index: config.elasticsearch.index || 'misskey_note', - body: index + body: index, }); } }); diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index efbacf3d10..4daf6b4434 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -175,7 +175,7 @@ export const entities = [ Ad, PasswordResetRequest, UserPending, - ...charts as any + ...charts as any, ]; export function initDb(justBorrow = false, sync = false, forceRecreate = false) { @@ -205,12 +205,12 @@ export function initDb(justBorrow = false, sync = false, forceRecreate = false) port: config.redis.port, password: config.redis.pass, prefix: `${config.redis.prefix}:query:`, - db: config.redis.db || 0 - } + db: config.redis.db || 0, + }, } : false, logging: log, logger: log ? new MyCustomLogger() : undefined, - entities: entities + entities: entities, }); } diff --git a/packages/backend/src/db/redis.ts b/packages/backend/src/db/redis.ts index 7e0ee1e3ce..9fc2b62412 100644 --- a/packages/backend/src/db/redis.ts +++ b/packages/backend/src/db/redis.ts @@ -8,7 +8,7 @@ export function createConnection() { { password: config.redis.pass, prefix: config.redis.prefix, - db: config.redis.db || 0 + db: config.redis.db || 0, } ); } diff --git a/packages/backend/src/games/reversi/core.ts b/packages/backend/src/games/reversi/core.ts index fc7f006cea..0cf7714543 100644 --- a/packages/backend/src/games/reversi/core.ts +++ b/packages/backend/src/games/reversi/core.ts @@ -134,7 +134,7 @@ export default class Reversi { color, pos, effects, - turn + turn, }); this.calcTurn(); @@ -211,7 +211,7 @@ export default class Reversi { [ 0, +1], // 下 [ -1, +1], // 左下 [ -1, 0], // 左 - [ -1, -1] // 左上 + [ -1, -1], // 左上 ]; const effectsInLine = ([dx, dy]: [number, number]): number[] => { diff --git a/packages/backend/src/games/reversi/maps.ts b/packages/backend/src/games/reversi/maps.ts index dc0d1bf9d0..8442c6d741 100644 --- a/packages/backend/src/games/reversi/maps.ts +++ b/packages/backend/src/games/reversi/maps.ts @@ -22,8 +22,8 @@ export const fourfour: Map = { '----', '-wb-', '-bw-', - '----' - ] + '----', + ], }; export const sixsix: Map = { @@ -35,8 +35,8 @@ export const sixsix: Map = { '--wb--', '--bw--', '------', - '------' - ] + '------', + ], }; export const roundedSixsix: Map = { @@ -49,8 +49,8 @@ export const roundedSixsix: Map = { '--wb--', '--bw--', '------', - ' ---- ' - ] + ' ---- ', + ], }; export const roundedSixsix2: Map = { @@ -63,8 +63,8 @@ export const roundedSixsix2: Map = { '--wb--', '--bw--', ' ---- ', - ' -- ' - ] + ' -- ', + ], }; export const eighteight: Map = { @@ -78,8 +78,8 @@ export const eighteight: Map = { '---bw---', '--------', '--------', - '--------' - ] + '--------', + ], }; export const eighteightH1: Map = { @@ -93,8 +93,8 @@ export const eighteightH1: Map = { '---bw---', '--------', '--------', - '--------' - ] + '--------', + ], }; export const eighteightH2: Map = { @@ -108,8 +108,8 @@ export const eighteightH2: Map = { '---bw---', '--------', '--------', - '-------b' - ] + '-------b', + ], }; export const eighteightH3: Map = { @@ -123,8 +123,8 @@ export const eighteightH3: Map = { '---bw---', '--------', '--------', - '-------b' - ] + '-------b', + ], }; export const eighteightH4: Map = { @@ -138,8 +138,8 @@ export const eighteightH4: Map = { '---bw---', '--------', '--------', - 'b------b' - ] + 'b------b', + ], }; export const eighteightH28: Map = { @@ -153,8 +153,8 @@ export const eighteightH28: Map = { 'b--bw--b', 'b------b', 'b------b', - 'bbbbbbbb' - ] + 'bbbbbbbb', + ], }; export const roundedEighteight: Map = { @@ -169,8 +169,8 @@ export const roundedEighteight: Map = { '---bw---', '--------', '--------', - ' ------ ' - ] + ' ------ ', + ], }; export const roundedEighteight2: Map = { @@ -185,8 +185,8 @@ export const roundedEighteight2: Map = { '---bw---', '--------', ' ------ ', - ' ---- ' - ] + ' ---- ', + ], }; export const roundedEighteight3: Map = { @@ -201,8 +201,8 @@ export const roundedEighteight3: Map = { '---bw---', ' ------ ', ' ---- ', - ' -- ' - ] + ' -- ', + ], }; export const eighteightWithNotch: Map = { @@ -217,8 +217,8 @@ export const eighteightWithNotch: Map = { ' --bw-- ', '--------', '--------', - '--- ---' - ] + '--- ---', + ], }; export const eighteightWithSomeHoles: Map = { @@ -233,8 +233,8 @@ export const eighteightWithSomeHoles: Map = { '---bw- -', ' -------', '--- ----', - '--------' - ] + '--------', + ], }; export const circle: Map = { @@ -249,8 +249,8 @@ export const circle: Map = { '---bw---', ' ------ ', ' ------ ', - ' -- ' - ] + ' -- ', + ], }; export const smile: Map = { @@ -265,8 +265,8 @@ export const smile: Map = { '-- bw --', '--- ---', '--------', - ' ------ ' - ] + ' ------ ', + ], }; export const window: Map = { @@ -281,8 +281,8 @@ export const window: Map = { '---bw---', '- -- -', '- -- -', - '--------' - ] + '--------', + ], }; export const reserved: Map = { @@ -297,8 +297,8 @@ export const reserved: Map = { '---bw---', '--------', '--------', - 'b------w' - ] + 'b------w', + ], }; export const x: Map = { @@ -313,8 +313,8 @@ export const x: Map = { '---bw---', '--b--w--', '-b----w-', - 'b------w' - ] + 'b------w', + ], }; export const parallel: Map = { @@ -329,8 +329,8 @@ export const parallel: Map = { '---ww---', '--------', '--------', - '--------' - ] + '--------', + ], }; export const lackOfBlack: Map = { @@ -344,8 +344,8 @@ export const lackOfBlack: Map = { '---bw---', '--------', '--------', - '--------' - ] + '--------', + ], }; export const squareParty: Map = { @@ -360,8 +360,8 @@ export const squareParty: Map = { '-bbbwww-', '-b-bw-w-', '-bbbwww-', - '--------' - ] + '--------', + ], }; export const minesweeper: Map = { @@ -376,8 +376,8 @@ export const minesweeper: Map = { '-w-bw-b-', 'b-w--b-w', '-b-bw-w-', - 'w-w--b-b' - ] + 'w-w--b-b', + ], }; export const tenthtenth: Map = { @@ -393,8 +393,8 @@ export const tenthtenth: Map = { '----------', '----------', '----------', - '----------' - ] + '----------', + ], }; export const hole: Map = { @@ -411,8 +411,8 @@ export const hole: Map = { '--wb--wb--', '--bw--bw--', '----------', - '----------' - ] + '----------', + ], }; export const grid: Map = { @@ -429,8 +429,8 @@ export const grid: Map = { '- - -- - -', '----------', '- - -- - -', - '----------' - ] + '----------', + ], }; export const cross: Map = { @@ -447,8 +447,8 @@ export const cross: Map = { '----------', ' ---- ', ' ---- ', - ' ---- ' - ] + ' ---- ', + ], }; export const charX: Map = { @@ -465,8 +465,8 @@ export const charX: Map = { ' -------- ', '----------', '---- ----', - '--- ---' - ] + '--- ---', + ], }; export const charY: Map = { @@ -483,8 +483,8 @@ export const charY: Map = { ' ------ ', ' ------ ', ' ------ ', - ' ------ ' - ] + ' ------ ', + ], }; export const walls: Map = { @@ -501,8 +501,8 @@ export const walls: Map = { 'w--------w', 'w--------w', 'w--------w', - ' bbbbbbbb ' - ] + ' bbbbbbbb ', + ], }; export const cpu: Map = { @@ -519,8 +519,8 @@ export const cpu: Map = { 'w--------w', ' -------- ', 'w--------w', - ' b b b b ' - ] + ' b b b b ', + ], }; export const checker: Map = { @@ -537,8 +537,8 @@ export const checker: Map = { '---bwbw---', '----------', '----------', - '----------' - ] + '----------', + ], }; export const japaneseCurry: Map = { @@ -555,8 +555,8 @@ export const japaneseCurry: Map = { 'w-w-w-b-b-', '-w-w-w-b-b', 'w-w-w-w-b-', - '-w-w-w-w-b' - ] + '-w-w-w-w-b', + ], }; export const mosaic: Map = { @@ -574,7 +574,7 @@ export const mosaic: Map = { ' - - - - -', '- - - - - ', ' - - - - -', - ] + ], }; export const arena: Map = { @@ -591,8 +591,8 @@ export const arena: Map = { ' -------- ', '- ------ -', ' - - - - ', - '- - -- - -' - ] + '- - -- - -', + ], }; export const reactor: Map = { @@ -609,8 +609,8 @@ export const reactor: Map = { '---w b---', '- --bw-- -', 'w- - - -b', - '-b------w-' - ] + '-b------w-', + ], }; export const sixeight: Map = { @@ -624,8 +624,8 @@ export const sixeight: Map = { '--bw--', '------', '------', - '------' - ] + '------', + ], }; export const spark: Map = { @@ -642,8 +642,8 @@ export const spark: Map = { ' -------- ', ' -------- ', '----------', - ' - - ' - ] + ' - - ', + ], }; export const islands: Map = { @@ -660,8 +660,8 @@ export const islands: Map = { ' --------', ' --------', ' --------', - ' --------' - ] + ' --------', + ], }; export const galaxy: Map = { @@ -680,8 +680,8 @@ export const galaxy: Map = { '---w--bbb---', ' ---w------ ', ' ---www-- ', - ' ------ ' - ] + ' ------ ', + ], }; export const triangle: Map = { @@ -698,8 +698,8 @@ export const triangle: Map = { ' -------- ', ' -------- ', '----------', - '----------' - ] + '----------', + ], }; export const iphonex: Map = { @@ -718,8 +718,8 @@ export const iphonex: Map = { '--------', '--------', '--------', - ' ------ ' - ] + ' ------ ', + ], }; export const dealWithIt: Map = { @@ -731,8 +731,8 @@ export const dealWithIt: Map = { '--w-b-------', ' --b-w------', ' --w-b---- ', - ' ------- ' - ] + ' ------- ', + ], }; export const experiment: Map = { @@ -750,8 +750,8 @@ export const experiment: Map = { 'bbbbbb wwwwww', 'bbbbbb wwwwww', 'bbbbbb wwwwww', - 'wwwwww bbbbbb' - ] + 'wwwwww bbbbbb', + ], }; export const bigBoard: Map = { @@ -773,8 +773,8 @@ export const bigBoard: Map = { '----------------', '----------------', '----------------', - '----------------' - ] + '----------------', + ], }; export const twoBoard: Map = { @@ -789,8 +789,8 @@ export const twoBoard: Map = { '---bw--- ---bw---', '-------- --------', '-------- --------', - '-------- --------' - ] + '-------- --------', + ], }; export const test1: Map = { @@ -800,8 +800,8 @@ export const test1: Map = { '--------', '---wb---', '---bw---', - '--------' - ] + '--------', + ], }; export const test2: Map = { @@ -812,8 +812,8 @@ export const test2: Map = { '------', '-b--w-', '-w--b-', - '-w--b-' - ] + '-w--b-', + ], }; export const test3: Map = { @@ -832,7 +832,7 @@ export const test3: Map = { '-w-', '---', 'b--', - ] + ], }; export const test4: Map = { @@ -843,8 +843,8 @@ export const test4: Map = { '-w--b-', '------', '-w--b-', - '-w--b-' - ] + '-w--b-', + ], }; // 検証用: この盤面で藍(lv3)が黒で始めると何故か(?)A1に打ってしまう @@ -860,7 +860,7 @@ export const test6: Map = { 'wwbwbbbb', '--wbbbbb', '-wwwww--', - ] + ], }; // 検証用: この盤面で藍(lv3)が黒で始めると何故か(?)G7に打ってしまう @@ -876,7 +876,7 @@ export const test7: Map = { '-wwbbwwb', '--wwww--', '--wwww--', - ] + ], }; // 検証用: この盤面で藍(lv5)が黒で始めると何故か(?)A1に打ってしまう @@ -892,5 +892,5 @@ export const test8: Map = { 'wwwwww--', '--www---', '--ww----', - ] + ], }; diff --git a/packages/backend/src/mfm/to-html.ts b/packages/backend/src/mfm/to-html.ts index 343c76fb3e..b16c6b95e5 100644 --- a/packages/backend/src/mfm/to-html.ts +++ b/packages/backend/src/mfm/to-html.ts @@ -144,7 +144,7 @@ export function toHtml(nodes: mfm.MfmNode[] | null, mentionedRemoteUsers: IMenti a.href = `https://www.google.com/search?q=${node.props.query}`; a.textContent = node.props.content; return a; - } + }, }; appendChildren(nodes, doc.body); diff --git a/packages/backend/src/misc/cache.ts b/packages/backend/src/misc/cache.ts index 71fbbd8a4c..76835b44b1 100644 --- a/packages/backend/src/misc/cache.ts +++ b/packages/backend/src/misc/cache.ts @@ -10,7 +10,7 @@ export class Cache { public set(key: string | null, value: T): void { this.cache.set(key, { date: Date.now(), - value + value, }); } diff --git a/packages/backend/src/misc/captcha.ts b/packages/backend/src/misc/captcha.ts index f36943b589..41a986d785 100644 --- a/packages/backend/src/misc/captcha.ts +++ b/packages/backend/src/misc/captcha.ts @@ -33,17 +33,17 @@ type CaptchaResponse = { async function getCaptchaResponse(url: string, secret: string, response: string): Promise { const params = new URLSearchParams({ secret, - response + response, }); const res = await fetch(url, { method: 'POST', body: params, headers: { - 'User-Agent': config.userAgent + 'User-Agent': config.userAgent, }, timeout: 10 * 1000, - agent: getAgentByUrl + agent: getAgentByUrl, }).catch(e => { throw `${e.message || e}`; }); diff --git a/packages/backend/src/misc/check-hit-antenna.ts b/packages/backend/src/misc/check-hit-antenna.ts index e70b7429c7..3c39a337fd 100644 --- a/packages/backend/src/misc/check-hit-antenna.ts +++ b/packages/backend/src/misc/check-hit-antenna.ts @@ -24,7 +24,7 @@ export async function checkHitAntenna(antenna: Antenna, note: (Note | Packed<'No if (antennaUserFollowing && !antennaUserFollowing.includes(note.userId)) return false; } else if (antenna.src === 'list') { const listUsers = (await UserListJoinings.find({ - userListId: antenna.userListId! + userListId: antenna.userListId!, })).map(x => x.userId); if (!listUsers.includes(note.userId)) return false; @@ -32,7 +32,7 @@ export async function checkHitAntenna(antenna: Antenna, note: (Note | Packed<'No const joining = await UserGroupJoinings.findOneOrFail(antenna.userGroupJoiningId!); const groupUsers = (await UserGroupJoinings.find({ - userGroupId: joining.userGroupId + userGroupId: joining.userGroupId, })).map(x => x.userId); if (!groupUsers.includes(note.userId)) return false; diff --git a/packages/backend/src/misc/download-url.ts b/packages/backend/src/misc/download-url.ts index c96b4fd1d6..3dc640dc0d 100644 --- a/packages/backend/src/misc/download-url.ts +++ b/packages/backend/src/misc/download-url.ts @@ -22,7 +22,7 @@ export async function downloadUrl(url: string, path: string) { const req = got.stream(url, { headers: { - 'User-Agent': config.userAgent + 'User-Agent': config.userAgent, }, timeout: { lookup: timeout, diff --git a/packages/backend/src/misc/fetch-meta.ts b/packages/backend/src/misc/fetch-meta.ts index a0bcdd4d48..b7b055d180 100644 --- a/packages/backend/src/misc/fetch-meta.ts +++ b/packages/backend/src/misc/fetch-meta.ts @@ -10,8 +10,8 @@ export async function fetchMeta(noCache = false): Promise { // 過去のバグでレコードが複数出来てしまっている可能性があるので新しいIDを優先する const meta = await transactionalEntityManager.findOne(Meta, { order: { - id: 'DESC' - } + id: 'DESC', + }, }); if (meta) { @@ -19,7 +19,7 @@ export async function fetchMeta(noCache = false): Promise { return meta; } else { const saved = await transactionalEntityManager.save(Meta, { - id: 'x' + id: 'x', }) as Meta; cache = saved; diff --git a/packages/backend/src/misc/fetch.ts b/packages/backend/src/misc/fetch.ts index f4f16a27e2..baebab1922 100644 --- a/packages/backend/src/misc/fetch.ts +++ b/packages/backend/src/misc/fetch.ts @@ -12,9 +12,9 @@ export async function getJson(url: string, accept = 'application/json, */*', tim method: 'GET', headers: Object.assign({ 'User-Agent': config.userAgent, - Accept: accept + Accept: accept, }, headers || {}), - timeout + timeout, }); return await res.json(); @@ -26,9 +26,9 @@ export async function getHtml(url: string, accept = 'text/html, */*', timeout = method: 'GET', headers: Object.assign({ 'User-Agent': config.userAgent, - Accept: accept + Accept: accept, }, headers || {}), - timeout + timeout, }); return await res.text(); @@ -95,7 +95,7 @@ export const httpAgent = config.proxy maxSockets, maxFreeSockets: 256, scheduling: 'lifo', - proxy: config.proxy + proxy: config.proxy, }) : _http; @@ -109,7 +109,7 @@ export const httpsAgent = config.proxy maxSockets, maxFreeSockets: 256, scheduling: 'lifo', - proxy: config.proxy + proxy: config.proxy, }) : _https; diff --git a/packages/backend/src/misc/gen-key-pair.ts b/packages/backend/src/misc/gen-key-pair.ts index d4a8fa7534..9db6b2a3ea 100644 --- a/packages/backend/src/misc/gen-key-pair.ts +++ b/packages/backend/src/misc/gen-key-pair.ts @@ -8,14 +8,14 @@ export async function genRsaKeyPair(modulusLength = 2048) { modulusLength, publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', cipher: undefined, - passphrase: undefined - } + passphrase: undefined, + }, }); } @@ -24,13 +24,13 @@ export async function genEcKeyPair(namedCurve: 'prime256v1' | 'secp384r1' | 'sec namedCurve, publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', cipher: undefined, - passphrase: undefined - } + passphrase: undefined, + }, }); } diff --git a/packages/backend/src/misc/get-file-info.ts b/packages/backend/src/misc/get-file-info.ts index 8d7f6b1bf9..f36aa8f966 100644 --- a/packages/backend/src/misc/get-file-info.ts +++ b/packages/backend/src/misc/get-file-info.ts @@ -26,12 +26,12 @@ export type FileInfo = { const TYPE_OCTET_STREAM = { mime: 'application/octet-stream', - ext: null + ext: null, }; const TYPE_SVG = { mime: 'image/svg+xml', - ext: 'svg' + ext: 'svg', }; /** @@ -116,7 +116,7 @@ export async function detectType(path: string) { return { mime: type.mime, - ext: type.ext + ext: type.ext, }; } diff --git a/packages/backend/src/misc/reaction-lib.ts b/packages/backend/src/misc/reaction-lib.ts index e24f4a4fcd..04b1e34ebe 100644 --- a/packages/backend/src/misc/reaction-lib.ts +++ b/packages/backend/src/misc/reaction-lib.ts @@ -112,14 +112,14 @@ export function decodeReaction(str: string): DecodedReaction { return { reaction: `:${name}@${host || '.'}:`, // ローカル分は@以降を省略するのではなく.にする name, - host + host, }; } return { reaction: str, name: undefined, - host: undefined + host: undefined, }; } diff --git a/packages/backend/src/models/entities/abuse-user-report.ts b/packages/backend/src/models/entities/abuse-user-report.ts index c0cff139f6..019d613f76 100644 --- a/packages/backend/src/models/entities/abuse-user-report.ts +++ b/packages/backend/src/models/entities/abuse-user-report.ts @@ -9,7 +9,7 @@ export class AbuseUserReport { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the AbuseUserReport.' + comment: 'The created date of the AbuseUserReport.', }) public createdAt: Date; @@ -18,7 +18,7 @@ export class AbuseUserReport { public targetUserId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public targetUser: User | null; @@ -28,26 +28,26 @@ export class AbuseUserReport { public reporterId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public reporter: User | null; @Column({ ...id(), - nullable: true + nullable: true, }) public assigneeId: User['id'] | null; @ManyToOne(type => User, { - onDelete: 'SET NULL' + onDelete: 'SET NULL', }) @JoinColumn() public assignee: User | null; @Index() @Column('boolean', { - default: false + default: false, }) public resolved: boolean; @@ -60,14 +60,14 @@ export class AbuseUserReport { @Index() @Column('varchar', { length: 128, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public targetUserHost: string | null; @Index() @Column('varchar', { length: 128, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public reporterHost: string | null; //#endregion diff --git a/packages/backend/src/models/entities/access-token.ts b/packages/backend/src/models/entities/access-token.ts index 5f41b3c1fc..33b60e44f3 100644 --- a/packages/backend/src/models/entities/access-token.ts +++ b/packages/backend/src/models/entities/access-token.ts @@ -9,7 +9,7 @@ export class AccessToken { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the AccessToken.' + comment: 'The created date of the AccessToken.', }) public createdAt: Date; @@ -21,7 +21,7 @@ export class AccessToken { @Index() @Column('varchar', { - length: 128 + length: 128, }) public token: string; @@ -29,13 +29,13 @@ export class AccessToken { @Column('varchar', { length: 128, nullable: true, - default: null + default: null, }) public session: string | null; @Index() @Column('varchar', { - length: 128 + length: 128, }) public hash: string; @@ -44,7 +44,7 @@ export class AccessToken { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -52,12 +52,12 @@ export class AccessToken { @Column({ ...id(), nullable: true, - default: null + default: null, }) public appId: App['id'] | null; @ManyToOne(type => App, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public app: App | null; @@ -65,32 +65,32 @@ export class AccessToken { @Column('varchar', { length: 128, nullable: true, - default: null + default: null, }) public name: string | null; @Column('varchar', { length: 512, nullable: true, - default: null + default: null, }) public description: string | null; @Column('varchar', { length: 512, nullable: true, - default: null + default: null, }) public iconUrl: string | null; @Column('varchar', { length: 64, array: true, - default: '{}' + default: '{}', }) public permission: string[]; @Column('boolean', { - default: false + default: false, }) public fetched: boolean; } diff --git a/packages/backend/src/models/entities/ad.ts b/packages/backend/src/models/entities/ad.ts index b2fc04c4f0..68be4ab1ca 100644 --- a/packages/backend/src/models/entities/ad.ts +++ b/packages/backend/src/models/entities/ad.ts @@ -8,44 +8,44 @@ export class Ad { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the Ad.' + comment: 'The created date of the Ad.', }) public createdAt: Date; @Index() @Column('timestamp with time zone', { - comment: 'The expired date of the Ad.' + comment: 'The expired date of the Ad.', }) public expiresAt: Date; @Column('varchar', { - length: 32, nullable: false + length: 32, nullable: false, }) public place: string; // 今は使われていないが将来的に活用される可能性はある @Column('varchar', { - length: 32, nullable: false + length: 32, nullable: false, }) public priority: string; @Column('integer', { - default: 1, nullable: false + default: 1, nullable: false, }) public ratio: number; @Column('varchar', { - length: 1024, nullable: false + length: 1024, nullable: false, }) public url: string; @Column('varchar', { - length: 1024, nullable: false + length: 1024, nullable: false, }) public imageUrl: string; @Column('varchar', { - length: 8192, nullable: false + length: 8192, nullable: false, }) public memo: string; diff --git a/packages/backend/src/models/entities/announcement-read.ts b/packages/backend/src/models/entities/announcement-read.ts index 892beb826f..88a1966e28 100644 --- a/packages/backend/src/models/entities/announcement-read.ts +++ b/packages/backend/src/models/entities/announcement-read.ts @@ -10,7 +10,7 @@ export class AnnouncementRead { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the AnnouncementRead.' + comment: 'The created date of the AnnouncementRead.', }) public createdAt: Date; @@ -19,7 +19,7 @@ export class AnnouncementRead { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -29,7 +29,7 @@ export class AnnouncementRead { public announcementId: Announcement['id']; @ManyToOne(type => Announcement, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public announcement: Announcement | null; diff --git a/packages/backend/src/models/entities/announcement.ts b/packages/backend/src/models/entities/announcement.ts index 06d379c229..3448bb6861 100644 --- a/packages/backend/src/models/entities/announcement.ts +++ b/packages/backend/src/models/entities/announcement.ts @@ -8,28 +8,28 @@ export class Announcement { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the Announcement.' + comment: 'The created date of the Announcement.', }) public createdAt: Date; @Column('timestamp with time zone', { comment: 'The updated date of the Announcement.', - nullable: true + nullable: true, }) public updatedAt: Date | null; @Column('varchar', { - length: 8192, nullable: false + length: 8192, nullable: false, }) public text: string; @Column('varchar', { - length: 256, nullable: false + length: 256, nullable: false, }) public title: string; @Column('varchar', { - length: 1024, nullable: true + length: 1024, nullable: true, }) public imageUrl: string | null; diff --git a/packages/backend/src/models/entities/antenna-note.ts b/packages/backend/src/models/entities/antenna-note.ts index 9b911524ef..a72da423de 100644 --- a/packages/backend/src/models/entities/antenna-note.ts +++ b/packages/backend/src/models/entities/antenna-note.ts @@ -12,12 +12,12 @@ export class AntennaNote { @Index() @Column({ ...id(), - comment: 'The note ID.' + comment: 'The note ID.', }) public noteId: Note['id']; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note: Note | null; @@ -25,19 +25,19 @@ export class AntennaNote { @Index() @Column({ ...id(), - comment: 'The antenna ID.' + comment: 'The antenna ID.', }) public antennaId: Antenna['id']; @ManyToOne(type => Antenna, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public antenna: Antenna | null; @Index() @Column('boolean', { - default: false + default: false, }) public read: boolean; } diff --git a/packages/backend/src/models/entities/antenna.ts b/packages/backend/src/models/entities/antenna.ts index bcfe09a829..ffe7cc7e3d 100644 --- a/packages/backend/src/models/entities/antenna.ts +++ b/packages/backend/src/models/entities/antenna.ts @@ -10,26 +10,26 @@ export class Antenna { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the Antenna.' + comment: 'The created date of the Antenna.', }) public createdAt: Date; @Index() @Column({ ...id(), - comment: 'The owner ID.' + comment: 'The owner ID.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @Column('varchar', { length: 128, - comment: 'The name of the Antenna.' + comment: 'The name of the Antenna.', }) public name: string; @@ -38,51 +38,51 @@ export class Antenna { @Column({ ...id(), - nullable: true + nullable: true, }) public userListId: UserList['id'] | null; @ManyToOne(type => UserList, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public userList: UserList | null; @Column({ ...id(), - nullable: true + nullable: true, }) public userGroupJoiningId: UserGroupJoining['id'] | null; @ManyToOne(type => UserGroupJoining, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public userGroupJoining: UserGroupJoining | null; @Column('varchar', { length: 1024, array: true, - default: '{}' + default: '{}', }) public users: string[]; @Column('jsonb', { - default: [] + default: [], }) public keywords: string[][]; @Column('jsonb', { - default: [] + default: [], }) public excludeKeywords: string[][]; @Column('boolean', { - default: false + default: false, }) public caseSensitive: boolean; @Column('boolean', { - default: false + default: false, }) public withReplies: boolean; diff --git a/packages/backend/src/models/entities/app.ts b/packages/backend/src/models/entities/app.ts index ea87546311..c1efdc0705 100644 --- a/packages/backend/src/models/entities/app.ts +++ b/packages/backend/src/models/entities/app.ts @@ -9,7 +9,7 @@ export class App { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the App.' + comment: 'The created date of the App.', }) public createdAt: Date; @@ -17,7 +17,7 @@ export class App { @Column({ ...id(), nullable: true, - comment: 'The owner ID.' + comment: 'The owner ID.', }) public userId: User['id'] | null; @@ -30,31 +30,31 @@ export class App { @Index() @Column('varchar', { length: 64, - comment: 'The secret key of the App.' + comment: 'The secret key of the App.', }) public secret: string; @Column('varchar', { length: 128, - comment: 'The name of the App.' + comment: 'The name of the App.', }) public name: string; @Column('varchar', { length: 512, - comment: 'The description of the App.' + comment: 'The description of the App.', }) public description: string; @Column('varchar', { length: 64, array: true, - comment: 'The permission of the App.' + comment: 'The permission of the App.', }) public permission: string[]; @Column('varchar', { length: 512, nullable: true, - comment: 'The callbackUrl of the App.' + comment: 'The callbackUrl of the App.', }) public callbackUrl: string | null; } diff --git a/packages/backend/src/models/entities/attestation-challenge.ts b/packages/backend/src/models/entities/attestation-challenge.ts index 942747c02f..cf3527059e 100644 --- a/packages/backend/src/models/entities/attestation-challenge.ts +++ b/packages/backend/src/models/entities/attestation-challenge.ts @@ -12,7 +12,7 @@ export class AttestationChallenge { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -20,19 +20,19 @@ export class AttestationChallenge { @Index() @Column('varchar', { length: 64, - comment: 'Hex-encoded sha256 hash of the challenge.' + comment: 'Hex-encoded sha256 hash of the challenge.', }) public challenge: string; @Column('timestamp with time zone', { - comment: 'The date challenge was created for expiry purposes.' + comment: 'The date challenge was created for expiry purposes.', }) public createdAt: Date; @Column('boolean', { comment: 'Indicates that the challenge is only for registration purposes if true to prevent the challenge for being used as authentication.', - default: false + default: false, }) public registrationChallenge: boolean; diff --git a/packages/backend/src/models/entities/auth-session.ts b/packages/backend/src/models/entities/auth-session.ts index 4eec27e3f6..1991385525 100644 --- a/packages/backend/src/models/entities/auth-session.ts +++ b/packages/backend/src/models/entities/auth-session.ts @@ -9,25 +9,25 @@ export class AuthSession { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the AuthSession.' + comment: 'The created date of the AuthSession.', }) public createdAt: Date; @Index() @Column('varchar', { - length: 128 + length: 128, }) public token: string; @Column({ ...id(), - nullable: true + nullable: true, }) public userId: User['id']; @ManyToOne(type => User, { onDelete: 'CASCADE', - nullable: true + nullable: true, }) @JoinColumn() public user: User | null; @@ -36,7 +36,7 @@ export class AuthSession { public appId: App['id']; @ManyToOne(type => App, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public app: App | null; diff --git a/packages/backend/src/models/entities/blocking.ts b/packages/backend/src/models/entities/blocking.ts index 48487cb086..aacbfef7fd 100644 --- a/packages/backend/src/models/entities/blocking.ts +++ b/packages/backend/src/models/entities/blocking.ts @@ -10,19 +10,19 @@ export class Blocking { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the Blocking.' + comment: 'The created date of the Blocking.', }) public createdAt: Date; @Index() @Column({ ...id(), - comment: 'The blockee user ID.' + comment: 'The blockee user ID.', }) public blockeeId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public blockee: User | null; @@ -30,12 +30,12 @@ export class Blocking { @Index() @Column({ ...id(), - comment: 'The blocker user ID.' + comment: 'The blocker user ID.', }) public blockerId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public blocker: User | null; diff --git a/packages/backend/src/models/entities/channel-following.ts b/packages/backend/src/models/entities/channel-following.ts index fca801e5ab..3727283a28 100644 --- a/packages/backend/src/models/entities/channel-following.ts +++ b/packages/backend/src/models/entities/channel-following.ts @@ -11,19 +11,19 @@ export class ChannelFollowing { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the ChannelFollowing.' + comment: 'The created date of the ChannelFollowing.', }) public createdAt: Date; @Index() @Column({ ...id(), - comment: 'The followee channel ID.' + comment: 'The followee channel ID.', }) public followeeId: Channel['id']; @ManyToOne(type => Channel, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public followee: Channel | null; @@ -31,12 +31,12 @@ export class ChannelFollowing { @Index() @Column({ ...id(), - comment: 'The follower user ID.' + comment: 'The follower user ID.', }) public followerId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public follower: User | null; diff --git a/packages/backend/src/models/entities/channel-note-pining.ts b/packages/backend/src/models/entities/channel-note-pining.ts index 26a7eb501f..d6b6774033 100644 --- a/packages/backend/src/models/entities/channel-note-pining.ts +++ b/packages/backend/src/models/entities/channel-note-pining.ts @@ -10,7 +10,7 @@ export class ChannelNotePining { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the ChannelNotePining.' + comment: 'The created date of the ChannelNotePining.', }) public createdAt: Date; @@ -19,7 +19,7 @@ export class ChannelNotePining { public channelId: Channel['id']; @ManyToOne(type => Channel, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public channel: Channel | null; @@ -28,7 +28,7 @@ export class ChannelNotePining { public noteId: Note['id']; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note: Note | null; diff --git a/packages/backend/src/models/entities/channel.ts b/packages/backend/src/models/entities/channel.ts index f2d713612d..a6767b038f 100644 --- a/packages/backend/src/models/entities/channel.ts +++ b/packages/backend/src/models/entities/channel.ts @@ -10,13 +10,13 @@ export class Channel { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the Channel.' + comment: 'The created date of the Channel.', }) public createdAt: Date; @Index() @Column('timestamp with time zone', { - nullable: true + nullable: true, }) public lastNotedAt: Date | null; @@ -24,37 +24,37 @@ export class Channel { @Column({ ...id(), nullable: true, - comment: 'The owner ID.' + comment: 'The owner ID.', }) public userId: User['id'] | null; @ManyToOne(type => User, { - onDelete: 'SET NULL' + onDelete: 'SET NULL', }) @JoinColumn() public user: User | null; @Column('varchar', { length: 128, - comment: 'The name of the Channel.' + comment: 'The name of the Channel.', }) public name: string; @Column('varchar', { length: 2048, nullable: true, - comment: 'The description of the Channel.' + comment: 'The description of the Channel.', }) public description: string | null; @Column({ ...id(), nullable: true, - comment: 'The ID of banner Channel.' + comment: 'The ID of banner Channel.', }) public bannerId: DriveFile['id'] | null; @ManyToOne(type => DriveFile, { - onDelete: 'SET NULL' + onDelete: 'SET NULL', }) @JoinColumn() public banner: DriveFile | null; @@ -62,14 +62,14 @@ export class Channel { @Index() @Column('integer', { default: 0, - comment: 'The count of notes.' + comment: 'The count of notes.', }) public notesCount: number; @Index() @Column('integer', { default: 0, - comment: 'The count of users.' + comment: 'The count of users.', }) public usersCount: number; } diff --git a/packages/backend/src/models/entities/clip-note.ts b/packages/backend/src/models/entities/clip-note.ts index 7d96b2ef7a..2bc4352266 100644 --- a/packages/backend/src/models/entities/clip-note.ts +++ b/packages/backend/src/models/entities/clip-note.ts @@ -12,12 +12,12 @@ export class ClipNote { @Index() @Column({ ...id(), - comment: 'The note ID.' + comment: 'The note ID.', }) public noteId: Note['id']; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note: Note | null; @@ -25,12 +25,12 @@ export class ClipNote { @Index() @Column({ ...id(), - comment: 'The clip ID.' + comment: 'The clip ID.', }) public clipId: Clip['id']; @ManyToOne(type => Clip, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public clip: Clip | null; diff --git a/packages/backend/src/models/entities/clip.ts b/packages/backend/src/models/entities/clip.ts index 66b5b8847e..84f5c4d214 100644 --- a/packages/backend/src/models/entities/clip.ts +++ b/packages/backend/src/models/entities/clip.ts @@ -8,37 +8,37 @@ export class Clip { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the Clip.' + comment: 'The created date of the Clip.', }) public createdAt: Date; @Index() @Column({ ...id(), - comment: 'The owner ID.' + comment: 'The owner ID.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @Column('varchar', { length: 128, - comment: 'The name of the Clip.' + comment: 'The name of the Clip.', }) public name: string; @Column('boolean', { - default: false + default: false, }) public isPublic: boolean; @Column('varchar', { length: 2048, nullable: true, default: null, - comment: 'The description of the Clip.' + comment: 'The description of the Clip.', }) public description: string | null; } diff --git a/packages/backend/src/models/entities/drive-file.ts b/packages/backend/src/models/entities/drive-file.ts index 4ec7b94ed2..0af52d7cc0 100644 --- a/packages/backend/src/models/entities/drive-file.ts +++ b/packages/backend/src/models/entities/drive-file.ts @@ -11,7 +11,7 @@ export class DriveFile { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the DriveFile.' + comment: 'The created date of the DriveFile.', }) public createdAt: Date; @@ -19,12 +19,12 @@ export class DriveFile { @Column({ ...id(), nullable: true, - comment: 'The owner ID.' + comment: 'The owner ID.', }) public userId: User['id'] | null; @ManyToOne(type => User, { - onDelete: 'SET NULL' + onDelete: 'SET NULL', }) @JoinColumn() public user: User | null; @@ -32,50 +32,50 @@ export class DriveFile { @Index() @Column('varchar', { length: 128, nullable: true, - comment: 'The host of owner. It will be null if the user in local.' + comment: 'The host of owner. It will be null if the user in local.', }) public userHost: string | null; @Index() @Column('varchar', { length: 32, - comment: 'The MD5 hash of the DriveFile.' + comment: 'The MD5 hash of the DriveFile.', }) public md5: string; @Column('varchar', { length: 256, - comment: 'The file name of the DriveFile.' + comment: 'The file name of the DriveFile.', }) public name: string; @Index() @Column('varchar', { length: 128, - comment: 'The content type (MIME) of the DriveFile.' + comment: 'The content type (MIME) of the DriveFile.', }) public type: string; @Column('integer', { - comment: 'The file size (bytes) of the DriveFile.' + comment: 'The file size (bytes) of the DriveFile.', }) public size: number; @Column('varchar', { length: 512, nullable: true, - comment: 'The comment of the DriveFile.' + comment: 'The comment of the DriveFile.', }) public comment: string | null; @Column('varchar', { length: 128, nullable: true, - comment: 'The BlurHash string.' + comment: 'The BlurHash string.', }) public blurhash: string | null; @Column('jsonb', { default: {}, - comment: 'The any properties of the DriveFile. For example, it includes image width/height.' + comment: 'The any properties of the DriveFile. For example, it includes image width/height.', }) public properties: { width?: number; height?: number; orientation?: number; avgColor?: string }; @@ -85,19 +85,19 @@ export class DriveFile { @Column('varchar', { length: 512, - comment: 'The URL of the DriveFile.' + comment: 'The URL of the DriveFile.', }) public url: string; @Column('varchar', { length: 512, nullable: true, - comment: 'The URL of the thumbnail of the DriveFile.' + comment: 'The URL of the thumbnail of the DriveFile.', }) public thumbnailUrl: string | null; @Column('varchar', { length: 512, nullable: true, - comment: 'The URL of the webpublic of the DriveFile.' + comment: 'The URL of the webpublic of the DriveFile.', }) public webpublicUrl: string | null; @@ -122,7 +122,7 @@ export class DriveFile { @Index() @Column('varchar', { length: 512, nullable: true, - comment: 'The URI of the DriveFile. it will be null when the DriveFile is local.' + comment: 'The URI of the DriveFile. it will be null when the DriveFile is local.', }) public uri: string | null; @@ -135,12 +135,12 @@ export class DriveFile { @Column({ ...id(), nullable: true, - comment: 'The parent folder ID. If null, it means the DriveFile is located in root.' + comment: 'The parent folder ID. If null, it means the DriveFile is located in root.', }) public folderId: DriveFolder['id'] | null; @ManyToOne(type => DriveFolder, { - onDelete: 'SET NULL' + onDelete: 'SET NULL', }) @JoinColumn() public folder: DriveFolder | null; @@ -148,7 +148,7 @@ export class DriveFile { @Index() @Column('boolean', { default: false, - comment: 'Whether the DriveFile is NSFW.' + comment: 'Whether the DriveFile is NSFW.', }) public isSensitive: boolean; @@ -158,7 +158,7 @@ export class DriveFile { @Index() @Column('boolean', { default: false, - comment: 'Whether the DriveFile is direct link to remote server.' + comment: 'Whether the DriveFile is direct link to remote server.', }) public isLink: boolean; } diff --git a/packages/backend/src/models/entities/drive-folder.ts b/packages/backend/src/models/entities/drive-folder.ts index a80d075855..09f5e6448e 100644 --- a/packages/backend/src/models/entities/drive-folder.ts +++ b/packages/backend/src/models/entities/drive-folder.ts @@ -9,13 +9,13 @@ export class DriveFolder { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the DriveFolder.' + comment: 'The created date of the DriveFolder.', }) public createdAt: Date; @Column('varchar', { length: 128, - comment: 'The name of the DriveFolder.' + comment: 'The name of the DriveFolder.', }) public name: string; @@ -23,12 +23,12 @@ export class DriveFolder { @Column({ ...id(), nullable: true, - comment: 'The owner ID.' + comment: 'The owner ID.', }) public userId: User['id'] | null; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -37,12 +37,12 @@ export class DriveFolder { @Column({ ...id(), nullable: true, - comment: 'The parent folder ID. If null, it means the DriveFolder is located in root.' + comment: 'The parent folder ID. If null, it means the DriveFolder is located in root.', }) public parentId: DriveFolder['id'] | null; @ManyToOne(type => DriveFolder, { - onDelete: 'SET NULL' + onDelete: 'SET NULL', }) @JoinColumn() public parent: DriveFolder | null; diff --git a/packages/backend/src/models/entities/emoji.ts b/packages/backend/src/models/entities/emoji.ts index d6080ae099..1146908a88 100644 --- a/packages/backend/src/models/entities/emoji.ts +++ b/packages/backend/src/models/entities/emoji.ts @@ -8,24 +8,24 @@ export class Emoji { public id: string; @Column('timestamp with time zone', { - nullable: true + nullable: true, }) public updatedAt: Date | null; @Index() @Column('varchar', { - length: 128 + length: 128, }) public name: string; @Index() @Column('varchar', { - length: 128, nullable: true + length: 128, nullable: true, }) public host: string | null; @Column('varchar', { - length: 128, nullable: true + length: 128, nullable: true, }) public category: string | null; @@ -35,17 +35,17 @@ export class Emoji { public url: string; @Column('varchar', { - length: 512, nullable: true + length: 512, nullable: true, }) public uri: string | null; @Column('varchar', { - length: 64, nullable: true + length: 64, nullable: true, }) public type: string | null; @Column('varchar', { - array: true, length: 128, default: '{}' + array: true, length: 128, default: '{}', }) public aliases: string[]; } diff --git a/packages/backend/src/models/entities/follow-request.ts b/packages/backend/src/models/entities/follow-request.ts index 22ec263962..6aa202299a 100644 --- a/packages/backend/src/models/entities/follow-request.ts +++ b/packages/backend/src/models/entities/follow-request.ts @@ -9,19 +9,19 @@ export class FollowRequest { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the FollowRequest.' + comment: 'The created date of the FollowRequest.', }) public createdAt: Date; @Index() @Column({ ...id(), - comment: 'The followee user ID.' + comment: 'The followee user ID.', }) public followeeId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public followee: User | null; @@ -29,56 +29,56 @@ export class FollowRequest { @Index() @Column({ ...id(), - comment: 'The follower user ID.' + comment: 'The follower user ID.', }) public followerId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public follower: User | null; @Column('varchar', { length: 128, nullable: true, - comment: 'id of Follow Activity.' + comment: 'id of Follow Activity.', }) public requestId: string | null; //#region Denormalized fields @Column('varchar', { length: 128, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public followerHost: string | null; @Column('varchar', { length: 512, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public followerInbox: string | null; @Column('varchar', { length: 512, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public followerSharedInbox: string | null; @Column('varchar', { length: 128, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public followeeHost: string | null; @Column('varchar', { length: 512, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public followeeInbox: string | null; @Column('varchar', { length: 512, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public followeeSharedInbox: string | null; //#endregion diff --git a/packages/backend/src/models/entities/following.ts b/packages/backend/src/models/entities/following.ts index ee3286a1a1..c3631e8501 100644 --- a/packages/backend/src/models/entities/following.ts +++ b/packages/backend/src/models/entities/following.ts @@ -10,19 +10,19 @@ export class Following { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the Following.' + comment: 'The created date of the Following.', }) public createdAt: Date; @Index() @Column({ ...id(), - comment: 'The followee user ID.' + comment: 'The followee user ID.', }) public followeeId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public followee: User | null; @@ -30,12 +30,12 @@ export class Following { @Index() @Column({ ...id(), - comment: 'The follower user ID.' + comment: 'The follower user ID.', }) public followerId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public follower: User | null; @@ -43,37 +43,37 @@ export class Following { //#region Denormalized fields @Column('varchar', { length: 128, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public followerHost: string | null; @Column('varchar', { length: 512, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public followerInbox: string | null; @Column('varchar', { length: 512, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public followerSharedInbox: string | null; @Column('varchar', { length: 128, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public followeeHost: string | null; @Column('varchar', { length: 512, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public followeeInbox: string | null; @Column('varchar', { length: 512, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public followeeSharedInbox: string | null; //#endregion diff --git a/packages/backend/src/models/entities/gallery-like.ts b/packages/backend/src/models/entities/gallery-like.ts index 7d084a2275..41615dcea9 100644 --- a/packages/backend/src/models/entities/gallery-like.ts +++ b/packages/backend/src/models/entities/gallery-like.ts @@ -17,7 +17,7 @@ export class GalleryLike { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -26,7 +26,7 @@ export class GalleryLike { public postId: GalleryPost['id']; @ManyToOne(type => GalleryPost, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public post: GalleryPost | null; diff --git a/packages/backend/src/models/entities/gallery-post.ts b/packages/backend/src/models/entities/gallery-post.ts index f59cd671f3..393603e3d9 100644 --- a/packages/backend/src/models/entities/gallery-post.ts +++ b/packages/backend/src/models/entities/gallery-post.ts @@ -10,13 +10,13 @@ export class GalleryPost { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the GalleryPost.' + comment: 'The created date of the GalleryPost.', }) public createdAt: Date; @Index() @Column('timestamp with time zone', { - comment: 'The updated date of the GalleryPost.' + comment: 'The updated date of the GalleryPost.', }) public updatedAt: Date; @@ -26,19 +26,19 @@ export class GalleryPost { public title: string; @Column('varchar', { - length: 2048, nullable: true + length: 2048, nullable: true, }) public description: string | null; @Index() @Column({ ...id(), - comment: 'The ID of author.' + comment: 'The ID of author.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -46,26 +46,26 @@ export class GalleryPost { @Index() @Column({ ...id(), - array: true, default: '{}' + array: true, default: '{}', }) public fileIds: DriveFile['id'][]; @Index() @Column('boolean', { default: false, - comment: 'Whether the post is sensitive.' + comment: 'Whether the post is sensitive.', }) public isSensitive: boolean; @Index() @Column('integer', { - default: 0 + default: 0, }) public likedCount: number; @Index() @Column('varchar', { - length: 128, array: true, default: '{}' + length: 128, array: true, default: '{}', }) public tags: string[]; diff --git a/packages/backend/src/models/entities/games/reversi/game.ts b/packages/backend/src/models/entities/games/reversi/game.ts index 9deacaf5c6..fe9b8a5ba5 100644 --- a/packages/backend/src/models/entities/games/reversi/game.ts +++ b/packages/backend/src/models/entities/games/reversi/game.ts @@ -9,13 +9,13 @@ export class ReversiGame { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the ReversiGame.' + comment: 'The created date of the ReversiGame.', }) public createdAt: Date; @Column('timestamp with time zone', { nullable: true, - comment: 'The started date of the ReversiGame.' + comment: 'The started date of the ReversiGame.', }) public startedAt: Date | null; @@ -23,7 +23,7 @@ export class ReversiGame { public user1Id: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user1: User | null; @@ -32,7 +32,7 @@ export class ReversiGame { public user2Id: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user2: User | null; @@ -69,13 +69,13 @@ export class ReversiGame { @Column({ ...id(), - nullable: true + nullable: true, }) public winnerId: User['id'] | null; @Column({ ...id(), - nullable: true + nullable: true, }) public surrendered: User['id'] | null; @@ -94,7 +94,7 @@ export class ReversiGame { public map: string[]; @Column('varchar', { - length: 32 + length: 32, }) public bw: string; @@ -127,7 +127,7 @@ export class ReversiGame { * ログのposを文字列としてすべて連結したもののCRC32値 */ @Column('varchar', { - length: 32, nullable: true + length: 32, nullable: true, }) public crc32: string | null; } diff --git a/packages/backend/src/models/entities/games/reversi/matching.ts b/packages/backend/src/models/entities/games/reversi/matching.ts index 477a29316e..70bb555e2f 100644 --- a/packages/backend/src/models/entities/games/reversi/matching.ts +++ b/packages/backend/src/models/entities/games/reversi/matching.ts @@ -9,7 +9,7 @@ export class ReversiMatching { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the ReversiMatching.' + comment: 'The created date of the ReversiMatching.', }) public createdAt: Date; @@ -18,7 +18,7 @@ export class ReversiMatching { public parentId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public parent: User | null; @@ -28,7 +28,7 @@ export class ReversiMatching { public childId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public child: User | null; diff --git a/packages/backend/src/models/entities/hashtag.ts b/packages/backend/src/models/entities/hashtag.ts index 842cdaa562..761974590a 100644 --- a/packages/backend/src/models/entities/hashtag.ts +++ b/packages/backend/src/models/entities/hashtag.ts @@ -9,7 +9,7 @@ export class Hashtag { @Index({ unique: true }) @Column('varchar', { - length: 128 + length: 128, }) public name: string; @@ -21,7 +21,7 @@ export class Hashtag { @Index() @Column('integer', { - default: 0 + default: 0, }) public mentionedUsersCount: number; @@ -33,7 +33,7 @@ export class Hashtag { @Index() @Column('integer', { - default: 0 + default: 0, }) public mentionedLocalUsersCount: number; @@ -45,7 +45,7 @@ export class Hashtag { @Index() @Column('integer', { - default: 0 + default: 0, }) public mentionedRemoteUsersCount: number; @@ -57,7 +57,7 @@ export class Hashtag { @Index() @Column('integer', { - default: 0 + default: 0, }) public attachedUsersCount: number; @@ -69,7 +69,7 @@ export class Hashtag { @Index() @Column('integer', { - default: 0 + default: 0, }) public attachedLocalUsersCount: number; @@ -81,7 +81,7 @@ export class Hashtag { @Index() @Column('integer', { - default: 0 + default: 0, }) public attachedRemoteUsersCount: number; } diff --git a/packages/backend/src/models/entities/instance.ts b/packages/backend/src/models/entities/instance.ts index 7c8719e06a..d1314be178 100644 --- a/packages/backend/src/models/entities/instance.ts +++ b/packages/backend/src/models/entities/instance.ts @@ -11,7 +11,7 @@ export class Instance { */ @Index() @Column('timestamp with time zone', { - comment: 'The caught date of the Instance.' + comment: 'The caught date of the Instance.', }) public caughtAt: Date; @@ -21,7 +21,7 @@ export class Instance { @Index({ unique: true }) @Column('varchar', { length: 128, - comment: 'The host of the Instance.' + comment: 'The host of the Instance.', }) public host: string; @@ -30,7 +30,7 @@ export class Instance { */ @Column('integer', { default: 0, - comment: 'The count of the users of the Instance.' + comment: 'The count of the users of the Instance.', }) public usersCount: number; @@ -39,7 +39,7 @@ export class Instance { */ @Column('integer', { default: 0, - comment: 'The count of the notes of the Instance.' + comment: 'The count of the notes of the Instance.', }) public notesCount: number; @@ -109,7 +109,7 @@ export class Instance { * このインスタンスと不通かどうか */ @Column('boolean', { - default: false + default: false, }) public isNotResponding: boolean; @@ -118,13 +118,13 @@ export class Instance { */ @Index() @Column('boolean', { - default: false + default: false, }) public isSuspended: boolean; @Column('varchar', { length: 64, nullable: true, default: null, - comment: 'The software of the Instance.' + comment: 'The software of the Instance.', }) public softwareName: string | null; diff --git a/packages/backend/src/models/entities/messaging-message.ts b/packages/backend/src/models/entities/messaging-message.ts index ac0764674c..06ae005de9 100644 --- a/packages/backend/src/models/entities/messaging-message.ts +++ b/packages/backend/src/models/entities/messaging-message.ts @@ -11,19 +11,19 @@ export class MessagingMessage { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the MessagingMessage.' + comment: 'The created date of the MessagingMessage.', }) public createdAt: Date; @Index() @Column({ ...id(), - comment: 'The sender user ID.' + comment: 'The sender user ID.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -31,12 +31,12 @@ export class MessagingMessage { @Index() @Column({ ...id(), nullable: true, - comment: 'The recipient user ID.' + comment: 'The recipient user ID.', }) public recipientId: User['id'] | null; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public recipient: User | null; @@ -44,18 +44,18 @@ export class MessagingMessage { @Index() @Column({ ...id(), nullable: true, - comment: 'The recipient group ID.' + comment: 'The recipient group ID.', }) public groupId: UserGroup['id'] | null; @ManyToOne(type => UserGroup, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public group: UserGroup | null; @Column('varchar', { - length: 4096, nullable: true + length: 4096, nullable: true, }) public text: string | null; @@ -71,7 +71,7 @@ export class MessagingMessage { @Column({ ...id(), - array: true, default: '{}' + array: true, default: '{}', }) public reads: User['id'][]; @@ -82,7 +82,7 @@ export class MessagingMessage { public fileId: DriveFile['id'] | null; @ManyToOne(type => DriveFile, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public file: DriveFile | null; diff --git a/packages/backend/src/models/entities/meta.ts b/packages/backend/src/models/entities/meta.ts index 9a1a87c155..c462d5ade6 100644 --- a/packages/backend/src/models/entities/meta.ts +++ b/packages/backend/src/models/entities/meta.ts @@ -7,17 +7,17 @@ import { Clip } from './clip'; export class Meta { @PrimaryColumn({ type: 'varchar', - length: 32 + length: 32, }) public id: string; @Column('varchar', { - length: 128, nullable: true + length: 128, nullable: true, }) public name: string | null; @Column('varchar', { - length: 1024, nullable: true + length: 1024, nullable: true, }) public description: string | null; @@ -25,7 +25,7 @@ export class Meta { * メンテナの名前 */ @Column('varchar', { - length: 128, nullable: true + length: 128, nullable: true, }) public maintainerName: string | null; @@ -33,7 +33,7 @@ export class Meta { * メンテナの連絡先 */ @Column('varchar', { - length: 128, nullable: true + length: 128, nullable: true, }) public maintainerEmail: string | null; @@ -58,27 +58,27 @@ export class Meta { public useStarForReactionFallback: boolean; @Column('varchar', { - length: 64, array: true, default: '{}' + length: 64, array: true, default: '{}', }) public langs: string[]; @Column('varchar', { - length: 256, array: true, default: '{}' + length: 256, array: true, default: '{}', }) public pinnedUsers: string[]; @Column('varchar', { - length: 256, array: true, default: '{}' + length: 256, array: true, default: '{}', }) public hiddenTags: string[]; @Column('varchar', { - length: 256, array: true, default: '{}' + length: 256, array: true, default: '{}', }) public blockedHosts: string[]; @Column('varchar', { - length: 512, array: true, default: '{"/featured", "/channels", "/explore", "/pages", "/about-misskey"}' + length: 512, array: true, default: '{"/featured", "/channels", "/explore", "/pages", "/about-misskey"}', }) public pinnedPages: string[]; @@ -91,38 +91,38 @@ export class Meta { @Column('varchar', { length: 512, nullable: true, - default: '/assets/ai.png' + default: '/assets/ai.png', }) public mascotImageUrl: string | null; @Column('varchar', { length: 512, - nullable: true + nullable: true, }) public bannerUrl: string | null; @Column('varchar', { length: 512, - nullable: true + nullable: true, }) public backgroundImageUrl: string | null; @Column('varchar', { length: 512, - nullable: true + nullable: true, }) public logoImageUrl: string | null; @Column('varchar', { length: 512, nullable: true, - default: 'https://xn--931a.moe/aiart/yubitun.png' + default: 'https://xn--931a.moe/aiart/yubitun.png', }) public errorImageUrl: string | null; @Column('varchar', { length: 512, - nullable: true + nullable: true, }) public iconUrl: string | null; @@ -143,7 +143,7 @@ export class Meta { public proxyAccountId: User['id'] | null; @ManyToOne(type => User, { - onDelete: 'SET NULL' + onDelete: 'SET NULL', }) @JoinColumn() public proxyAccount: User | null; @@ -160,13 +160,13 @@ export class Meta { @Column('varchar', { length: 64, - nullable: true + nullable: true, }) public hcaptchaSiteKey: string | null; @Column('varchar', { length: 64, - nullable: true + nullable: true, }) public hcaptchaSecretKey: string | null; @@ -177,37 +177,37 @@ export class Meta { @Column('varchar', { length: 64, - nullable: true + nullable: true, }) public recaptchaSiteKey: string | null; @Column('varchar', { length: 64, - nullable: true + nullable: true, }) public recaptchaSecretKey: string | null; @Column('integer', { default: 1024, - comment: 'Drive capacity of a local user (MB)' + comment: 'Drive capacity of a local user (MB)', }) public localDriveCapacityMb: number; @Column('integer', { default: 32, - comment: 'Drive capacity of a remote user (MB)' + comment: 'Drive capacity of a remote user (MB)', }) public remoteDriveCapacityMb: number; @Column('integer', { default: 500, - comment: 'Max allowed note text length in characters' + comment: 'Max allowed note text length in characters', }) public maxNoteTextLength: number; @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public summalyProxy: string | null; @@ -218,7 +218,7 @@ export class Meta { @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public email: string | null; @@ -229,24 +229,24 @@ export class Meta { @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public smtpHost: string | null; @Column('integer', { - nullable: true + nullable: true, }) public smtpPort: number | null; @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public smtpUser: string | null; @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public smtpPass: string | null; @@ -257,13 +257,13 @@ export class Meta { @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public swPublicKey: string | null; @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public swPrivateKey: string | null; @@ -274,13 +274,13 @@ export class Meta { @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public twitterConsumerKey: string | null; @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public twitterConsumerSecret: string | null; @@ -291,13 +291,13 @@ export class Meta { @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public githubClientId: string | null; @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public githubClientSecret: string | null; @@ -308,19 +308,19 @@ export class Meta { @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public discordClientId: string | null; @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public discordClientSecret: string | null; @Column('varchar', { length: 128, - nullable: true + nullable: true, }) public deeplAuthKey: string | null; @@ -331,21 +331,21 @@ export class Meta { @Column('varchar', { length: 512, - nullable: true + nullable: true, }) public ToSUrl: string | null; @Column('varchar', { length: 512, default: 'https://github.com/misskey-dev/misskey', - nullable: false + nullable: false, }) public repositoryUrl: string; @Column('varchar', { length: 512, default: 'https://github.com/misskey-dev/misskey/issues/new', - nullable: true + nullable: true, }) public feedbackUrl: string | null; @@ -356,48 +356,48 @@ export class Meta { @Column('varchar', { length: 512, - nullable: true + nullable: true, }) public objectStorageBucket: string | null; @Column('varchar', { length: 512, - nullable: true + nullable: true, }) public objectStoragePrefix: string | null; @Column('varchar', { length: 512, - nullable: true + nullable: true, }) public objectStorageBaseUrl: string | null; @Column('varchar', { length: 512, - nullable: true + nullable: true, }) public objectStorageEndpoint: string | null; @Column('varchar', { length: 512, - nullable: true + nullable: true, }) public objectStorageRegion: string | null; @Column('varchar', { length: 512, - nullable: true + nullable: true, }) public objectStorageAccessKey: string | null; @Column('varchar', { length: 512, - nullable: true + nullable: true, }) public objectStorageSecretKey: string | null; @Column('integer', { - nullable: true + nullable: true, }) public objectStoragePort: number | null; diff --git a/packages/backend/src/models/entities/moderation-log.ts b/packages/backend/src/models/entities/moderation-log.ts index 33d3d683ae..fe000e14f2 100644 --- a/packages/backend/src/models/entities/moderation-log.ts +++ b/packages/backend/src/models/entities/moderation-log.ts @@ -8,7 +8,7 @@ export class ModerationLog { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the ModerationLog.' + comment: 'The created date of the ModerationLog.', }) public createdAt: Date; @@ -17,7 +17,7 @@ export class ModerationLog { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; diff --git a/packages/backend/src/models/entities/muted-note.ts b/packages/backend/src/models/entities/muted-note.ts index 521876688c..b01bb0551a 100644 --- a/packages/backend/src/models/entities/muted-note.ts +++ b/packages/backend/src/models/entities/muted-note.ts @@ -13,12 +13,12 @@ export class MutedNote { @Index() @Column({ ...id(), - comment: 'The note ID.' + comment: 'The note ID.', }) public noteId: Note['id']; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note: Note | null; @@ -26,12 +26,12 @@ export class MutedNote { @Index() @Column({ ...id(), - comment: 'The user ID.' + comment: 'The user ID.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -42,7 +42,7 @@ export class MutedNote { @Index() @Column('enum', { enum: mutedNoteReasons, - comment: 'The reason of the MutedNote.' + comment: 'The reason of the MutedNote.', }) public reason: typeof mutedNoteReasons[number]; } diff --git a/packages/backend/src/models/entities/muting.ts b/packages/backend/src/models/entities/muting.ts index 0084213bcc..b9f18a5852 100644 --- a/packages/backend/src/models/entities/muting.ts +++ b/packages/backend/src/models/entities/muting.ts @@ -10,19 +10,19 @@ export class Muting { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the Muting.' + comment: 'The created date of the Muting.', }) public createdAt: Date; @Index() @Column({ ...id(), - comment: 'The mutee user ID.' + comment: 'The mutee user ID.', }) public muteeId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public mutee: User | null; @@ -30,12 +30,12 @@ export class Muting { @Index() @Column({ ...id(), - comment: 'The muter user ID.' + comment: 'The muter user ID.', }) public muterId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public muter: User | null; diff --git a/packages/backend/src/models/entities/note-favorite.ts b/packages/backend/src/models/entities/note-favorite.ts index 0713c3ae56..69d9b49d13 100644 --- a/packages/backend/src/models/entities/note-favorite.ts +++ b/packages/backend/src/models/entities/note-favorite.ts @@ -10,7 +10,7 @@ export class NoteFavorite { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the NoteFavorite.' + comment: 'The created date of the NoteFavorite.', }) public createdAt: Date; @@ -19,7 +19,7 @@ export class NoteFavorite { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -28,7 +28,7 @@ export class NoteFavorite { public noteId: Note['id']; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note: Note | null; diff --git a/packages/backend/src/models/entities/note-reaction.ts b/packages/backend/src/models/entities/note-reaction.ts index 674dc3639e..369505a6c6 100644 --- a/packages/backend/src/models/entities/note-reaction.ts +++ b/packages/backend/src/models/entities/note-reaction.ts @@ -11,7 +11,7 @@ export class NoteReaction { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the NoteReaction.' + comment: 'The created date of the NoteReaction.', }) public createdAt: Date; @@ -20,7 +20,7 @@ export class NoteReaction { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user?: User | null; @@ -30,7 +30,7 @@ export class NoteReaction { public noteId: Note['id']; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note?: Note | null; @@ -38,7 +38,7 @@ export class NoteReaction { // TODO: 対象noteのuserIdを非正規化したい(「受け取ったリアクション一覧」のようなものを(JOIN無しで)実装したいため) @Column('varchar', { - length: 260 + length: 260, }) public reaction: string; } diff --git a/packages/backend/src/models/entities/note-thread-muting.ts b/packages/backend/src/models/entities/note-thread-muting.ts index b438522a4c..f4a3a48876 100644 --- a/packages/backend/src/models/entities/note-thread-muting.ts +++ b/packages/backend/src/models/entities/note-thread-muting.ts @@ -20,7 +20,7 @@ export class NoteThreadMuting { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; diff --git a/packages/backend/src/models/entities/note-unread.ts b/packages/backend/src/models/entities/note-unread.ts index 57dda4fafd..952f71cdaa 100644 --- a/packages/backend/src/models/entities/note-unread.ts +++ b/packages/backend/src/models/entities/note-unread.ts @@ -15,7 +15,7 @@ export class NoteUnread { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -25,7 +25,7 @@ export class NoteUnread { public noteId: Note['id']; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note: Note | null; @@ -48,7 +48,7 @@ export class NoteUnread { @Index() @Column({ ...id(), - comment: '[Denormalized]' + comment: '[Denormalized]', }) public noteUserId: User['id']; @@ -56,7 +56,7 @@ export class NoteUnread { @Column({ ...id(), nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public noteChannelId: Channel['id'] | null; //#endregion diff --git a/packages/backend/src/models/entities/note-watching.ts b/packages/backend/src/models/entities/note-watching.ts index 741a1c0c8b..2758efdc35 100644 --- a/packages/backend/src/models/entities/note-watching.ts +++ b/packages/backend/src/models/entities/note-watching.ts @@ -11,19 +11,19 @@ export class NoteWatching { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the NoteWatching.' + comment: 'The created date of the NoteWatching.', }) public createdAt: Date; @Index() @Column({ ...id(), - comment: 'The watcher ID.' + comment: 'The watcher ID.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -31,12 +31,12 @@ export class NoteWatching { @Index() @Column({ ...id(), - comment: 'The target Note ID.' + comment: 'The target Note ID.', }) public noteId: Note['id']; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note: Note | null; @@ -45,7 +45,7 @@ export class NoteWatching { @Index() @Column({ ...id(), - comment: '[Denormalized]' + comment: '[Denormalized]', }) public noteUserId: Note['userId']; //#endregion diff --git a/packages/backend/src/models/entities/note.ts b/packages/backend/src/models/entities/note.ts index 9dee25ea2a..e4a5ac871c 100644 --- a/packages/backend/src/models/entities/note.ts +++ b/packages/backend/src/models/entities/note.ts @@ -15,7 +15,7 @@ export class Note { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the Note.' + comment: 'The created date of the Note.', }) public createdAt: Date; @@ -23,12 +23,12 @@ export class Note { @Column({ ...id(), nullable: true, - comment: 'The ID of reply target.' + comment: 'The ID of reply target.', }) public replyId: Note['id'] | null; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public reply: Note | null; @@ -37,67 +37,67 @@ export class Note { @Column({ ...id(), nullable: true, - comment: 'The ID of renote target.' + comment: 'The ID of renote target.', }) public renoteId: Note['id'] | null; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public renote: Note | null; @Index() @Column('varchar', { - length: 256, nullable: true + length: 256, nullable: true, }) public threadId: string | null; @Column('varchar', { - length: 8192, nullable: true + length: 8192, nullable: true, }) public text: string | null; @Column('varchar', { - length: 256, nullable: true + length: 256, nullable: true, }) public name: string | null; @Column('varchar', { - length: 512, nullable: true + length: 512, nullable: true, }) public cw: string | null; @Index() @Column({ ...id(), - comment: 'The ID of author.' + comment: 'The ID of author.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @Column('boolean', { - default: false + default: false, }) public localOnly: boolean; @Column('smallint', { - default: 0 + default: 0, }) public renoteCount: number; @Column('smallint', { - default: 0 + default: 0, }) public repliesCount: number; @Column('jsonb', { - default: {} + default: {}, }) public reactions: Record; @@ -113,66 +113,66 @@ export class Note { @Index({ unique: true }) @Column('varchar', { length: 512, nullable: true, - comment: 'The URI of a note. it will be null when the note is local.' + comment: 'The URI of a note. it will be null when the note is local.', }) public uri: string | null; @Column('varchar', { length: 512, nullable: true, - comment: 'The human readable url of a note. it will be null when the note is local.' + comment: 'The human readable url of a note. it will be null when the note is local.', }) public url: string | null; @Column('integer', { - default: 0, select: false + default: 0, select: false, }) public score: number; @Index() @Column({ ...id(), - array: true, default: '{}' + array: true, default: '{}', }) public fileIds: DriveFile['id'][]; @Index() @Column('varchar', { - length: 256, array: true, default: '{}' + length: 256, array: true, default: '{}', }) public attachedFileTypes: string[]; @Index() @Column({ ...id(), - array: true, default: '{}' + array: true, default: '{}', }) public visibleUserIds: User['id'][]; @Index() @Column({ ...id(), - array: true, default: '{}' + array: true, default: '{}', }) public mentions: User['id'][]; @Column('text', { - default: '[]' + default: '[]', }) public mentionedRemoteUsers: string; @Column('varchar', { - length: 128, array: true, default: '{}' + length: 128, array: true, default: '{}', }) public emojis: string[]; @Index() @Column('varchar', { - length: 128, array: true, default: '{}' + length: 128, array: true, default: '{}', }) public tags: string[]; @Column('boolean', { - default: false + default: false, }) public hasPoll: boolean; @@ -180,12 +180,12 @@ export class Note { @Column({ ...id(), nullable: true, default: null, - comment: 'The ID of source channel.' + comment: 'The ID of source channel.', }) public channelId: Channel['id'] | null; @ManyToOne(type => Channel, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public channel: Channel | null; @@ -194,33 +194,33 @@ export class Note { @Index() @Column('varchar', { length: 128, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public userHost: string | null; @Column({ ...id(), nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public replyUserId: User['id'] | null; @Column('varchar', { length: 128, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public replyUserHost: string | null; @Column({ ...id(), nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public renoteUserId: User['id'] | null; @Column('varchar', { length: 128, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public renoteUserHost: string | null; //#endregion diff --git a/packages/backend/src/models/entities/notification.ts b/packages/backend/src/models/entities/notification.ts index 47184caacc..9c1d8242fe 100644 --- a/packages/backend/src/models/entities/notification.ts +++ b/packages/backend/src/models/entities/notification.ts @@ -14,7 +14,7 @@ export class Notification { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the Notification.' + comment: 'The created date of the Notification.', }) public createdAt: Date; @@ -24,12 +24,12 @@ export class Notification { @Index() @Column({ ...id(), - comment: 'The ID of recipient user of the Notification.' + comment: 'The ID of recipient user of the Notification.', }) public notifieeId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public notifiee: User | null; @@ -41,12 +41,12 @@ export class Notification { @Column({ ...id(), nullable: true, - comment: 'The ID of sender user of the Notification.' + comment: 'The ID of sender user of the Notification.', }) public notifierId: User['id'] | null; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public notifier: User | null; @@ -68,7 +68,7 @@ export class Notification { @Index() @Column('enum', { enum: notificationTypes, - comment: 'The type of the Notification.' + comment: 'The type of the Notification.', }) public type: typeof notificationTypes[number]; @@ -78,53 +78,53 @@ export class Notification { @Index() @Column('boolean', { default: false, - comment: 'Whether the Notification is read.' + comment: 'Whether the Notification is read.', }) public isRead: boolean; @Column({ ...id(), - nullable: true + nullable: true, }) public noteId: Note['id'] | null; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note: Note | null; @Column({ ...id(), - nullable: true + nullable: true, }) public followRequestId: FollowRequest['id'] | null; @ManyToOne(type => FollowRequest, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public followRequest: FollowRequest | null; @Column({ ...id(), - nullable: true + nullable: true, }) public userGroupInvitationId: UserGroupInvitation['id'] | null; @ManyToOne(type => UserGroupInvitation, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public userGroupInvitation: UserGroupInvitation | null; @Column('varchar', { - length: 128, nullable: true + length: 128, nullable: true, }) public reaction: string | null; @Column('integer', { - nullable: true + nullable: true, }) public choice: number | null; @@ -132,7 +132,7 @@ export class Notification { * アプリ通知のbody */ @Column('varchar', { - length: 2048, nullable: true + length: 2048, nullable: true, }) public customBody: string | null; @@ -141,7 +141,7 @@ export class Notification { * (省略時はアプリ名で表示されることを期待) */ @Column('varchar', { - length: 256, nullable: true + length: 256, nullable: true, }) public customHeader: string | null; @@ -150,7 +150,7 @@ export class Notification { * (省略時はアプリアイコンで表示されることを期待) */ @Column('varchar', { - length: 1024, nullable: true + length: 1024, nullable: true, }) public customIcon: string | null; @@ -160,12 +160,12 @@ export class Notification { @Index() @Column({ ...id(), - nullable: true + nullable: true, }) public appAccessTokenId: AccessToken['id'] | null; @ManyToOne(type => AccessToken, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public appAccessToken: AccessToken | null; diff --git a/packages/backend/src/models/entities/page-like.ts b/packages/backend/src/models/entities/page-like.ts index ca84ece8fd..16fb8f172a 100644 --- a/packages/backend/src/models/entities/page-like.ts +++ b/packages/backend/src/models/entities/page-like.ts @@ -17,7 +17,7 @@ export class PageLike { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -26,7 +26,7 @@ export class PageLike { public pageId: Page['id']; @ManyToOne(type => Page, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public page: Page | null; diff --git a/packages/backend/src/models/entities/page.ts b/packages/backend/src/models/entities/page.ts index ed0411a3d0..2b540e1990 100644 --- a/packages/backend/src/models/entities/page.ts +++ b/packages/backend/src/models/entities/page.ts @@ -11,13 +11,13 @@ export class Page { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the Page.' + comment: 'The created date of the Page.', }) public createdAt: Date; @Index() @Column('timestamp with time zone', { - comment: 'The updated date of the Page.' + comment: 'The updated date of the Page.', }) public updatedAt: Date; @@ -33,7 +33,7 @@ export class Page { public name: string; @Column('varchar', { - length: 256, nullable: true + length: 256, nullable: true, }) public summary: string | null; @@ -41,7 +41,7 @@ export class Page { public alignCenter: boolean; @Column('boolean', { - default: false + default: false, }) public hideTitleWhenPinned: boolean; @@ -53,12 +53,12 @@ export class Page { @Index() @Column({ ...id(), - comment: 'The ID of author.' + comment: 'The ID of author.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -70,24 +70,24 @@ export class Page { public eyeCatchingImageId: DriveFile['id'] | null; @ManyToOne(type => DriveFile, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public eyeCatchingImage: DriveFile | null; @Column('jsonb', { - default: [] + default: [], }) public content: Record[]; @Column('jsonb', { - default: [] + default: [], }) public variables: Record[]; @Column('varchar', { length: 16384, - default: '' + default: '', }) public script: string; @@ -102,12 +102,12 @@ export class Page { @Index() @Column({ ...id(), - array: true, default: '{}' + array: true, default: '{}', }) public visibleUserIds: User['id'][]; @Column('integer', { - default: 0 + default: 0, }) public likedCount: number; diff --git a/packages/backend/src/models/entities/password-reset-request.ts b/packages/backend/src/models/entities/password-reset-request.ts index 6d41d38a93..a2db0f1147 100644 --- a/packages/backend/src/models/entities/password-reset-request.ts +++ b/packages/backend/src/models/entities/password-reset-request.ts @@ -23,7 +23,7 @@ export class PasswordResetRequest { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; diff --git a/packages/backend/src/models/entities/poll-vote.ts b/packages/backend/src/models/entities/poll-vote.ts index 709376f909..fb44a58e9f 100644 --- a/packages/backend/src/models/entities/poll-vote.ts +++ b/packages/backend/src/models/entities/poll-vote.ts @@ -11,7 +11,7 @@ export class PollVote { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the PollVote.' + comment: 'The created date of the PollVote.', }) public createdAt: Date; @@ -20,7 +20,7 @@ export class PollVote { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -30,7 +30,7 @@ export class PollVote { public noteId: Note['id']; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note: Note | null; diff --git a/packages/backend/src/models/entities/poll.ts b/packages/backend/src/models/entities/poll.ts index e3bbb1c3f2..9c80693491 100644 --- a/packages/backend/src/models/entities/poll.ts +++ b/packages/backend/src/models/entities/poll.ts @@ -10,13 +10,13 @@ export class Poll { public noteId: Note['id']; @OneToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note: Note | null; @Column('timestamp with time zone', { - nullable: true + nullable: true, }) public expiresAt: Date | null; @@ -24,7 +24,7 @@ export class Poll { public multiple: boolean; @Column('varchar', { - length: 128, array: true, default: '{}' + length: 128, array: true, default: '{}', }) public choices: string[]; @@ -36,21 +36,21 @@ export class Poll { //#region Denormalized fields @Column('enum', { enum: noteVisibilities, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public noteVisibility: typeof noteVisibilities[number]; @Index() @Column({ ...id(), - comment: '[Denormalized]' + comment: '[Denormalized]', }) public userId: User['id']; @Index() @Column('varchar', { length: 128, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public userHost: string | null; //#endregion diff --git a/packages/backend/src/models/entities/promo-note.ts b/packages/backend/src/models/entities/promo-note.ts index 474f1cb235..e3fbab4414 100644 --- a/packages/backend/src/models/entities/promo-note.ts +++ b/packages/backend/src/models/entities/promo-note.ts @@ -9,7 +9,7 @@ export class PromoNote { public noteId: Note['id']; @OneToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note: Note | null; @@ -21,7 +21,7 @@ export class PromoNote { @Index() @Column({ ...id(), - comment: '[Denormalized]' + comment: '[Denormalized]', }) public userId: User['id']; //#endregion diff --git a/packages/backend/src/models/entities/promo-read.ts b/packages/backend/src/models/entities/promo-read.ts index 2e0977b6b5..777ed301ba 100644 --- a/packages/backend/src/models/entities/promo-read.ts +++ b/packages/backend/src/models/entities/promo-read.ts @@ -10,7 +10,7 @@ export class PromoRead { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the PromoRead.' + comment: 'The created date of the PromoRead.', }) public createdAt: Date; @@ -19,7 +19,7 @@ export class PromoRead { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -28,7 +28,7 @@ export class PromoRead { public noteId: Note['id']; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note: Note | null; diff --git a/packages/backend/src/models/entities/registry-item.ts b/packages/backend/src/models/entities/registry-item.ts index 54d2ef2082..6d5f0185db 100644 --- a/packages/backend/src/models/entities/registry-item.ts +++ b/packages/backend/src/models/entities/registry-item.ts @@ -9,50 +9,50 @@ export class RegistryItem { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the RegistryItem.' + comment: 'The created date of the RegistryItem.', }) public createdAt: Date; @Column('timestamp with time zone', { - comment: 'The updated date of the RegistryItem.' + comment: 'The updated date of the RegistryItem.', }) public updatedAt: Date; @Index() @Column({ ...id(), - comment: 'The owner ID.' + comment: 'The owner ID.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @Column('varchar', { length: 1024, - comment: 'The key of the RegistryItem.' + comment: 'The key of the RegistryItem.', }) public key: string; @Column('jsonb', { default: {}, nullable: true, - comment: 'The value of the RegistryItem.' + comment: 'The value of the RegistryItem.', }) public value: any | null; @Index() @Column('varchar', { - length: 1024, array: true, default: '{}' + length: 1024, array: true, default: '{}', }) public scope: string[]; // サードパーティアプリに開放するときのためのカラム @Index() @Column('varchar', { - length: 512, nullable: true + length: 512, nullable: true, }) public domain: string | null; } diff --git a/packages/backend/src/models/entities/signin.ts b/packages/backend/src/models/entities/signin.ts index 7e047084b1..7f54f2ebf2 100644 --- a/packages/backend/src/models/entities/signin.ts +++ b/packages/backend/src/models/entities/signin.ts @@ -8,7 +8,7 @@ export class Signin { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the Signin.' + comment: 'The created date of the Signin.', }) public createdAt: Date; @@ -17,7 +17,7 @@ export class Signin { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; diff --git a/packages/backend/src/models/entities/sw-subscription.ts b/packages/backend/src/models/entities/sw-subscription.ts index 7c3f6f0a6c..2debcf7443 100644 --- a/packages/backend/src/models/entities/sw-subscription.ts +++ b/packages/backend/src/models/entities/sw-subscription.ts @@ -15,7 +15,7 @@ export class SwSubscription { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; diff --git a/packages/backend/src/models/entities/user-group-invitation.ts b/packages/backend/src/models/entities/user-group-invitation.ts index 6fe8f20134..479442a135 100644 --- a/packages/backend/src/models/entities/user-group-invitation.ts +++ b/packages/backend/src/models/entities/user-group-invitation.ts @@ -10,19 +10,19 @@ export class UserGroupInvitation { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the UserGroupInvitation.' + comment: 'The created date of the UserGroupInvitation.', }) public createdAt: Date; @Index() @Column({ ...id(), - comment: 'The user ID.' + comment: 'The user ID.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -30,12 +30,12 @@ export class UserGroupInvitation { @Index() @Column({ ...id(), - comment: 'The group ID.' + comment: 'The group ID.', }) public userGroupId: UserGroup['id']; @ManyToOne(type => UserGroup, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public userGroup: UserGroup | null; diff --git a/packages/backend/src/models/entities/user-group-joining.ts b/packages/backend/src/models/entities/user-group-joining.ts index e09c3230f1..81f3358588 100644 --- a/packages/backend/src/models/entities/user-group-joining.ts +++ b/packages/backend/src/models/entities/user-group-joining.ts @@ -10,19 +10,19 @@ export class UserGroupJoining { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the UserGroupJoining.' + comment: 'The created date of the UserGroupJoining.', }) public createdAt: Date; @Index() @Column({ ...id(), - comment: 'The user ID.' + comment: 'The user ID.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -30,12 +30,12 @@ export class UserGroupJoining { @Index() @Column({ ...id(), - comment: 'The group ID.' + comment: 'The group ID.', }) public userGroupId: UserGroup['id']; @ManyToOne(type => UserGroup, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public userGroup: UserGroup | null; diff --git a/packages/backend/src/models/entities/user-group.ts b/packages/backend/src/models/entities/user-group.ts index f4bac03223..1fdb60c40d 100644 --- a/packages/backend/src/models/entities/user-group.ts +++ b/packages/backend/src/models/entities/user-group.ts @@ -9,7 +9,7 @@ export class UserGroup { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the UserGroup.' + comment: 'The created date of the UserGroup.', }) public createdAt: Date; @@ -21,12 +21,12 @@ export class UserGroup { @Index() @Column({ ...id(), - comment: 'The ID of owner.' + comment: 'The ID of owner.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; diff --git a/packages/backend/src/models/entities/user-keypair.ts b/packages/backend/src/models/entities/user-keypair.ts index 603321d758..48bff0d104 100644 --- a/packages/backend/src/models/entities/user-keypair.ts +++ b/packages/backend/src/models/entities/user-keypair.ts @@ -8,7 +8,7 @@ export class UserKeypair { public userId: User['id']; @OneToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; diff --git a/packages/backend/src/models/entities/user-list-joining.ts b/packages/backend/src/models/entities/user-list-joining.ts index bb7dc40b95..2efa017527 100644 --- a/packages/backend/src/models/entities/user-list-joining.ts +++ b/packages/backend/src/models/entities/user-list-joining.ts @@ -10,19 +10,19 @@ export class UserListJoining { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the UserListJoining.' + comment: 'The created date of the UserListJoining.', }) public createdAt: Date; @Index() @Column({ ...id(), - comment: 'The user ID.' + comment: 'The user ID.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -30,12 +30,12 @@ export class UserListJoining { @Index() @Column({ ...id(), - comment: 'The list ID.' + comment: 'The list ID.', }) public userListId: UserList['id']; @ManyToOne(type => UserList, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public userList: UserList | null; diff --git a/packages/backend/src/models/entities/user-list.ts b/packages/backend/src/models/entities/user-list.ts index 35a83ef8c3..c2896a1dbe 100644 --- a/packages/backend/src/models/entities/user-list.ts +++ b/packages/backend/src/models/entities/user-list.ts @@ -8,26 +8,26 @@ export class UserList { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the UserList.' + comment: 'The created date of the UserList.', }) public createdAt: Date; @Index() @Column({ ...id(), - comment: 'The owner ID.' + comment: 'The owner ID.', }) public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @Column('varchar', { length: 128, - comment: 'The name of the UserList.' + comment: 'The name of the UserList.', }) public name: string; } diff --git a/packages/backend/src/models/entities/user-note-pining.ts b/packages/backend/src/models/entities/user-note-pining.ts index 04a6f8f645..b91e02c5cb 100644 --- a/packages/backend/src/models/entities/user-note-pining.ts +++ b/packages/backend/src/models/entities/user-note-pining.ts @@ -10,7 +10,7 @@ export class UserNotePining { public id: string; @Column('timestamp with time zone', { - comment: 'The created date of the UserNotePinings.' + comment: 'The created date of the UserNotePinings.', }) public createdAt: Date; @@ -19,7 +19,7 @@ export class UserNotePining { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -28,7 +28,7 @@ export class UserNotePining { public noteId: Note['id']; @ManyToOne(type => Note, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public note: Note | null; diff --git a/packages/backend/src/models/entities/user-profile.ts b/packages/backend/src/models/entities/user-profile.ts index 60e16820f4..eb8cdadd19 100644 --- a/packages/backend/src/models/entities/user-profile.ts +++ b/packages/backend/src/models/entities/user-profile.ts @@ -12,26 +12,26 @@ export class UserProfile { public userId: User['id']; @OneToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @Column('varchar', { length: 128, nullable: true, - comment: 'The location of the User.' + comment: 'The location of the User.', }) public location: string | null; @Column('char', { length: 10, nullable: true, - comment: 'The birthday (YYYY-MM-DD) of the User.' + comment: 'The birthday (YYYY-MM-DD) of the User.', }) public birthday: string | null; @Column('varchar', { length: 2048, nullable: true, - comment: 'The description (bio) of the User.' + comment: 'The description (bio) of the User.', }) public description: string | null; @@ -50,13 +50,13 @@ export class UserProfile { @Column('varchar', { length: 512, nullable: true, - comment: 'Remote URL of the user.' + comment: 'Remote URL of the user.', }) public url: string | null; @Column('varchar', { length: 128, nullable: true, - comment: 'The email address of the User.' + comment: 'The email address of the User.', }) public email: string | null; @@ -71,7 +71,7 @@ export class UserProfile { public emailVerified: boolean; @Column('jsonb', { - default: ['follow', 'receiveFollowRequest', 'groupInvited'] + default: ['follow', 'receiveFollowRequest', 'groupInvited'], }) public emailNotificationTypes: string[]; @@ -113,20 +113,20 @@ export class UserProfile { @Column('varchar', { length: 128, nullable: true, - comment: 'The password hash of the User. It will be null if the origin of the user is local.' + comment: 'The password hash of the User. It will be null if the origin of the user is local.', }) public password: string | null; // TODO: そのうち消す @Column('jsonb', { default: {}, - comment: 'The client-specific data of the User.' + comment: 'The client-specific data of the User.', }) public clientData: Record; @Column('jsonb', { default: {}, - comment: 'The room data of the User.' + comment: 'The room data of the User.', }) public room: Record; @@ -137,7 +137,7 @@ export class UserProfile { @Column('boolean', { default: false, - comment: 'Whether reject index by crawler.' + comment: 'Whether reject index by crawler.', }) public noCrawle: boolean; @@ -163,18 +163,18 @@ export class UserProfile { @Column({ ...id(), - nullable: true + nullable: true, }) public pinnedPageId: Page['id'] | null; @OneToOne(type => Page, { - onDelete: 'SET NULL' + onDelete: 'SET NULL', }) @JoinColumn() public pinnedPage: Page | null; @Column('jsonb', { - default: {} + default: {}, }) public integrations: Record; @@ -185,12 +185,12 @@ export class UserProfile { public enableWordMute: boolean; @Column('jsonb', { - default: [] + default: [], }) public mutedWords: string[][]; @Column('jsonb', { - default: [] + default: [], }) public mutedInstances: string[]; @@ -205,7 +205,7 @@ export class UserProfile { @Index() @Column('varchar', { length: 128, nullable: true, - comment: '[Denormalized]' + comment: '[Denormalized]', }) public userHost: string | null; //#endregion diff --git a/packages/backend/src/models/entities/user-publickey.ts b/packages/backend/src/models/entities/user-publickey.ts index 21edc3e9e2..128e13510c 100644 --- a/packages/backend/src/models/entities/user-publickey.ts +++ b/packages/backend/src/models/entities/user-publickey.ts @@ -8,7 +8,7 @@ export class UserPublickey { public userId: User['id']; @OneToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; diff --git a/packages/backend/src/models/entities/user-security-key.ts b/packages/backend/src/models/entities/user-security-key.ts index d54c728e53..e7b63fb825 100644 --- a/packages/backend/src/models/entities/user-security-key.ts +++ b/packages/backend/src/models/entities/user-security-key.ts @@ -5,7 +5,7 @@ import { id } from '../id'; @Entity() export class UserSecurityKey { @PrimaryColumn('varchar', { - comment: 'Variable-length id given to navigator.credentials.get()' + comment: 'Variable-length id given to navigator.credentials.get()', }) public id: string; @@ -14,7 +14,7 @@ export class UserSecurityKey { public userId: User['id']; @ManyToOne(type => User, { - onDelete: 'CASCADE' + onDelete: 'CASCADE', }) @JoinColumn() public user: User | null; @@ -22,19 +22,19 @@ export class UserSecurityKey { @Index() @Column('varchar', { comment: - 'Variable-length public key used to verify attestations (hex-encoded).' + 'Variable-length public key used to verify attestations (hex-encoded).', }) public publicKey: string; @Column('timestamp with time zone', { comment: - 'The date of the last time the UserSecurityKey was successfully validated.' + 'The date of the last time the UserSecurityKey was successfully validated.', }) public lastUsed: Date; @Column('varchar', { comment: 'User-defined name for this key', - length: 30 + length: 30, }) public name: string; diff --git a/packages/backend/src/models/entities/user.ts b/packages/backend/src/models/entities/user.ts index 65aebd2d1a..0aa01ba00a 100644 --- a/packages/backend/src/models/entities/user.ts +++ b/packages/backend/src/models/entities/user.ts @@ -10,25 +10,25 @@ export class User { @Index() @Column('timestamp with time zone', { - comment: 'The created date of the User.' + comment: 'The created date of the User.', }) public createdAt: Date; @Index() @Column('timestamp with time zone', { nullable: true, - comment: 'The updated date of the User.' + comment: 'The updated date of the User.', }) public updatedAt: Date | null; @Column('timestamp with time zone', { - nullable: true + nullable: true, }) public lastFetchedAt: Date | null; @Index() @Column('timestamp with time zone', { - nullable: true + nullable: true, }) public lastActiveDate: Date | null; @@ -39,50 +39,50 @@ export class User { @Column('varchar', { length: 128, - comment: 'The username of the User.' + comment: 'The username of the User.', }) public username: string; @Index() @Column('varchar', { length: 128, select: false, - comment: 'The username (lowercased) of the User.' + comment: 'The username (lowercased) of the User.', }) public usernameLower: string; @Column('varchar', { length: 128, nullable: true, - comment: 'The name of the User.' + comment: 'The name of the User.', }) public name: string | null; @Column('integer', { default: 0, - comment: 'The count of followers.' + comment: 'The count of followers.', }) public followersCount: number; @Column('integer', { default: 0, - comment: 'The count of following.' + comment: 'The count of following.', }) public followingCount: number; @Column('integer', { default: 0, - comment: 'The count of notes.' + comment: 'The count of notes.', }) public notesCount: number; @Column({ ...id(), nullable: true, - comment: 'The ID of avatar DriveFile.' + comment: 'The ID of avatar DriveFile.', }) public avatarId: DriveFile['id'] | null; @OneToOne(type => DriveFile, { - onDelete: 'SET NULL' + onDelete: 'SET NULL', }) @JoinColumn() public avatar: DriveFile | null; @@ -90,19 +90,19 @@ export class User { @Column({ ...id(), nullable: true, - comment: 'The ID of banner DriveFile.' + comment: 'The ID of banner DriveFile.', }) public bannerId: DriveFile['id'] | null; @OneToOne(type => DriveFile, { - onDelete: 'SET NULL' + onDelete: 'SET NULL', }) @JoinColumn() public banner: DriveFile | null; @Index() @Column('varchar', { - length: 128, array: true, default: '{}' + length: 128, array: true, default: '{}', }) public tags: string[]; @@ -128,107 +128,107 @@ export class User { @Column('boolean', { default: false, - comment: 'Whether the User is suspended.' + comment: 'Whether the User is suspended.', }) public isSuspended: boolean; @Column('boolean', { default: false, - comment: 'Whether the User is silenced.' + comment: 'Whether the User is silenced.', }) public isSilenced: boolean; @Column('boolean', { default: false, - comment: 'Whether the User is locked.' + comment: 'Whether the User is locked.', }) public isLocked: boolean; @Column('boolean', { default: false, - comment: 'Whether the User is a bot.' + comment: 'Whether the User is a bot.', }) public isBot: boolean; @Column('boolean', { default: false, - comment: 'Whether the User is a cat.' + comment: 'Whether the User is a cat.', }) public isCat: boolean; @Column('boolean', { default: false, - comment: 'Whether the User is the admin.' + comment: 'Whether the User is the admin.', }) public isAdmin: boolean; @Column('boolean', { default: false, - comment: 'Whether the User is a moderator.' + comment: 'Whether the User is a moderator.', }) public isModerator: boolean; @Index() @Column('boolean', { default: true, - comment: 'Whether the User is explorable.' + comment: 'Whether the User is explorable.', }) public isExplorable: boolean; // アカウントが削除されたかどうかのフラグだが、完全に削除される際は物理削除なので実質削除されるまでの「削除が進行しているかどうか」のフラグ @Column('boolean', { default: false, - comment: 'Whether the User is deleted.' + comment: 'Whether the User is deleted.', }) public isDeleted: boolean; @Column('varchar', { - length: 128, array: true, default: '{}' + length: 128, array: true, default: '{}', }) public emojis: string[]; @Index() @Column('varchar', { length: 128, nullable: true, - comment: 'The host of the User. It will be null if the origin of the user is local.' + comment: 'The host of the User. It will be null if the origin of the user is local.', }) public host: string | null; @Column('varchar', { length: 512, nullable: true, - comment: 'The inbox URL of the User. It will be null if the origin of the user is local.' + comment: 'The inbox URL of the User. It will be null if the origin of the user is local.', }) public inbox: string | null; @Column('varchar', { length: 512, nullable: true, - comment: 'The sharedInbox URL of the User. It will be null if the origin of the user is local.' + comment: 'The sharedInbox URL of the User. It will be null if the origin of the user is local.', }) public sharedInbox: string | null; @Column('varchar', { length: 512, nullable: true, - comment: 'The featured URL of the User. It will be null if the origin of the user is local.' + comment: 'The featured URL of the User. It will be null if the origin of the user is local.', }) public featured: string | null; @Index() @Column('varchar', { length: 512, nullable: true, - comment: 'The URI of the User. It will be null if the origin of the user is local.' + comment: 'The URI of the User. It will be null if the origin of the user is local.', }) public uri: string | null; @Column('varchar', { length: 512, nullable: true, - comment: 'The URI of the user Follower Collection. It will be null if the origin of the user is local.' + comment: 'The URI of the user Follower Collection. It will be null if the origin of the user is local.', }) public followersUri: string | null; @Index({ unique: true }) @Column('char', { length: 16, nullable: true, unique: true, - comment: 'The native access token of the User. It will be null if the origin of the user is local.' + comment: 'The native access token of the User. It will be null if the origin of the user is local.', }) public token: string | null; diff --git a/packages/backend/src/models/id.ts b/packages/backend/src/models/id.ts index cdb8259073..d614fc5048 100644 --- a/packages/backend/src/models/id.ts +++ b/packages/backend/src/models/id.ts @@ -1,4 +1,4 @@ export const id = () => ({ type: 'varchar' as const, - length: 32 + length: 32, }); diff --git a/packages/backend/src/models/repositories/abuse-user-report.ts b/packages/backend/src/models/repositories/abuse-user-report.ts index 039a9924d2..5e267b3c2b 100644 --- a/packages/backend/src/models/repositories/abuse-user-report.ts +++ b/packages/backend/src/models/repositories/abuse-user-report.ts @@ -19,13 +19,13 @@ export class AbuseUserReportRepository extends Repository { targetUserId: report.targetUserId, assigneeId: report.assigneeId, reporter: Users.pack(report.reporter || report.reporterId, null, { - detail: true + detail: true, }), targetUser: Users.pack(report.targetUser || report.targetUserId, null, { - detail: true + detail: true, }), assignee: report.assigneeId ? Users.pack(report.assignee || report.assigneeId, null, { - detail: true + detail: true, }) : null, }); } diff --git a/packages/backend/src/models/repositories/antenna.ts b/packages/backend/src/models/repositories/antenna.ts index 657de55581..548f44f1b7 100644 --- a/packages/backend/src/models/repositories/antenna.ts +++ b/packages/backend/src/models/repositories/antenna.ts @@ -27,7 +27,7 @@ export class AntennaRepository extends Repository { notify: antenna.notify, withReplies: antenna.withReplies, withFile: antenna.withFile, - hasUnreadNote + hasUnreadNote, }; } } @@ -39,16 +39,16 @@ export const packedAntennaSchema = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, createdAt: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'date-time' + format: 'date-time', }, name: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, keywords: { type: 'array' as const, @@ -58,9 +58,9 @@ export const packedAntennaSchema = { optional: false as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const - } - } + optional: false as const, nullable: false as const, + }, + }, }, excludeKeywords: { type: 'array' as const, @@ -70,55 +70,55 @@ export const packedAntennaSchema = { optional: false as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const - } - } + optional: false as const, nullable: false as const, + }, + }, }, src: { type: 'string' as const, optional: false as const, nullable: false as const, - enum: ['home', 'all', 'users', 'list', 'group'] + enum: ['home', 'all', 'users', 'list', 'group'], }, userListId: { type: 'string' as const, optional: false as const, nullable: true as const, - format: 'id' + format: 'id', }, userGroupId: { type: 'string' as const, optional: false as const, nullable: true as const, - format: 'id' + format: 'id', }, users: { type: 'array' as const, optional: false as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const - } + optional: false as const, nullable: false as const, + }, }, caseSensitive: { type: 'boolean' as const, optional: false as const, nullable: false as const, - default: false + default: false, }, notify: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, withReplies: { type: 'boolean' as const, optional: false as const, nullable: false as const, - default: false + default: false, }, withFile: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, hasUnreadNote: { type: 'boolean' as const, optional: false as const, nullable: false as const, - default: false - } + default: false, + }, }, }; diff --git a/packages/backend/src/models/repositories/app.ts b/packages/backend/src/models/repositories/app.ts index 0226edad11..bec0765ac2 100644 --- a/packages/backend/src/models/repositories/app.ts +++ b/packages/backend/src/models/repositories/app.ts @@ -18,7 +18,7 @@ export class AppRepository extends Repository { const opts = Object.assign({ detail: false, includeSecret: false, - includeProfileImageIds: false + includeProfileImageIds: false, }, options); const app = typeof src === 'object' ? src : await this.findOneOrFail(src); @@ -33,8 +33,8 @@ export class AppRepository extends Repository { isAuthorized: await AccessTokens.count({ appId: app.id, userId: me, - }).then(count => count > 0) - } : {}) + }).then(count => count > 0), + } : {}), }; } } @@ -45,31 +45,31 @@ export const packedAppSchema = { properties: { id: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, name: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, callbackUrl: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, permission: { type: 'array' as const, optional: false as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const - } + optional: false as const, nullable: false as const, + }, }, secret: { type: 'string' as const, - optional: true as const, nullable: false as const + optional: true as const, nullable: false as const, }, isAuthorized: { type: 'boolean' as const, - optional: true as const, nullable: false as const - } - } + optional: true as const, nullable: false as const, + }, + }, }; diff --git a/packages/backend/src/models/repositories/auth-session.ts b/packages/backend/src/models/repositories/auth-session.ts index c8f4c10f2a..6308909c41 100644 --- a/packages/backend/src/models/repositories/auth-session.ts +++ b/packages/backend/src/models/repositories/auth-session.ts @@ -15,7 +15,7 @@ export class AuthSessionRepository extends Repository { return await awaitAll({ id: session.id, app: Apps.pack(session.appId, me), - token: session.token + token: session.token, }); } } diff --git a/packages/backend/src/models/repositories/blocking.ts b/packages/backend/src/models/repositories/blocking.ts index ac60c9a4ce..a6895eabf4 100644 --- a/packages/backend/src/models/repositories/blocking.ts +++ b/packages/backend/src/models/repositories/blocking.ts @@ -18,8 +18,8 @@ export class BlockingRepository extends Repository { createdAt: blocking.createdAt.toISOString(), blockeeId: blocking.blockeeId, blockee: Users.pack(blocking.blockeeId, me, { - detail: true - }) + detail: true, + }), }); } @@ -56,5 +56,5 @@ export const packedBlockingSchema = { optional: false as const, nullable: false as const, ref: 'User' as const, }, - } + }, }; diff --git a/packages/backend/src/models/repositories/channel.ts b/packages/backend/src/models/repositories/channel.ts index 5c7d095473..0a6b02f495 100644 --- a/packages/backend/src/models/repositories/channel.ts +++ b/packages/backend/src/models/repositories/channel.ts @@ -36,7 +36,7 @@ export class ChannelRepository extends Repository { ...(me ? { isFollowing: following != null, hasUnreadNote, - } : {}) + } : {}), }; } } diff --git a/packages/backend/src/models/repositories/drive-file.ts b/packages/backend/src/models/repositories/drive-file.ts index f2f0308dc0..79b890aa6e 100644 --- a/packages/backend/src/models/repositories/drive-file.ts +++ b/packages/backend/src/models/repositories/drive-file.ts @@ -46,7 +46,7 @@ export class DriveFileRepository extends Repository { if (file.uri != null && file.userHost != null && config.mediaProxy != null) { return appendQuery(config.mediaProxy, query({ url: file.uri, - thumbnail: thumbnail ? '1' : undefined + thumbnail: thumbnail ? '1' : undefined, })); } @@ -118,7 +118,7 @@ export class DriveFileRepository extends Repository { ): Promise | null> { const opts = Object.assign({ detail: false, - self: false + self: false, }, options); const file = typeof src === 'object' ? src : await this.findOne(src); @@ -141,10 +141,10 @@ export class DriveFileRepository extends Repository { comment: file.comment, folderId: file.folderId, folder: opts.detail && file.folderId ? DriveFolders.pack(file.folderId, { - detail: true + detail: true, }) : null, userId: opts.withUser ? file.userId : null, - user: (opts.withUser && file.userId) ? Users.pack(file.userId) : null + user: (opts.withUser && file.userId) ? Users.pack(file.userId) : null, }); } @@ -175,23 +175,23 @@ export const packedDriveFileSchema = { name: { type: 'string' as const, optional: false as const, nullable: false as const, - example: 'lenna.jpg' + example: 'lenna.jpg', }, type: { type: 'string' as const, optional: false as const, nullable: false as const, - example: 'image/jpeg' + example: 'image/jpeg', }, md5: { type: 'string' as const, optional: false as const, nullable: false as const, format: 'md5', - example: '15eca7fba0480996e2245f5185bf39f2' + example: '15eca7fba0480996e2245f5185bf39f2', }, size: { type: 'number' as const, optional: false as const, nullable: false as const, - example: 51469 + example: 51469, }, isSensitive: { type: 'boolean' as const, @@ -199,7 +199,7 @@ export const packedDriveFileSchema = { }, blurhash: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, properties: { type: 'object' as const, @@ -208,24 +208,24 @@ export const packedDriveFileSchema = { width: { type: 'number' as const, optional: true as const, nullable: false as const, - example: 1280 + example: 1280, }, height: { type: 'number' as const, optional: true as const, nullable: false as const, - example: 720 + example: 720, }, orientation: { type: 'number' as const, optional: true as const, nullable: false as const, - example: 8 + example: 8, }, avgColor: { type: 'string' as const, optional: true as const, nullable: false as const, - example: 'rgb(40,65,87)' - } - } + example: 'rgb(40,65,87)', + }, + }, }, url: { type: 'string' as const, @@ -239,7 +239,7 @@ export const packedDriveFileSchema = { }, comment: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, folderId: { type: 'string' as const, @@ -262,6 +262,6 @@ export const packedDriveFileSchema = { type: 'object' as const, optional: true as const, nullable: true as const, ref: 'User' as const, - } + }, }, }; diff --git a/packages/backend/src/models/repositories/drive-folder.ts b/packages/backend/src/models/repositories/drive-folder.ts index 8ef6f01b5d..4ee4a68e08 100644 --- a/packages/backend/src/models/repositories/drive-folder.ts +++ b/packages/backend/src/models/repositories/drive-folder.ts @@ -20,7 +20,7 @@ export class DriveFolderRepository extends Repository { } ): Promise> { const opts = Object.assign({ - detail: false + detail: false, }, options); const folder = typeof src === 'object' ? src : await this.findOneOrFail(src); @@ -33,18 +33,18 @@ export class DriveFolderRepository extends Repository { ...(opts.detail ? { foldersCount: DriveFolders.count({ - parentId: folder.id + parentId: folder.id, }), filesCount: DriveFiles.count({ - folderId: folder.id + folderId: folder.id, }), ...(folder.parentId ? { parent: this.pack(folder.parentId, { - detail: true - }) - } : {}) - } : {}) + detail: true, + }), + } : {}), + } : {}), }); } } diff --git a/packages/backend/src/models/repositories/emoji.ts b/packages/backend/src/models/repositories/emoji.ts index 7985c27aba..b7529595a9 100644 --- a/packages/backend/src/models/repositories/emoji.ts +++ b/packages/backend/src/models/repositories/emoji.ts @@ -61,5 +61,5 @@ export const packedEmojiSchema = { type: 'string' as const, optional: false as const, nullable: false as const, }, - } + }, }; diff --git a/packages/backend/src/models/repositories/federation-instance.ts b/packages/backend/src/models/repositories/federation-instance.ts index 4b70971ecf..90dbbaab1c 100644 --- a/packages/backend/src/models/repositories/federation-instance.ts +++ b/packages/backend/src/models/repositories/federation-instance.ts @@ -7,100 +7,100 @@ export const packedFederationInstanceSchema = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, caughtAt: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'date-time' + format: 'date-time', }, host: { type: 'string' as const, optional: false as const, nullable: false as const, - example: 'misskey.example.com' + example: 'misskey.example.com', }, usersCount: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, notesCount: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, followingCount: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, followersCount: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, driveUsage: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, driveFiles: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, latestRequestSentAt: { type: 'string' as const, optional: false as const, nullable: true as const, - format: 'date-time' + format: 'date-time', }, lastCommunicatedAt: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'date-time' + format: 'date-time', }, isNotResponding: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isSuspended: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, softwareName: { type: 'string' as const, optional: false as const, nullable: true as const, - example: 'misskey' + example: 'misskey', }, softwareVersion: { type: 'string' as const, optional: false as const, nullable: true as const, - example: config.version + example: config.version, }, openRegistrations: { type: 'boolean' as const, optional: false as const, nullable: true as const, - example: true + example: true, }, name: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, description: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, maintainerName: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, maintainerEmail: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, iconUrl: { type: 'string' as const, optional: false as const, nullable: true as const, - format: 'url' + format: 'url', }, infoUpdatedAt: { type: 'string' as const, optional: false as const, nullable: true as const, - format: 'date-time' - } - } + format: 'date-time', + }, + }, }; diff --git a/packages/backend/src/models/repositories/following.ts b/packages/backend/src/models/repositories/following.ts index b1f716069f..1dfaaf908a 100644 --- a/packages/backend/src/models/repositories/following.ts +++ b/packages/backend/src/models/repositories/following.ts @@ -65,10 +65,10 @@ export class FollowingRepository extends Repository { followeeId: following.followeeId, followerId: following.followerId, followee: opts.populateFollowee ? Users.pack(following.followee || following.followeeId, me, { - detail: true + detail: true, }) : undefined, follower: opts.populateFollower ? Users.pack(following.follower || following.followerId, me, { - detail: true + detail: true, }) : undefined, }); } @@ -120,5 +120,5 @@ export const packedFollowingSchema = { optional: true as const, nullable: false as const, ref: 'User' as const, }, - } + }, }; diff --git a/packages/backend/src/models/repositories/gallery-post.ts b/packages/backend/src/models/repositories/gallery-post.ts index 4f666ff252..6d37e3120e 100644 --- a/packages/backend/src/models/repositories/gallery-post.ts +++ b/packages/backend/src/models/repositories/gallery-post.ts @@ -83,8 +83,8 @@ export const packedGalleryPostSchema = { items: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' - } + format: 'id', + }, }, files: { type: 'array' as const, @@ -93,7 +93,7 @@ export const packedGalleryPostSchema = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'DriveFile' as const, - } + }, }, tags: { type: 'array' as const, @@ -101,11 +101,11 @@ export const packedGalleryPostSchema = { items: { type: 'string' as const, optional: false as const, nullable: false as const, - } + }, }, isSensitive: { type: 'boolean' as const, optional: false as const, nullable: false as const, }, - } + }, }; diff --git a/packages/backend/src/models/repositories/games/reversi/game.ts b/packages/backend/src/models/repositories/games/reversi/game.ts index 9adb386fa9..a9e0496760 100644 --- a/packages/backend/src/models/repositories/games/reversi/game.ts +++ b/packages/backend/src/models/repositories/games/reversi/game.ts @@ -14,7 +14,7 @@ export class ReversiGameRepository extends Repository { } ): Promise> { const opts = Object.assign({ - detail: true + detail: true, }, options); const game = typeof src === 'object' ? src : await this.findOneOrFail(src); @@ -45,10 +45,10 @@ export class ReversiGameRepository extends Repository { logs: game.logs.map(log => ({ at: log.at.toISOString(), color: log.color, - pos: log.pos + pos: log.pos, })), map: game.map, - } : {}) + } : {}), }; } } @@ -176,8 +176,8 @@ export const packedReversiGameSchema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } - } + }, + }, }, map: { type: 'array' as const, @@ -185,7 +185,7 @@ export const packedReversiGameSchema = { items: { type: 'string' as const, optional: false as const, nullable: false as const, - } - } - } + }, + }, + }, }; diff --git a/packages/backend/src/models/repositories/games/reversi/matching.ts b/packages/backend/src/models/repositories/games/reversi/matching.ts index b4515800df..b55f598068 100644 --- a/packages/backend/src/models/repositories/games/reversi/matching.ts +++ b/packages/backend/src/models/repositories/games/reversi/matching.ts @@ -18,12 +18,12 @@ export class ReversiMatchingRepository extends Repository { createdAt: matching.createdAt.toISOString(), parentId: matching.parentId, parent: Users.pack(matching.parentId, me, { - detail: true + detail: true, }), childId: matching.childId, child: Users.pack(matching.childId, me, { - detail: true - }) + detail: true, + }), }); } } @@ -65,5 +65,5 @@ export const packedReversiMatchingSchema = { optional: false as const, nullable: false as const, ref: 'User' as const, }, - } + }, }; diff --git a/packages/backend/src/models/repositories/hashtag.ts b/packages/backend/src/models/repositories/hashtag.ts index d52f6ba7c6..6e513c7ebb 100644 --- a/packages/backend/src/models/repositories/hashtag.ts +++ b/packages/backend/src/models/repositories/hashtag.ts @@ -58,5 +58,5 @@ export const packedHashtagSchema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } + }, }; diff --git a/packages/backend/src/models/repositories/messaging-message.ts b/packages/backend/src/models/repositories/messaging-message.ts index abdff63689..1b2dd3a246 100644 --- a/packages/backend/src/models/repositories/messaging-message.ts +++ b/packages/backend/src/models/repositories/messaging-message.ts @@ -112,8 +112,8 @@ export const packedMessagingMessageSchema = { items: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' - } + format: 'id', + }, }, }, }; diff --git a/packages/backend/src/models/repositories/moderation-logs.ts b/packages/backend/src/models/repositories/moderation-logs.ts index c7df3afdc9..1585d5bfcf 100644 --- a/packages/backend/src/models/repositories/moderation-logs.ts +++ b/packages/backend/src/models/repositories/moderation-logs.ts @@ -17,7 +17,7 @@ export class ModerationLogRepository extends Repository { info: log.info, userId: log.userId, user: Users.pack(log.user || log.userId, null, { - detail: true + detail: true, }), }); } diff --git a/packages/backend/src/models/repositories/muting.ts b/packages/backend/src/models/repositories/muting.ts index 869afd3c4e..b82d1f0daa 100644 --- a/packages/backend/src/models/repositories/muting.ts +++ b/packages/backend/src/models/repositories/muting.ts @@ -18,8 +18,8 @@ export class MutingRepository extends Repository { createdAt: muting.createdAt.toISOString(), muteeId: muting.muteeId, mutee: Users.pack(muting.muteeId, me, { - detail: true - }) + detail: true, + }), }); } @@ -56,5 +56,5 @@ export const packedMutingSchema = { optional: false as const, nullable: false as const, ref: 'User' as const, }, - } + }, }; diff --git a/packages/backend/src/models/repositories/note-reaction.ts b/packages/backend/src/models/repositories/note-reaction.ts index 5d86065526..dfb25cbea1 100644 --- a/packages/backend/src/models/repositories/note-reaction.ts +++ b/packages/backend/src/models/repositories/note-reaction.ts @@ -27,7 +27,7 @@ export class NoteReactionRepository extends Repository { type: convertLegacyReaction(reaction.reaction), ...(opts.withNote ? { note: await Notes.pack(reaction.noteId, me), - } : {}) + } : {}), }; } } diff --git a/packages/backend/src/models/repositories/note.ts b/packages/backend/src/models/repositories/note.ts index c076cb31e8..96dfad70e9 100644 --- a/packages/backend/src/models/repositories/note.ts +++ b/packages/backend/src/models/repositories/note.ts @@ -51,7 +51,7 @@ export class NoteRepository extends Repository { // フォロワーかどうか const following = await Followings.findOne({ followeeId: note.userId, - followerId: meId + followerId: meId, }); if (following == null) { @@ -103,7 +103,7 @@ export class NoteRepository extends Repository { // フォロワーかどうか const following = await Followings.findOne({ followeeId: packedNote.userId, - followerId: meId + followerId: meId, }); if (following == null) { @@ -138,7 +138,7 @@ export class NoteRepository extends Repository { ): Promise> { const opts = Object.assign({ detail: true, - skipHide: false + skipHide: false, }, options); const meId = me ? me.id : null; @@ -150,13 +150,13 @@ export class NoteRepository extends Repository { const choices = poll.choices.map(c => ({ text: c, votes: poll.votes[poll.choices.indexOf(c)], - isVoted: false + isVoted: false, })); if (poll.multiple) { const votes = await PollVotes.find({ userId: meId!, - noteId: note.id + noteId: note.id, }); const myChoices = votes.map(v => v.choice); @@ -166,7 +166,7 @@ export class NoteRepository extends Repository { } else { const vote = await PollVotes.findOne({ userId: meId!, - noteId: note.id + noteId: note.id, }); if (vote) { @@ -177,7 +177,7 @@ export class NoteRepository extends Repository { return { multiple: poll.multiple, expiresAt: poll.expiresAt, - choices + choices, }; } @@ -251,20 +251,20 @@ export class NoteRepository extends Repository { ...(opts.detail ? { reply: note.replyId ? this.pack(note.reply || note.replyId, me, { detail: false, - _hint_: options?._hint_ + _hint_: options?._hint_, }) : undefined, renote: note.renoteId ? this.pack(note.renote || note.renoteId, me, { detail: true, - _hint_: options?._hint_ + _hint_: options?._hint_, }) : undefined, poll: note.hasPoll ? populatePoll() : undefined, ...(meId ? { - myReaction: populateMyReaction() - } : {}) - } : {}) + myReaction: populateMyReaction(), + } : {}), + } : {}), }); if (packed.user.isCat && packed.text) { @@ -315,8 +315,8 @@ export class NoteRepository extends Repository { return await Promise.all(notes.map(n => this.pack(n, me, { ...options, _hint_: { - myReactions: myReactionsMap - } + myReactions: myReactionsMap, + }, }))); } } @@ -390,8 +390,8 @@ export const packedNoteSchema = { items: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' - } + format: 'id', + }, }, visibleUserIds: { type: 'array' as const, @@ -399,8 +399,8 @@ export const packedNoteSchema = { items: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' - } + format: 'id', + }, }, fileIds: { type: 'array' as const, @@ -408,8 +408,8 @@ export const packedNoteSchema = { items: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' - } + format: 'id', + }, }, files: { type: 'array' as const, @@ -418,7 +418,7 @@ export const packedNoteSchema = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'DriveFile' as const, - } + }, }, tags: { type: 'array' as const, @@ -426,7 +426,7 @@ export const packedNoteSchema = { items: { type: 'string' as const, optional: false as const, nullable: false as const, - } + }, }, poll: { type: 'object' as const, diff --git a/packages/backend/src/models/repositories/notification.ts b/packages/backend/src/models/repositories/notification.ts index d1cf9b087e..47d569ed21 100644 --- a/packages/backend/src/models/repositories/notification.ts +++ b/packages/backend/src/models/repositories/notification.ts @@ -32,40 +32,40 @@ export class NotificationRepository extends Repository { ...(notification.type === 'mention' ? { note: Notes.pack(notification.note || notification.noteId!, { id: notification.notifieeId }, { detail: true, - _hint_: options._hintForEachNotes_ + _hint_: options._hintForEachNotes_, }), } : {}), ...(notification.type === 'reply' ? { note: Notes.pack(notification.note || notification.noteId!, { id: notification.notifieeId }, { detail: true, - _hint_: options._hintForEachNotes_ + _hint_: options._hintForEachNotes_, }), } : {}), ...(notification.type === 'renote' ? { note: Notes.pack(notification.note || notification.noteId!, { id: notification.notifieeId }, { detail: true, - _hint_: options._hintForEachNotes_ + _hint_: options._hintForEachNotes_, }), } : {}), ...(notification.type === 'quote' ? { note: Notes.pack(notification.note || notification.noteId!, { id: notification.notifieeId }, { detail: true, - _hint_: options._hintForEachNotes_ + _hint_: options._hintForEachNotes_, }), } : {}), ...(notification.type === 'reaction' ? { note: Notes.pack(notification.note || notification.noteId!, { id: notification.notifieeId }, { detail: true, - _hint_: options._hintForEachNotes_ + _hint_: options._hintForEachNotes_, }), - reaction: notification.reaction + reaction: notification.reaction, } : {}), ...(notification.type === 'pollVote' ? { note: Notes.pack(notification.note || notification.noteId!, { id: notification.notifieeId }, { detail: true, - _hint_: options._hintForEachNotes_ + _hint_: options._hintForEachNotes_, }), - choice: notification.choice + choice: notification.choice, } : {}), ...(notification.type === 'groupInvited' ? { invitation: UserGroupInvitations.pack(notification.userGroupInvitationId!), @@ -102,8 +102,8 @@ export class NotificationRepository extends Repository { return await Promise.all(notifications.map(x => this.pack(x, { _hintForEachNotes_: { - myReactions: myReactionsMap - } + myReactions: myReactionsMap, + }, }))); } } @@ -171,5 +171,5 @@ export const packedNotificationSchema = { type: 'string' as const, optional: true as const, nullable: true as const, }, - } + }, }; diff --git a/packages/backend/src/models/repositories/page.ts b/packages/backend/src/models/repositories/page.ts index 3a3642d7ec..46b453cad9 100644 --- a/packages/backend/src/models/repositories/page.ts +++ b/packages/backend/src/models/repositories/page.ts @@ -21,7 +21,7 @@ export class PageRepository extends Repository { if (x.type === 'image') { attachedFiles.push(DriveFiles.findOne({ id: x.fileId, - userId: page.userId + userId: page.userId, })); } if (x.children) { @@ -53,7 +53,7 @@ export class PageRepository extends Repository { migrate(page.content); if (migrated) { this.update(page.id, { - content: page.content + content: page.content, }); } @@ -138,5 +138,5 @@ export const packedPageSchema = { ref: 'User' as const, optional: false as const, nullable: false as const, }, - } + }, }; diff --git a/packages/backend/src/models/repositories/queue.ts b/packages/backend/src/models/repositories/queue.ts index 161751ddc8..521c634390 100644 --- a/packages/backend/src/models/repositories/queue.ts +++ b/packages/backend/src/models/repositories/queue.ts @@ -4,27 +4,27 @@ export const packedQueueCountSchema = { properties: { waiting: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, active: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, completed: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, failed: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, delayed: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, paused: { type: 'number' as const, - optional: false as const, nullable: false as const - } - } + optional: false as const, nullable: false as const, + }, + }, }; diff --git a/packages/backend/src/models/repositories/user-group.ts b/packages/backend/src/models/repositories/user-group.ts index b38a2fb50d..02a0348885 100644 --- a/packages/backend/src/models/repositories/user-group.ts +++ b/packages/backend/src/models/repositories/user-group.ts @@ -11,7 +11,7 @@ export class UserGroupRepository extends Repository { const userGroup = typeof src === 'object' ? src : await this.findOneOrFail(src); const users = await UserGroupJoinings.find({ - userGroupId: userGroup.id + userGroupId: userGroup.id, }); return { @@ -19,7 +19,7 @@ export class UserGroupRepository extends Repository { createdAt: userGroup.createdAt.toISOString(), name: userGroup.name, ownerId: userGroup.userId, - userIds: users.map(x => x.userId) + userIds: users.map(x => x.userId), }; } } @@ -55,7 +55,7 @@ export const packedUserGroupSchema = { type: 'string' as const, nullable: false as const, optional: false as const, format: 'id', - } + }, }, }, }; diff --git a/packages/backend/src/models/repositories/user-list.ts b/packages/backend/src/models/repositories/user-list.ts index 331c278e6f..792a17cb49 100644 --- a/packages/backend/src/models/repositories/user-list.ts +++ b/packages/backend/src/models/repositories/user-list.ts @@ -11,14 +11,14 @@ export class UserListRepository extends Repository { const userList = typeof src === 'object' ? src : await this.findOneOrFail(src); const users = await UserListJoinings.find({ - userListId: userList.id + userListId: userList.id, }); return { id: userList.id, createdAt: userList.createdAt.toISOString(), name: userList.name, - userIds: users.map(x => x.userId) + userIds: users.map(x => x.userId), }; } } @@ -49,7 +49,7 @@ export const packedUserListSchema = { type: 'string' as const, nullable: false as const, optional: false as const, format: 'id', - } + }, }, }, }; diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index 2f6c150d39..3dc7c67ec2 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -15,32 +15,32 @@ export class UserRepository extends Repository { const [following1, following2, followReq1, followReq2, toBlocking, fromBlocked, mute] = await Promise.all([ Followings.findOne({ followerId: me, - followeeId: target + followeeId: target, }), Followings.findOne({ followerId: target, - followeeId: me + followeeId: me, }), FollowRequests.findOne({ followerId: me, - followeeId: target + followeeId: target, }), FollowRequests.findOne({ followerId: target, - followeeId: me + followeeId: me, }), Blockings.findOne({ blockerId: me, - blockeeId: target + blockeeId: target, }), Blockings.findOne({ blockerId: target, - blockeeId: me + blockeeId: me, }), Mutings.findOne({ muterId: me, - muteeId: target - }) + muteeId: target, + }), ]); return { @@ -51,13 +51,13 @@ export class UserRepository extends Repository { isFollowed: following2 != null, isBlocking: toBlocking != null, isBlocked: fromBlocked != null, - isMuted: mute != null + isMuted: mute != null, }; } public async getHasUnreadMessagingMessage(userId: User['id']): Promise { const mute = await Mutings.find({ - muterId: userId + muterId: userId, }); const joinings = await UserGroupJoinings.find({ userId: userId }); @@ -76,9 +76,9 @@ export class UserRepository extends Repository { isRead: false, ...(mute.length > 0 ? { userId: Not(In(mute.map(x => x.muteeId))) } : {}), }, - take: 1 + take: 1, }).then(count => count > 0), - groupQs + groupQs, ]); return withUser || withGroups.some(x => x); @@ -86,11 +86,11 @@ export class UserRepository extends Repository { public async getHasUnreadAnnouncement(userId: User['id']): Promise { const reads = await AnnouncementReads.find({ - userId: userId + userId: userId, }); const count = await Announcements.count(reads.length > 0 ? { - id: Not(In(reads.map(read => read.announcementId))) + id: Not(In(reads.map(read => read.announcementId))), } : {}); return count > 0; @@ -101,7 +101,7 @@ export class UserRepository extends Repository { const unread = myAntennas.length > 0 ? await AntennaNotes.findOne({ antennaId: In(myAntennas.map(x => x.id)), - read: false + read: false, }) : null; return unread != null; @@ -120,7 +120,7 @@ export class UserRepository extends Repository { public async getHasUnreadNotification(userId: User['id']): Promise { const mute = await Mutings.find({ - muterId: userId + muterId: userId, }); const mutedUserIds = mute.map(m => m.muteeId); @@ -128,9 +128,9 @@ export class UserRepository extends Repository { where: { notifieeId: userId, ...(mutedUserIds.length > 0 ? { notifierId: Not(In(mutedUserIds)) } : {}), - isRead: false + isRead: false, }, - take: 1 + take: 1, }); return count > 0; @@ -138,7 +138,7 @@ export class UserRepository extends Repository { public async getHasPendingReceivedFollowRequest(userId: User['id']): Promise { const count = await FollowRequests.count({ - followeeId: userId + followeeId: userId, }); return count > 0; @@ -173,7 +173,7 @@ export class UserRepository extends Repository { ): Promise> { const opts = Object.assign({ detail: false, - includeSecrets: false + includeSecrets: false, }, options); const user = typeof src === 'object' ? src : await this.findOneOrFail(src); @@ -245,7 +245,7 @@ export class UserRepository extends Repository { notesCount: user.notesCount, pinnedNoteIds: pins.map(pin => pin.noteId), pinnedNotes: Notes.packMany(pins.map(pin => pin.note!), me, { - detail: true + detail: true, }), pinnedPageId: profile!.pinnedPageId, pinnedPage: profile!.pinnedPageId ? Pages.pack(profile!.pinnedPageId, me) : null, @@ -255,7 +255,7 @@ export class UserRepository extends Repository { usePasswordLessLogin: profile!.usePasswordLessLogin, securityKeys: profile!.twoFactorEnabled ? UserSecurityKeys.count({ - userId: user.id + userId: user.id, }).then(result => result >= 1) : false, } : {}), @@ -274,11 +274,11 @@ export class UserRepository extends Repository { hideOnlineStatus: user.hideOnlineStatus, hasUnreadSpecifiedNotes: NoteUnreads.count({ where: { userId: user.id, isSpecified: true }, - take: 1 + take: 1, }).then(count => count > 0), hasUnreadMentions: NoteUnreads.count({ where: { userId: user.id, isMentioned: true }, - take: 1 + take: 1, }).then(count => count > 0), hasUnreadAnnouncement: this.getHasUnreadAnnouncement(user.id), hasUnreadAntenna: this.getHasUnreadAntenna(user.id), @@ -299,11 +299,11 @@ export class UserRepository extends Repository { securityKeysList: profile!.twoFactorEnabled ? UserSecurityKeys.find({ where: { - userId: user.id + userId: user.id, }, - select: ['id', 'name', 'lastUsed'] + select: ['id', 'name', 'lastUsed'], }) - : [] + : [], } : {}), ...(relation ? { @@ -314,7 +314,7 @@ export class UserRepository extends Repository { isBlocking: relation.isBlocking, isBlocked: relation.isBlocked, isMuted: relation.isMuted, - } : {}) + } : {}), }; return await awaitAll(packed); @@ -366,17 +366,17 @@ export const packedUserSchema = { name: { type: 'string' as const, nullable: true as const, optional: false as const, - example: '藍' + example: '藍', }, username: { type: 'string' as const, nullable: false as const, optional: false as const, - example: 'ai' + example: 'ai', }, host: { type: 'string' as const, nullable: true as const, optional: false as const, - example: 'misskey.example.com' + example: 'misskey.example.com', }, avatarUrl: { type: 'string' as const, @@ -390,17 +390,17 @@ export const packedUserSchema = { avatarColor: { type: 'any' as const, nullable: true as const, optional: false as const, - default: null + default: null, }, isAdmin: { type: 'boolean' as const, nullable: false as const, optional: true as const, - default: false + default: false, }, isModerator: { type: 'boolean' as const, nullable: false as const, optional: true as const, - default: false + default: false, }, isBot: { type: 'boolean' as const, @@ -419,15 +419,15 @@ export const packedUserSchema = { properties: { name: { type: 'string' as const, - nullable: false as const, optional: false as const + nullable: false as const, optional: false as const, }, url: { type: 'string' as const, nullable: false as const, optional: false as const, - format: 'url' + format: 'url', }, - } - } + }, + }, }, url: { type: 'string' as const, @@ -456,7 +456,7 @@ export const packedUserSchema = { bannerColor: { type: 'any' as const, nullable: true as const, optional: true as const, - default: null + default: null, }, isLocked: { type: 'boolean' as const, @@ -465,12 +465,12 @@ export const packedUserSchema = { isSuspended: { type: 'boolean' as const, nullable: false as const, optional: true as const, - example: false + example: false, }, description: { type: 'string' as const, nullable: true as const, optional: true as const, - example: 'Hi masters, I am Ai!' + example: 'Hi masters, I am Ai!', }, location: { type: 'string' as const, @@ -479,7 +479,7 @@ export const packedUserSchema = { birthday: { type: 'string' as const, nullable: true as const, optional: true as const, - example: '2018-03-12' + example: '2018-03-12', }, fields: { type: 'array' as const, @@ -490,15 +490,15 @@ export const packedUserSchema = { properties: { name: { type: 'string' as const, - nullable: false as const, optional: false as const + nullable: false as const, optional: false as const, }, value: { type: 'string' as const, - nullable: false as const, optional: false as const - } + nullable: false as const, optional: false as const, + }, }, - maxLength: 4 - } + maxLength: 4, + }, }, followersCount: { type: 'number' as const, @@ -519,7 +519,7 @@ export const packedUserSchema = { type: 'string' as const, nullable: false as const, optional: false as const, format: 'id', - } + }, }, pinnedNotes: { type: 'array' as const, @@ -528,11 +528,11 @@ export const packedUserSchema = { type: 'object' as const, nullable: false as const, optional: false as const, ref: 'Note' as const, - } + }, }, pinnedPageId: { type: 'string' as const, - nullable: true as const, optional: true as const + nullable: true as const, optional: true as const, }, pinnedPage: { type: 'object' as const, @@ -542,47 +542,47 @@ export const packedUserSchema = { twoFactorEnabled: { type: 'boolean' as const, nullable: false as const, optional: true as const, - default: false + default: false, }, usePasswordLessLogin: { type: 'boolean' as const, nullable: false as const, optional: true as const, - default: false + default: false, }, securityKeys: { type: 'boolean' as const, nullable: false as const, optional: true as const, - default: false + default: false, }, avatarId: { type: 'string' as const, nullable: true as const, optional: true as const, - format: 'id' + format: 'id', }, bannerId: { type: 'string' as const, nullable: true as const, optional: true as const, - format: 'id' + format: 'id', }, autoWatch: { type: 'boolean' as const, - nullable: false as const, optional: true as const + nullable: false as const, optional: true as const, }, injectFeaturedNote: { type: 'boolean' as const, - nullable: false as const, optional: true as const + nullable: false as const, optional: true as const, }, alwaysMarkNsfw: { type: 'boolean' as const, - nullable: false as const, optional: true as const + nullable: false as const, optional: true as const, }, carefulBot: { type: 'boolean' as const, - nullable: false as const, optional: true as const + nullable: false as const, optional: true as const, }, autoAcceptFollowed: { type: 'boolean' as const, - nullable: false as const, optional: true as const + nullable: false as const, optional: true as const, }, hasUnreadSpecifiedNotes: { type: 'boolean' as const, @@ -618,47 +618,47 @@ export const packedUserSchema = { }, integrations: { type: 'object' as const, - nullable: false as const, optional: true as const + nullable: false as const, optional: true as const, }, mutedWords: { type: 'array' as const, - nullable: false as const, optional: true as const + nullable: false as const, optional: true as const, }, mutedInstances: { type: 'array' as const, - nullable: false as const, optional: true as const + nullable: false as const, optional: true as const, }, mutingNotificationTypes: { type: 'array' as const, - nullable: false as const, optional: true as const + nullable: false as const, optional: true as const, }, isFollowing: { type: 'boolean' as const, - optional: true as const, nullable: false as const + optional: true as const, nullable: false as const, }, hasPendingFollowRequestFromYou: { type: 'boolean' as const, - optional: true as const, nullable: false as const + optional: true as const, nullable: false as const, }, hasPendingFollowRequestToYou: { type: 'boolean' as const, - optional: true as const, nullable: false as const + optional: true as const, nullable: false as const, }, isFollowed: { type: 'boolean' as const, - optional: true as const, nullable: false as const + optional: true as const, nullable: false as const, }, isBlocking: { type: 'boolean' as const, - optional: true as const, nullable: false as const + optional: true as const, nullable: false as const, }, isBlocked: { type: 'boolean' as const, - optional: true as const, nullable: false as const + optional: true as const, nullable: false as const, }, isMuted: { type: 'boolean' as const, - optional: true as const, nullable: false as const - } + optional: true as const, nullable: false as const, + }, }, }; diff --git a/packages/backend/src/prelude/maybe.ts b/packages/backend/src/prelude/maybe.ts index 0b4b543ca5..df7c4ed52a 100644 --- a/packages/backend/src/prelude/maybe.ts +++ b/packages/backend/src/prelude/maybe.ts @@ -9,7 +9,7 @@ export interface IJust extends IMaybe { export function just(value: T): IJust { return { isJust: () => true, - get: () => value + get: () => value, }; } diff --git a/packages/backend/src/prelude/xml.ts b/packages/backend/src/prelude/xml.ts index 0773f75d47..b4469a1d8d 100644 --- a/packages/backend/src/prelude/xml.ts +++ b/packages/backend/src/prelude/xml.ts @@ -3,7 +3,7 @@ const map: Record = { '<': '<', '>': '>', '"': '"', - '\'': ''' + '\'': ''', }; const beginingOfCDATA = '(name: string, limitPerSec = -1) { prefix: config.redis.prefix ? `${config.redis.prefix}:queue` : 'queue', limiter: limitPerSec > 0 ? { max: limitPerSec, - duration: 1000 + duration: 1000, } : undefined, settings: { backoffStrategies: { - apBackoff - } - } + apBackoff, + }, + }, }); } diff --git a/packages/backend/src/queue/processors/db/delete-account.ts b/packages/backend/src/queue/processors/db/delete-account.ts index e54f38e35e..4b620842a4 100644 --- a/packages/backend/src/queue/processors/db/delete-account.ts +++ b/packages/backend/src/queue/processors/db/delete-account.ts @@ -25,12 +25,12 @@ export async function deleteAccount(job: Bull.Job): Promise const notes = await Notes.find({ where: { userId: user.id, - ...(cursor ? { id: MoreThan(cursor) } : {}) + ...(cursor ? { id: MoreThan(cursor) } : {}), }, take: 100, order: { - id: 1 - } + id: 1, + }, }); if (notes.length === 0) { @@ -52,12 +52,12 @@ export async function deleteAccount(job: Bull.Job): Promise const files = await DriveFiles.find({ where: { userId: user.id, - ...(cursor ? { id: MoreThan(cursor) } : {}) + ...(cursor ? { id: MoreThan(cursor) } : {}), }, take: 10, order: { - id: 1 - } + id: 1, + }, }); if (files.length === 0) { diff --git a/packages/backend/src/queue/processors/db/delete-drive-files.ts b/packages/backend/src/queue/processors/db/delete-drive-files.ts index 8a28468b0d..d26f5a47c4 100644 --- a/packages/backend/src/queue/processors/db/delete-drive-files.ts +++ b/packages/backend/src/queue/processors/db/delete-drive-files.ts @@ -24,12 +24,12 @@ export async function deleteDriveFiles(job: Bull.Job, done: any): const files = await DriveFiles.find({ where: { userId: user.id, - ...(cursor ? { id: MoreThan(cursor) } : {}) + ...(cursor ? { id: MoreThan(cursor) } : {}), }, take: 100, order: { - id: 1 - } + id: 1, + }, }); if (files.length === 0) { diff --git a/packages/backend/src/queue/processors/db/export-blocking.ts b/packages/backend/src/queue/processors/db/export-blocking.ts index 8b8aa259d4..8c886d3b4e 100644 --- a/packages/backend/src/queue/processors/db/export-blocking.ts +++ b/packages/backend/src/queue/processors/db/export-blocking.ts @@ -40,12 +40,12 @@ export async function exportBlocking(job: Bull.Job, done: any): P const blockings = await Blockings.find({ where: { blockerId: user.id, - ...(cursor ? { id: MoreThan(cursor) } : {}) + ...(cursor ? { id: MoreThan(cursor) } : {}), }, take: 100, order: { - id: 1 - } + id: 1, + }, }); if (blockings.length === 0) { diff --git a/packages/backend/src/queue/processors/db/export-following.ts b/packages/backend/src/queue/processors/db/export-following.ts index a0ecf5f560..54e3b11372 100644 --- a/packages/backend/src/queue/processors/db/export-following.ts +++ b/packages/backend/src/queue/processors/db/export-following.ts @@ -40,12 +40,12 @@ export async function exportFollowing(job: Bull.Job, done: any): const followings = await Followings.find({ where: { followerId: user.id, - ...(cursor ? { id: MoreThan(cursor) } : {}) + ...(cursor ? { id: MoreThan(cursor) } : {}), }, take: 100, order: { - id: 1 - } + id: 1, + }, }); if (followings.length === 0) { diff --git a/packages/backend/src/queue/processors/db/export-mute.ts b/packages/backend/src/queue/processors/db/export-mute.ts index d5976f7d56..0b1fd24fe0 100644 --- a/packages/backend/src/queue/processors/db/export-mute.ts +++ b/packages/backend/src/queue/processors/db/export-mute.ts @@ -40,12 +40,12 @@ export async function exportMute(job: Bull.Job, done: any): Promi const mutes = await Mutings.find({ where: { muterId: user.id, - ...(cursor ? { id: MoreThan(cursor) } : {}) + ...(cursor ? { id: MoreThan(cursor) } : {}), }, take: 100, order: { - id: 1 - } + id: 1, + }, }); if (mutes.length === 0) { diff --git a/packages/backend/src/queue/processors/db/export-user-lists.ts b/packages/backend/src/queue/processors/db/export-user-lists.ts index 8a86c4df5d..44a8f9f671 100644 --- a/packages/backend/src/queue/processors/db/export-user-lists.ts +++ b/packages/backend/src/queue/processors/db/export-user-lists.ts @@ -22,7 +22,7 @@ export async function exportUserLists(job: Bull.Job, done: any): } const lists = await UserLists.find({ - userId: user.id + userId: user.id, }); // Create temp file @@ -40,7 +40,7 @@ export async function exportUserLists(job: Bull.Job, done: any): for (const list of lists) { const joinings = await UserListJoinings.find({ userListId: list.id }); const users = await Users.find({ - id: In(joinings.map(j => j.userId)) + id: In(joinings.map(j => j.userId)), }); for (const u of users) { diff --git a/packages/backend/src/queue/processors/db/import-blocking.ts b/packages/backend/src/queue/processors/db/import-blocking.ts index 2e77107034..42c3cd0a40 100644 --- a/packages/backend/src/queue/processors/db/import-blocking.ts +++ b/packages/backend/src/queue/processors/db/import-blocking.ts @@ -21,7 +21,7 @@ export async function importBlocking(job: Bull.Job, done: a } const file = await DriveFiles.findOne({ - id: job.data.fileId + id: job.data.fileId, }); if (file == null) { done(); @@ -41,10 +41,10 @@ export async function importBlocking(job: Bull.Job, done: a let target = isSelfHost(host!) ? await Users.findOne({ host: null, - usernameLower: username.toLowerCase() + usernameLower: username.toLowerCase(), }) : await Users.findOne({ host: toPuny(host!), - usernameLower: username.toLowerCase() + usernameLower: username.toLowerCase(), }); if (host == null && target == null) continue; diff --git a/packages/backend/src/queue/processors/db/import-following.ts b/packages/backend/src/queue/processors/db/import-following.ts index 2bd079e4bc..f19296832e 100644 --- a/packages/backend/src/queue/processors/db/import-following.ts +++ b/packages/backend/src/queue/processors/db/import-following.ts @@ -21,7 +21,7 @@ export async function importFollowing(job: Bull.Job, done: } const file = await DriveFiles.findOne({ - id: job.data.fileId + id: job.data.fileId, }); if (file == null) { done(); @@ -41,10 +41,10 @@ export async function importFollowing(job: Bull.Job, done: let target = isSelfHost(host!) ? await Users.findOne({ host: null, - usernameLower: username.toLowerCase() + usernameLower: username.toLowerCase(), }) : await Users.findOne({ host: toPuny(host!), - usernameLower: username.toLowerCase() + usernameLower: username.toLowerCase(), }); if (host == null && target == null) continue; diff --git a/packages/backend/src/queue/processors/db/import-muting.ts b/packages/backend/src/queue/processors/db/import-muting.ts index 8060980625..189740c292 100644 --- a/packages/backend/src/queue/processors/db/import-muting.ts +++ b/packages/backend/src/queue/processors/db/import-muting.ts @@ -22,7 +22,7 @@ export async function importMuting(job: Bull.Job, done: any } const file = await DriveFiles.findOne({ - id: job.data.fileId + id: job.data.fileId, }); if (file == null) { done(); @@ -42,10 +42,10 @@ export async function importMuting(job: Bull.Job, done: any let target = isSelfHost(host!) ? await Users.findOne({ host: null, - usernameLower: username.toLowerCase() + usernameLower: username.toLowerCase(), }) : await Users.findOne({ host: toPuny(host!), - usernameLower: username.toLowerCase() + usernameLower: username.toLowerCase(), }); if (host == null && target == null) continue; diff --git a/packages/backend/src/queue/processors/db/import-user-lists.ts b/packages/backend/src/queue/processors/db/import-user-lists.ts index 46b728b387..8245010de0 100644 --- a/packages/backend/src/queue/processors/db/import-user-lists.ts +++ b/packages/backend/src/queue/processors/db/import-user-lists.ts @@ -22,7 +22,7 @@ export async function importUserLists(job: Bull.Job, done: } const file = await DriveFiles.findOne({ - id: job.data.fileId + id: job.data.fileId, }); if (file == null) { done(); @@ -42,7 +42,7 @@ export async function importUserLists(job: Bull.Job, done: let list = await UserLists.findOne({ userId: user.id, - name: listName + name: listName, }); if (list == null) { @@ -51,16 +51,16 @@ export async function importUserLists(job: Bull.Job, done: createdAt: new Date(), userId: user.id, name: listName, - userIds: [] + userIds: [], }); } let target = isSelfHost(host!) ? await Users.findOne({ host: null, - usernameLower: username.toLowerCase() + usernameLower: username.toLowerCase(), }) : await Users.findOne({ host: toPuny(host!), - usernameLower: username.toLowerCase() + usernameLower: username.toLowerCase(), }); if (target == null) { diff --git a/packages/backend/src/queue/processors/deliver.ts b/packages/backend/src/queue/processors/deliver.ts index 3c61896a2f..46aeb8cb7e 100644 --- a/packages/backend/src/queue/processors/deliver.ts +++ b/packages/backend/src/queue/processors/deliver.ts @@ -33,7 +33,7 @@ export default async (job: Bull.Job) => { if (suspendedHosts == null) { suspendedHosts = await Instances.find({ where: { - isSuspended: true + isSuspended: true, }, }); suspendedHostsCache.set(null, suspendedHosts); @@ -55,7 +55,7 @@ export default async (job: Bull.Job) => { latestRequestSentAt: new Date(), latestStatus: 200, lastCommunicatedAt: new Date(), - isNotResponding: false + isNotResponding: false, }); fetchInstanceMetadata(i); @@ -70,7 +70,7 @@ export default async (job: Bull.Job) => { Instances.update(i.id, { latestRequestSentAt: new Date(), latestStatus: res instanceof StatusError ? res.statusCode : null, - isNotResponding: true + isNotResponding: true, }); instanceChart.requestSent(i.host, false); diff --git a/packages/backend/src/queue/processors/inbox.ts b/packages/backend/src/queue/processors/inbox.ts index 4032ce8653..bfdebc0077 100644 --- a/packages/backend/src/queue/processors/inbox.ts +++ b/packages/backend/src/queue/processors/inbox.ts @@ -135,7 +135,7 @@ export default async (job: Bull.Job): Promise => { Instances.update(i.id, { latestRequestReceivedAt: new Date(), lastCommunicatedAt: new Date(), - isNotResponding: false + isNotResponding: false, }); fetchInstanceMetadata(i); diff --git a/packages/backend/src/queue/processors/object-storage/clean-remote-files.ts b/packages/backend/src/queue/processors/object-storage/clean-remote-files.ts index a094c39d5d..788383a0a3 100644 --- a/packages/backend/src/queue/processors/object-storage/clean-remote-files.ts +++ b/packages/backend/src/queue/processors/object-storage/clean-remote-files.ts @@ -18,12 +18,12 @@ export default async function cleanRemoteFiles(job: Bull.Job { const key = await UserPublickeys.findOne({ - keyId + keyId, }); if (key == null) return null; @@ -86,7 +86,7 @@ export default class DbResolver { return { user, - key + key, }; } @@ -102,7 +102,7 @@ export default class DbResolver { return { user, - key + key, }; } @@ -115,11 +115,11 @@ export default class DbResolver { if (matchLocal) { return { type: matchLocal[1], - id: matchLocal[2] + id: matchLocal[2], }; } else { return { - uri + uri, }; } } diff --git a/packages/backend/src/remote/activitypub/deliver-manager.ts b/packages/backend/src/remote/activitypub/deliver-manager.ts index d37f97a447..b16f907693 100644 --- a/packages/backend/src/remote/activitypub/deliver-manager.ts +++ b/packages/backend/src/remote/activitypub/deliver-manager.ts @@ -43,7 +43,7 @@ export default class DeliverManager { */ public addFollowersRecipe() { const deliver = { - type: 'Followers' + type: 'Followers', } as IFollowersRecipe; this.addRecipe(deliver); @@ -56,7 +56,7 @@ export default class DeliverManager { public addDirectRecipe(to: IRemoteUser) { const recipe = { type: 'Direct', - to + to, } as IDirectRecipe; this.addRecipe(recipe); @@ -83,7 +83,7 @@ export default class DeliverManager { if (isFollowers(recipe)) { // followers deliver const followers = await Followings.find({ - followeeId: this.actor.id + followeeId: this.actor.id, }); for (const following of followers) { diff --git a/packages/backend/src/remote/activitypub/kernel/announce/note.ts b/packages/backend/src/remote/activitypub/kernel/announce/note.ts index 5230867f24..e9158f7752 100644 --- a/packages/backend/src/remote/activitypub/kernel/announce/note.ts +++ b/packages/backend/src/remote/activitypub/kernel/announce/note.ts @@ -59,7 +59,7 @@ export default async function(resolver: Resolver, actor: IRemoteUser, activity: renote, visibility: activityAudience.visibility, visibleUsers: activityAudience.visibleUsers, - uri + uri, }); } finally { unlock(); diff --git a/packages/backend/src/remote/activitypub/kernel/flag/index.ts b/packages/backend/src/remote/activitypub/kernel/flag/index.ts index 7abfd694cd..aec6d2daaa 100644 --- a/packages/backend/src/remote/activitypub/kernel/flag/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/flag/index.ts @@ -12,7 +12,7 @@ export default async (actor: IRemoteUser, activity: IFlag): Promise => { const userIds = uris.filter(uri => uri.startsWith(config.url + '/users/')).map(uri => uri.split('/').pop()); const users = await Users.find({ - id: In(userIds) + id: In(userIds), }); if (users.length < 1) return `skip`; @@ -23,7 +23,7 @@ export default async (actor: IRemoteUser, activity: IFlag): Promise => { targetUserHost: users[0].host, reporterId: actor.id, reporterHost: actor.host, - comment: `${activity.content}\n${JSON.stringify(uris, null, 2)}` + comment: `${activity.content}\n${JSON.stringify(uris, null, 2)}`, }); return `ok`; diff --git a/packages/backend/src/remote/activitypub/kernel/undo/accept.ts b/packages/backend/src/remote/activitypub/kernel/undo/accept.ts index 5112d1d4ea..10c8a9c9d9 100644 --- a/packages/backend/src/remote/activitypub/kernel/undo/accept.ts +++ b/packages/backend/src/remote/activitypub/kernel/undo/accept.ts @@ -15,7 +15,7 @@ export default async (actor: IRemoteUser, activity: IAccept): Promise => const following = await Followings.findOne({ followerId: follower.id, - followeeId: actor.id + followeeId: actor.id, }); if (following) { diff --git a/packages/backend/src/remote/activitypub/kernel/undo/announce.ts b/packages/backend/src/remote/activitypub/kernel/undo/announce.ts index 7bb9d7fcad..7f302a616d 100644 --- a/packages/backend/src/remote/activitypub/kernel/undo/announce.ts +++ b/packages/backend/src/remote/activitypub/kernel/undo/announce.ts @@ -7,7 +7,7 @@ export const undoAnnounce = async (actor: IRemoteUser, activity: IAnnounce): Pro const uri = getApId(activity); const note = await Notes.findOne({ - uri + uri, }); if (!note) return 'skip: no such Announce'; diff --git a/packages/backend/src/remote/activitypub/kernel/undo/follow.ts b/packages/backend/src/remote/activitypub/kernel/undo/follow.ts index d85c7e4a71..783e5acf15 100644 --- a/packages/backend/src/remote/activitypub/kernel/undo/follow.ts +++ b/packages/backend/src/remote/activitypub/kernel/undo/follow.ts @@ -19,12 +19,12 @@ export default async (actor: IRemoteUser, activity: IFollow): Promise => const req = await FollowRequests.findOne({ followerId: actor.id, - followeeId: followee.id + followeeId: followee.id, }); const following = await Followings.findOne({ followerId: actor.id, - followeeId: followee.id + followeeId: followee.id, }); if (req) { diff --git a/packages/backend/src/remote/activitypub/misc/ld-signature.ts b/packages/backend/src/remote/activitypub/misc/ld-signature.ts index dec07ea81b..946914bfaa 100644 --- a/packages/backend/src/remote/activitypub/misc/ld-signature.ts +++ b/packages/backend/src/remote/activitypub/misc/ld-signature.ts @@ -20,7 +20,7 @@ export class LdSignature { creator, domain, nonce: crypto.randomBytes(16).toString('hex'), - created: (created || new Date()).toISOString() + created: (created || new Date()).toISOString(), } as { type: string; creator: string; @@ -45,8 +45,8 @@ export class LdSignature { ...data, signature: { ...options, - signatureValue: signature.toString('base64') - } + signatureValue: signature.toString('base64'), + }, }; } @@ -60,7 +60,7 @@ export class LdSignature { public async createVerifyData(data: any, options: any) { const transformedOptions = { ...options, - '@context': 'https://w3id.org/identity/v1' + '@context': 'https://w3id.org/identity/v1', }; delete transformedOptions['type']; delete transformedOptions['id']; @@ -79,7 +79,7 @@ export class LdSignature { public async normalize(data: any) { const customLoader = this.getLoader(); return await jsonld.normalize(data, { - documentLoader: customLoader + documentLoader: customLoader, }); } @@ -93,7 +93,7 @@ export class LdSignature { return { contextUrl: null, document: CONTEXTS[url], - documentUrl: url + documentUrl: url, }; } } @@ -103,7 +103,7 @@ export class LdSignature { return { contextUrl: null, document: document, - documentUrl: url + documentUrl: url, }; }; } diff --git a/packages/backend/src/remote/activitypub/models/image.ts b/packages/backend/src/remote/activitypub/models/image.ts index d0a96e4313..902eb36a17 100644 --- a/packages/backend/src/remote/activitypub/models/image.ts +++ b/packages/backend/src/remote/activitypub/models/image.ts @@ -38,7 +38,7 @@ export async function createImage(actor: IRemoteUser, value: any): Promise); })); } diff --git a/packages/backend/src/remote/activitypub/models/person.ts b/packages/backend/src/remote/activitypub/models/person.ts index 9e9cb3a96a..19a7a70903 100644 --- a/packages/backend/src/remote/activitypub/models/person.ts +++ b/packages/backend/src/remote/activitypub/models/person.ts @@ -238,7 +238,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise ({ userId, screenName }), 'misskey:authentication:github': (id, login) => ({ id, login }), - 'misskey:authentication:discord': (id, name) => $discord(id, name) + 'misskey:authentication:discord': (id, name) => $discord(id, name), }; const $discord = (id: string, name: string) => { diff --git a/packages/backend/src/remote/activitypub/models/question.ts b/packages/backend/src/remote/activitypub/models/question.ts index 79f93c3a30..3e48e598e6 100644 --- a/packages/backend/src/remote/activitypub/models/question.ts +++ b/packages/backend/src/remote/activitypub/models/question.ts @@ -1,6 +1,6 @@ import config from '@/config/index'; import Resolver from '../resolver'; -import { IObject, IQuestion, isQuestion, } from '../type'; +import { IObject, IQuestion, isQuestion } from '../type'; import { apLogger } from '../logger'; import { Notes, Polls } from '@/models/index'; import { IPoll } from '@/models/entities/poll'; @@ -31,7 +31,7 @@ export async function extractPollFromQuestion(source: string | IObject, resolver choices, votes, multiple, - expiresAt + expiresAt, }; } @@ -76,7 +76,7 @@ export async function updateQuestion(value: any) { } await Polls.update({ noteId: note.id }, { - votes: poll.votes + votes: poll.votes, }); return changed; diff --git a/packages/backend/src/remote/activitypub/renderer/accept.ts b/packages/backend/src/remote/activitypub/renderer/accept.ts index f1e61f4c6a..3bce2165cd 100644 --- a/packages/backend/src/remote/activitypub/renderer/accept.ts +++ b/packages/backend/src/remote/activitypub/renderer/accept.ts @@ -4,5 +4,5 @@ import { User } from '@/models/entities/user'; export default (object: any, user: { id: User['id']; host: null }) => ({ type: 'Accept', actor: `${config.url}/users/${user.id}`, - object + object, }); diff --git a/packages/backend/src/remote/activitypub/renderer/add.ts b/packages/backend/src/remote/activitypub/renderer/add.ts index 21414a9380..960daf8424 100644 --- a/packages/backend/src/remote/activitypub/renderer/add.ts +++ b/packages/backend/src/remote/activitypub/renderer/add.ts @@ -5,5 +5,5 @@ export default (user: ILocalUser, target: any, object: any) => ({ type: 'Add', actor: `${config.url}/users/${user.id}`, target, - object + object, }); diff --git a/packages/backend/src/remote/activitypub/renderer/announce.ts b/packages/backend/src/remote/activitypub/renderer/announce.ts index 7bf90922be..ab113b48e6 100644 --- a/packages/backend/src/remote/activitypub/renderer/announce.ts +++ b/packages/backend/src/remote/activitypub/renderer/announce.ts @@ -24,6 +24,6 @@ export default (object: any, note: Note) => { published: note.createdAt.toISOString(), to, cc, - object + object, }; }; diff --git a/packages/backend/src/remote/activitypub/renderer/block.ts b/packages/backend/src/remote/activitypub/renderer/block.ts index bb3d74295a..bfb831daa8 100644 --- a/packages/backend/src/remote/activitypub/renderer/block.ts +++ b/packages/backend/src/remote/activitypub/renderer/block.ts @@ -4,5 +4,5 @@ import { ILocalUser, IRemoteUser } from '@/models/entities/user'; export default (blocker: ILocalUser, blockee: IRemoteUser) => ({ type: 'Block', actor: `${config.url}/users/${blocker.id}`, - object: blockee.uri + object: blockee.uri, }); diff --git a/packages/backend/src/remote/activitypub/renderer/create.ts b/packages/backend/src/remote/activitypub/renderer/create.ts index 04aa993a91..ac9e69af20 100644 --- a/packages/backend/src/remote/activitypub/renderer/create.ts +++ b/packages/backend/src/remote/activitypub/renderer/create.ts @@ -7,7 +7,7 @@ export default (object: any, note: Note) => { actor: `${config.url}/users/${note.userId}`, type: 'Create', published: note.createdAt.toISOString(), - object + object, } as any; if (object.to) activity.to = object.to; diff --git a/packages/backend/src/remote/activitypub/renderer/emoji.ts b/packages/backend/src/remote/activitypub/renderer/emoji.ts index ca514c56b5..9d08c8ba81 100644 --- a/packages/backend/src/remote/activitypub/renderer/emoji.ts +++ b/packages/backend/src/remote/activitypub/renderer/emoji.ts @@ -9,6 +9,6 @@ export default (emoji: Emoji) => ({ icon: { type: 'Image', mediaType: emoji.type || 'image/png', - url: emoji.url - } + url: emoji.url, + }, }); diff --git a/packages/backend/src/remote/activitypub/renderer/follow-relay.ts b/packages/backend/src/remote/activitypub/renderer/follow-relay.ts index 984c3c7639..38800267bf 100644 --- a/packages/backend/src/remote/activitypub/renderer/follow-relay.ts +++ b/packages/backend/src/remote/activitypub/renderer/follow-relay.ts @@ -7,7 +7,7 @@ export function renderFollowRelay(relay: Relay, relayActor: ILocalUser) { id: `${config.url}/activities/follow-relay/${relay.id}`, type: 'Follow', actor: `${config.url}/users/${relayActor.id}`, - object: 'https://www.w3.org/ns/activitystreams#Public' + object: 'https://www.w3.org/ns/activitystreams#Public', }; return follow; diff --git a/packages/backend/src/remote/activitypub/renderer/follow.ts b/packages/backend/src/remote/activitypub/renderer/follow.ts index c8a7946799..5258df7e97 100644 --- a/packages/backend/src/remote/activitypub/renderer/follow.ts +++ b/packages/backend/src/remote/activitypub/renderer/follow.ts @@ -6,7 +6,7 @@ export default (follower: { id: User['id']; host: User['host']; uri: User['host' const follow = { type: 'Follow', actor: Users.isLocalUser(follower) ? `${config.url}/users/${follower.id}` : follower.uri, - object: Users.isLocalUser(followee) ? `${config.url}/users/${followee.id}` : followee.uri + object: Users.isLocalUser(followee) ? `${config.url}/users/${followee.id}` : followee.uri, } as any; if (requestId) follow.id = requestId; diff --git a/packages/backend/src/remote/activitypub/renderer/hashtag.ts b/packages/backend/src/remote/activitypub/renderer/hashtag.ts index 290c74c7fe..d83a8e68b1 100644 --- a/packages/backend/src/remote/activitypub/renderer/hashtag.ts +++ b/packages/backend/src/remote/activitypub/renderer/hashtag.ts @@ -3,5 +3,5 @@ import config from '@/config/index'; export default (tag: string) => ({ type: 'Hashtag', href: `${config.url}/tags/${encodeURIComponent(tag)}`, - name: `#${tag}` + name: `#${tag}`, }); diff --git a/packages/backend/src/remote/activitypub/renderer/image.ts b/packages/backend/src/remote/activitypub/renderer/image.ts index 0cb3d6ed65..ee3860be8c 100644 --- a/packages/backend/src/remote/activitypub/renderer/image.ts +++ b/packages/backend/src/remote/activitypub/renderer/image.ts @@ -5,5 +5,5 @@ export default (file: DriveFile) => ({ type: 'Image', url: DriveFiles.getPublicUrl(file), sensitive: file.isSensitive, - name: file.comment + name: file.comment, }); diff --git a/packages/backend/src/remote/activitypub/renderer/index.ts b/packages/backend/src/remote/activitypub/renderer/index.ts index f6ec6583d0..911118e4c9 100644 --- a/packages/backend/src/remote/activitypub/renderer/index.ts +++ b/packages/backend/src/remote/activitypub/renderer/index.ts @@ -41,8 +41,8 @@ export const renderActivity = (x: any): IActivity | null => { 'isCat': 'misskey:isCat', // vcard vcard: 'http://www.w3.org/2006/vcard/ns#', - } - ] + }, + ], }, x); }; diff --git a/packages/backend/src/remote/activitypub/renderer/key.ts b/packages/backend/src/remote/activitypub/renderer/key.ts index 992f98d79a..51bc888dd7 100644 --- a/packages/backend/src/remote/activitypub/renderer/key.ts +++ b/packages/backend/src/remote/activitypub/renderer/key.ts @@ -9,6 +9,6 @@ export default (user: ILocalUser, key: UserKeypair, postfix?: string) => ({ owner: `${config.url}/users/${user.id}`, publicKeyPem: createPublicKey(key.publicKey).export({ type: 'spki', - format: 'pem' - }) + format: 'pem', + }), }); diff --git a/packages/backend/src/remote/activitypub/renderer/like.ts b/packages/backend/src/remote/activitypub/renderer/like.ts index a7e79a176f..2e4da9d26f 100644 --- a/packages/backend/src/remote/activitypub/renderer/like.ts +++ b/packages/backend/src/remote/activitypub/renderer/like.ts @@ -13,14 +13,14 @@ export const renderLike = async (noteReaction: NoteReaction, note: Note) => { actor: `${config.url}/users/${noteReaction.userId}`, object: note.uri ? note.uri : `${config.url}/notes/${noteReaction.noteId}`, content: reaction, - _misskey_reaction: reaction + _misskey_reaction: reaction, } as any; if (reaction.startsWith(':')) { const name = reaction.replace(/:/g, ''); const emoji = await Emojis.findOne({ name, - host: null + host: null, }); if (emoji) object.tag = [ renderEmoji(emoji) ]; diff --git a/packages/backend/src/remote/activitypub/renderer/note.ts b/packages/backend/src/remote/activitypub/renderer/note.ts index 84a1786784..4f9a372b2f 100644 --- a/packages/backend/src/remote/activitypub/renderer/note.ts +++ b/packages/backend/src/remote/activitypub/renderer/note.ts @@ -76,7 +76,7 @@ export default async function renderNote(note: Note, dive = true, isTalk = false } const mentionedUsers = note.mentions.length > 0 ? await Users.find({ - id: In(note.mentions) + id: In(note.mentions), }) : []; const hashtagTags = (note.tags || []).map(tag => renderHashtag(tag)); @@ -101,7 +101,7 @@ export default async function renderNote(note: Note, dive = true, isTalk = false const summary = note.cw === '' ? String.fromCharCode(0x200B) : note.cw; const content = toHtml(Object.assign({}, note, { - text: apText + text: apText, })); const emojis = await getEmojis(note.emojis); @@ -116,7 +116,7 @@ export default async function renderNote(note: Note, dive = true, isTalk = false const asPoll = poll ? { type: 'Question', content: toHtml(Object.assign({}, note, { - text: text + text: text, })), [poll.expiresAt && poll.expiresAt < new Date() ? 'closed' : 'endTime']: poll.expiresAt, [poll.multiple ? 'anyOf' : 'oneOf']: poll.choices.map((text, i) => ({ @@ -124,13 +124,13 @@ export default async function renderNote(note: Note, dive = true, isTalk = false name: text, replies: { type: 'Collection', - totalItems: poll!.votes[i] - } - })) + totalItems: poll!.votes[i], + }, + })), } : {}; const asTalk = isTalk ? { - _misskey_talk: true + _misskey_talk: true, } : {}; return { @@ -150,7 +150,7 @@ export default async function renderNote(note: Note, dive = true, isTalk = false sensitive: note.cw != null || files.some(file => file.isSensitive), tag, ...asPoll, - ...asTalk + ...asTalk, }; } @@ -160,7 +160,7 @@ export async function getEmojis(names: string[]): Promise { const emojis = await Promise.all( names.map(name => Emojis.findOne({ name, - host: null + host: null, })) ); diff --git a/packages/backend/src/remote/activitypub/renderer/ordered-collection-page.ts b/packages/backend/src/remote/activitypub/renderer/ordered-collection-page.ts index 2433358646..c5e25f577b 100644 --- a/packages/backend/src/remote/activitypub/renderer/ordered-collection-page.ts +++ b/packages/backend/src/remote/activitypub/renderer/ordered-collection-page.ts @@ -13,7 +13,7 @@ export default function(id: string, totalItems: any, orderedItems: any, partOf: partOf, type: 'OrderedCollectionPage', totalItems, - orderedItems + orderedItems, } as any; if (prev) page.prev = prev; diff --git a/packages/backend/src/remote/activitypub/renderer/person.ts b/packages/backend/src/remote/activitypub/renderer/person.ts index f2a283a870..d1c4c0040b 100644 --- a/packages/backend/src/remote/activitypub/renderer/person.ts +++ b/packages/backend/src/remote/activitypub/renderer/person.ts @@ -19,7 +19,7 @@ export async function renderPerson(user: ILocalUser) { const [avatar, banner, profile] = await Promise.all([ user.avatarId ? DriveFiles.findOne(user.avatarId) : Promise.resolve(undefined), user.bannerId ? DriveFiles.findOne(user.bannerId) : Promise.resolve(undefined), - UserProfiles.findOneOrFail(user.id) + UserProfiles.findOneOrFail(user.id), ]); const attachment: { @@ -36,7 +36,7 @@ export async function renderPerson(user: ILocalUser) { name: field.name, value: (field.value != null && field.value.match(/^https?:/)) ? `${new URL(field.value).href}` - : field.value + : field.value, }); } } @@ -74,7 +74,7 @@ export async function renderPerson(user: ILocalUser) { discoverable: !!user.isExplorable, publicKey: renderKey(user, keypair, `#main-key`), isCat: user.isCat, - attachment: attachment.length ? attachment : undefined + attachment: attachment.length ? attachment : undefined, } as any; if (profile?.birthday) { diff --git a/packages/backend/src/remote/activitypub/renderer/question.ts b/packages/backend/src/remote/activitypub/renderer/question.ts index c800e73a5b..3cbff33abc 100644 --- a/packages/backend/src/remote/activitypub/renderer/question.ts +++ b/packages/backend/src/remote/activitypub/renderer/question.ts @@ -14,9 +14,9 @@ export default async function renderQuestion(user: { id: User['id'] }, note: Not _misskey_votes: poll.votes[i], replies: { type: 'Collection', - totalItems: poll.votes[i] - } - })) + totalItems: poll.votes[i], + }, + })), }; return question; diff --git a/packages/backend/src/remote/activitypub/renderer/read.ts b/packages/backend/src/remote/activitypub/renderer/read.ts index 95357f64d3..2fe3b8e5e0 100644 --- a/packages/backend/src/remote/activitypub/renderer/read.ts +++ b/packages/backend/src/remote/activitypub/renderer/read.ts @@ -5,5 +5,5 @@ import { MessagingMessage } from '@/models/entities/messaging-message'; export const renderReadActivity = (user: { id: User['id'] }, message: MessagingMessage) => ({ type: 'Read', actor: `${config.url}/users/${user.id}`, - object: message.uri + object: message.uri, }); diff --git a/packages/backend/src/remote/activitypub/renderer/reject.ts b/packages/backend/src/remote/activitypub/renderer/reject.ts index 42beffecf2..575ef52ab8 100644 --- a/packages/backend/src/remote/activitypub/renderer/reject.ts +++ b/packages/backend/src/remote/activitypub/renderer/reject.ts @@ -4,5 +4,5 @@ import { User } from '@/models/entities/user'; export default (object: any, user: { id: User['id'] }) => ({ type: 'Reject', actor: `${config.url}/users/${user.id}`, - object + object, }); diff --git a/packages/backend/src/remote/activitypub/renderer/remove.ts b/packages/backend/src/remote/activitypub/renderer/remove.ts index 79d60edbaa..8afaf199cc 100644 --- a/packages/backend/src/remote/activitypub/renderer/remove.ts +++ b/packages/backend/src/remote/activitypub/renderer/remove.ts @@ -5,5 +5,5 @@ export default (user: { id: User['id'] }, target: any, object: any) => ({ type: 'Remove', actor: `${config.url}/users/${user.id}`, target, - object + object, }); diff --git a/packages/backend/src/remote/activitypub/renderer/tombstone.ts b/packages/backend/src/remote/activitypub/renderer/tombstone.ts index 553406b93b..313ca74e9d 100644 --- a/packages/backend/src/remote/activitypub/renderer/tombstone.ts +++ b/packages/backend/src/remote/activitypub/renderer/tombstone.ts @@ -1,4 +1,4 @@ export default (id: string) => ({ id, - type: 'Tombstone' + type: 'Tombstone', }); diff --git a/packages/backend/src/remote/activitypub/renderer/vote.ts b/packages/backend/src/remote/activitypub/renderer/vote.ts index ff038070f7..fd7bc9dbed 100644 --- a/packages/backend/src/remote/activitypub/renderer/vote.ts +++ b/packages/backend/src/remote/activitypub/renderer/vote.ts @@ -17,7 +17,7 @@ export default async function renderVote(user: { id: User['id'] }, vote: PollVot attributedTo: `${config.url}/users/${user.id}`, to: [pollOwner.uri], inReplyTo: note.uri, - name: poll.choices[vote.choice] - } + name: poll.choices[vote.choice], + }, }; } diff --git a/packages/backend/src/remote/activitypub/request.ts b/packages/backend/src/remote/activitypub/request.ts index d6ced630c1..715937e2a7 100644 --- a/packages/backend/src/remote/activitypub/request.ts +++ b/packages/backend/src/remote/activitypub/request.ts @@ -12,13 +12,13 @@ export default async (user: { id: User['id'] }, url: string, object: any) => { const req = createSignedPost({ key: { privateKeyPem: keypair.privateKey, - keyId: `${config.url}/users/${user.id}#main-key` + keyId: `${config.url}/users/${user.id}#main-key`, }, url, body, additionalHeaders: { 'User-Agent': config.userAgent, - } + }, }); await getResponse({ @@ -40,18 +40,18 @@ export async function signedGet(url: string, user: { id: User['id'] }) { const req = createSignedGet({ key: { privateKeyPem: keypair.privateKey, - keyId: `${config.url}/users/${user.id}#main-key` + keyId: `${config.url}/users/${user.id}#main-key`, }, url, additionalHeaders: { 'User-Agent': config.userAgent, - } + }, }); const res = await getResponse({ url, method: req.request.method, - headers: req.request.headers + headers: req.request.headers, }); return await res.json(); diff --git a/packages/backend/src/remote/resolve-user.ts b/packages/backend/src/remote/resolve-user.ts index a12396abc8..df6226cc50 100644 --- a/packages/backend/src/remote/resolve-user.ts +++ b/packages/backend/src/remote/resolve-user.ts @@ -71,9 +71,9 @@ export async function resolveUser(username: string, host: string | null, option? await Users.update({ usernameLower, - host: host + host: host, }, { - uri: self.href + uri: self.href, }); } else { logger.info(`uri is fine: ${acctLower}`); diff --git a/packages/backend/src/server/activitypub.ts b/packages/backend/src/server/activitypub.ts index eabe681136..da6a00e58e 100644 --- a/packages/backend/src/server/activitypub.ts +++ b/packages/backend/src/server/activitypub.ts @@ -68,7 +68,7 @@ router.get('/notes/:note', async (ctx, next) => { const note = await Notes.findOne({ id: ctx.params.note, visibility: In(['public', 'home']), - localOnly: false + localOnly: false, }); if (note == null) { @@ -97,7 +97,7 @@ router.get('/notes/:note/activity', async ctx => { id: ctx.params.note, userHost: null, visibility: In(['public', 'home']), - localOnly: false + localOnly: false, }); if (note == null) { @@ -128,7 +128,7 @@ router.get('/users/:user/publickey', async ctx => { const user = await Users.findOne({ id: userId, - host: null + host: null, }); if (user == null) { @@ -167,7 +167,7 @@ router.get('/users/:user', async (ctx, next) => { const user = await Users.findOne({ id: userId, host: null, - isSuspended: false + isSuspended: false, }); await userInfo(ctx, user); @@ -179,7 +179,7 @@ router.get('/@:user', async (ctx, next) => { const user = await Users.findOne({ usernameLower: ctx.params.user.toLowerCase(), host: null, - isSuspended: false + isSuspended: false, }); await userInfo(ctx, user); @@ -190,7 +190,7 @@ router.get('/@:user', async (ctx, next) => { router.get('/emojis/:emoji', async ctx => { const emoji = await Emojis.findOne({ host: null, - name: ctx.params.emoji + name: ctx.params.emoji, }); if (emoji == null) { diff --git a/packages/backend/src/server/activitypub/featured.ts b/packages/backend/src/server/activitypub/featured.ts index 1598cc680f..40b8d8cc81 100644 --- a/packages/backend/src/server/activitypub/featured.ts +++ b/packages/backend/src/server/activitypub/featured.ts @@ -12,7 +12,7 @@ export default async (ctx: Router.RouterContext) => { // Verify user const user = await Users.findOne({ id: userId, - host: null + host: null, }); if (user == null) { @@ -22,7 +22,7 @@ export default async (ctx: Router.RouterContext) => { const pinings = await UserNotePinings.find({ where: { userId: user.id }, - order: { id: 'DESC' } + order: { id: 'DESC' }, }); const pinnedNotes = await Promise.all(pinings.map(pining => diff --git a/packages/backend/src/server/activitypub/followers.ts b/packages/backend/src/server/activitypub/followers.ts index baf2d23460..927fb5d18a 100644 --- a/packages/backend/src/server/activitypub/followers.ts +++ b/packages/backend/src/server/activitypub/followers.ts @@ -30,7 +30,7 @@ export default async (ctx: Router.RouterContext) => { // Verify user const user = await Users.findOne({ id: userId, - host: null + host: null, }); if (user == null) { @@ -57,7 +57,7 @@ export default async (ctx: Router.RouterContext) => { if (page) { const query = { - followeeId: user.id + followeeId: user.id, } as any; // カーソルが指定されている場合 @@ -69,7 +69,7 @@ export default async (ctx: Router.RouterContext) => { const followings = await Followings.find({ where: query, take: limit + 1, - order: { id: -1 } + order: { id: -1 }, }); // 「次のページ」があるかどうか @@ -80,13 +80,13 @@ export default async (ctx: Router.RouterContext) => { const rendered = renderOrderedCollectionPage( `${partOf}?${url.query({ page: 'true', - cursor + cursor, })}`, user.followersCount, renderedFollowers, partOf, undefined, inStock ? `${partOf}?${url.query({ page: 'true', - cursor: followings[followings.length - 1].id + cursor: followings[followings.length - 1].id, })}` : undefined ); diff --git a/packages/backend/src/server/activitypub/following.ts b/packages/backend/src/server/activitypub/following.ts index b9eb806c3c..a3237582ad 100644 --- a/packages/backend/src/server/activitypub/following.ts +++ b/packages/backend/src/server/activitypub/following.ts @@ -31,7 +31,7 @@ export default async (ctx: Router.RouterContext) => { // Verify user const user = await Users.findOne({ id: userId, - host: null + host: null, }); if (user == null) { @@ -58,7 +58,7 @@ export default async (ctx: Router.RouterContext) => { if (page) { const query = { - followerId: user.id + followerId: user.id, } as FindConditions; // カーソルが指定されている場合 @@ -70,7 +70,7 @@ export default async (ctx: Router.RouterContext) => { const followings = await Followings.find({ where: query, take: limit + 1, - order: { id: -1 } + order: { id: -1 }, }); // 「次のページ」があるかどうか @@ -81,13 +81,13 @@ export default async (ctx: Router.RouterContext) => { const rendered = renderOrderedCollectionPage( `${partOf}?${url.query({ page: 'true', - cursor + cursor, })}`, user.followingCount, renderedFollowees, partOf, undefined, inStock ? `${partOf}?${url.query({ page: 'true', - cursor: followings[followings.length - 1].id + cursor: followings[followings.length - 1].id, })}` : undefined ); diff --git a/packages/backend/src/server/activitypub/outbox.ts b/packages/backend/src/server/activitypub/outbox.ts index df528e8b5a..ba6b46a0cc 100644 --- a/packages/backend/src/server/activitypub/outbox.ts +++ b/packages/backend/src/server/activitypub/outbox.ts @@ -38,7 +38,7 @@ export default async (ctx: Router.RouterContext) => { // Verify user const user = await Users.findOne({ id: userId, - host: null + host: null, }); if (user == null) { @@ -67,16 +67,16 @@ export default async (ctx: Router.RouterContext) => { `${partOf}?${url.query({ page: 'true', since_id: sinceId, - until_id: untilId + until_id: untilId, })}`, user.notesCount, activities, partOf, notes.length ? `${partOf}?${url.query({ page: 'true', - since_id: notes[0].id + since_id: notes[0].id, })}` : undefined, notes.length ? `${partOf}?${url.query({ page: 'true', - until_id: notes[notes.length - 1].id + until_id: notes[notes.length - 1].id, })}` : undefined ); diff --git a/packages/backend/src/server/api/2fa.ts b/packages/backend/src/server/api/2fa.ts index 2c8c842a11..2a69e49c83 100644 --- a/packages/backend/src/server/api/2fa.ts +++ b/packages/backend/src/server/api/2fa.ts @@ -112,7 +112,7 @@ export function verifyLogin({ clientDataJSON, clientData, signature, - challenge + challenge, }: { publicKey: Buffer, authenticatorData: Buffer, diff --git a/packages/backend/src/server/api/api-handler.ts b/packages/backend/src/server/api/api-handler.ts index cbace8917e..faa35d12d4 100644 --- a/packages/backend/src/server/api/api-handler.ts +++ b/packages/backend/src/server/api/api-handler.ts @@ -19,8 +19,8 @@ export default (endpoint: IEndpoint, ctx: Koa.Context) => new Promise((res) => { code: y!.code, id: y!.id, kind: y!.kind, - ...(y!.info ? { info: y!.info } : {}) - } + ...(y!.info ? { info: y!.info } : {}), + }, }; } else { // 文字列を返す場合は、JSON.stringify通さないとJSONと認識されない @@ -42,7 +42,7 @@ export default (endpoint: IEndpoint, ctx: Koa.Context) => new Promise((res) => { reply(403, new ApiError({ message: 'Authentication failed. Please ensure your token is correct.', code: 'AUTHENTICATION_FAILED', - id: 'b0a7f5f8-dc2f-4171-b91f-de88ad238e14' + id: 'b0a7f5f8-dc2f-4171-b91f-de88ad238e14', })); } else { reply(500, new ApiError()); diff --git a/packages/backend/src/server/api/authenticate.ts b/packages/backend/src/server/api/authenticate.ts index b8e216edc4..d33e9e3753 100644 --- a/packages/backend/src/server/api/authenticate.ts +++ b/packages/backend/src/server/api/authenticate.ts @@ -28,9 +28,9 @@ export default async (token: string): Promise<[User | null | undefined, App | nu } else { const accessToken = await AccessTokens.findOne({ where: [{ - hash: token.toLowerCase() // app + hash: token.toLowerCase(), // app }, { - token: token // miauth + token: token, // miauth }], }); @@ -44,7 +44,7 @@ export default async (token: string): Promise<[User | null | undefined, App | nu const user = await Users .findOne({ - id: accessToken.userId // findOne(accessToken.userId) のように書かないのは後方互換性のため + id: accessToken.userId, // findOne(accessToken.userId) のように書かないのは後方互換性のため }); if (accessToken.appId) { @@ -53,7 +53,7 @@ export default async (token: string): Promise<[User | null | undefined, App | nu return [user, { id: accessToken.id, - permission: app.permission + permission: app.permission, } as AccessToken]; } else { return [user, accessToken]; diff --git a/packages/backend/src/server/api/call.ts b/packages/backend/src/server/api/call.ts index bd86ffdc35..36aadb532b 100644 --- a/packages/backend/src/server/api/call.ts +++ b/packages/backend/src/server/api/call.ts @@ -9,7 +9,7 @@ import { AccessToken } from '@/models/entities/access-token'; const accessDenied = { message: 'Access denied.', code: 'ACCESS_DENIED', - id: '56f35758-7dd5-468b-8439-5d6fb8ec9b8e' + id: '56f35758-7dd5-468b-8439-5d6fb8ec9b8e', }; export default async (endpoint: string, user: User | null | undefined, token: AccessToken | null | undefined, data: any, file?: any) => { @@ -22,7 +22,7 @@ export default async (endpoint: string, user: User | null | undefined, token: Ac message: 'No such endpoint.', code: 'NO_SUCH_ENDPOINT', id: 'f8080b67-5f9c-4eb7-8c18-7f1eeae8f709', - httpStatusCode: 404 + httpStatusCode: 404, }); } @@ -35,7 +35,7 @@ export default async (endpoint: string, user: User | null | undefined, token: Ac message: 'Credential required.', code: 'CREDENTIAL_REQUIRED', id: '1384574d-a912-4b81-8601-c7b1c4085df1', - httpStatusCode: 401 + httpStatusCode: 401, }); } @@ -44,7 +44,7 @@ export default async (endpoint: string, user: User | null | undefined, token: Ac message: 'Your account has been suspended.', code: 'YOUR_ACCOUNT_SUSPENDED', id: 'a8c724b3-6e9c-4b46-b1a8-bc3ed6258370', - httpStatusCode: 403 + httpStatusCode: 403, }); } @@ -71,7 +71,7 @@ export default async (endpoint: string, user: User | null | undefined, token: Ac message: 'Rate limit exceeded. Please try again later.', code: 'RATE_LIMIT_EXCEEDED', id: 'd5826d14-3982-4d2e-8011-b9e9f02499ef', - httpStatusCode: 429 + httpStatusCode: 429, }); }); } @@ -88,15 +88,15 @@ export default async (endpoint: string, user: User | null | undefined, token: Ac e: { message: e?.message, code: e?.name, - stack: e?.stack - } + stack: e?.stack, + }, }); throw new ApiError(null, { e: { message: e?.message, code: e?.name, - stack: e?.stack - } + stack: e?.stack, + }, }); } }).finally(() => { diff --git a/packages/backend/src/server/api/common/inject-promo.ts b/packages/backend/src/server/api/common/inject-promo.ts index 87767a65bf..06a3841995 100644 --- a/packages/backend/src/server/api/common/inject-promo.ts +++ b/packages/backend/src/server/api/common/inject-promo.ts @@ -9,7 +9,7 @@ export async function injectPromo(timeline: Note[], user?: User | null) { // TODO: readやexpireフィルタはクエリ側でやる const reads = user ? await PromoReads.find({ - userId: user.id + userId: user.id, }) : []; let promos = await PromoNotes.find(); diff --git a/packages/backend/src/server/api/common/read-messaging-message.ts b/packages/backend/src/server/api/common/read-messaging-message.ts index 33f41b2770..928333e59c 100644 --- a/packages/backend/src/server/api/common/read-messaging-message.ts +++ b/packages/backend/src/server/api/common/read-messaging-message.ts @@ -24,7 +24,7 @@ export async function readUserMessagingMessage( if (messageIds.length === 0) return; const messages = await MessagingMessages.find({ - id: In(messageIds) + id: In(messageIds), }); for (const message of messages) { @@ -38,9 +38,9 @@ export async function readUserMessagingMessage( id: In(messageIds), userId: otherpartyId, recipientId: userId, - isRead: false + isRead: false, }, { - isRead: true + isRead: true, }); // Publish event @@ -66,7 +66,7 @@ export async function readGroupMessagingMessage( // check joined const joining = await UserGroupJoinings.findOne({ userId: userId, - userGroupId: groupId + userGroupId: groupId, }); if (joining == null) { @@ -74,7 +74,7 @@ export async function readGroupMessagingMessage( } const messages = await MessagingMessages.find({ - id: In(messageIds) + id: In(messageIds), }); const reads: MessagingMessage['id'][] = []; @@ -86,7 +86,7 @@ export async function readGroupMessagingMessage( // Update document await MessagingMessages.createQueryBuilder().update() .set({ - reads: (() => `array_append("reads", '${joining.userId}')`) as any + reads: (() => `array_append("reads", '${joining.userId}')`) as any, }) .where('id = :id', { id: message.id }) .execute(); @@ -97,7 +97,7 @@ export async function readGroupMessagingMessage( // Publish event publishGroupMessagingStream(groupId, 'read', { ids: reads, - userId: userId + userId: userId, }); publishMessagingIndexStream(userId, 'read', reads); diff --git a/packages/backend/src/server/api/common/read-notification.ts b/packages/backend/src/server/api/common/read-notification.ts index a4406c9eeb..049a7feed6 100644 --- a/packages/backend/src/server/api/common/read-notification.ts +++ b/packages/backend/src/server/api/common/read-notification.ts @@ -11,9 +11,9 @@ export async function readNotification( // Update documents await Notifications.update({ id: In(notificationIds), - isRead: false + isRead: false, }, { - isRead: true + isRead: true, }); post(userId); @@ -27,9 +27,9 @@ export async function readNotificationByQuery( await Notifications.update({ ...query, notifieeId: userId, - isRead: false + isRead: false, }, { - isRead: true + isRead: true, }); post(userId); diff --git a/packages/backend/src/server/api/common/signin.ts b/packages/backend/src/server/api/common/signin.ts index 4c7aacf1cd..b713260ac6 100644 --- a/packages/backend/src/server/api/common/signin.ts +++ b/packages/backend/src/server/api/common/signin.ts @@ -14,7 +14,7 @@ export default function(ctx: Koa.Context, user: ILocalUser, redirect = false) { // SEE: https://github.com/koajs/koa/issues/974 // When using a SSL proxy it should be configured to add the "X-Forwarded-Proto: https" header secure: config.url.startsWith('https'), - httpOnly: false + httpOnly: false, }); //#endregion @@ -22,7 +22,7 @@ export default function(ctx: Koa.Context, user: ILocalUser, redirect = false) { } else { ctx.body = { id: user.id, - i: user.token + i: user.token, }; ctx.status = 200; } @@ -35,7 +35,7 @@ export default function(ctx: Koa.Context, user: ILocalUser, redirect = false) { userId: user.id, ip: ctx.ip, headers: ctx.headers, - success: true + success: true, }); // Publish signin event diff --git a/packages/backend/src/server/api/common/signup.ts b/packages/backend/src/server/api/common/signup.ts index 2ba0d8e479..f8db7e374e 100644 --- a/packages/backend/src/server/api/common/signup.ts +++ b/packages/backend/src/server/api/common/signup.ts @@ -54,14 +54,14 @@ export async function signup(opts: { modulusLength: 4096, publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', cipher: undefined, - passphrase: undefined - } + passphrase: undefined, + }, } as any, (err, publicKey, privateKey) => err ? rej(err) : res([publicKey, privateKey]) )); @@ -72,7 +72,7 @@ export async function signup(opts: { await getConnection().transaction(async transactionalEntityManager => { const exist = await transactionalEntityManager.findOne(User, { usernameLower: username.toLowerCase(), - host: null + host: null, }); if (exist) throw new Error(' the username is already used'); @@ -92,7 +92,7 @@ export async function signup(opts: { await transactionalEntityManager.save(new UserKeypair({ publicKey: keyPair[0], privateKey: keyPair[1], - userId: account.id + userId: account.id, })); await transactionalEntityManager.save(new UserProfile({ diff --git a/packages/backend/src/server/api/define.ts b/packages/backend/src/server/api/define.ts index 48253e78e0..71e5fadde0 100644 --- a/packages/backend/src/server/api/define.ts +++ b/packages/backend/src/server/api/define.ts @@ -70,7 +70,7 @@ function getParams(defs: T, params: any): [Params, A id: '3d81ceae-475f-4600-b2a8-2bc116157532', }, { param: k, - reason: e.message + reason: e.message, }); return true; } else { diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts index 6d9d2b0782..a61b3f564c 100644 --- a/packages/backend/src/server/api/endpoints.ts +++ b/packages/backend/src/server/api/endpoints.ts @@ -108,7 +108,7 @@ export interface IEndpoint { } const files = glob.sync('**/*.js', { - cwd: path.resolve(_dirname + '/endpoints/') + cwd: path.resolve(_dirname + '/endpoints/'), }); const endpoints: IEndpoint[] = files.map(f => { @@ -117,7 +117,7 @@ const endpoints: IEndpoint[] = files.map(f => { return { name: f.replace('.js', ''), exec: ep.default, - meta: ep.meta || {} + meta: ep.meta || {}, }; }); diff --git a/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts b/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts index 403eb24191..774506bf0d 100644 --- a/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts +++ b/packages/backend/src/server/api/endpoints/admin/abuse-user-reports.ts @@ -13,7 +13,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -35,7 +35,7 @@ export const meta = { 'local', 'remote', ]), - default: 'combined' + default: 'combined', }, targetUserOrigin: { @@ -44,7 +44,7 @@ export const meta = { 'local', 'remote', ]), - default: 'combined' + default: 'combined', }, }, @@ -73,7 +73,7 @@ export const meta = { resolved: { type: 'boolean' as const, nullable: false as const, optional: false as const, - example: false + example: false, }, reporterId: { type: 'string' as const, @@ -93,21 +93,21 @@ export const meta = { reporter: { type: 'object' as const, nullable: false as const, optional: false as const, - ref: 'User' + ref: 'User', }, targetUser: { type: 'object' as const, nullable: false as const, optional: false as const, - ref: 'User' + ref: 'User', }, assignee: { type: 'object' as const, nullable: true as const, optional: true as const, - ref: 'User' - } - } - } - } + ref: 'User', + }, + }, + }, + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts index fa15e84f77..b1cdb29a56 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts @@ -12,7 +12,7 @@ export const meta = { password: { validator: Users.validatePassword, - } + }, }, res: { @@ -23,9 +23,9 @@ export const meta = { token: { type: 'string' as const, optional: false as const, nullable: false as const, - } - } - } + }, + }, + }, }; export default define(meta, async (ps, _me) => { @@ -42,7 +42,7 @@ export default define(meta, async (ps, _me) => { const res = await Users.pack(account, account, { detail: true, - includeSecrets: true + includeSecrets: true, }); (res as any).token = secret; diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts index 4e8a559805..3881e02bba 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/delete.ts @@ -16,7 +16,7 @@ export const meta = { userId: { validator: $.type(ID), }, - } + }, }; export default define(meta, async (ps, me) => { @@ -39,11 +39,11 @@ export default define(meta, async (ps, me) => { await doPostSuspend(user).catch(e => {}); createDeleteAccountJob(user, { - soft: false + soft: false, }); } else { createDeleteAccountJob(user, { - soft: true // リモートユーザーの削除は、完全にDBから物理削除してしまうと再度連合してきてアカウントが復活する可能性があるため、soft指定する + soft: true, // リモートユーザーの削除は、完全にDBから物理削除してしまうと再度連合してきてアカウントが復活する可能性があるため、soft指定する }); } diff --git a/packages/backend/src/server/api/endpoints/admin/ad/create.ts b/packages/backend/src/server/api/endpoints/admin/ad/create.ts index 27c7b5d318..e41d015646 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/create.ts @@ -11,26 +11,26 @@ export const meta = { params: { url: { - validator: $.str.min(1) + validator: $.str.min(1), }, memo: { - validator: $.str + validator: $.str, }, place: { - validator: $.str + validator: $.str, }, priority: { - validator: $.str + validator: $.str, }, ratio: { - validator: $.num.int().min(0) + validator: $.num.int().min(0), }, expiresAt: { - validator: $.num.int() + validator: $.num.int(), }, imageUrl: { - validator: $.str.min(1) - } + validator: $.str.min(1), + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts b/packages/backend/src/server/api/endpoints/admin/ad/delete.ts index 91934e1aab..ab5cd96d0f 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/delete.ts @@ -12,17 +12,17 @@ export const meta = { params: { id: { - validator: $.type(ID) - } + validator: $.type(ID), + }, }, errors: { noSuchAd: { message: 'No such ad.', code: 'NO_SUCH_AD', - id: 'ccac9863-3a03-416e-b899-8a64041118b1' - } - } + id: 'ccac9863-3a03-416e-b899-8a64041118b1', + }, + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/admin/ad/list.ts b/packages/backend/src/server/api/endpoints/admin/ad/list.ts index 000aaaba9d..f22dd0e961 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/list.ts @@ -13,7 +13,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { diff --git a/packages/backend/src/server/api/endpoints/admin/ad/update.ts b/packages/backend/src/server/api/endpoints/admin/ad/update.ts index 36c87895c2..1d91cfd162 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/update.ts @@ -12,28 +12,28 @@ export const meta = { params: { id: { - validator: $.type(ID) + validator: $.type(ID), }, memo: { - validator: $.str + validator: $.str, }, url: { - validator: $.str.min(1) + validator: $.str.min(1), }, imageUrl: { - validator: $.str.min(1) + validator: $.str.min(1), }, place: { - validator: $.str + validator: $.str, }, priority: { - validator: $.str + validator: $.str, }, ratio: { - validator: $.num.int().min(0) + validator: $.num.int().min(0), }, expiresAt: { - validator: $.num.int() + validator: $.num.int(), }, }, @@ -41,9 +41,9 @@ export const meta = { noSuchAd: { message: 'No such ad.', code: 'NO_SUCH_AD', - id: 'b7aa1727-1354-47bc-a182-3a9c3973d300' - } - } + id: 'b7aa1727-1354-47bc-a182-3a9c3973d300', + }, + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/create.ts b/packages/backend/src/server/api/endpoints/admin/announcements/create.ts index f1c07745f9..886cacff73 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/create.ts @@ -11,14 +11,14 @@ export const meta = { params: { title: { - validator: $.str.min(1) + validator: $.str.min(1), }, text: { - validator: $.str.min(1) + validator: $.str.min(1), }, imageUrl: { - validator: $.nullable.str.min(1) - } + validator: $.nullable.str.min(1), + }, }, res: { @@ -52,9 +52,9 @@ export const meta = { imageUrl: { type: 'string' as const, optional: false as const, nullable: true as const, - } - } - } + }, + }, + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts b/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts index 7dbc05b4c9..ade9ef581e 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/delete.ts @@ -12,17 +12,17 @@ export const meta = { params: { id: { - validator: $.type(ID) - } + validator: $.type(ID), + }, }, errors: { noSuchAnnouncement: { message: 'No such announcement.', code: 'NO_SUCH_ANNOUNCEMENT', - id: 'ecad8040-a276-4e85-bda9-015a708d291e' - } - } + id: 'ecad8040-a276-4e85-bda9-015a708d291e', + }, + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/list.ts b/packages/backend/src/server/api/endpoints/admin/announcements/list.ts index 4039bcd88f..f25b5e8efc 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/list.ts @@ -13,7 +13,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -63,10 +63,10 @@ export const meta = { reads: { type: 'number' as const, optional: false as const, nullable: false as const, - } - } - } - } + }, + }, + }, + }, }; export default define(meta, async (ps) => { @@ -76,7 +76,7 @@ export default define(meta, async (ps) => { for (const announcement of announcements) { (announcement as any).reads = await AnnouncementReads.count({ - announcementId: announcement.id + announcementId: announcement.id, }); } diff --git a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts index 343f37d626..3fa8440ebd 100644 --- a/packages/backend/src/server/api/endpoints/admin/announcements/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/announcements/update.ts @@ -12,26 +12,26 @@ export const meta = { params: { id: { - validator: $.type(ID) + validator: $.type(ID), }, title: { - validator: $.str.min(1) + validator: $.str.min(1), }, text: { - validator: $.str.min(1) + validator: $.str.min(1), }, imageUrl: { - validator: $.nullable.str.min(1) - } + validator: $.nullable.str.min(1), + }, }, errors: { noSuchAnnouncement: { message: 'No such announcement.', code: 'NO_SUCH_ANNOUNCEMENT', - id: 'd3aae5a7-6372-4cb4-b61c-f511ffc2d7cc' - } - } + id: 'd3aae5a7-6372-4cb4-b61c-f511ffc2d7cc', + }, + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts b/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts index 988ab29558..50979d53e8 100644 --- a/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/delete-all-files-of-a-user.ts @@ -14,12 +14,12 @@ export const meta = { userId: { validator: $.type(ID), }, - } + }, }; export default define(meta, async (ps, me) => { const files = await DriveFiles.find({ - userId: ps.userId + userId: ps.userId, }); for (const file of files) { diff --git a/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts b/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts index 8497478da9..ae0e396b4f 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/cleanup.ts @@ -12,7 +12,7 @@ export const meta = { export default define(meta, async (ps, me) => { const files = await DriveFiles.find({ - userId: IsNull() + userId: IsNull(), }); for (const file of files) { diff --git a/packages/backend/src/server/api/endpoints/admin/drive/files.ts b/packages/backend/src/server/api/endpoints/admin/drive/files.ts index fe1c799805..ee07245db7 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/files.ts @@ -13,7 +13,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -25,7 +25,7 @@ export const meta = { }, type: { - validator: $.optional.nullable.str.match(/^[a-zA-Z0-9\/\-*]+$/) + validator: $.optional.nullable.str.match(/^[a-zA-Z0-9\/\-*]+$/), }, origin: { @@ -34,12 +34,12 @@ export const meta = { 'local', 'remote', ]), - default: 'local' + default: 'local', }, hostname: { validator: $.optional.nullable.str, - default: null + default: null, }, }, @@ -49,9 +49,9 @@ export const meta = { items: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'DriveFile' - } - } + ref: 'DriveFile', + }, + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts b/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts index 270b89c4fa..ab8e3d68e9 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/show-file.ts @@ -24,8 +24,8 @@ export const meta = { noSuchFile: { message: 'No such file.', code: 'NO_SUCH_FILE', - id: 'caf3ca38-c6e5-472e-a30c-b05377dcc240' - } + id: 'caf3ca38-c6e5-472e-a30c-b05377dcc240', + }, }, res: { @@ -51,36 +51,36 @@ export const meta = { }, userHost: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, md5: { type: 'string' as const, optional: false as const, nullable: false as const, format: 'md5', - example: '15eca7fba0480996e2245f5185bf39f2' + example: '15eca7fba0480996e2245f5185bf39f2', }, name: { type: 'string' as const, optional: false as const, nullable: false as const, - example: 'lenna.jpg' + example: 'lenna.jpg', }, type: { type: 'string' as const, optional: false as const, nullable: false as const, - example: 'image/jpeg' + example: 'image/jpeg', }, size: { type: 'number' as const, optional: false as const, nullable: false as const, - example: 51469 + example: 51469, }, comment: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, blurhash: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, properties: { type: 'object' as const, @@ -89,24 +89,24 @@ export const meta = { width: { type: 'number' as const, optional: false as const, nullable: false as const, - example: 1280 + example: 1280, }, height: { type: 'number' as const, optional: false as const, nullable: false as const, - example: 720 + example: 720, }, avgColor: { type: 'string' as const, optional: true as const, nullable: false as const, - example: 'rgb(40,65,87)' - } - } + example: 'rgb(40,65,87)', + }, + }, }, storedInternal: { type: 'boolean' as const, optional: false as const, nullable: true as const, - example: true + example: true, }, url: { type: 'string' as const, @@ -137,11 +137,11 @@ export const meta = { }, uri: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, src: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, folderId: { type: 'string' as const, @@ -155,21 +155,21 @@ export const meta = { }, isLink: { type: 'boolean' as const, - optional: false as const, nullable: false as const - } - } - } + optional: false as const, nullable: false as const, + }, + }, + }, }; export default define(meta, async (ps, me) => { const file = ps.fileId ? await DriveFiles.findOne(ps.fileId) : await DriveFiles.findOne({ where: [{ - url: ps.url + url: ps.url, }, { - thumbnailUrl: ps.url + thumbnailUrl: ps.url, }, { - webpublicUrl: ps.url - }] + webpublicUrl: ps.url, + }], }); if (file == null) { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/add.ts b/packages/backend/src/server/api/endpoints/admin/emoji/add.ts index 1af81fe46d..407d9920d9 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/add.ts @@ -17,7 +17,7 @@ export const meta = { params: { fileId: { - validator: $.type(ID) + validator: $.type(ID), }, }, @@ -25,9 +25,9 @@ export const meta = { noSuchFile: { message: 'No such file.', code: 'MO_SUCH_FILE', - id: 'fc46b5a4-6b92-4c33-ac66-b806659bb5cf' - } - } + id: 'fc46b5a4-6b92-4c33-ac66-b806659bb5cf', + }, + }, }; export default define(meta, async (ps, me) => { @@ -51,14 +51,14 @@ export default define(meta, async (ps, me) => { await getConnection().queryResultCache!.remove(['meta_emojis']); publishBroadcastStream('emojiAdded', { - emoji: await Emojis.pack(emoji.id) + emoji: await Emojis.pack(emoji.id), }); insertModerationLog(me, 'addEmoji', { - emojiId: emoji.id + emojiId: emoji.id, }); return { - id: emoji.id + id: emoji.id, }; }); diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts b/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts index 4c8ab99f7c..ae02df65e2 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/copy.ts @@ -17,7 +17,7 @@ export const meta = { params: { emojiId: { - validator: $.type(ID) + validator: $.type(ID), }, }, @@ -25,8 +25,8 @@ export const meta = { noSuchEmoji: { message: 'No such emoji.', code: 'NO_SUCH_EMOJI', - id: 'e2785b66-dca3-4087-9cac-b93c541cc425' - } + id: 'e2785b66-dca3-4087-9cac-b93c541cc425', + }, }, res: { @@ -37,9 +37,9 @@ export const meta = { type: 'string' as const, optional: false as const, nullable: false as const, format: 'id', - } - } - } + }, + }, + }, }; export default define(meta, async (ps, me) => { @@ -72,10 +72,10 @@ export default define(meta, async (ps, me) => { await getConnection().queryResultCache!.remove(['meta_emojis']); publishBroadcastStream('emojiAdded', { - emoji: await Emojis.pack(copied.id) + emoji: await Emojis.pack(copied.id), }); return { - id: copied.id + id: copied.id, }; }); diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts b/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts index 3c8ca22170..090ba2b64a 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list-remote.ts @@ -14,17 +14,17 @@ export const meta = { params: { query: { validator: $.optional.nullable.str, - default: null + default: null, }, host: { validator: $.optional.nullable.str, - default: null + default: null, }, limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -33,7 +33,7 @@ export const meta = { untilId: { validator: $.optional.type(ID), - } + }, }, res: { @@ -53,8 +53,8 @@ export const meta = { optional: false as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const - } + optional: false as const, nullable: false as const, + }, }, name: { type: 'string' as const, @@ -71,10 +71,10 @@ export const meta = { url: { type: 'string' as const, optional: false as const, nullable: false as const, - } - } - } - } + }, + }, + }, + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/list.ts b/packages/backend/src/server/api/endpoints/admin/emoji/list.ts index cb1e79e0fe..89cb60acaf 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list.ts @@ -14,12 +14,12 @@ export const meta = { params: { query: { validator: $.optional.nullable.str, - default: null + default: null, }, limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -28,7 +28,7 @@ export const meta = { untilId: { validator: $.optional.type(ID), - } + }, }, res: { @@ -48,8 +48,8 @@ export const meta = { optional: false as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const - } + optional: false as const, nullable: false as const, + }, }, name: { type: 'string' as const, @@ -66,10 +66,10 @@ export const meta = { url: { type: 'string' as const, optional: false as const, nullable: false as const, - } - } - } - } + }, + }, + }, + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/remove.ts b/packages/backend/src/server/api/endpoints/admin/emoji/remove.ts index 259950e362..78085470a9 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/remove.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/remove.ts @@ -14,17 +14,17 @@ export const meta = { params: { id: { - validator: $.type(ID) - } + validator: $.type(ID), + }, }, errors: { noSuchEmoji: { message: 'No such emoji.', code: 'NO_SUCH_EMOJI', - id: 'be83669b-773a-44b7-b1f8-e5e5170ac3c2' - } - } + id: 'be83669b-773a-44b7-b1f8-e5e5170ac3c2', + }, + }, }; export default define(meta, async (ps, me) => { @@ -37,6 +37,6 @@ export default define(meta, async (ps, me) => { await getConnection().queryResultCache!.remove(['meta_emojis']); insertModerationLog(me, 'removeEmoji', { - emoji: emoji + emoji: emoji, }); }); diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts index 3fd547d7e5..c61d8cb320 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts @@ -13,29 +13,29 @@ export const meta = { params: { id: { - validator: $.type(ID) + validator: $.type(ID), }, name: { - validator: $.str + validator: $.str, }, category: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, aliases: { - validator: $.arr($.str) - } + validator: $.arr($.str), + }, }, errors: { noSuchEmoji: { message: 'No such emoji.', code: 'NO_SUCH_EMOJI', - id: '684dec9d-a8c2-4364-9aa8-456c49cb1dc8' - } - } + id: '684dec9d-a8c2-4364-9aa8-456c49cb1dc8', + }, + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts b/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts index 82540c5447..d9e003d35d 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/delete-all-files.ts @@ -11,14 +11,14 @@ export const meta = { params: { host: { - validator: $.str - } - } + validator: $.str, + }, + }, }; export default define(meta, async (ps, me) => { const files = await DriveFiles.find({ - userHost: ps.host + userHost: ps.host, }); for (const file of files) { diff --git a/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts b/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts index 65a6947ba0..9e7a8ec476 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/refresh-remote-instance-metadata.ts @@ -12,9 +12,9 @@ export const meta = { params: { host: { - validator: $.str + validator: $.str, }, - } + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts b/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts index 7935eaa631..8fc964fd2f 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/remove-all-following.ts @@ -11,19 +11,19 @@ export const meta = { params: { host: { - validator: $.str - } - } + validator: $.str, + }, + }, }; export default define(meta, async (ps, me) => { const followings = await Followings.find({ - followerHost: ps.host + followerHost: ps.host, }); const pairs = await Promise.all(followings.map(f => Promise.all([ Users.findOneOrFail(f.followerId), - Users.findOneOrFail(f.followeeId) + Users.findOneOrFail(f.followeeId), ]))); for (const pair of pairs) { diff --git a/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts b/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts index 34eab27c78..4ea1275f7c 100644 --- a/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts +++ b/packages/backend/src/server/api/endpoints/admin/federation/update-instance.ts @@ -11,13 +11,13 @@ export const meta = { params: { host: { - validator: $.str + validator: $.str, }, isSuspended: { - validator: $.bool + validator: $.bool, }, - } + }, }; export default define(meta, async (ps, me) => { @@ -28,6 +28,6 @@ export default define(meta, async (ps, me) => { } Instances.update({ host: toPuny(ps.host) }, { - isSuspended: ps.isSuspended + isSuspended: ps.isSuspended, }); }); diff --git a/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts b/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts index bce813232b..64f0292943 100644 --- a/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/get-table-stats.ts @@ -16,10 +16,10 @@ export const meta = { example: { migrations: { count: 66, - size: 32768 + size: 32768, }, - } - } + }, + }, }; export default define(meta, async () => { diff --git a/packages/backend/src/server/api/endpoints/admin/invite.ts b/packages/backend/src/server/api/endpoints/admin/invite.ts index 2c69eec535..b9452c83d2 100644 --- a/packages/backend/src/server/api/endpoints/admin/invite.ts +++ b/packages/backend/src/server/api/endpoints/admin/invite.ts @@ -20,10 +20,10 @@ export const meta = { optional: false as const, nullable: false as const, example: '2ERUA5VR', maxLength: 8, - minLength: 8 - } - } - } + minLength: 8, + }, + }, + }, }; export default define(meta, async () => { diff --git a/packages/backend/src/server/api/endpoints/admin/moderators/add.ts b/packages/backend/src/server/api/endpoints/admin/moderators/add.ts index 2b87fc217f..8e3419bf66 100644 --- a/packages/backend/src/server/api/endpoints/admin/moderators/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/moderators/add.ts @@ -13,7 +13,7 @@ export const meta = { userId: { validator: $.type(ID), }, - } + }, }; export default define(meta, async (ps) => { @@ -28,6 +28,6 @@ export default define(meta, async (ps) => { } await Users.update(user.id, { - isModerator: true + isModerator: true, }); }); diff --git a/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts b/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts index cbb0625224..5a5a91e9ce 100644 --- a/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts +++ b/packages/backend/src/server/api/endpoints/admin/moderators/remove.ts @@ -13,7 +13,7 @@ export const meta = { userId: { validator: $.type(ID), }, - } + }, }; export default define(meta, async (ps) => { @@ -24,6 +24,6 @@ export default define(meta, async (ps) => { } await Users.update(user.id, { - isModerator: false + isModerator: false, }); }); diff --git a/packages/backend/src/server/api/endpoints/admin/promo/create.ts b/packages/backend/src/server/api/endpoints/admin/promo/create.ts index 3bdaaad4d9..245780c2d1 100644 --- a/packages/backend/src/server/api/endpoints/admin/promo/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/promo/create.ts @@ -17,7 +17,7 @@ export const meta = { }, expiresAt: { - validator: $.num.int() + validator: $.num.int(), }, }, @@ -25,15 +25,15 @@ export const meta = { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: 'ee449fbe-af2a-453b-9cae-cf2fe7c895fc' + id: 'ee449fbe-af2a-453b-9cae-cf2fe7c895fc', }, alreadyPromoted: { message: 'The note has already promoted.', code: 'ALREADY_PROMOTED', - id: 'ae427aa2-7a41-484f-a18c-2c1104051604' + id: 'ae427aa2-7a41-484f-a18c-2c1104051604', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/admin/queue/clear.ts b/packages/backend/src/server/api/endpoints/admin/queue/clear.ts index fedb7065ab..3a7ae6b4b0 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/clear.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/clear.ts @@ -8,7 +8,7 @@ export const meta = { requireCredential: true as const, requireModerator: true, - params: {} + params: {}, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts b/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts index cd7b640983..cb2d1d0d79 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/deliver-delayed.ts @@ -24,15 +24,15 @@ export const meta = { }, { type: 'number' as const, - } - ] - } + }, + ], + }, }, example: [[ 'example.com', - 12 - ]] - } + 12, + ]], + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts index 1925906c28..d524002faf 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/inbox-delayed.ts @@ -24,15 +24,15 @@ export const meta = { }, { type: 'number' as const, - } - ] - } + }, + ], + }, }, example: [[ 'example.com', - 12 - ]] - } + 12, + ]], + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/admin/queue/jobs.ts b/packages/backend/src/server/api/endpoints/admin/queue/jobs.ts index c426e5f39b..ece1d46f3f 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/jobs.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/jobs.ts @@ -19,7 +19,7 @@ export const meta = { limit: { validator: $.optional.num, - default: 50 + default: 50, }, }, @@ -33,27 +33,27 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, data: { type: 'object' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, attempts: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, maxAttempts: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, timestamp: { type: 'number' as const, - optional: false as const, nullable: false as const - } - } - } - } + optional: false as const, nullable: false as const, + }, + }, + }, + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/admin/queue/stats.ts b/packages/backend/src/server/api/endpoints/admin/queue/stats.ts index 38f18459dd..1fc42ea0b5 100644 --- a/packages/backend/src/server/api/endpoints/admin/queue/stats.ts +++ b/packages/backend/src/server/api/endpoints/admin/queue/stats.ts @@ -14,19 +14,19 @@ export const meta = { optional: false as const, nullable: false as const, properties: { deliver: { - ref: 'QueueCount' + ref: 'QueueCount', }, inbox: { - ref: 'QueueCount' + ref: 'QueueCount', }, db: { - ref: 'QueueCount' + ref: 'QueueCount', }, objectStorage: { - ref: 'QueueCount' - } - } - } + ref: 'QueueCount', + }, + }, + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/admin/relays/add.ts b/packages/backend/src/server/api/endpoints/admin/relays/add.ts index 567035fd3a..80609aee94 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/add.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/add.ts @@ -12,7 +12,7 @@ export const meta = { params: { inbox: { - validator: $.str + validator: $.str, }, }, @@ -20,7 +20,7 @@ export const meta = { invalidUrl: { message: 'Invalid URL', code: 'INVALID_URL', - id: 'fb8c92d3-d4e5-44e7-b3d4-800d5cef8b2c' + id: 'fb8c92d3-d4e5-44e7-b3d4-800d5cef8b2c', }, }, @@ -31,12 +31,12 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, inbox: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'url' + format: 'url', }, status: { type: 'string' as const, @@ -45,11 +45,11 @@ export const meta = { enum: [ 'requesting', 'accepted', - 'rejected' - ] - } - } - } + 'rejected', + ], + }, + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/admin/relays/list.ts b/packages/backend/src/server/api/endpoints/admin/relays/list.ts index 031ebe85d0..ef103fbb31 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/list.ts @@ -20,12 +20,12 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, inbox: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'url' + format: 'url', }, status: { type: 'string' as const, @@ -34,12 +34,12 @@ export const meta = { enum: [ 'requesting', 'accepted', - 'rejected' - ] - } - } - } - } + 'rejected', + ], + }, + }, + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/admin/relays/remove.ts b/packages/backend/src/server/api/endpoints/admin/relays/remove.ts index c1c50f5dc0..e7ddef30fc 100644 --- a/packages/backend/src/server/api/endpoints/admin/relays/remove.ts +++ b/packages/backend/src/server/api/endpoints/admin/relays/remove.ts @@ -10,7 +10,7 @@ export const meta = { params: { inbox: { - validator: $.str + validator: $.str, }, }, }; diff --git a/packages/backend/src/server/api/endpoints/admin/reset-password.ts b/packages/backend/src/server/api/endpoints/admin/reset-password.ts index 0fc2c6a868..bdd7ef27b8 100644 --- a/packages/backend/src/server/api/endpoints/admin/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/admin/reset-password.ts @@ -25,10 +25,10 @@ export const meta = { type: 'string' as const, optional: false as const, nullable: false as const, minLength: 8, - maxLength: 8 - } - } - } + maxLength: 8, + }, + }, + }, }; export default define(meta, async (ps) => { @@ -48,12 +48,12 @@ export default define(meta, async (ps) => { const hash = bcrypt.hashSync(passwd); await UserProfiles.update({ - userId: user.id + userId: user.id, }, { - password: hash + password: hash, }); return { - password: passwd + password: passwd, }; }); diff --git a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts index 7b71f8e000..94158ecfdb 100644 --- a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts +++ b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts @@ -13,7 +13,7 @@ export const meta = { reportId: { validator: $.type(ID), }, - } + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/admin/send-email.ts b/packages/backend/src/server/api/endpoints/admin/send-email.ts index 6f67b78542..4797aa7a2b 100644 --- a/packages/backend/src/server/api/endpoints/admin/send-email.ts +++ b/packages/backend/src/server/api/endpoints/admin/send-email.ts @@ -18,7 +18,7 @@ export const meta = { text: { validator: $.str, }, - } + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/admin/server-info.ts b/packages/backend/src/server/api/endpoints/admin/server-info.ts index bb2d35e397..4ddc39deb0 100644 --- a/packages/backend/src/server/api/endpoints/admin/server-info.ts +++ b/packages/backend/src/server/api/endpoints/admin/server-info.ts @@ -24,7 +24,7 @@ export const meta = { os: { type: 'string' as const, optional: false as const, nullable: false as const, - example: 'linux' + example: 'linux', }, node: { type: 'string' as const, @@ -45,8 +45,8 @@ export const meta = { cores: { type: 'number' as const, optional: false as const, nullable: false as const, - } - } + }, + }, }, mem: { type: 'object' as const, @@ -56,8 +56,8 @@ export const meta = { type: 'number' as const, optional: false as const, nullable: false as const, format: 'bytes', - } - } + }, + }, }, fs: { type: 'object' as const, @@ -72,8 +72,8 @@ export const meta = { type: 'number' as const, optional: false as const, nullable: false as const, format: 'bytes', - } - } + }, + }, }, net: { type: 'object' as const, @@ -82,12 +82,12 @@ export const meta = { interface: { type: 'string' as const, optional: false as const, nullable: false as const, - example: 'eth0' - } - } - } - } - } + example: 'eth0', + }, + }, + }, + }, + }, }; export default define(meta, async () => { @@ -103,17 +103,17 @@ export default define(meta, async () => { redis: redisClient.server_info.redis_version, cpu: { model: os.cpus()[0].model, - cores: os.cpus().length + cores: os.cpus().length, }, mem: { - total: memStats.total + total: memStats.total, }, fs: { total: fsStats[0].size, used: fsStats[0].used, }, net: { - interface: netInterface - } + interface: netInterface, + }, }; }); diff --git a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts index e9509568d0..19d4be973f 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts @@ -13,7 +13,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -35,34 +35,34 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, createdAt: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'date-time' + format: 'date-time', }, type: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, info: { type: 'object' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, userId: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, user: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' - } - } - } - } + ref: 'User', + }, + }, + }, + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/admin/show-user.ts b/packages/backend/src/server/api/endpoints/admin/show-user.ts index 963c123255..21cc9e5abc 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-user.ts @@ -22,85 +22,85 @@ export const meta = { id: { type: 'string' as const, nullable: false as const, optional: false as const, - format: 'id' + format: 'id', }, createdAt: { type: 'string' as const, nullable: false as const, optional: false as const, - format: 'date-time' + format: 'date-time', }, updatedAt: { type: 'string' as const, nullable: true as const, optional: false as const, - format: 'date-time' + format: 'date-time', }, lastFetchedAt: { type: 'string' as const, - nullable: true as const, optional: false as const + nullable: true as const, optional: false as const, }, username: { type: 'string' as const, - nullable: false as const, optional: false as const + nullable: false as const, optional: false as const, }, name: { type: 'string' as const, - nullable: false as const, optional: false as const + nullable: false as const, optional: false as const, }, folowersCount: { type: 'number' as const, - nullable: false as const, optional: false as const + nullable: false as const, optional: false as const, }, followingCount: { type: 'number' as const, - nullable: false as const, optional: false as const + nullable: false as const, optional: false as const, }, notesCount: { type: 'number' as const, - nullable: false as const, optional: false as const + nullable: false as const, optional: false as const, }, avatarId: { type: 'string' as const, - nullable: true as const, optional: false as const + nullable: true as const, optional: false as const, }, bannerId: { type: 'string' as const, - nullable: true as const, optional: false as const + nullable: true as const, optional: false as const, }, tags: { type: 'array' as const, nullable: false as const, optional: false as const, items: { type: 'string' as const, - nullable: false as const, optional: false as const - } + nullable: false as const, optional: false as const, + }, }, avatarUrl: { type: 'string' as const, nullable: true as const, optional: false as const, - format: 'url' + format: 'url', }, bannerUrl: { type: 'string' as const, nullable: true as const, optional: false as const, - format: 'url' + format: 'url', }, avatarBlurhash: { type: 'any' as const, nullable: true as const, optional: false as const, - default: null + default: null, }, bannerBlurhash: { type: 'any' as const, nullable: true as const, optional: false as const, - default: null + default: null, }, isSuspended: { type: 'boolean' as const, - nullable: false as const, optional: false as const + nullable: false as const, optional: false as const, }, isSilenced: { type: 'boolean' as const, - nullable: false as const, optional: false as const + nullable: false as const, optional: false as const, }, isLocked: { type: 'boolean' as const, @@ -108,55 +108,55 @@ export const meta = { }, isBot: { type: 'boolean' as const, - nullable: false as const, optional: false as const + nullable: false as const, optional: false as const, }, isCat: { type: 'boolean' as const, - nullable: false as const, optional: false as const + nullable: false as const, optional: false as const, }, isAdmin: { type: 'boolean' as const, - nullable: false as const, optional: false as const + nullable: false as const, optional: false as const, }, isModerator: { type: 'boolean' as const, - nullable: false as const, optional: false as const + nullable: false as const, optional: false as const, }, emojis: { type: 'array' as const, nullable: false as const, optional: false as const, items: { type: 'string' as const, - nullable: false as const, optional: false as const - } + nullable: false as const, optional: false as const, + }, }, host: { type: 'string' as const, - nullable: true as const, optional: false as const + nullable: true as const, optional: false as const, }, inbox: { type: 'string' as const, - nullable: true as const, optional: false as const + nullable: true as const, optional: false as const, }, sharedInbox: { type: 'string' as const, - nullable: true as const, optional: false as const + nullable: true as const, optional: false as const, }, featured: { type: 'string' as const, - nullable: true as const, optional: false as const + nullable: true as const, optional: false as const, }, uri: { type: 'string' as const, - nullable: true as const, optional: false as const + nullable: true as const, optional: false as const, }, token: { type: 'string' as const, nullable: false as const, optional: false as const, - default: '' - } - } - } + default: '', + }, + }, + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/admin/show-users.ts b/packages/backend/src/server/api/endpoints/admin/show-users.ts index 20b63e7be6..9c57917cb2 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-users.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-users.ts @@ -11,12 +11,12 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, offset: { validator: $.optional.num.min(0), - default: 0 + default: 0, }, sort: { @@ -40,7 +40,7 @@ export const meta = { 'silenced', 'suspended', ]), - default: 'all' + default: 'all', }, origin: { @@ -49,18 +49,18 @@ export const meta = { 'local', 'remote', ]), - default: 'local' + default: 'local', }, username: { validator: $.optional.str, - default: null + default: null, }, hostname: { validator: $.optional.str, - default: null - } + default: null, + }, }, res: { @@ -69,9 +69,9 @@ export const meta = { items: { type: 'object' as const, nullable: false as const, optional: false as const, - ref: 'User' - } - } + ref: 'User', + }, + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/admin/silence-user.ts b/packages/backend/src/server/api/endpoints/admin/silence-user.ts index 9bfed2310a..9f5135b1a6 100644 --- a/packages/backend/src/server/api/endpoints/admin/silence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/silence-user.ts @@ -14,7 +14,7 @@ export const meta = { userId: { validator: $.type(ID), }, - } + }, }; export default define(meta, async (ps, me) => { @@ -29,7 +29,7 @@ export default define(meta, async (ps, me) => { } await Users.update(user.id, { - isSilenced: true + isSilenced: true, }); insertModerationLog(me, 'silence', { diff --git a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts index 364f258ce8..c062dcc93f 100644 --- a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts @@ -18,7 +18,7 @@ export const meta = { userId: { validator: $.type(ID), }, - } + }, }; export default define(meta, async (ps, me) => { @@ -37,7 +37,7 @@ export default define(meta, async (ps, me) => { } await Users.update(user.id, { - isSuspended: true + isSuspended: true, }); insertModerationLog(me, 'suspend', { @@ -58,12 +58,12 @@ export default define(meta, async (ps, me) => { async function unFollowAll(follower: User) { const followings = await Followings.find({ - followerId: follower.id + followerId: follower.id, }); for (const following of followings) { const followee = await Users.findOne({ - id: following.followeeId + id: following.followeeId, }); if (followee == null) { @@ -79,6 +79,6 @@ async function readAllNotify(notifier: User) { notifierId: notifier.id, isRead: false, }, { - isRead: true + isRead: true, }); } diff --git a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts index 9994fbf462..bc081c8487 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts @@ -14,7 +14,7 @@ export const meta = { userId: { validator: $.type(ID), }, - } + }, }; export default define(meta, async (ps, me) => { @@ -25,7 +25,7 @@ export default define(meta, async (ps, me) => { } await Users.update(user.id, { - isSilenced: false + isSilenced: false, }); insertModerationLog(me, 'unsilence', { diff --git a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts index ab4c2d3dfe..73a5bc739b 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts @@ -15,7 +15,7 @@ export const meta = { userId: { validator: $.type(ID), }, - } + }, }; export default define(meta, async (ps, me) => { @@ -26,7 +26,7 @@ export default define(meta, async (ps, me) => { } await Users.update(user.id, { - isSuspended: false + isSuspended: false, }); insertModerationLog(me, 'unsuspend', { diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index 55447098dc..e67088e0aa 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -246,57 +246,57 @@ export const meta = { }, useObjectStorage: { - validator: $.optional.bool + validator: $.optional.bool, }, objectStorageBaseUrl: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, objectStorageBucket: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, objectStoragePrefix: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, objectStorageEndpoint: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, objectStorageRegion: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, objectStoragePort: { - validator: $.optional.nullable.num + validator: $.optional.nullable.num, }, objectStorageAccessKey: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, objectStorageSecretKey: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, objectStorageUseSSL: { - validator: $.optional.bool + validator: $.optional.bool, }, objectStorageUseProxy: { - validator: $.optional.bool + validator: $.optional.bool, }, objectStorageSetPublicRead: { - validator: $.optional.bool + validator: $.optional.bool, }, objectStorageS3ForcePathStyle: { - validator: $.optional.bool + validator: $.optional.bool, }, - } + }, }; export default define(meta, async (ps, me) => { @@ -593,8 +593,8 @@ export default define(meta, async (ps, me) => { await getConnection().transaction(async transactionalEntityManager => { const meta = await transactionalEntityManager.findOne(Meta, { order: { - id: 'DESC' - } + id: 'DESC', + }, }); if (meta) { diff --git a/packages/backend/src/server/api/endpoints/admin/vacuum.ts b/packages/backend/src/server/api/endpoints/admin/vacuum.ts index 9a80d88c44..d08dfdd9ea 100644 --- a/packages/backend/src/server/api/endpoints/admin/vacuum.ts +++ b/packages/backend/src/server/api/endpoints/admin/vacuum.ts @@ -16,7 +16,7 @@ export const meta = { analyze: { validator: $.bool, }, - } + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/announcements.ts b/packages/backend/src/server/api/endpoints/announcements.ts index a67737b2ff..32ef49d889 100644 --- a/packages/backend/src/server/api/endpoints/announcements.ts +++ b/packages/backend/src/server/api/endpoints/announcements.ts @@ -12,12 +12,12 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, withUnreads: { validator: $.optional.boolean, - default: false + default: false, }, sinceId: { @@ -67,10 +67,10 @@ export const meta = { isRead: { type: 'boolean' as const, optional: false as const, nullable: false as const, - } - } - } - } + }, + }, + }, + }, }; export default define(meta, async (ps, user) => { @@ -80,7 +80,7 @@ export default define(meta, async (ps, user) => { if (user) { const reads = (await AnnouncementReads.find({ - userId: user.id + userId: user.id, })).map(x => x.announcementId); for (const announcement of announcements) { diff --git a/packages/backend/src/server/api/endpoints/antennas/create.ts b/packages/backend/src/server/api/endpoints/antennas/create.ts index 4bdae8cc33..83c7d3e0a5 100644 --- a/packages/backend/src/server/api/endpoints/antennas/create.ts +++ b/packages/backend/src/server/api/endpoints/antennas/create.ts @@ -15,11 +15,11 @@ export const meta = { params: { name: { - validator: $.str.range(1, 100) + validator: $.str.range(1, 100), }, src: { - validator: $.str.or(['home', 'all', 'users', 'list', 'group']) + validator: $.str.or(['home', 'all', 'users', 'list', 'group']), }, userListId: { @@ -31,53 +31,53 @@ export const meta = { }, keywords: { - validator: $.arr($.arr($.str)) + validator: $.arr($.arr($.str)), }, excludeKeywords: { - validator: $.arr($.arr($.str)) + validator: $.arr($.arr($.str)), }, users: { - validator: $.arr($.str) + validator: $.arr($.str), }, caseSensitive: { - validator: $.bool + validator: $.bool, }, withReplies: { - validator: $.bool + validator: $.bool, }, withFile: { - validator: $.bool + validator: $.bool, }, notify: { - validator: $.bool - } + validator: $.bool, + }, }, errors: { noSuchUserList: { message: 'No such user list.', code: 'NO_SUCH_USER_LIST', - id: '95063e93-a283-4b8b-9aa5-bcdb8df69a7f' + id: '95063e93-a283-4b8b-9aa5-bcdb8df69a7f', }, noSuchUserGroup: { message: 'No such user group.', code: 'NO_SUCH_USER_GROUP', - id: 'aa3c0b9a-8cae-47c0-92ac-202ce5906682' - } + id: 'aa3c0b9a-8cae-47c0-92ac-202ce5906682', + }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'Antenna' - } + ref: 'Antenna', + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/antennas/delete.ts b/packages/backend/src/server/api/endpoints/antennas/delete.ts index 1cd136183e..721932f311 100644 --- a/packages/backend/src/server/api/endpoints/antennas/delete.ts +++ b/packages/backend/src/server/api/endpoints/antennas/delete.ts @@ -15,22 +15,22 @@ export const meta = { params: { antennaId: { validator: $.type(ID), - } + }, }, errors: { noSuchAntenna: { message: 'No such antenna.', code: 'NO_SUCH_ANTENNA', - id: 'b34dcf9d-348f-44bb-99d0-6c9314cfe2df' - } - } + id: 'b34dcf9d-348f-44bb-99d0-6c9314cfe2df', + }, + }, }; export default define(meta, async (ps, user) => { const antenna = await Antennas.findOne({ id: ps.antennaId, - userId: user.id + userId: user.id, }); if (antenna == null) { diff --git a/packages/backend/src/server/api/endpoints/antennas/list.ts b/packages/backend/src/server/api/endpoints/antennas/list.ts index 8baae8435b..4a9eed8563 100644 --- a/packages/backend/src/server/api/endpoints/antennas/list.ts +++ b/packages/backend/src/server/api/endpoints/antennas/list.ts @@ -14,9 +14,9 @@ export const meta = { items: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'Antenna' - } - } + ref: 'Antenna', + }, + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/antennas/notes.ts b/packages/backend/src/server/api/endpoints/antennas/notes.ts index 02fec2778b..968924831c 100644 --- a/packages/backend/src/server/api/endpoints/antennas/notes.ts +++ b/packages/backend/src/server/api/endpoints/antennas/notes.ts @@ -23,7 +23,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -47,8 +47,8 @@ export const meta = { noSuchAntenna: { message: 'No such antenna.', code: 'NO_SUCH_ANTENNA', - id: '850926e0-fd3b-49b6-b69a-b28a5dbd82fe' - } + id: '850926e0-fd3b-49b6-b69a-b28a5dbd82fe', + }, }, res: { @@ -57,15 +57,15 @@ export const meta = { items: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'Note' - } - } + ref: 'Note', + }, + }, }; export default define(meta, async (ps, user) => { const antenna = await Antennas.findOne({ id: ps.antennaId, - userId: user.id + userId: user.id, }); if (antenna == null) { diff --git a/packages/backend/src/server/api/endpoints/antennas/show.ts b/packages/backend/src/server/api/endpoints/antennas/show.ts index 3cdf4dcb61..79e988497d 100644 --- a/packages/backend/src/server/api/endpoints/antennas/show.ts +++ b/packages/backend/src/server/api/endpoints/antennas/show.ts @@ -21,15 +21,15 @@ export const meta = { noSuchAntenna: { message: 'No such antenna.', code: 'NO_SUCH_ANTENNA', - id: 'c06569fb-b025-4f23-b22d-1fcd20d2816b' + id: 'c06569fb-b025-4f23-b22d-1fcd20d2816b', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'Antenna' - } + ref: 'Antenna', + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/antennas/update.ts b/packages/backend/src/server/api/endpoints/antennas/update.ts index d69b4feee6..d5400a7926 100644 --- a/packages/backend/src/server/api/endpoints/antennas/update.ts +++ b/packages/backend/src/server/api/endpoints/antennas/update.ts @@ -18,11 +18,11 @@ export const meta = { }, name: { - validator: $.str.range(1, 100) + validator: $.str.range(1, 100), }, src: { - validator: $.str.or(['home', 'all', 'users', 'list', 'group']) + validator: $.str.or(['home', 'all', 'users', 'list', 'group']), }, userListId: { @@ -34,66 +34,66 @@ export const meta = { }, keywords: { - validator: $.arr($.arr($.str)) + validator: $.arr($.arr($.str)), }, excludeKeywords: { - validator: $.arr($.arr($.str)) + validator: $.arr($.arr($.str)), }, users: { - validator: $.arr($.str) + validator: $.arr($.str), }, caseSensitive: { - validator: $.bool + validator: $.bool, }, withReplies: { - validator: $.bool + validator: $.bool, }, withFile: { - validator: $.bool + validator: $.bool, }, notify: { - validator: $.bool - } + validator: $.bool, + }, }, errors: { noSuchAntenna: { message: 'No such antenna.', code: 'NO_SUCH_ANTENNA', - id: '10c673ac-8852-48eb-aa1f-f5b67f069290' + id: '10c673ac-8852-48eb-aa1f-f5b67f069290', }, noSuchUserList: { message: 'No such user list.', code: 'NO_SUCH_USER_LIST', - id: '1c6b35c9-943e-48c2-81e4-2844989407f7' + id: '1c6b35c9-943e-48c2-81e4-2844989407f7', }, noSuchUserGroup: { message: 'No such user group.', code: 'NO_SUCH_USER_GROUP', - id: '109ed789-b6eb-456e-b8a9-6059d567d385' - } + id: '109ed789-b6eb-456e-b8a9-6059d567d385', + }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'Antenna' - } + ref: 'Antenna', + }, }; export default define(meta, async (ps, user) => { // Fetch the antenna const antenna = await Antennas.findOne({ id: ps.antennaId, - userId: user.id + userId: user.id, }); if (antenna == null) { diff --git a/packages/backend/src/server/api/endpoints/ap/get.ts b/packages/backend/src/server/api/endpoints/ap/get.ts index 2f97a24774..000ed2d2df 100644 --- a/packages/backend/src/server/api/endpoints/ap/get.ts +++ b/packages/backend/src/server/api/endpoints/ap/get.ts @@ -11,7 +11,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 30 + max: 30, }, params: { @@ -26,7 +26,7 @@ export const meta = { res: { type: 'object' as const, optional: false as const, nullable: false as const, - } + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/ap/show.ts b/packages/backend/src/server/api/endpoints/ap/show.ts index 32685d44bd..709349262a 100644 --- a/packages/backend/src/server/api/endpoints/ap/show.ts +++ b/packages/backend/src/server/api/endpoints/ap/show.ts @@ -20,7 +20,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 30 + max: 30, }, params: { @@ -33,8 +33,8 @@ export const meta = { noSuchObject: { message: 'No such object.', code: 'NO_SUCH_OBJECT', - id: 'dc94d745-1262-4e63-a17d-fecaa57efc82' - } + id: 'dc94d745-1262-4e63-a17d-fecaa57efc82', + }, }, res: { @@ -44,14 +44,14 @@ export const meta = { type: { type: 'string' as const, optional: false as const, nullable: false as const, - enum: ['User', 'Note'] + enum: ['User', 'Note'], }, object: { type: 'object' as const, - optional: false as const, nullable: false as const - } - } - } + optional: false as const, nullable: false as const, + }, + }, + }, }; export default define(meta, async (ps) => { @@ -79,7 +79,7 @@ async function fetchAny(uri: string) { if (note) { return { type: 'Note', - object: await Notes.pack(note, null, { detail: true }) + object: await Notes.pack(note, null, { detail: true }), }; } } else if (type === 'users') { @@ -88,7 +88,7 @@ async function fetchAny(uri: string) { if (user) { return { type: 'User', - object: await Users.pack(user, null, { detail: true }) + object: await Users.pack(user, null, { detail: true }), }; } } @@ -102,7 +102,7 @@ async function fetchAny(uri: string) { { const [user, note] = await Promise.all([ Users.findOne({ uri: uri }), - Notes.findOne({ uri: uri }) + Notes.findOne({ uri: uri }), ]); const packed = await mergePack(user, note); @@ -127,7 +127,7 @@ async function fetchAny(uri: string) { if (note) { return { type: 'Note', - object: await Notes.pack(note, null, { detail: true }) + object: await Notes.pack(note, null, { detail: true }), }; } } else if (type === 'users') { @@ -136,7 +136,7 @@ async function fetchAny(uri: string) { if (user) { return { type: 'User', - object: await Users.pack(user, null, { detail: true }) + object: await Users.pack(user, null, { detail: true }), }; } } @@ -144,7 +144,7 @@ async function fetchAny(uri: string) { const [user, note] = await Promise.all([ Users.findOne({ uri: object.id }), - Notes.findOne({ uri: object.id }) + Notes.findOne({ uri: object.id }), ]); const packed = await mergePack(user, note); @@ -156,7 +156,7 @@ async function fetchAny(uri: string) { const user = await createPerson(getApId(object)); return { type: 'User', - object: await Users.pack(user, null, { detail: true }) + object: await Users.pack(user, null, { detail: true }), }; } @@ -164,7 +164,7 @@ async function fetchAny(uri: string) { const note = await createNote(getApId(object), undefined, true); return { type: 'Note', - object: await Notes.pack(note!, null, { detail: true }) + object: await Notes.pack(note!, null, { detail: true }), }; } @@ -175,14 +175,14 @@ async function mergePack(user: User | null | undefined, note: Note | null | unde if (user != null) { return { type: 'User', - object: await Users.pack(user, null, { detail: true }) + object: await Users.pack(user, null, { detail: true }), }; } if (note != null) { return { type: 'Note', - object: await Notes.pack(note, null, { detail: true }) + object: await Notes.pack(note, null, { detail: true }), }; } diff --git a/packages/backend/src/server/api/endpoints/app/create.ts b/packages/backend/src/server/api/endpoints/app/create.ts index c2ce943dcc..78586cbcf2 100644 --- a/packages/backend/src/server/api/endpoints/app/create.ts +++ b/packages/backend/src/server/api/endpoints/app/create.ts @@ -53,11 +53,11 @@ export default define(meta, async (ps, user) => { description: ps.description, permission, callbackUrl: ps.callbackUrl, - secret: secret + secret: secret, }); return await Apps.pack(app, null, { detail: true, - includeSecret: true + includeSecret: true, }); }); diff --git a/packages/backend/src/server/api/endpoints/app/show.ts b/packages/backend/src/server/api/endpoints/app/show.ts index 27f12eb44f..c83d576b43 100644 --- a/packages/backend/src/server/api/endpoints/app/show.ts +++ b/packages/backend/src/server/api/endpoints/app/show.ts @@ -23,15 +23,15 @@ export const meta = { noSuchApp: { message: 'No such app.', code: 'NO_SUCH_APP', - id: 'dce83913-2dc6-4093-8a7b-71dbb11718a3' - } + id: 'dce83913-2dc6-4093-8a7b-71dbb11718a3', + }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'App' - } + ref: 'App', + }, }; export default define(meta, async (ps, user, token) => { @@ -46,6 +46,6 @@ export default define(meta, async (ps, user, token) => { return await Apps.pack(ap, user, { detail: true, - includeSecret: isSecure && (ap.userId === user!.id) + includeSecret: isSecure && (ap.userId === user!.id), }); }); diff --git a/packages/backend/src/server/api/endpoints/auth/accept.ts b/packages/backend/src/server/api/endpoints/auth/accept.ts index 1d1d8ac227..989ebf8f25 100644 --- a/packages/backend/src/server/api/endpoints/auth/accept.ts +++ b/packages/backend/src/server/api/endpoints/auth/accept.ts @@ -15,17 +15,17 @@ export const meta = { params: { token: { - validator: $.str - } + validator: $.str, + }, }, errors: { noSuchSession: { message: 'No such session.', code: 'NO_SUCH_SESSION', - id: '9c72d8de-391a-43c1-9d06-08d29efde8df' + id: '9c72d8de-391a-43c1-9d06-08d29efde8df', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -65,12 +65,12 @@ export default define(meta, async (ps, user) => { appId: session.appId, userId: user.id, token: accessToken, - hash: hash + hash: hash, }); } // Update session await AuthSessions.update(session.id, { - userId: user.id + userId: user.id, }); }); diff --git a/packages/backend/src/server/api/endpoints/auth/session/generate.ts b/packages/backend/src/server/api/endpoints/auth/session/generate.ts index 859cf52ed3..39ba5a972a 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/generate.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/generate.ts @@ -14,7 +14,7 @@ export const meta = { params: { appSecret: { validator: $.str, - } + }, }, res: { @@ -30,22 +30,22 @@ export const meta = { optional: false as const, nullable: false as const, format: 'url', }, - } + }, }, errors: { noSuchApp: { message: 'No such app.', code: 'NO_SUCH_APP', - id: '92f93e63-428e-4f2f-a5a4-39e1407fe998' - } - } + id: '92f93e63-428e-4f2f-a5a4-39e1407fe998', + }, + }, }; export default define(meta, async (ps) => { // Lookup app const app = await Apps.findOne({ - secret: ps.appSecret + secret: ps.appSecret, }); if (app == null) { @@ -60,11 +60,11 @@ export default define(meta, async (ps) => { id: genId(), createdAt: new Date(), appId: app.id, - token: token + token: token, }); return { token: doc.token, - url: `${config.authUrl}/${doc.token}` + url: `${config.authUrl}/${doc.token}`, }; }); diff --git a/packages/backend/src/server/api/endpoints/auth/session/show.ts b/packages/backend/src/server/api/endpoints/auth/session/show.ts index 23f1a56a37..e890dd95a3 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/show.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/show.ts @@ -11,15 +11,15 @@ export const meta = { params: { token: { validator: $.str, - } + }, }, errors: { noSuchSession: { message: 'No such session.', code: 'NO_SUCH_SESSION', - id: 'bd72c97d-eba7-4adb-a467-f171b8847250' - } + id: 'bd72c97d-eba7-4adb-a467-f171b8847250', + }, }, res: { @@ -29,25 +29,25 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, app: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'App' + ref: 'App', }, token: { type: 'string' as const, - optional: false as const, nullable: false as const - } - } - } + optional: false as const, nullable: false as const, + }, + }, + }, }; export default define(meta, async (ps, user) => { // Lookup session const session = await AuthSessions.findOne({ - token: ps.token + token: ps.token, }); if (session == null) { diff --git a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts index 72201cb207..241b13d4da 100644 --- a/packages/backend/src/server/api/endpoints/auth/session/userkey.ts +++ b/packages/backend/src/server/api/endpoints/auth/session/userkey.ts @@ -15,7 +15,7 @@ export const meta = { token: { validator: $.str, - } + }, }, res: { @@ -32,34 +32,34 @@ export const meta = { optional: false as const, nullable: false as const, ref: 'User', }, - } + }, }, errors: { noSuchApp: { message: 'No such app.', code: 'NO_SUCH_APP', - id: 'fcab192a-2c5a-43b7-8ad8-9b7054d8d40d' + id: 'fcab192a-2c5a-43b7-8ad8-9b7054d8d40d', }, noSuchSession: { message: 'No such session.', code: 'NO_SUCH_SESSION', - id: '5b5a1503-8bc8-4bd0-8054-dc189e8cdcb3' + id: '5b5a1503-8bc8-4bd0-8054-dc189e8cdcb3', }, pendingSession: { message: 'This session is not completed yet.', code: 'PENDING_SESSION', - id: '8c8a4145-02cc-4cca-8e66-29ba60445a8e' - } - } + id: '8c8a4145-02cc-4cca-8e66-29ba60445a8e', + }, + }, }; export default define(meta, async (ps) => { // Lookup app const app = await Apps.findOne({ - secret: ps.appSecret + secret: ps.appSecret, }); if (app == null) { @@ -69,7 +69,7 @@ export default define(meta, async (ps) => { // Fetch token const session = await AuthSessions.findOne({ token: ps.token, - appId: app.id + appId: app.id, }); if (session == null) { @@ -83,7 +83,7 @@ export default define(meta, async (ps) => { // Lookup access token const accessToken = await AccessTokens.findOneOrFail({ appId: app.id, - userId: session.userId + userId: session.userId, }); // Delete session @@ -92,7 +92,7 @@ export default define(meta, async (ps) => { return { accessToken: accessToken.token, user: await Users.pack(session.userId, null, { - detail: true - }) + detail: true, + }), }; }); diff --git a/packages/backend/src/server/api/endpoints/blocking/create.ts b/packages/backend/src/server/api/endpoints/blocking/create.ts index 4d33c09479..cb92589d19 100644 --- a/packages/backend/src/server/api/endpoints/blocking/create.ts +++ b/packages/backend/src/server/api/endpoints/blocking/create.ts @@ -12,7 +12,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 100 + max: 100, }, requireCredential: true as const, @@ -22,34 +22,34 @@ export const meta = { params: { userId: { validator: $.type(ID), - } + }, }, errors: { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '7cc4f851-e2f1-4621-9633-ec9e1d00c01e' + id: '7cc4f851-e2f1-4621-9633-ec9e1d00c01e', }, blockeeIsYourself: { message: 'Blockee is yourself.', code: 'BLOCKEE_IS_YOURSELF', - id: '88b19138-f28d-42c0-8499-6a31bbd0fdc6' + id: '88b19138-f28d-42c0-8499-6a31bbd0fdc6', }, alreadyBlocking: { message: 'You are already blocking that user.', code: 'ALREADY_BLOCKING', - id: '787fed64-acb9-464a-82eb-afbd745b9614' + id: '787fed64-acb9-464a-82eb-afbd745b9614', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' - } + ref: 'User', + }, }; export default define(meta, async (ps, user) => { @@ -69,7 +69,7 @@ export default define(meta, async (ps, user) => { // Check if already blocking const exist = await Blockings.findOne({ blockerId: blocker.id, - blockeeId: blockee.id + blockeeId: blockee.id, }); if (exist != null) { @@ -80,10 +80,10 @@ export default define(meta, async (ps, user) => { NoteWatchings.delete({ userId: blocker.id, - noteUserId: blockee.id + noteUserId: blockee.id, }); return await Users.pack(blockee.id, blocker, { - detail: true + detail: true, }); }); diff --git a/packages/backend/src/server/api/endpoints/blocking/delete.ts b/packages/backend/src/server/api/endpoints/blocking/delete.ts index ae5dab020a..7a99fe0f49 100644 --- a/packages/backend/src/server/api/endpoints/blocking/delete.ts +++ b/packages/backend/src/server/api/endpoints/blocking/delete.ts @@ -12,7 +12,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 100 + max: 100, }, requireCredential: true as const, @@ -22,26 +22,26 @@ export const meta = { params: { userId: { validator: $.type(ID), - } + }, }, errors: { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '8621d8bf-c358-4303-a066-5ea78610eb3f' + id: '8621d8bf-c358-4303-a066-5ea78610eb3f', }, blockeeIsYourself: { message: 'Blockee is yourself.', code: 'BLOCKEE_IS_YOURSELF', - id: '06f6fac6-524b-473c-a354-e97a40ae6eac' + id: '06f6fac6-524b-473c-a354-e97a40ae6eac', }, notBlocking: { message: 'You are not blocking that user.', code: 'NOT_BLOCKING', - id: '291b2efa-60c6-45c0-9f6a-045c8f9b02cd' + id: '291b2efa-60c6-45c0-9f6a-045c8f9b02cd', }, }, @@ -69,7 +69,7 @@ export default define(meta, async (ps, user) => { // Check not blocking const exist = await Blockings.findOne({ blockerId: blocker.id, - blockeeId: blockee.id + blockeeId: blockee.id, }); if (exist == null) { @@ -80,6 +80,6 @@ export default define(meta, async (ps, user) => { await deleteBlocking(blocker, blockee); return await Users.pack(blockee.id, blocker, { - detail: true + detail: true, }); }); diff --git a/packages/backend/src/server/api/endpoints/blocking/list.ts b/packages/backend/src/server/api/endpoints/blocking/list.ts index fe25fdaba1..901403d144 100644 --- a/packages/backend/src/server/api/endpoints/blocking/list.ts +++ b/packages/backend/src/server/api/endpoints/blocking/list.ts @@ -14,7 +14,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 30 + default: 30, }, sinceId: { @@ -33,7 +33,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Blocking', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/channels/create.ts b/packages/backend/src/server/api/endpoints/channels/create.ts index 0cedfd6c6a..0176f86e00 100644 --- a/packages/backend/src/server/api/endpoints/channels/create.ts +++ b/packages/backend/src/server/api/endpoints/channels/create.ts @@ -15,16 +15,16 @@ export const meta = { params: { name: { - validator: $.str.range(1, 128) + validator: $.str.range(1, 128), }, description: { - validator: $.nullable.optional.str.range(1, 2048) + validator: $.nullable.optional.str.range(1, 2048), }, bannerId: { validator: $.nullable.optional.type(ID), - } + }, }, res: { @@ -37,9 +37,9 @@ export const meta = { noSuchFile: { message: 'No such file.', code: 'NO_SUCH_FILE', - id: 'cd1e9f3e-5a12-4ab4-96f6-5d0a2cc32050' + id: 'cd1e9f3e-5a12-4ab4-96f6-5d0a2cc32050', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -47,7 +47,7 @@ export default define(meta, async (ps, user) => { if (ps.bannerId != null) { banner = await DriveFiles.findOne({ id: ps.bannerId, - userId: user.id + userId: user.id, }); if (banner == null) { diff --git a/packages/backend/src/server/api/endpoints/channels/featured.ts b/packages/backend/src/server/api/endpoints/channels/featured.ts index dc1f49f960..8eab2402be 100644 --- a/packages/backend/src/server/api/endpoints/channels/featured.ts +++ b/packages/backend/src/server/api/endpoints/channels/featured.ts @@ -13,7 +13,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Channel', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/channels/follow.ts b/packages/backend/src/server/api/endpoints/channels/follow.ts index d4664e6996..d30593acd9 100644 --- a/packages/backend/src/server/api/endpoints/channels/follow.ts +++ b/packages/backend/src/server/api/endpoints/channels/follow.ts @@ -23,9 +23,9 @@ export const meta = { noSuchChannel: { message: 'No such channel.', code: 'NO_SUCH_CHANNEL', - id: 'c0031718-d573-4e85-928e-10039f1fbb68' + id: 'c0031718-d573-4e85-928e-10039f1fbb68', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/channels/followed.ts b/packages/backend/src/server/api/endpoints/channels/followed.ts index be239a01d6..28454c97fd 100644 --- a/packages/backend/src/server/api/endpoints/channels/followed.ts +++ b/packages/backend/src/server/api/endpoints/channels/followed.ts @@ -22,7 +22,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 5 + default: 5, }, }, @@ -33,7 +33,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Channel', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/channels/owned.ts b/packages/backend/src/server/api/endpoints/channels/owned.ts index 4a2e9db17b..44024b158e 100644 --- a/packages/backend/src/server/api/endpoints/channels/owned.ts +++ b/packages/backend/src/server/api/endpoints/channels/owned.ts @@ -22,7 +22,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 5 + default: 5, }, }, @@ -33,7 +33,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Channel', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/channels/show.ts b/packages/backend/src/server/api/endpoints/channels/show.ts index 803ce6363d..e7ce4f22eb 100644 --- a/packages/backend/src/server/api/endpoints/channels/show.ts +++ b/packages/backend/src/server/api/endpoints/channels/show.ts @@ -25,9 +25,9 @@ export const meta = { noSuchChannel: { message: 'No such channel.', code: 'NO_SUCH_CHANNEL', - id: '6f6c314b-7486-4897-8966-c04a66a02923' + id: '6f6c314b-7486-4897-8966-c04a66a02923', }, - } + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/channels/timeline.ts b/packages/backend/src/server/api/endpoints/channels/timeline.ts index 0ed057a11e..56c205cae5 100644 --- a/packages/backend/src/server/api/endpoints/channels/timeline.ts +++ b/packages/backend/src/server/api/endpoints/channels/timeline.ts @@ -45,16 +45,16 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, errors: { noSuchChannel: { message: 'No such channel.', code: 'NO_SUCH_CHANNEL', - id: '4d0eeeba-a02c-4c3c-9966-ef60d38d2e7f' - } - } + id: '4d0eeeba-a02c-4c3c-9966-ef60d38d2e7f', + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/channels/unfollow.ts b/packages/backend/src/server/api/endpoints/channels/unfollow.ts index 700f8e93ba..8ce9a7e644 100644 --- a/packages/backend/src/server/api/endpoints/channels/unfollow.ts +++ b/packages/backend/src/server/api/endpoints/channels/unfollow.ts @@ -22,9 +22,9 @@ export const meta = { noSuchChannel: { message: 'No such channel.', code: 'NO_SUCH_CHANNEL', - id: '19959ee9-0153-4c51-bbd9-a98c49dc59d6' + id: '19959ee9-0153-4c51-bbd9-a98c49dc59d6', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/channels/update.ts b/packages/backend/src/server/api/endpoints/channels/update.ts index 05f279d6ac..0e6863ac76 100644 --- a/packages/backend/src/server/api/endpoints/channels/update.ts +++ b/packages/backend/src/server/api/endpoints/channels/update.ts @@ -17,16 +17,16 @@ export const meta = { }, name: { - validator: $.optional.str.range(1, 128) + validator: $.optional.str.range(1, 128), }, description: { - validator: $.nullable.optional.str.range(1, 2048) + validator: $.nullable.optional.str.range(1, 2048), }, bannerId: { validator: $.nullable.optional.type(ID), - } + }, }, res: { @@ -39,21 +39,21 @@ export const meta = { noSuchChannel: { message: 'No such channel.', code: 'NO_SUCH_CHANNEL', - id: 'f9c5467f-d492-4c3c-9a8d-a70dacc86512' + id: 'f9c5467f-d492-4c3c-9a8d-a70dacc86512', }, accessDenied: { message: 'You do not have edit privilege of the channel.', code: 'ACCESS_DENIED', - id: '1fb7cb09-d46a-4fdf-b8df-057788cce513' + id: '1fb7cb09-d46a-4fdf-b8df-057788cce513', }, noSuchFile: { message: 'No such file.', code: 'NO_SUCH_FILE', - id: 'e86c14a4-0da2-4032-8df3-e737a04c7f3b' + id: 'e86c14a4-0da2-4032-8df3-e737a04c7f3b', }, - } + }, }; export default define(meta, async (ps, me) => { @@ -74,7 +74,7 @@ export default define(meta, async (ps, me) => { if (ps.bannerId != null) { banner = await DriveFiles.findOne({ id: ps.bannerId, - userId: me.id + userId: me.id, }); if (banner == null) { diff --git a/packages/backend/src/server/api/endpoints/charts/instance.ts b/packages/backend/src/server/api/endpoints/charts/instance.ts index 1835023188..4e96304d8c 100644 --- a/packages/backend/src/server/api/endpoints/charts/instance.ts +++ b/packages/backend/src/server/api/endpoints/charts/instance.ts @@ -23,7 +23,7 @@ export const meta = { host: { validator: $.str, - } + }, }, res: convertLog(instanceChart.schema), diff --git a/packages/backend/src/server/api/endpoints/charts/user/drive.ts b/packages/backend/src/server/api/endpoints/charts/user/drive.ts index f2770e2df8..4fc12b3306 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/drive.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/drive.ts @@ -24,7 +24,7 @@ export const meta = { userId: { validator: $.type(ID), - } + }, }, res: convertLog(perUserDriveChart.schema), diff --git a/packages/backend/src/server/api/endpoints/charts/user/following.ts b/packages/backend/src/server/api/endpoints/charts/user/following.ts index 8c97b63e89..9207760a3c 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/following.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/following.ts @@ -24,7 +24,7 @@ export const meta = { userId: { validator: $.type(ID), - } + }, }, res: convertLog(perUserFollowingChart.schema), diff --git a/packages/backend/src/server/api/endpoints/charts/user/notes.ts b/packages/backend/src/server/api/endpoints/charts/user/notes.ts index 0d5f5a8b6a..f543920572 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/notes.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/notes.ts @@ -24,7 +24,7 @@ export const meta = { userId: { validator: $.type(ID), - } + }, }, res: convertLog(perUserNotesChart.schema), diff --git a/packages/backend/src/server/api/endpoints/charts/user/reactions.ts b/packages/backend/src/server/api/endpoints/charts/user/reactions.ts index 3cabe40d56..4ceb79f7f8 100644 --- a/packages/backend/src/server/api/endpoints/charts/user/reactions.ts +++ b/packages/backend/src/server/api/endpoints/charts/user/reactions.ts @@ -24,7 +24,7 @@ export const meta = { userId: { validator: $.type(ID), - } + }, }, res: convertLog(perUserReactionsChart.schema), diff --git a/packages/backend/src/server/api/endpoints/clips/add-note.ts b/packages/backend/src/server/api/endpoints/clips/add-note.ts index 79d7b8adde..99312a71b9 100644 --- a/packages/backend/src/server/api/endpoints/clips/add-note.ts +++ b/packages/backend/src/server/api/endpoints/clips/add-note.ts @@ -27,27 +27,27 @@ export const meta = { noSuchClip: { message: 'No such clip.', code: 'NO_SUCH_CLIP', - id: 'd6e76cc0-a1b5-4c7c-a287-73fa9c716dcf' + id: 'd6e76cc0-a1b5-4c7c-a287-73fa9c716dcf', }, noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: 'fc8c0b49-c7a3-4664-a0a6-b418d386bb8b' + id: 'fc8c0b49-c7a3-4664-a0a6-b418d386bb8b', }, alreadyClipped: { message: 'The note has already been clipped.', code: 'ALREADY_CLIPPED', - id: '734806c4-542c-463a-9311-15c512803965' + id: '734806c4-542c-463a-9311-15c512803965', }, - } + }, }; export default define(meta, async (ps, user) => { const clip = await Clips.findOne({ id: ps.clipId, - userId: user.id + userId: user.id, }); if (clip == null) { @@ -61,7 +61,7 @@ export default define(meta, async (ps, user) => { const exist = await ClipNotes.findOne({ noteId: note.id, - clipId: clip.id + clipId: clip.id, }); if (exist != null) { @@ -71,6 +71,6 @@ export default define(meta, async (ps, user) => { await ClipNotes.insert({ id: genId(), noteId: note.id, - clipId: clip.id + clipId: clip.id, }); }); diff --git a/packages/backend/src/server/api/endpoints/clips/create.ts b/packages/backend/src/server/api/endpoints/clips/create.ts index 02d2773709..cb4ff56abd 100644 --- a/packages/backend/src/server/api/endpoints/clips/create.ts +++ b/packages/backend/src/server/api/endpoints/clips/create.ts @@ -12,23 +12,23 @@ export const meta = { params: { name: { - validator: $.str.range(1, 100) + validator: $.str.range(1, 100), }, isPublic: { - validator: $.optional.bool + validator: $.optional.bool, }, description: { - validator: $.optional.nullable.str.range(1, 2048) - } + validator: $.optional.nullable.str.range(1, 2048), + }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'Clip' - } + ref: 'Clip', + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/clips/delete.ts b/packages/backend/src/server/api/endpoints/clips/delete.ts index ca489af3bf..9ec6bc7eac 100644 --- a/packages/backend/src/server/api/endpoints/clips/delete.ts +++ b/packages/backend/src/server/api/endpoints/clips/delete.ts @@ -14,22 +14,22 @@ export const meta = { params: { clipId: { validator: $.type(ID), - } + }, }, errors: { noSuchClip: { message: 'No such clip.', code: 'NO_SUCH_CLIP', - id: '70ca08ba-6865-4630-b6fb-8494759aa754' - } - } + id: '70ca08ba-6865-4630-b6fb-8494759aa754', + }, + }, }; export default define(meta, async (ps, user) => { const clip = await Clips.findOne({ id: ps.clipId, - userId: user.id + userId: user.id, }); if (clip == null) { diff --git a/packages/backend/src/server/api/endpoints/clips/list.ts b/packages/backend/src/server/api/endpoints/clips/list.ts index 1f6db9b979..3b32c02899 100644 --- a/packages/backend/src/server/api/endpoints/clips/list.ts +++ b/packages/backend/src/server/api/endpoints/clips/list.ts @@ -14,9 +14,9 @@ export const meta = { items: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'Clip' - } - } + ref: 'Clip', + }, + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/clips/notes.ts b/packages/backend/src/server/api/endpoints/clips/notes.ts index 5a9fed52fa..90ddd66a1f 100644 --- a/packages/backend/src/server/api/endpoints/clips/notes.ts +++ b/packages/backend/src/server/api/endpoints/clips/notes.ts @@ -22,7 +22,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -38,8 +38,8 @@ export const meta = { noSuchClip: { message: 'No such clip.', code: 'NO_SUCH_CLIP', - id: '1d7645e6-2b6d-4635-b0fe-fe22b0e72e00' - } + id: '1d7645e6-2b6d-4635-b0fe-fe22b0e72e00', + }, }, res: { @@ -48,9 +48,9 @@ export const meta = { items: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'Note' - } - } + ref: 'Note', + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/clips/show.ts b/packages/backend/src/server/api/endpoints/clips/show.ts index 8f245cd18e..8e9409fadd 100644 --- a/packages/backend/src/server/api/endpoints/clips/show.ts +++ b/packages/backend/src/server/api/endpoints/clips/show.ts @@ -21,15 +21,15 @@ export const meta = { noSuchClip: { message: 'No such clip.', code: 'NO_SUCH_CLIP', - id: 'c3c5fe33-d62c-44d2-9ea5-d997703f5c20' + id: 'c3c5fe33-d62c-44d2-9ea5-d997703f5c20', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'Clip' - } + ref: 'Clip', + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/clips/update.ts b/packages/backend/src/server/api/endpoints/clips/update.ts index 7f645560bb..9cf12499af 100644 --- a/packages/backend/src/server/api/endpoints/clips/update.ts +++ b/packages/backend/src/server/api/endpoints/clips/update.ts @@ -21,34 +21,34 @@ export const meta = { }, isPublic: { - validator: $.optional.bool + validator: $.optional.bool, }, description: { - validator: $.optional.nullable.str.range(1, 2048) - } + validator: $.optional.nullable.str.range(1, 2048), + }, }, errors: { noSuchClip: { message: 'No such clip.', code: 'NO_SUCH_CLIP', - id: 'b4d92d70-b216-46fa-9a3f-a8c811699257' + id: 'b4d92d70-b216-46fa-9a3f-a8c811699257', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'Clip' - } + ref: 'Clip', + }, }; export default define(meta, async (ps, user) => { // Fetch the clip const clip = await Clips.findOne({ id: ps.clipId, - userId: user.id + userId: user.id, }); if (clip == null) { diff --git a/packages/backend/src/server/api/endpoints/drive.ts b/packages/backend/src/server/api/endpoints/drive.ts index 2974ccfab9..b9741ba875 100644 --- a/packages/backend/src/server/api/endpoints/drive.ts +++ b/packages/backend/src/server/api/endpoints/drive.ts @@ -20,9 +20,9 @@ export const meta = { usage: { type: 'number' as const, optional: false as const, nullable: false as const, - } - } - } + }, + }, + }, }; export default define(meta, async (ps, user) => { @@ -33,6 +33,6 @@ export default define(meta, async (ps, user) => { return { capacity: 1024 * 1024 * instance.localDriveCapacityMb, - usage: usage + usage: usage, }; }); diff --git a/packages/backend/src/server/api/endpoints/drive/files.ts b/packages/backend/src/server/api/endpoints/drive/files.ts index 95435e1e43..00ebb51e30 100644 --- a/packages/backend/src/server/api/endpoints/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/drive/files.ts @@ -14,7 +14,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -31,8 +31,8 @@ export const meta = { }, type: { - validator: $.optional.nullable.str.match(/^[a-zA-Z\/\-*]+$/) - } + validator: $.optional.nullable.str.match(/^[a-zA-Z\/\-*]+$/), + }, }, res: { @@ -42,7 +42,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'DriveFile', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts index eec7d7877e..c8317c1cc8 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/attached-notes.ts @@ -14,7 +14,7 @@ export const meta = { params: { fileId: { validator: $.type(ID), - } + }, }, res: { @@ -24,7 +24,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, errors: { @@ -32,8 +32,8 @@ export const meta = { message: 'No such file.', code: 'NO_SUCH_FILE', id: 'c118ece3-2e4b-4296-99d1-51756e32d232', - } - } + }, + }, }; export default define(meta, async (ps, user) => { @@ -52,6 +52,6 @@ export default define(meta, async (ps, user) => { .getMany(); return await Notes.packMany(notes, user, { - detail: true + detail: true, }); }); diff --git a/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts b/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts index 2c36078421..a6db160d2f 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/check-existence.ts @@ -12,7 +12,7 @@ export const meta = { params: { md5: { validator: $.str, - } + }, }, res: { diff --git a/packages/backend/src/server/api/endpoints/drive/files/create.ts b/packages/backend/src/server/api/endpoints/drive/files/create.ts index 89755d9498..5523ae1967 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/create.ts @@ -14,7 +14,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 120 + max: 120, }, requireFile: true, @@ -42,7 +42,7 @@ export const meta = { validator: $.optional.either($.bool, $.str), default: false, transform: (v: any): boolean => v === true || v === 'true', - } + }, }, res: { @@ -55,9 +55,9 @@ export const meta = { invalidFileName: { message: 'Invalid file name.', code: 'INVALID_FILE_NAME', - id: 'f449b209-0c60-4e51-84d5-29486263bfd4' - } - } + id: 'f449b209-0c60-4e51-84d5-29486263bfd4', + }, + }, }; export default define(meta, async (ps, user, _, file, cleanup) => { diff --git a/packages/backend/src/server/api/endpoints/drive/files/delete.ts b/packages/backend/src/server/api/endpoints/drive/files/delete.ts index 038325694d..3a8e4b11f4 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/delete.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/delete.ts @@ -16,22 +16,22 @@ export const meta = { params: { fileId: { validator: $.type(ID), - } + }, }, errors: { noSuchFile: { message: 'No such file.', code: 'NO_SUCH_FILE', - id: '908939ec-e52b-4458-b395-1025195cea58' + id: '908939ec-e52b-4458-b395-1025195cea58', }, accessDenied: { message: 'Access denied.', code: 'ACCESS_DENIED', - id: '5eb8d909-2540-4970-90b8-dd6f86088121' + id: '5eb8d909-2540-4970-90b8-dd6f86088121', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts b/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts index 5fea7bbbb0..16717149ac 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/find-by-hash.ts @@ -12,7 +12,7 @@ export const meta = { params: { md5: { validator: $.str, - } + }, }, res: { @@ -22,7 +22,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'DriveFile', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/drive/files/find.ts b/packages/backend/src/server/api/endpoints/drive/files/find.ts index dd419f4c04..108e08593a 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/find.ts @@ -12,7 +12,7 @@ export const meta = { params: { name: { - validator: $.str + validator: $.str, }, folderId: { @@ -28,7 +28,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'DriveFile', - } + }, }, }; @@ -36,7 +36,7 @@ export default define(meta, async (ps, user) => { const files = await DriveFiles.find({ name: ps.name, userId: user.id, - folderId: ps.folderId + folderId: ps.folderId, }); return await Promise.all(files.map(file => DriveFiles.pack(file, { self: true }))); diff --git a/packages/backend/src/server/api/endpoints/drive/files/show.ts b/packages/backend/src/server/api/endpoints/drive/files/show.ts index a96ebaa123..96f8e5c03a 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/show.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/show.ts @@ -19,7 +19,7 @@ export const meta = { url: { validator: $.optional.str, - } + }, }, res: { @@ -32,21 +32,21 @@ export const meta = { noSuchFile: { message: 'No such file.', code: 'NO_SUCH_FILE', - id: '067bc436-2718-4795-b0fb-ecbe43949e31' + id: '067bc436-2718-4795-b0fb-ecbe43949e31', }, accessDenied: { message: 'Access denied.', code: 'ACCESS_DENIED', - id: '25b73c73-68b1-41d0-bad1-381cfdf6579f' + id: '25b73c73-68b1-41d0-bad1-381cfdf6579f', }, fileIdOrUrlRequired: { message: 'fileId or url required.', code: 'INVALID_PARAM', - id: '89674805-722c-440c-8d88-5641830dc3e4' - } - } + id: '89674805-722c-440c-8d88-5641830dc3e4', + }, + }, }; export default define(meta, async (ps, user) => { @@ -57,11 +57,11 @@ export default define(meta, async (ps, user) => { } else if (ps.url) { file = await DriveFiles.findOne({ where: [{ - url: ps.url + url: ps.url, }, { - webpublicUrl: ps.url + webpublicUrl: ps.url, }, { - thumbnailUrl: ps.url + thumbnailUrl: ps.url, }], }); } else { @@ -79,6 +79,6 @@ export default define(meta, async (ps, user) => { return await DriveFiles.pack(file, { detail: true, withUser: true, - self: true + self: true, }); }); diff --git a/packages/backend/src/server/api/endpoints/drive/files/update.ts b/packages/backend/src/server/api/endpoints/drive/files/update.ts index f277a9c3dc..04b2db9cf4 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/update.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/update.ts @@ -36,34 +36,34 @@ export const meta = { comment: { validator: $.optional.nullable.str.max(DB_MAX_IMAGE_COMMENT_LENGTH), default: undefined as any, - } + }, }, errors: { noSuchFile: { message: 'No such file.', code: 'NO_SUCH_FILE', - id: 'e7778c7e-3af9-49cd-9690-6dbc3e6c972d' + id: 'e7778c7e-3af9-49cd-9690-6dbc3e6c972d', }, accessDenied: { message: 'Access denied.', code: 'ACCESS_DENIED', - id: '01a53b27-82fc-445b-a0c1-b558465a8ed2' + id: '01a53b27-82fc-445b-a0c1-b558465a8ed2', }, noSuchFolder: { message: 'No such folder.', code: 'NO_SUCH_FOLDER', - id: 'ea8fb7a5-af77-4a08-b608-c0218176cd73' + id: 'ea8fb7a5-af77-4a08-b608-c0218176cd73', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'DriveFile' - } + ref: 'DriveFile', + }, }; export default define(meta, async (ps, user) => { @@ -89,7 +89,7 @@ export default define(meta, async (ps, user) => { } else { const folder = await DriveFolders.findOne({ id: ps.folderId, - userId: user.id + userId: user.id, }); if (folder == null) { @@ -104,7 +104,7 @@ export default define(meta, async (ps, user) => { name: file.name, comment: file.comment, folderId: file.folderId, - isSensitive: file.isSensitive + isSensitive: file.isSensitive, }); const fileObj = await DriveFiles.pack(file, { self: true }); diff --git a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts index adb5126fbe..8a2fbc36b5 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts @@ -12,7 +12,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 60 + max: 60, }, requireCredential: true as const, @@ -48,8 +48,8 @@ export const meta = { force: { validator: $.optional.bool, default: false, - } - } + }, + }, }; export default define(meta, async (ps, user) => { @@ -57,7 +57,7 @@ export default define(meta, async (ps, user) => { DriveFiles.pack(file, { self: true }).then(packedFile => { publishMainStream(user.id, 'urlUploadFinished', { marker: ps.marker, - file: packedFile + file: packedFile, }); }); }); diff --git a/packages/backend/src/server/api/endpoints/drive/folders.ts b/packages/backend/src/server/api/endpoints/drive/folders.ts index 6f16878b13..cd2d1743c8 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders.ts @@ -14,7 +14,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -28,7 +28,7 @@ export const meta = { folderId: { validator: $.optional.nullable.type(ID), default: null, - } + }, }, res: { @@ -38,7 +38,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'DriveFolder', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/drive/folders/create.ts b/packages/backend/src/server/api/endpoints/drive/folders/create.ts index 80f96bd641..9ae59d4b49 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/create.ts @@ -21,22 +21,22 @@ export const meta = { parentId: { validator: $.optional.nullable.type(ID), - } + }, }, errors: { noSuchFolder: { message: 'No such folder.', code: 'NO_SUCH_FOLDER', - id: '53326628-a00d-40a6-a3cd-8975105c0f95' + id: '53326628-a00d-40a6-a3cd-8975105c0f95', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'DriveFolder' - } + ref: 'DriveFolder', + }, }; export default define(meta, async (ps, user) => { @@ -46,7 +46,7 @@ export default define(meta, async (ps, user) => { // Fetch parent folder parent = await DriveFolders.findOne({ id: ps.parentId, - userId: user.id + userId: user.id, }); if (parent == null) { @@ -60,7 +60,7 @@ export default define(meta, async (ps, user) => { createdAt: new Date(), name: ps.name, parentId: parent !== null ? parent.id : null, - userId: user.id + userId: user.id, }).then(x => DriveFolders.findOneOrFail(x.identifiers[0])); const folderObj = await DriveFolders.pack(folder); diff --git a/packages/backend/src/server/api/endpoints/drive/folders/delete.ts b/packages/backend/src/server/api/endpoints/drive/folders/delete.ts index 38b4aef103..bfd3361e76 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/delete.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/delete.ts @@ -15,29 +15,29 @@ export const meta = { params: { folderId: { validator: $.type(ID), - } + }, }, errors: { noSuchFolder: { message: 'No such folder.', code: 'NO_SUCH_FOLDER', - id: '1069098f-c281-440f-b085-f9932edbe091' + id: '1069098f-c281-440f-b085-f9932edbe091', }, hasChildFilesOrFolders: { message: 'This folder has child files or folders.', code: 'HAS_CHILD_FILES_OR_FOLDERS', - id: 'b0fc8a17-963c-405d-bfbc-859a487295e1' + id: 'b0fc8a17-963c-405d-bfbc-859a487295e1', }, - } + }, }; export default define(meta, async (ps, user) => { // Get folder const folder = await DriveFolders.findOne({ id: ps.folderId, - userId: user.id + userId: user.id, }); if (folder == null) { @@ -46,7 +46,7 @@ export default define(meta, async (ps, user) => { const [childFoldersCount, childFilesCount] = await Promise.all([ DriveFolders.count({ parentId: folder.id }), - DriveFiles.count({ folderId: folder.id }) + DriveFiles.count({ folderId: folder.id }), ]); if (childFoldersCount !== 0 || childFilesCount !== 0) { diff --git a/packages/backend/src/server/api/endpoints/drive/folders/find.ts b/packages/backend/src/server/api/endpoints/drive/folders/find.ts index a6c5a49988..872eabef98 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/find.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/find.ts @@ -12,7 +12,7 @@ export const meta = { params: { name: { - validator: $.str + validator: $.str, }, parentId: { @@ -28,7 +28,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'DriveFolder', - } + }, }, }; @@ -36,7 +36,7 @@ export default define(meta, async (ps, user) => { const folders = await DriveFolders.find({ name: ps.name, userId: user.id, - parentId: ps.parentId + parentId: ps.parentId, }); return await Promise.all(folders.map(folder => DriveFolders.pack(folder))); diff --git a/packages/backend/src/server/api/endpoints/drive/folders/show.ts b/packages/backend/src/server/api/endpoints/drive/folders/show.ts index e907a24f05..63b5bc9e77 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/show.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/show.ts @@ -14,7 +14,7 @@ export const meta = { params: { folderId: { validator: $.type(ID), - } + }, }, res: { @@ -27,16 +27,16 @@ export const meta = { noSuchFolder: { message: 'No such folder.', code: 'NO_SUCH_FOLDER', - id: 'd74ab9eb-bb09-4bba-bf24-fb58f761e1e9' + id: 'd74ab9eb-bb09-4bba-bf24-fb58f761e1e9', }, - } + }, }; export default define(meta, async (ps, user) => { // Get folder const folder = await DriveFolders.findOne({ id: ps.folderId, - userId: user.id + userId: user.id, }); if (folder == null) { @@ -44,6 +44,6 @@ export default define(meta, async (ps, user) => { } return await DriveFolders.pack(folder, { - detail: true + detail: true, }); }); diff --git a/packages/backend/src/server/api/endpoints/drive/folders/update.ts b/packages/backend/src/server/api/endpoints/drive/folders/update.ts index 612252e6df..e547808866 100644 --- a/packages/backend/src/server/api/endpoints/drive/folders/update.ts +++ b/packages/backend/src/server/api/endpoints/drive/folders/update.ts @@ -23,41 +23,41 @@ export const meta = { parentId: { validator: $.optional.nullable.type(ID), - } + }, }, errors: { noSuchFolder: { message: 'No such folder.', code: 'NO_SUCH_FOLDER', - id: 'f7974dac-2c0d-4a27-926e-23583b28e98e' + id: 'f7974dac-2c0d-4a27-926e-23583b28e98e', }, noSuchParentFolder: { message: 'No such parent folder.', code: 'NO_SUCH_PARENT_FOLDER', - id: 'ce104e3a-faaf-49d5-b459-10ff0cbbcaa1' + id: 'ce104e3a-faaf-49d5-b459-10ff0cbbcaa1', }, recursiveNesting: { message: 'It can not be structured like nesting folders recursively.', code: 'NO_SUCH_PARENT_FOLDER', - id: 'ce104e3a-faaf-49d5-b459-10ff0cbbcaa1' + id: 'ce104e3a-faaf-49d5-b459-10ff0cbbcaa1', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'DriveFolder' - } + ref: 'DriveFolder', + }, }; export default define(meta, async (ps, user) => { // Fetch folder const folder = await DriveFolders.findOne({ id: ps.folderId, - userId: user.id + userId: user.id, }); if (folder == null) { @@ -75,7 +75,7 @@ export default define(meta, async (ps, user) => { // Get parent folder const parent = await DriveFolders.findOne({ id: ps.parentId, - userId: user.id + userId: user.id, }); if (parent == null) { @@ -86,7 +86,7 @@ export default define(meta, async (ps, user) => { async function checkCircle(folderId: any): Promise { // Fetch folder const folder2 = await DriveFolders.findOne({ - id: folderId + id: folderId, }); if (folder2!.id === folder!.id) { @@ -111,7 +111,7 @@ export default define(meta, async (ps, user) => { // Update DriveFolders.update(folder.id, { name: folder.name, - parentId: folder.parentId + parentId: folder.parentId, }); const folderObj = await DriveFolders.pack(folder); diff --git a/packages/backend/src/server/api/endpoints/drive/stream.ts b/packages/backend/src/server/api/endpoints/drive/stream.ts index 141e02f748..e3031f75b2 100644 --- a/packages/backend/src/server/api/endpoints/drive/stream.ts +++ b/packages/backend/src/server/api/endpoints/drive/stream.ts @@ -14,7 +14,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -26,8 +26,8 @@ export const meta = { }, type: { - validator: $.optional.str.match(/^[a-zA-Z\/\-*]+$/) - } + validator: $.optional.str.match(/^[a-zA-Z\/\-*]+$/), + }, }, res: { @@ -37,7 +37,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'DriveFile', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/email-address/available.ts b/packages/backend/src/server/api/endpoints/email-address/available.ts index f6fccd59b0..f2254e1481 100644 --- a/packages/backend/src/server/api/endpoints/email-address/available.ts +++ b/packages/backend/src/server/api/endpoints/email-address/available.ts @@ -9,8 +9,8 @@ export const meta = { params: { emailAddress: { - validator: $.str - } + validator: $.str, + }, }, res: { @@ -25,8 +25,8 @@ export const meta = { type: 'string' as const, optional: false as const, nullable: true as const, }, - } - } + }, + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/endpoint.ts b/packages/backend/src/server/api/endpoints/endpoint.ts index 1a04d8bee8..eacee689dc 100644 --- a/packages/backend/src/server/api/endpoints/endpoint.ts +++ b/packages/backend/src/server/api/endpoints/endpoint.ts @@ -10,7 +10,7 @@ export const meta = { params: { endpoint: { validator: $.str, - } + }, }, }; @@ -20,7 +20,7 @@ export default define(meta, async (ps) => { return { params: Object.entries(ep.meta.params || {}).map(([k, v]) => ({ name: k, - type: v.validator.name === 'ID' ? 'String' : v.validator.name - })) + type: v.validator.name === 'ID' ? 'String' : v.validator.name, + })), }; }); diff --git a/packages/backend/src/server/api/endpoints/endpoints.ts b/packages/backend/src/server/api/endpoints/endpoints.ts index f7b9757d8d..6d4588383d 100644 --- a/packages/backend/src/server/api/endpoints/endpoints.ts +++ b/packages/backend/src/server/api/endpoints/endpoints.ts @@ -14,15 +14,15 @@ export const meta = { optional: false as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, example: [ 'admin/abuse-user-reports', 'admin/accounts/create', 'admin/announcements/create', - '...' - ] - } + '...', + ], + }, }; export default define(meta, async () => { diff --git a/packages/backend/src/server/api/endpoints/federation/dns.ts b/packages/backend/src/server/api/endpoints/federation/dns.ts index 7ba566301a..19e3ef8055 100644 --- a/packages/backend/src/server/api/endpoints/federation/dns.ts +++ b/packages/backend/src/server/api/endpoints/federation/dns.ts @@ -14,8 +14,8 @@ export const meta = { params: { host: { - validator: $.str - } + validator: $.str, + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/federation/followers.ts b/packages/backend/src/server/api/endpoints/federation/followers.ts index 655e7b7b9a..9cb4082bbf 100644 --- a/packages/backend/src/server/api/endpoints/federation/followers.ts +++ b/packages/backend/src/server/api/endpoints/federation/followers.ts @@ -11,7 +11,7 @@ export const meta = { params: { host: { - validator: $.str + validator: $.str, }, sinceId: { @@ -24,7 +24,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, }, @@ -35,7 +35,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Following', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/federation/following.ts b/packages/backend/src/server/api/endpoints/federation/following.ts index 5b283581a6..4a42550f93 100644 --- a/packages/backend/src/server/api/endpoints/federation/following.ts +++ b/packages/backend/src/server/api/endpoints/federation/following.ts @@ -11,7 +11,7 @@ export const meta = { params: { host: { - validator: $.str + validator: $.str, }, sinceId: { @@ -24,7 +24,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, }, @@ -35,7 +35,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Following', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/federation/instances.ts b/packages/backend/src/server/api/endpoints/federation/instances.ts index cf5e44ebd5..50d9ff3fd7 100644 --- a/packages/backend/src/server/api/endpoints/federation/instances.ts +++ b/packages/backend/src/server/api/endpoints/federation/instances.ts @@ -40,17 +40,17 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 30 + default: 30, }, offset: { validator: $.optional.num.min(0), - default: 0 + default: 0, }, sort: { validator: $.optional.str, - } + }, }, res: { @@ -59,9 +59,9 @@ export const meta = { items: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'FederationInstance' - } - } + ref: 'FederationInstance', + }, + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/federation/show-instance.ts b/packages/backend/src/server/api/endpoints/federation/show-instance.ts index f8352aefb3..9d5d9bc9f8 100644 --- a/packages/backend/src/server/api/endpoints/federation/show-instance.ts +++ b/packages/backend/src/server/api/endpoints/federation/show-instance.ts @@ -10,15 +10,15 @@ export const meta = { params: { host: { - validator: $.str - } + validator: $.str, + }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'FederationInstance' - } + ref: 'FederationInstance', + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts b/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts index 580c3cb3d9..2ba09b1361 100644 --- a/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts +++ b/packages/backend/src/server/api/endpoints/federation/update-remote-user.ts @@ -13,7 +13,7 @@ export const meta = { userId: { validator: $.type(ID), }, - } + }, }; export default define(meta, async (ps) => { diff --git a/packages/backend/src/server/api/endpoints/federation/users.ts b/packages/backend/src/server/api/endpoints/federation/users.ts index 0e35df3e1c..730dbd74c3 100644 --- a/packages/backend/src/server/api/endpoints/federation/users.ts +++ b/packages/backend/src/server/api/endpoints/federation/users.ts @@ -11,7 +11,7 @@ export const meta = { params: { host: { - validator: $.str + validator: $.str, }, sinceId: { @@ -24,7 +24,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, }, @@ -35,7 +35,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'User', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/following/create.ts b/packages/backend/src/server/api/endpoints/following/create.ts index 92e86bf6b2..096b1f6055 100644 --- a/packages/backend/src/server/api/endpoints/following/create.ts +++ b/packages/backend/src/server/api/endpoints/following/create.ts @@ -12,7 +12,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 100 + max: 100, }, requireCredential: true as const, @@ -22,46 +22,46 @@ export const meta = { params: { userId: { validator: $.type(ID), - } + }, }, errors: { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: 'fcd2eef9-a9b2-4c4f-8624-038099e90aa5' + id: 'fcd2eef9-a9b2-4c4f-8624-038099e90aa5', }, followeeIsYourself: { message: 'Followee is yourself.', code: 'FOLLOWEE_IS_YOURSELF', - id: '26fbe7bb-a331-4857-af17-205b426669a9' + id: '26fbe7bb-a331-4857-af17-205b426669a9', }, alreadyFollowing: { message: 'You are already following that user.', code: 'ALREADY_FOLLOWING', - id: '35387507-38c7-4cb9-9197-300b93783fa0' + id: '35387507-38c7-4cb9-9197-300b93783fa0', }, blocking: { message: 'You are blocking that user.', code: 'BLOCKING', - id: '4e2206ec-aa4f-4960-b865-6c23ac38e2d9' + id: '4e2206ec-aa4f-4960-b865-6c23ac38e2d9', }, blocked: { message: 'You are blocked by that user.', code: 'BLOCKED', - id: 'c4ab57cc-4e41-45e9-bfd9-584f61e35ce0' + id: 'c4ab57cc-4e41-45e9-bfd9-584f61e35ce0', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' - } + ref: 'User', + }, }; export default define(meta, async (ps, user) => { @@ -81,7 +81,7 @@ export default define(meta, async (ps, user) => { // Check if already following const exist = await Followings.findOne({ followerId: follower.id, - followeeId: followee.id + followeeId: followee.id, }); if (exist != null) { diff --git a/packages/backend/src/server/api/endpoints/following/delete.ts b/packages/backend/src/server/api/endpoints/following/delete.ts index 030d30c9b5..5a0e44ad0b 100644 --- a/packages/backend/src/server/api/endpoints/following/delete.ts +++ b/packages/backend/src/server/api/endpoints/following/delete.ts @@ -12,7 +12,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 100 + max: 100, }, requireCredential: true as const, @@ -22,34 +22,34 @@ export const meta = { params: { userId: { validator: $.type(ID), - } + }, }, errors: { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '5b12c78d-2b28-4dca-99d2-f56139b42ff8' + id: '5b12c78d-2b28-4dca-99d2-f56139b42ff8', }, followeeIsYourself: { message: 'Followee is yourself.', code: 'FOLLOWEE_IS_YOURSELF', - id: 'd9e400b9-36b0-4808-b1d8-79e707f1296c' + id: 'd9e400b9-36b0-4808-b1d8-79e707f1296c', }, notFollowing: { message: 'You are not following that user.', code: 'NOT_FOLLOWING', - id: '5dbf82f5-c92b-40b1-87d1-6c8c0741fd09' + id: '5dbf82f5-c92b-40b1-87d1-6c8c0741fd09', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' - } + ref: 'User', + }, }; export default define(meta, async (ps, user) => { @@ -69,7 +69,7 @@ export default define(meta, async (ps, user) => { // Check not following const exist = await Followings.findOne({ followerId: follower.id, - followeeId: followee.id + followeeId: followee.id, }); if (exist == null) { diff --git a/packages/backend/src/server/api/endpoints/following/invalidate.ts b/packages/backend/src/server/api/endpoints/following/invalidate.ts index c0e9df3652..050199bfaa 100644 --- a/packages/backend/src/server/api/endpoints/following/invalidate.ts +++ b/packages/backend/src/server/api/endpoints/following/invalidate.ts @@ -12,7 +12,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 100 + max: 100, }, requireCredential: true as const, @@ -22,34 +22,34 @@ export const meta = { params: { userId: { validator: $.type(ID), - } + }, }, errors: { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '5b12c78d-2b28-4dca-99d2-f56139b42ff8' + id: '5b12c78d-2b28-4dca-99d2-f56139b42ff8', }, followerIsYourself: { message: 'Follower is yourself.', code: 'FOLLOWER_IS_YOURSELF', - id: '07dc03b9-03da-422d-885b-438313707662' + id: '07dc03b9-03da-422d-885b-438313707662', }, notFollowing: { message: 'The other use is not following you.', code: 'NOT_FOLLOWING', - id: '5dbf82f5-c92b-40b1-87d1-6c8c0741fd09' + id: '5dbf82f5-c92b-40b1-87d1-6c8c0741fd09', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' - } + ref: 'User', + }, }; export default define(meta, async (ps, user) => { @@ -69,7 +69,7 @@ export default define(meta, async (ps, user) => { // Check not following const exist = await Followings.findOne({ followerId: follower.id, - followeeId: followee.id + followeeId: followee.id, }); if (exist == null) { diff --git a/packages/backend/src/server/api/endpoints/following/requests/accept.ts b/packages/backend/src/server/api/endpoints/following/requests/accept.ts index af39ea1d90..9c07248568 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/accept.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/accept.ts @@ -15,21 +15,21 @@ export const meta = { params: { userId: { validator: $.type(ID), - } + }, }, errors: { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '66ce1645-d66c-46bb-8b79-96739af885bd' + id: '66ce1645-d66c-46bb-8b79-96739af885bd', }, noFollowRequest: { message: 'No follow request.', code: 'NO_FOLLOW_REQUEST', - id: 'bcde4f8b-0913-4614-8881-614e522fb041' + id: 'bcde4f8b-0913-4614-8881-614e522fb041', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/following/requests/cancel.ts b/packages/backend/src/server/api/endpoints/following/requests/cancel.ts index b69c9d2fe1..d65aa436a0 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/cancel.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/cancel.ts @@ -16,28 +16,28 @@ export const meta = { params: { userId: { validator: $.type(ID), - } + }, }, errors: { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '4e68c551-fc4c-4e46-bb41-7d4a37bf9dab' + id: '4e68c551-fc4c-4e46-bb41-7d4a37bf9dab', }, followRequestNotFound: { message: 'Follow request not found.', code: 'FOLLOW_REQUEST_NOT_FOUND', - id: '089b125b-d338-482a-9a09-e2622ac9f8d4' + id: '089b125b-d338-482a-9a09-e2622ac9f8d4', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' - } + ref: 'User', + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/following/requests/list.ts b/packages/backend/src/server/api/endpoints/following/requests/list.ts index 84440ccac7..2dadd0d60c 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/list.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/list.ts @@ -18,26 +18,26 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, follower: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' + ref: 'User', }, followee: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' - } - } - } - } + ref: 'User', + }, + }, + }, + }, }; export default define(meta, async (ps, user) => { const reqs = await FollowRequests.find({ - followeeId: user.id + followeeId: user.id, }); return await Promise.all(reqs.map(req => FollowRequests.pack(req))); diff --git a/packages/backend/src/server/api/endpoints/following/requests/reject.ts b/packages/backend/src/server/api/endpoints/following/requests/reject.ts index 30d0e094c3..c385b32385 100644 --- a/packages/backend/src/server/api/endpoints/following/requests/reject.ts +++ b/packages/backend/src/server/api/endpoints/following/requests/reject.ts @@ -15,16 +15,16 @@ export const meta = { params: { userId: { validator: $.type(ID), - } + }, }, errors: { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: 'abc2ffa6-25b2-4380-ba99-321ff3a94555' + id: 'abc2ffa6-25b2-4380-ba99-321ff3a94555', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/gallery/featured.ts b/packages/backend/src/server/api/endpoints/gallery/featured.ts index 30ef8cedec..dc86cf40ba 100644 --- a/packages/backend/src/server/api/endpoints/gallery/featured.ts +++ b/packages/backend/src/server/api/endpoints/gallery/featured.ts @@ -13,7 +13,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'GalleryPost', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/gallery/popular.ts b/packages/backend/src/server/api/endpoints/gallery/popular.ts index 18449b9654..ee3fe51ebf 100644 --- a/packages/backend/src/server/api/endpoints/gallery/popular.ts +++ b/packages/backend/src/server/api/endpoints/gallery/popular.ts @@ -13,7 +13,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'GalleryPost', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/gallery/posts.ts b/packages/backend/src/server/api/endpoints/gallery/posts.ts index 53d3236d2d..90bd2d959f 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts.ts @@ -10,7 +10,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -29,7 +29,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'GalleryPost', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts index 34af72695d..dae6e27ddb 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts @@ -17,7 +17,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 300 + max: 300, }, params: { @@ -47,14 +47,14 @@ export const meta = { errors: { - } + }, }; export default define(meta, async (ps, user) => { const files = (await Promise.all(ps.fileIds.map(fileId => DriveFiles.findOne({ id: fileId, - userId: user.id + userId: user.id, }) ))).filter((file): file is DriveFile => file != null); @@ -70,7 +70,7 @@ export default define(meta, async (ps, user) => { description: ps.description, userId: user.id, isSensitive: ps.isSensitive, - fileIds: files.map(file => file.id) + fileIds: files.map(file => file.id), })).then(x => GalleryPosts.findOneOrFail(x.identifiers[0])); return await GalleryPosts.pack(post, user); diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts b/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts index e5b7c07f2f..e43c12a4c1 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/delete.ts @@ -21,9 +21,9 @@ export const meta = { noSuchPost: { message: 'No such post.', code: 'NO_SUCH_POST', - id: 'ae52f367-4bd7-4ecd-afc6-5672fff427f5' + id: 'ae52f367-4bd7-4ecd-afc6-5672fff427f5', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts index 81a25c0ad1..d355d1e312 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts @@ -15,28 +15,28 @@ export const meta = { params: { postId: { validator: $.type(ID), - } + }, }, errors: { noSuchPost: { message: 'No such post.', code: 'NO_SUCH_POST', - id: '56c06af3-1287-442f-9701-c93f7c4a62ff' + id: '56c06af3-1287-442f-9701-c93f7c4a62ff', }, yourPost: { message: 'You cannot like your post.', code: 'YOUR_POST', - id: 'f78f1511-5ebc-4478-a888-1198d752da68' + id: 'f78f1511-5ebc-4478-a888-1198d752da68', }, alreadyLiked: { message: 'The post has already been liked.', code: 'ALREADY_LIKED', - id: '40e9ed56-a59c-473a-bf3f-f289c54fb5a7' + id: '40e9ed56-a59c-473a-bf3f-f289c54fb5a7', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -52,7 +52,7 @@ export default define(meta, async (ps, user) => { // if already liked const exist = await GalleryLikes.findOne({ postId: post.id, - userId: user.id + userId: user.id, }); if (exist != null) { @@ -64,7 +64,7 @@ export default define(meta, async (ps, user) => { id: genId(), createdAt: new Date(), postId: post.id, - userId: user.id + userId: user.id, }); GalleryPosts.increment({ id: post.id }, 'likedCount', 1); diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/show.ts b/packages/backend/src/server/api/endpoints/gallery/posts/show.ts index 93852a5f8d..7e620b2c48 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/show.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/show.ts @@ -19,15 +19,15 @@ export const meta = { noSuchPost: { message: 'No such post.', code: 'NO_SUCH_POST', - id: '1137bf14-c5b0-4604-85bb-5b5371b1cd45' + id: '1137bf14-c5b0-4604-85bb-5b5371b1cd45', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'GalleryPost' - } + ref: 'GalleryPost', + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts b/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts index 0347cdf79e..323e7c4828 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/unlike.ts @@ -14,22 +14,22 @@ export const meta = { params: { postId: { validator: $.type(ID), - } + }, }, errors: { noSuchPost: { message: 'No such post.', code: 'NO_SUCH_POST', - id: 'c32e6dd0-b555-4413-925e-b3757d19ed84' + id: 'c32e6dd0-b555-4413-925e-b3757d19ed84', }, notLiked: { message: 'You have not liked that post.', code: 'NOT_LIKED', - id: 'e3e8e06e-be37-41f7-a5b4-87a8250288f0' + id: 'e3e8e06e-be37-41f7-a5b4-87a8250288f0', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -40,7 +40,7 @@ export default define(meta, async (ps, user) => { const exist = await GalleryLikes.findOne({ postId: post.id, - userId: user.id + userId: user.id, }); if (exist == null) { diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/update.ts b/packages/backend/src/server/api/endpoints/gallery/posts/update.ts index f94606acf2..7cd694e804 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/update.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/update.ts @@ -16,7 +16,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 300 + max: 300, }, params: { @@ -50,14 +50,14 @@ export const meta = { errors: { - } + }, }; export default define(meta, async (ps, user) => { const files = (await Promise.all(ps.fileIds.map(fileId => DriveFiles.findOne({ id: fileId, - userId: user.id + userId: user.id, }) ))).filter((file): file is DriveFile => file != null); @@ -73,7 +73,7 @@ export default define(meta, async (ps, user) => { title: ps.title, description: ps.description, isSensitive: ps.isSensitive, - fileIds: files.map(file => file.id) + fileIds: files.map(file => file.id), }); const post = await GalleryPosts.findOneOrFail(ps.postId); diff --git a/packages/backend/src/server/api/endpoints/games/reversi/games.ts b/packages/backend/src/server/api/endpoints/games/reversi/games.ts index 4db9ecb69f..f77f11942c 100644 --- a/packages/backend/src/server/api/endpoints/games/reversi/games.ts +++ b/packages/backend/src/server/api/endpoints/games/reversi/games.ts @@ -11,7 +11,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -24,8 +24,8 @@ export const meta = { my: { validator: $.optional.bool, - default: false - } + default: false, + }, }, res: { @@ -38,86 +38,86 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, createdAt: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'date-time' + format: 'date-time', }, startedAt: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'date-time' + format: 'date-time', }, isStarted: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isEnded: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, form1: { type: 'any' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, form2: { type: 'any' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, user1Accepted: { type: 'boolean' as const, optional: false as const, nullable: false as const, - default: false + default: false, }, user2Accepted: { type: 'boolean' as const, optional: false as const, nullable: false as const, - default: false + default: false, }, user1Id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, user2Id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, user1: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' + ref: 'User', }, user2: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' + ref: 'User', }, winnerId: { type: 'string' as const, optional: false as const, nullable: true as const, - format: 'id' + format: 'id', }, winner: { type: 'object' as const, optional: false as const, nullable: true as const, - ref: 'User' + ref: 'User', }, surrendered: { type: 'string' as const, optional: false as const, nullable: true as const, - format: 'id' + format: 'id', }, black: { type: 'number' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, bw: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isLlotheo: { type: 'boolean' as const, @@ -125,15 +125,15 @@ export const meta = { }, canPutEverywhere: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, loopedBoard: { type: 'boolean' as const, - optional: false as const, nullable: false as const - } - } - } - } + optional: false as const, nullable: false as const, + }, + }, + }, + }, }; export default define(meta, async (ps, user) => { @@ -151,6 +151,6 @@ export default define(meta, async (ps, user) => { const games = await query.take(ps.limit!).getMany(); return await Promise.all(games.map((g) => ReversiGames.pack(g, user, { - detail: false + detail: false, }))); }); diff --git a/packages/backend/src/server/api/endpoints/games/reversi/games/show.ts b/packages/backend/src/server/api/endpoints/games/reversi/games/show.ts index 93afffdb1f..0476a4be9b 100644 --- a/packages/backend/src/server/api/endpoints/games/reversi/games/show.ts +++ b/packages/backend/src/server/api/endpoints/games/reversi/games/show.ts @@ -18,7 +18,7 @@ export const meta = { noSuchGame: { message: 'No such game.', code: 'NO_SUCH_GAME', - id: 'f13a03db-fae1-46c9-87f3-43c8165419e1' + id: 'f13a03db-fae1-46c9-87f3-43c8165419e1', }, }, @@ -32,86 +32,86 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, createdAt: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'date-time' + format: 'date-time', }, startedAt: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'date-time' + format: 'date-time', }, isStarted: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isEnded: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, form1: { type: 'any' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, form2: { type: 'any' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, user1Accepted: { type: 'boolean' as const, optional: false as const, nullable: false as const, - default: false + default: false, }, user2Accepted: { type: 'boolean' as const, optional: false as const, nullable: false as const, - default: false + default: false, }, user1Id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, user2Id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, user1: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' + ref: 'User', }, user2: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' + ref: 'User', }, winnerId: { type: 'string' as const, optional: false as const, nullable: true as const, - format: 'id' + format: 'id', }, winner: { type: 'object' as const, optional: false as const, nullable: true as const, - ref: 'User' + ref: 'User', }, surrendered: { type: 'string' as const, optional: false as const, nullable: true as const, - format: 'id' + format: 'id', }, black: { type: 'number' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, bw: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isLlotheo: { type: 'boolean' as const, @@ -119,27 +119,27 @@ export const meta = { }, canPutEverywhere: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, loopedBoard: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, board: { type: 'array' as const, optional: false as const, nullable: false as const, items: { type: 'any' as const, - optional: false as const, nullable: false as const - } + optional: false as const, nullable: false as const, + }, }, turn: { type: 'any' as const, - optional: false as const, nullable: false as const - } - } - } - } + optional: false as const, nullable: false as const, + }, + }, + }, + }, }; export default define(meta, async (ps, user) => { @@ -152,7 +152,7 @@ export default define(meta, async (ps, user) => { const o = new Reversi(game.map, { isLlotheo: game.isLlotheo, canPutEverywhere: game.canPutEverywhere, - loopedBoard: game.loopedBoard + loopedBoard: game.loopedBoard, }); for (const log of game.logs) { @@ -163,6 +163,6 @@ export default define(meta, async (ps, user) => { return Object.assign({ board: o.board, - turn: o.turn + turn: o.turn, }, packed); }); diff --git a/packages/backend/src/server/api/endpoints/games/reversi/games/surrender.ts b/packages/backend/src/server/api/endpoints/games/reversi/games/surrender.ts index 00d58b19e3..84b80c47a0 100644 --- a/packages/backend/src/server/api/endpoints/games/reversi/games/surrender.ts +++ b/packages/backend/src/server/api/endpoints/games/reversi/games/surrender.ts @@ -13,28 +13,28 @@ export const meta = { params: { gameId: { validator: $.type(ID), - } + }, }, errors: { noSuchGame: { message: 'No such game.', code: 'NO_SUCH_GAME', - id: 'ace0b11f-e0a6-4076-a30d-e8284c81b2df' + id: 'ace0b11f-e0a6-4076-a30d-e8284c81b2df', }, alreadyEnded: { message: 'That game has already ended.', code: 'ALREADY_ENDED', - id: '6c2ad4a6-cbf1-4a5b-b187-b772826cfc6d' + id: '6c2ad4a6-cbf1-4a5b-b187-b772826cfc6d', }, accessDenied: { message: 'Access denied.', code: 'ACCESS_DENIED', - id: '6e04164b-a992-4c93-8489-2123069973e1' + id: '6e04164b-a992-4c93-8489-2123069973e1', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -57,11 +57,11 @@ export default define(meta, async (ps, user) => { await ReversiGames.update(game.id, { surrendered: user.id, isEnded: true, - winnerId: winnerId + winnerId: winnerId, }); publishReversiGameStream(game.id, 'ended', { winnerId: winnerId, - game: await ReversiGames.pack(game.id, user) + game: await ReversiGames.pack(game.id, user), }); }); diff --git a/packages/backend/src/server/api/endpoints/games/reversi/invitations.ts b/packages/backend/src/server/api/endpoints/games/reversi/invitations.ts index c8629377b2..b859a2fc75 100644 --- a/packages/backend/src/server/api/endpoints/games/reversi/invitations.ts +++ b/packages/backend/src/server/api/endpoints/games/reversi/invitations.ts @@ -16,42 +16,42 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, createdAt: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'date-time' + format: 'date-time', }, parentId: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, parent: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' + ref: 'User', }, childId: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, child: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' - } - } - } - } + ref: 'User', + }, + }, + }, + }, }; export default define(meta, async (ps, user) => { // Find session const invitations = await ReversiMatchings.find({ - childId: user.id + childId: user.id, }); return await Promise.all(invitations.map((i) => ReversiMatchings.pack(i, user))); diff --git a/packages/backend/src/server/api/endpoints/games/reversi/match.ts b/packages/backend/src/server/api/endpoints/games/reversi/match.ts index 5ceb16c7d7..c66c5a4f75 100644 --- a/packages/backend/src/server/api/endpoints/games/reversi/match.ts +++ b/packages/backend/src/server/api/endpoints/games/reversi/match.ts @@ -25,15 +25,15 @@ export const meta = { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '0b4f0559-b484-4e31-9581-3f73cee89b28' + id: '0b4f0559-b484-4e31-9581-3f73cee89b28', }, isYourself: { message: 'Target user is yourself.', code: 'TARGET_IS_YOURSELF', - id: '96fd7bd6-d2bc-426c-a865-d055dcd2828e' + id: '96fd7bd6-d2bc-426c-a865-d055dcd2828e', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -45,7 +45,7 @@ export default define(meta, async (ps, user) => { // Find session const exist = await ReversiMatchings.findOne({ parentId: ps.userId, - childId: user.id + childId: user.id, }); if (exist) { @@ -65,13 +65,13 @@ export default define(meta, async (ps, user) => { logs: [], map: eighteight.data, bw: 'random', - isLlotheo: false + isLlotheo: false, } as Partial); publishReversiStream(exist.parentId, 'matched', await ReversiGames.pack(game, { id: exist.parentId })); const other = await ReversiMatchings.count({ - childId: user.id + childId: user.id, }); if (other == 0) { @@ -88,7 +88,7 @@ export default define(meta, async (ps, user) => { // 以前のセッションはすべて削除しておく await ReversiMatchings.delete({ - parentId: user.id + parentId: user.id, }); // セッションを作成 @@ -96,7 +96,7 @@ export default define(meta, async (ps, user) => { id: genId(), createdAt: new Date(), parentId: user.id, - childId: child.id + childId: child.id, } as ReversiMatching); const packed = await ReversiMatchings.pack(matching, child); diff --git a/packages/backend/src/server/api/endpoints/games/reversi/match/cancel.ts b/packages/backend/src/server/api/endpoints/games/reversi/match/cancel.ts index e4a138bb87..8076b7c5d8 100644 --- a/packages/backend/src/server/api/endpoints/games/reversi/match/cancel.ts +++ b/packages/backend/src/server/api/endpoints/games/reversi/match/cancel.ts @@ -4,11 +4,11 @@ import { ReversiMatchings } from '@/models/index'; export const meta = { tags: ['games'], - requireCredential: true as const + requireCredential: true as const, }; export default define(meta, async (ps, user) => { await ReversiMatchings.delete({ - parentId: user.id + parentId: user.id, }); }); diff --git a/packages/backend/src/server/api/endpoints/get-online-users-count.ts b/packages/backend/src/server/api/endpoints/get-online-users-count.ts index 5c80d588d3..0616431abc 100644 --- a/packages/backend/src/server/api/endpoints/get-online-users-count.ts +++ b/packages/backend/src/server/api/endpoints/get-online-users-count.ts @@ -9,15 +9,15 @@ export const meta = { requireCredential: false as const, params: { - } + }, }; export default define(meta, async () => { const count = await Users.count({ - lastActiveDate: MoreThan(new Date(Date.now() - USER_ONLINE_THRESHOLD)) + lastActiveDate: MoreThan(new Date(Date.now() - USER_ONLINE_THRESHOLD)), }); return { - count + count, }; }); diff --git a/packages/backend/src/server/api/endpoints/hashtags/list.ts b/packages/backend/src/server/api/endpoints/hashtags/list.ts index 821016a50c..5f8bfee2df 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/list.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/list.ts @@ -10,22 +10,22 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, attachedToUserOnly: { validator: $.optional.bool, - default: false + default: false, }, attachedToLocalUserOnly: { validator: $.optional.bool, - default: false + default: false, }, attachedToRemoteUserOnly: { validator: $.optional.bool, - default: false + default: false, }, sort: { @@ -53,7 +53,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Hashtag', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/hashtags/search.ts b/packages/backend/src/server/api/endpoints/hashtags/search.ts index fd0cac3983..d7de1db557 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/search.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/search.ts @@ -20,7 +20,7 @@ export const meta = { offset: { validator: $.optional.num.min(0), default: 0, - } + }, }, res: { @@ -29,7 +29,7 @@ export const meta = { items: { type: 'string' as const, optional: false as const, nullable: false as const, - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/hashtags/show.ts b/packages/backend/src/server/api/endpoints/hashtags/show.ts index f22edbfffd..9410aea389 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/show.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/show.ts @@ -12,7 +12,7 @@ export const meta = { params: { tag: { validator: $.str, - } + }, }, res: { @@ -25,9 +25,9 @@ export const meta = { noSuchHashtag: { message: 'No such hashtag.', code: 'NO_SUCH_HASHTAG', - id: '110ee688-193e-4a3a-9ecf-c167b2e6981e' - } - } + id: '110ee688-193e-4a3a-9ecf-c167b2e6981e', + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/hashtags/trend.ts b/packages/backend/src/server/api/endpoints/hashtags/trend.ts index 3d67241ab6..deb8417ad6 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/trend.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/trend.ts @@ -42,15 +42,15 @@ export const meta = { items: { type: 'number' as const, optional: false as const, nullable: false as const, - } + }, }, usersCount: { type: 'number' as const, optional: false as const, nullable: false as const, - } - } - } - } + }, + }, + }, + }, }; export default define(meta, async () => { @@ -92,7 +92,7 @@ export default define(meta, async () => { } else { tags.push({ name: tag, - users: [note.userId] + users: [note.userId], }); } } @@ -139,7 +139,7 @@ export default define(meta, async () => { const stats = hots.map((tag, i) => ({ tag, chart: countsLog.map(counts => counts[i]), - usersCount: totalCounts[i] + usersCount: totalCounts[i], })); return stats; diff --git a/packages/backend/src/server/api/endpoints/hashtags/users.ts b/packages/backend/src/server/api/endpoints/hashtags/users.ts index 8c8cd1510b..69b17a19eb 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/users.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/users.ts @@ -15,7 +15,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sort: { @@ -32,9 +32,9 @@ export const meta = { state: { validator: $.optional.str.or([ 'all', - 'alive' + 'alive', ]), - default: 'all' + default: 'all', }, origin: { @@ -43,8 +43,8 @@ export const meta = { 'local', 'remote', ]), - default: 'local' - } + default: 'local', + }, }, res: { @@ -54,7 +54,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'User', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/i.ts b/packages/backend/src/server/api/endpoints/i.ts index 0568a962d8..2063a55a81 100644 --- a/packages/backend/src/server/api/endpoints/i.ts +++ b/packages/backend/src/server/api/endpoints/i.ts @@ -21,6 +21,6 @@ export default define(meta, async (ps, user, token) => { // ここで渡ってきている user はキャッシュされていて古い可能性もあるので id だけ渡す return await Users.pack(user.id, user, { detail: true, - includeSecrets: isSecure + includeSecrets: isSecure, }); }); diff --git a/packages/backend/src/server/api/endpoints/i/2fa/done.ts b/packages/backend/src/server/api/endpoints/i/2fa/done.ts index 2bd2128cce..3b772386f3 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/done.ts @@ -10,9 +10,9 @@ export const meta = { params: { token: { - validator: $.str - } - } + validator: $.str, + }, + }, }; export default define(meta, async (ps, user) => { @@ -27,7 +27,7 @@ export default define(meta, async (ps, user) => { const verified = (speakeasy as any).totp.verify({ secret: profile.twoFactorTempSecret, encoding: 'base32', - token: token + token: token, }); if (!verified) { @@ -36,6 +36,6 @@ export default define(meta, async (ps, user) => { await UserProfiles.update(user.id, { twoFactorSecret: profile.twoFactorTempSecret, - twoFactorEnabled: true + twoFactorEnabled: true, }); }); diff --git a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts index e06d0a9f68..f0045fb997 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/key-done.ts @@ -7,7 +7,7 @@ import { UserProfiles, UserSecurityKeys, AttestationChallenges, - Users + Users, } from '@/models/index'; import config from '@/config/index'; import { procedures, hash } from '../../../2fa'; @@ -22,21 +22,21 @@ export const meta = { params: { clientDataJSON: { - validator: $.str + validator: $.str, }, attestationObject: { - validator: $.str + validator: $.str, }, password: { - validator: $.str + validator: $.str, }, challengeId: { - validator: $.str + validator: $.str, }, name: { - validator: $.str - } - } + validator: $.str, + }, + }, }; const rpIdHashReal = hash(Buffer.from(config.hostname, 'utf-8')); @@ -99,7 +99,7 @@ export default define(meta, async (ps, user) => { clientDataHash: clientDataJSONHash, credentialId, publicKey, - rpIdHash + rpIdHash, }); if (!verificationData.valid) throw new Error('signature invalid'); @@ -107,7 +107,7 @@ export default define(meta, async (ps, user) => { userId: user.id, id: ps.challengeId, registrationChallenge: true, - challenge: hash(clientData.challenge).toString('hex') + challenge: hash(clientData.challenge).toString('hex'), }); if (!attestationChallenge) { @@ -116,7 +116,7 @@ export default define(meta, async (ps, user) => { await AttestationChallenges.delete({ userId: user.id, - id: ps.challengeId + id: ps.challengeId, }); // Expired challenge (> 5min old) @@ -134,17 +134,17 @@ export default define(meta, async (ps, user) => { id: credentialIdString, lastUsed: new Date(), name: ps.name, - publicKey: verificationData.publicKey.toString('hex') + publicKey: verificationData.publicKey.toString('hex'), }); // Publish meUpdated event publishMainStream(user.id, 'meUpdated', await Users.pack(user.id, user, { detail: true, - includeSecrets: true + includeSecrets: true, })); return { id: credentialIdString, - name: ps.name + name: ps.name, }; }); diff --git a/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts b/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts index 064828b638..dc2b66286b 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/password-less.ts @@ -9,13 +9,13 @@ export const meta = { params: { value: { - validator: $.boolean - } - } + validator: $.boolean, + }, + }, }; export default define(meta, async (ps, user) => { await UserProfiles.update(user.id, { - usePasswordLessLogin: ps.value + usePasswordLessLogin: ps.value, }); }); diff --git a/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts index 1b385a10ee..aa6c8fb1d5 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register-key.ts @@ -16,9 +16,9 @@ export const meta = { params: { password: { - validator: $.str - } - } + validator: $.str, + }, + }, }; export default define(meta, async (ps, user) => { @@ -49,11 +49,11 @@ export default define(meta, async (ps, user) => { id: challengeId, challenge: hash(Buffer.from(challenge, 'utf-8')).toString('hex'), createdAt: new Date(), - registrationChallenge: true + registrationChallenge: true, }); return { challengeId, - challenge + challenge, }; }); diff --git a/packages/backend/src/server/api/endpoints/i/2fa/register.ts b/packages/backend/src/server/api/endpoints/i/2fa/register.ts index b03b98188a..347dec0f43 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/register.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/register.ts @@ -13,9 +13,9 @@ export const meta = { params: { password: { - validator: $.str - } - } + validator: $.str, + }, + }, }; export default define(meta, async (ps, user) => { @@ -30,11 +30,11 @@ export default define(meta, async (ps, user) => { // Generate user's secret key const secret = speakeasy.generateSecret({ - length: 32 + length: 32, }); await UserProfiles.update(user.id, { - twoFactorTempSecret: secret.base32 + twoFactorTempSecret: secret.base32, }); // Get the data URL of the authenticator URL @@ -42,13 +42,13 @@ export default define(meta, async (ps, user) => { secret: secret.base32, encoding: 'base32', label: user.username, - issuer: config.host + issuer: config.host, })); return { qr: dataUrl, secret: secret.base32, label: user.username, - issuer: config.host + issuer: config.host, }; }); diff --git a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts index dea56301ab..05d63452f1 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/remove-key.ts @@ -11,12 +11,12 @@ export const meta = { params: { password: { - validator: $.str + validator: $.str, }, credentialId: { - validator: $.str + validator: $.str, }, - } + }, }; export default define(meta, async (ps, user) => { @@ -32,13 +32,13 @@ export default define(meta, async (ps, user) => { // Make sure we only delete the user's own creds await UserSecurityKeys.delete({ userId: user.id, - id: ps.credentialId + id: ps.credentialId, }); // Publish meUpdated event publishMainStream(user.id, 'meUpdated', await Users.pack(user.id, user, { detail: true, - includeSecrets: true + includeSecrets: true, })); return {}; diff --git a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts index af53033daa..a0d8b5906b 100644 --- a/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts +++ b/packages/backend/src/server/api/endpoints/i/2fa/unregister.ts @@ -10,9 +10,9 @@ export const meta = { params: { password: { - validator: $.str - } - } + validator: $.str, + }, + }, }; export default define(meta, async (ps, user) => { @@ -27,6 +27,6 @@ export default define(meta, async (ps, user) => { await UserProfiles.update(user.id, { twoFactorSecret: null, - twoFactorEnabled: false + twoFactorEnabled: false, }); }); diff --git a/packages/backend/src/server/api/endpoints/i/apps.ts b/packages/backend/src/server/api/endpoints/i/apps.ts index 994528e5c9..64986865b2 100644 --- a/packages/backend/src/server/api/endpoints/i/apps.ts +++ b/packages/backend/src/server/api/endpoints/i/apps.ts @@ -16,7 +16,7 @@ export const meta = { '-lastUsedAt', ]), }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/authorized-apps.ts b/packages/backend/src/server/api/endpoints/i/authorized-apps.ts index 042fcd14e8..bfe20eb984 100644 --- a/packages/backend/src/server/api/endpoints/i/authorized-apps.ts +++ b/packages/backend/src/server/api/endpoints/i/authorized-apps.ts @@ -21,24 +21,24 @@ export const meta = { sort: { validator: $.optional.str.or('desc|asc'), default: 'desc', - } - } + }, + }, }; export default define(meta, async (ps, user) => { // Get tokens const tokens = await AccessTokens.find({ where: { - userId: user.id + userId: user.id, }, take: ps.limit!, skip: ps.offset, order: { - id: ps.sort == 'asc' ? 1 : -1 - } + id: ps.sort == 'asc' ? 1 : -1, + }, }); return await Promise.all(tokens.map(token => Apps.pack(token.appId, user, { - detail: true + detail: true, }))); }); diff --git a/packages/backend/src/server/api/endpoints/i/change-password.ts b/packages/backend/src/server/api/endpoints/i/change-password.ts index 7ea5f8c488..416eb6229f 100644 --- a/packages/backend/src/server/api/endpoints/i/change-password.ts +++ b/packages/backend/src/server/api/endpoints/i/change-password.ts @@ -10,13 +10,13 @@ export const meta = { params: { currentPassword: { - validator: $.str + validator: $.str, }, newPassword: { - validator: $.str - } - } + validator: $.str, + }, + }, }; export default define(meta, async (ps, user) => { @@ -34,6 +34,6 @@ export default define(meta, async (ps, user) => { const hash = await bcrypt.hash(ps.newPassword, salt); await UserProfiles.update(user.id, { - password: hash + password: hash, }); }); diff --git a/packages/backend/src/server/api/endpoints/i/delete-account.ts b/packages/backend/src/server/api/endpoints/i/delete-account.ts index 10e5adf64a..13a8f79dfa 100644 --- a/packages/backend/src/server/api/endpoints/i/delete-account.ts +++ b/packages/backend/src/server/api/endpoints/i/delete-account.ts @@ -13,9 +13,9 @@ export const meta = { params: { password: { - validator: $.str + validator: $.str, }, - } + }, }; export default define(meta, async (ps, user) => { @@ -36,7 +36,7 @@ export default define(meta, async (ps, user) => { await doPostSuspend(user).catch(e => {}); createDeleteAccountJob(user, { - soft: false + soft: false, }); await Users.update(user.id, { diff --git a/packages/backend/src/server/api/endpoints/i/favorites.ts b/packages/backend/src/server/api/endpoints/i/favorites.ts index b79d68ae73..49b0bcd46c 100644 --- a/packages/backend/src/server/api/endpoints/i/favorites.ts +++ b/packages/backend/src/server/api/endpoints/i/favorites.ts @@ -14,7 +14,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -33,7 +33,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'NoteFavorite', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/i/gallery/likes.ts b/packages/backend/src/server/api/endpoints/i/gallery/likes.ts index 7a2935a5ec..3ee7174f71 100644 --- a/packages/backend/src/server/api/endpoints/i/gallery/likes.ts +++ b/packages/backend/src/server/api/endpoints/i/gallery/likes.ts @@ -14,7 +14,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -33,15 +33,15 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, page: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'GalleryPost' - } - } - } + ref: 'GalleryPost', + }, + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/gallery/posts.ts b/packages/backend/src/server/api/endpoints/i/gallery/posts.ts index 21bb8759fc..c8aceb8bf3 100644 --- a/packages/backend/src/server/api/endpoints/i/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/i/gallery/posts.ts @@ -14,7 +14,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -32,9 +32,9 @@ export const meta = { items: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'GalleryPost' - } - } + ref: 'GalleryPost', + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts b/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts index 6b9be98582..3eddc2746c 100644 --- a/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts +++ b/packages/backend/src/server/api/endpoints/i/get-word-muted-notes-count.ts @@ -17,17 +17,17 @@ export const meta = { properties: { count: { type: 'number' as const, - optional: false as const, nullable: false as const - } - } - } + optional: false as const, nullable: false as const, + }, + }, + }, }; export default define(meta, async (ps, user) => { return { count: await MutedNotes.count({ userId: user.id, - reason: 'word' - }) + reason: 'word', + }), }; }); diff --git a/packages/backend/src/server/api/endpoints/i/import-blocking.ts b/packages/backend/src/server/api/endpoints/i/import-blocking.ts index 4822bd5868..f0e3106c53 100644 --- a/packages/backend/src/server/api/endpoints/i/import-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/import-blocking.ts @@ -18,34 +18,34 @@ export const meta = { params: { fileId: { validator: $.type(ID), - } + }, }, errors: { noSuchFile: { message: 'No such file.', code: 'NO_SUCH_FILE', - id: 'ebb53e5f-6574-9c0c-0b92-7ca6def56d7e' + id: 'ebb53e5f-6574-9c0c-0b92-7ca6def56d7e', }, unexpectedFileType: { message: 'We need csv file.', code: 'UNEXPECTED_FILE_TYPE', - id: 'b6fab7d6-d945-d67c-dfdb-32da1cd12cfe' + id: 'b6fab7d6-d945-d67c-dfdb-32da1cd12cfe', }, tooBigFile: { message: 'That file is too big.', code: 'TOO_BIG_FILE', - id: 'b7fbf0b1-aeef-3b21-29ef-fadd4cb72ccf' + id: 'b7fbf0b1-aeef-3b21-29ef-fadd4cb72ccf', }, emptyFile: { message: 'That file is empty.', code: 'EMPTY_FILE', - id: '6f3a4dcc-f060-a707-4950-806fbdbe60d6' + id: '6f3a4dcc-f060-a707-4950-806fbdbe60d6', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/import-following.ts b/packages/backend/src/server/api/endpoints/i/import-following.ts index 19aa2fa933..61e500599f 100644 --- a/packages/backend/src/server/api/endpoints/i/import-following.ts +++ b/packages/backend/src/server/api/endpoints/i/import-following.ts @@ -17,34 +17,34 @@ export const meta = { params: { fileId: { validator: $.type(ID), - } + }, }, errors: { noSuchFile: { message: 'No such file.', code: 'NO_SUCH_FILE', - id: 'b98644cf-a5ac-4277-a502-0b8054a709a3' + id: 'b98644cf-a5ac-4277-a502-0b8054a709a3', }, unexpectedFileType: { message: 'We need csv file.', code: 'UNEXPECTED_FILE_TYPE', - id: '660f3599-bce0-4f95-9dde-311fd841c183' + id: '660f3599-bce0-4f95-9dde-311fd841c183', }, tooBigFile: { message: 'That file is too big.', code: 'TOO_BIG_FILE', - id: 'dee9d4ed-ad07-43ed-8b34-b2856398bc60' + id: 'dee9d4ed-ad07-43ed-8b34-b2856398bc60', }, emptyFile: { message: 'That file is empty.', code: 'EMPTY_FILE', - id: '31a1b42c-06f7-42ae-8a38-a661c5c9f691' + id: '31a1b42c-06f7-42ae-8a38-a661c5c9f691', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/import-muting.ts b/packages/backend/src/server/api/endpoints/i/import-muting.ts index c474dd7186..da26617d91 100644 --- a/packages/backend/src/server/api/endpoints/i/import-muting.ts +++ b/packages/backend/src/server/api/endpoints/i/import-muting.ts @@ -18,34 +18,34 @@ export const meta = { params: { fileId: { validator: $.type(ID), - } + }, }, errors: { noSuchFile: { message: 'No such file.', code: 'NO_SUCH_FILE', - id: 'e674141e-bd2a-ba85-e616-aefb187c9c2a' + id: 'e674141e-bd2a-ba85-e616-aefb187c9c2a', }, unexpectedFileType: { message: 'We need csv file.', code: 'UNEXPECTED_FILE_TYPE', - id: '568c6e42-c86c-ba09-c004-517f83f9f1a8' + id: '568c6e42-c86c-ba09-c004-517f83f9f1a8', }, tooBigFile: { message: 'That file is too big.', code: 'TOO_BIG_FILE', - id: '9b4ada6d-d7f7-0472-0713-4f558bd1ec9c' + id: '9b4ada6d-d7f7-0472-0713-4f558bd1ec9c', }, emptyFile: { message: 'That file is empty.', code: 'EMPTY_FILE', - id: 'd2f12af1-e7b4-feac-86a3-519548f2728e' + id: 'd2f12af1-e7b4-feac-86a3-519548f2728e', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/import-user-lists.ts b/packages/backend/src/server/api/endpoints/i/import-user-lists.ts index ceccdd1852..1b850d314f 100644 --- a/packages/backend/src/server/api/endpoints/i/import-user-lists.ts +++ b/packages/backend/src/server/api/endpoints/i/import-user-lists.ts @@ -17,34 +17,34 @@ export const meta = { params: { fileId: { validator: $.type(ID), - } + }, }, errors: { noSuchFile: { message: 'No such file.', code: 'NO_SUCH_FILE', - id: 'ea9cc34f-c415-4bc6-a6fe-28ac40357049' + id: 'ea9cc34f-c415-4bc6-a6fe-28ac40357049', }, unexpectedFileType: { message: 'We need csv file.', code: 'UNEXPECTED_FILE_TYPE', - id: 'a3c9edda-dd9b-4596-be6a-150ef813745c' + id: 'a3c9edda-dd9b-4596-be6a-150ef813745c', }, tooBigFile: { message: 'That file is too big.', code: 'TOO_BIG_FILE', - id: 'ae6e7a22-971b-4b52-b2be-fc0b9b121fe9' + id: 'ae6e7a22-971b-4b52-b2be-fc0b9b121fe9', }, emptyFile: { message: 'That file is empty.', code: 'EMPTY_FILE', - id: '99efe367-ce6e-4d44-93f8-5fae7b040356' + id: '99efe367-ce6e-4d44-93f8-5fae7b040356', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/notifications.ts b/packages/backend/src/server/api/endpoints/i/notifications.ts index a85637d8a0..9083aefacd 100644 --- a/packages/backend/src/server/api/endpoints/i/notifications.ts +++ b/packages/backend/src/server/api/endpoints/i/notifications.ts @@ -19,7 +19,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -32,17 +32,17 @@ export const meta = { following: { validator: $.optional.bool, - default: false + default: false, }, unreadOnly: { validator: $.optional.bool, - default: false + default: false, }, markAsRead: { validator: $.optional.bool, - default: true + default: true, }, includeTypes: { @@ -51,7 +51,7 @@ export const meta = { excludeTypes: { validator: $.optional.arr($.str.or(notificationTypes as unknown as string[])), - } + }, }, res: { @@ -61,7 +61,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Notification', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/i/page-likes.ts b/packages/backend/src/server/api/endpoints/i/page-likes.ts index fa2bc31730..92fc294850 100644 --- a/packages/backend/src/server/api/endpoints/i/page-likes.ts +++ b/packages/backend/src/server/api/endpoints/i/page-likes.ts @@ -14,7 +14,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -33,15 +33,15 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, page: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'Page' - } - } - } + ref: 'Page', + }, + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/pages.ts b/packages/backend/src/server/api/endpoints/i/pages.ts index ee87fffa2d..5948712c30 100644 --- a/packages/backend/src/server/api/endpoints/i/pages.ts +++ b/packages/backend/src/server/api/endpoints/i/pages.ts @@ -14,7 +14,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -32,9 +32,9 @@ export const meta = { items: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'Page' - } - } + ref: 'Page', + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/pin.ts b/packages/backend/src/server/api/endpoints/i/pin.ts index de94220ba9..5fc49d6518 100644 --- a/packages/backend/src/server/api/endpoints/i/pin.ts +++ b/packages/backend/src/server/api/endpoints/i/pin.ts @@ -15,34 +15,34 @@ export const meta = { params: { noteId: { validator: $.type(ID), - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: '56734f8b-3928-431e-bf80-6ff87df40cb3' + id: '56734f8b-3928-431e-bf80-6ff87df40cb3', }, pinLimitExceeded: { message: 'You can not pin notes any more.', code: 'PIN_LIMIT_EXCEEDED', - id: '72dab508-c64d-498f-8740-a8eec1ba385a' + id: '72dab508-c64d-498f-8740-a8eec1ba385a', }, alreadyPinned: { message: 'That note has already been pinned.', code: 'ALREADY_PINNED', - id: '8b18c2b7-68fe-4edb-9892-c0cbaeb6c913' + id: '8b18c2b7-68fe-4edb-9892-c0cbaeb6c913', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' - } + ref: 'User', + }, }; export default define(meta, async (ps, user) => { @@ -54,6 +54,6 @@ export default define(meta, async (ps, user) => { }); return await Users.pack(user.id, user, { - detail: true + detail: true, }); }); diff --git a/packages/backend/src/server/api/endpoints/i/read-all-messaging-messages.ts b/packages/backend/src/server/api/endpoints/i/read-all-messaging-messages.ts index 9aca7611c9..a66d6bac7b 100644 --- a/packages/backend/src/server/api/endpoints/i/read-all-messaging-messages.ts +++ b/packages/backend/src/server/api/endpoints/i/read-all-messaging-messages.ts @@ -10,23 +10,23 @@ export const meta = { kind: 'write:account', params: { - } + }, }; export default define(meta, async (ps, user) => { // Update documents await MessagingMessages.update({ recipientId: user.id, - isRead: false + isRead: false, }, { - isRead: true + isRead: true, }); const joinings = await UserGroupJoinings.find({ userId: user.id }); await Promise.all(joinings.map(j => MessagingMessages.createQueryBuilder().update() .set({ - reads: (() => `array_append("reads", '${user.id}')`) as any + reads: (() => `array_append("reads", '${user.id}')`) as any, }) .where(`groupId = :groupId`, { groupId: j.userGroupId }) .andWhere('userId != :userId', { userId: user.id }) diff --git a/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts b/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts index 2a7102a590..90f555763e 100644 --- a/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/read-all-unread-notes.ts @@ -10,13 +10,13 @@ export const meta = { kind: 'write:account', params: { - } + }, }; export default define(meta, async (ps, user) => { // Remove documents await NoteUnreads.delete({ - userId: user.id + userId: user.id, }); // 全て既読になったイベントを発行 diff --git a/packages/backend/src/server/api/endpoints/i/read-announcement.ts b/packages/backend/src/server/api/endpoints/i/read-announcement.ts index 2f5036f953..d948f3efdf 100644 --- a/packages/backend/src/server/api/endpoints/i/read-announcement.ts +++ b/packages/backend/src/server/api/endpoints/i/read-announcement.ts @@ -23,9 +23,9 @@ export const meta = { noSuchAnnouncement: { message: 'No such announcement.', code: 'NO_SUCH_ANNOUNCEMENT', - id: '184663db-df88-4bc2-8b52-fb85f0681939' + id: '184663db-df88-4bc2-8b52-fb85f0681939', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -39,7 +39,7 @@ export default define(meta, async (ps, user) => { // Check if already read const read = await AnnouncementReads.findOne({ announcementId: ps.announcementId, - userId: user.id + userId: user.id, }); if (read != null) { diff --git a/packages/backend/src/server/api/endpoints/i/regenerate-token.ts b/packages/backend/src/server/api/endpoints/i/regenerate-token.ts index 1cce2d37be..f7e910154d 100644 --- a/packages/backend/src/server/api/endpoints/i/regenerate-token.ts +++ b/packages/backend/src/server/api/endpoints/i/regenerate-token.ts @@ -12,9 +12,9 @@ export const meta = { params: { password: { - validator: $.str - } - } + validator: $.str, + }, + }, }; export default define(meta, async (ps, user) => { @@ -31,7 +31,7 @@ export default define(meta, async (ps, user) => { const secret = generateUserToken(); await Users.update(user.id, { - token: secret + token: secret, }); // Publish event diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-all.ts b/packages/backend/src/server/api/endpoints/i/registry/get-all.ts index c8eaf83a25..1599ccea6b 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-all.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-all.ts @@ -12,7 +12,7 @@ export const meta = { validator: $.optional.arr($.str.match(/^[a-zA-Z0-9_]+$/)), default: [], }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts b/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts index 992800c44c..4edeae9e95 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-detail.ts @@ -10,7 +10,7 @@ export const meta = { params: { key: { - validator: $.str + validator: $.str, }, scope: { @@ -23,7 +23,7 @@ export const meta = { noSuchKey: { message: 'No such key.', code: 'NO_SUCH_KEY', - id: '97a1e8e7-c0f7-47d2-957a-92e61256e01a' + id: '97a1e8e7-c0f7-47d2-957a-92e61256e01a', }, }, }; diff --git a/packages/backend/src/server/api/endpoints/i/registry/get.ts b/packages/backend/src/server/api/endpoints/i/registry/get.ts index 569c3a9280..aa0695281a 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get.ts @@ -10,7 +10,7 @@ export const meta = { params: { key: { - validator: $.str + validator: $.str, }, scope: { @@ -23,7 +23,7 @@ export const meta = { noSuchKey: { message: 'No such key.', code: 'NO_SUCH_KEY', - id: 'ac3ed68a-62f0-422b-a7bc-d5e09e8f6a6a' + id: 'ac3ed68a-62f0-422b-a7bc-d5e09e8f6a6a', }, }, }; diff --git a/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts b/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts index 16a4fee374..9cac503538 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys-with-type.ts @@ -12,7 +12,7 @@ export const meta = { validator: $.optional.arr($.str.match(/^[a-zA-Z0-9_]+$/)), default: [], }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/registry/keys.ts b/packages/backend/src/server/api/endpoints/i/registry/keys.ts index 3a8aeaa195..215ccbd5b5 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/keys.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/keys.ts @@ -12,7 +12,7 @@ export const meta = { validator: $.optional.arr($.str.match(/^[a-zA-Z0-9_]+$/)), default: [], }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/registry/remove.ts b/packages/backend/src/server/api/endpoints/i/registry/remove.ts index 07bc23d4a6..17ce5851c0 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/remove.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/remove.ts @@ -10,7 +10,7 @@ export const meta = { params: { key: { - validator: $.str + validator: $.str, }, scope: { @@ -23,7 +23,7 @@ export const meta = { noSuchKey: { message: 'No such key.', code: 'NO_SUCH_KEY', - id: '1fac4e8a-a6cd-4e39-a4a5-3a7e11f1b019' + id: '1fac4e8a-a6cd-4e39-a4a5-3a7e11f1b019', }, }, }; diff --git a/packages/backend/src/server/api/endpoints/i/registry/scopes.ts b/packages/backend/src/server/api/endpoints/i/registry/scopes.ts index ecbdb05a8e..45aeb59771 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/scopes.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/scopes.ts @@ -7,7 +7,7 @@ export const meta = { secure: true, params: { - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/registry/set.ts b/packages/backend/src/server/api/endpoints/i/registry/set.ts index f129ee1b70..7c282064c3 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/set.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/set.ts @@ -11,18 +11,18 @@ export const meta = { params: { key: { - validator: $.str.min(1) + validator: $.str.min(1), }, value: { - validator: $.nullable.any + validator: $.nullable.any, }, scope: { validator: $.optional.arr($.str.match(/^[a-zA-Z0-9_]+$/)), default: [], }, - } + }, }; export default define(meta, async (ps, user) => { @@ -37,7 +37,7 @@ export default define(meta, async (ps, user) => { if (existingItem) { await RegistryItems.update(existingItem.id, { updatedAt: new Date(), - value: ps.value + value: ps.value, }); } else { await RegistryItems.insert({ @@ -48,7 +48,7 @@ export default define(meta, async (ps, user) => { domain: null, scope: ps.scope, key: ps.key, - value: ps.value + value: ps.value, }); } @@ -56,6 +56,6 @@ export default define(meta, async (ps, user) => { publishMainStream(user.id, 'registryUpdated', { scope: ps.scope, key: ps.key, - value: ps.value + value: ps.value, }); }); diff --git a/packages/backend/src/server/api/endpoints/i/revoke-token.ts b/packages/backend/src/server/api/endpoints/i/revoke-token.ts index bed868def4..1b6b18aa80 100644 --- a/packages/backend/src/server/api/endpoints/i/revoke-token.ts +++ b/packages/backend/src/server/api/endpoints/i/revoke-token.ts @@ -11,9 +11,9 @@ export const meta = { params: { tokenId: { - validator: $.type(ID) - } - } + validator: $.type(ID), + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/signin-history.ts b/packages/backend/src/server/api/endpoints/i/signin-history.ts index a2c10148c6..6f2f8fc8ca 100644 --- a/packages/backend/src/server/api/endpoints/i/signin-history.ts +++ b/packages/backend/src/server/api/endpoints/i/signin-history.ts @@ -12,7 +12,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -21,8 +21,8 @@ export const meta = { untilId: { validator: $.optional.type(ID), - } - } + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/i/unpin.ts b/packages/backend/src/server/api/endpoints/i/unpin.ts index dc79e255ab..c1b753bfaf 100644 --- a/packages/backend/src/server/api/endpoints/i/unpin.ts +++ b/packages/backend/src/server/api/endpoints/i/unpin.ts @@ -15,22 +15,22 @@ export const meta = { params: { noteId: { validator: $.type(ID), - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: '454170ce-9d63-4a43-9da1-ea10afe81e21' + id: '454170ce-9d63-4a43-9da1-ea10afe81e21', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' - } + ref: 'User', + }, }; export default define(meta, async (ps, user) => { @@ -40,6 +40,6 @@ export default define(meta, async (ps, user) => { }); return await Users.pack(user.id, user, { - detail: true + detail: true, }); }); diff --git a/packages/backend/src/server/api/endpoints/i/update-email.ts b/packages/backend/src/server/api/endpoints/i/update-email.ts index ff5a9f292c..d99fa2474d 100644 --- a/packages/backend/src/server/api/endpoints/i/update-email.ts +++ b/packages/backend/src/server/api/endpoints/i/update-email.ts @@ -17,16 +17,16 @@ export const meta = { limit: { duration: ms('1hour'), - max: 3 + max: 3, }, params: { password: { - validator: $.str + validator: $.str, }, email: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, }, @@ -34,15 +34,15 @@ export const meta = { incorrectPassword: { message: 'Incorrect password.', code: 'INCORRECT_PASSWORD', - id: 'e54c1d7e-e7d6-4103-86b6-0a95069b4ad3' + id: 'e54c1d7e-e7d6-4103-86b6-0a95069b4ad3', }, unavailable: { message: 'Unavailable email address.', code: 'UNAVAILABLE', - id: 'a2defefb-f220-8849-0af6-17f816099323' + id: 'a2defefb-f220-8849-0af6-17f816099323', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -65,12 +65,12 @@ export default define(meta, async (ps, user) => { await UserProfiles.update(user.id, { email: ps.email, emailVerified: false, - emailVerifyCode: null + emailVerifyCode: null, }); const iObj = await Users.pack(user.id, user, { detail: true, - includeSecrets: true + includeSecrets: true, }); // Publish meUpdated event @@ -80,7 +80,7 @@ export default define(meta, async (ps, user) => { const code = rndstr('a-z0-9', 16); await UserProfiles.update(user.id, { - emailVerifyCode: code + emailVerifyCode: code, }); const link = `${config.url}/verify-email/${code}`; diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index 4c5a4da622..5a62b39377 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -113,19 +113,19 @@ export const meta = { }, mutedWords: { - validator: $.optional.arr($.arr($.str)) + validator: $.optional.arr($.arr($.str)), }, mutedInstances: { - validator: $.optional.arr($.str) + validator: $.optional.arr($.str), }, mutingNotificationTypes: { - validator: $.optional.arr($.str.or(notificationTypes as unknown as string[])) + validator: $.optional.arr($.str.or(notificationTypes as unknown as string[])), }, emailNotificationTypes: { - validator: $.optional.arr($.str) + validator: $.optional.arr($.str), }, }, @@ -133,39 +133,39 @@ export const meta = { noSuchAvatar: { message: 'No such avatar file.', code: 'NO_SUCH_AVATAR', - id: '539f3a45-f215-4f81-a9a8-31293640207f' + id: '539f3a45-f215-4f81-a9a8-31293640207f', }, noSuchBanner: { message: 'No such banner file.', code: 'NO_SUCH_BANNER', - id: '0d8f5629-f210-41c2-9433-735831a58595' + id: '0d8f5629-f210-41c2-9433-735831a58595', }, avatarNotAnImage: { message: 'The file specified as an avatar is not an image.', code: 'AVATAR_NOT_AN_IMAGE', - id: 'f419f9f8-2f4d-46b1-9fb4-49d3a2fd7191' + id: 'f419f9f8-2f4d-46b1-9fb4-49d3a2fd7191', }, bannerNotAnImage: { message: 'The file specified as a banner is not an image.', code: 'BANNER_NOT_AN_IMAGE', - id: '75aedb19-2afd-4e6d-87fc-67941256fa60' + id: '75aedb19-2afd-4e6d-87fc-67941256fa60', }, noSuchPage: { message: 'No such page.', code: 'NO_SUCH_PAGE', - id: '8e01b590-7eb9-431b-a239-860e086c408e' + id: '8e01b590-7eb9-431b-a239-860e086c408e', }, }, res: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'User' - } + ref: 'User', + }, }; export default define(meta, async (ps, _user, token) => { @@ -280,7 +280,7 @@ export default define(meta, async (ps, _user, token) => { const iObj = await Users.pack(user.id, user, { detail: true, - includeSecrets: isSecure + includeSecrets: isSecure, }); // Publish meUpdated event diff --git a/packages/backend/src/server/api/endpoints/i/user-group-invites.ts b/packages/backend/src/server/api/endpoints/i/user-group-invites.ts index 1ebde243ca..6949e486ab 100644 --- a/packages/backend/src/server/api/endpoints/i/user-group-invites.ts +++ b/packages/backend/src/server/api/endpoints/i/user-group-invites.ts @@ -14,7 +14,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -36,16 +36,16 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, group: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'UserGroup' - } - } - } - } + ref: 'UserGroup', + }, + }, + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/messaging/history.ts b/packages/backend/src/server/api/endpoints/messaging/history.ts index e447703546..4ca3d6ebed 100644 --- a/packages/backend/src/server/api/endpoints/messaging/history.ts +++ b/packages/backend/src/server/api/endpoints/messaging/history.ts @@ -14,13 +14,13 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, group: { validator: $.optional.bool, - default: false - } + default: false, + }, }, res: { @@ -30,7 +30,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'MessagingMessage', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/messaging/messages.ts b/packages/backend/src/server/api/endpoints/messaging/messages.ts index 6baa24609e..79e7764245 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages.ts @@ -26,7 +26,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -39,8 +39,8 @@ export const meta = { markAsRead: { validator: $.optional.bool, - default: true - } + default: true, + }, }, res: { @@ -50,28 +50,28 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'MessagingMessage', - } + }, }, errors: { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '11795c64-40ea-4198-b06e-3c873ed9039d' + id: '11795c64-40ea-4198-b06e-3c873ed9039d', }, noSuchGroup: { message: 'No such group.', code: 'NO_SUCH_GROUP', - id: 'c4d9f88c-9270-4632-b032-6ed8cee36f7f' + id: 'c4d9f88c-9270-4632-b032-6ed8cee36f7f', }, groupAccessDenied: { message: 'You can not read messages of groups that you have not joined.', code: 'GROUP_ACCESS_DENIED', - id: 'a053a8dd-a491-4718-8f87-50775aad9284' + id: 'a053a8dd-a491-4718-8f87-50775aad9284', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -109,7 +109,7 @@ export default define(meta, async (ps, user) => { } return await Promise.all(messages.map(message => MessagingMessages.pack(message, user, { - populateRecipient: false + populateRecipient: false, }))); } else if (ps.groupId != null) { // Fetch recipient (group) @@ -122,7 +122,7 @@ export default define(meta, async (ps, user) => { // check joined const joining = await UserGroupJoinings.findOne({ userId: user.id, - userGroupId: recipientGroup.id + userGroupId: recipientGroup.id, }); if (joining == null) { @@ -140,7 +140,7 @@ export default define(meta, async (ps, user) => { } return await Promise.all(messages.map(message => MessagingMessages.pack(message, user, { - populateGroup: false + populateGroup: false, }))); } else { throw new Error(); diff --git a/packages/backend/src/server/api/endpoints/messaging/messages/create.ts b/packages/backend/src/server/api/endpoints/messaging/messages/create.ts index df0b455cbe..02b22ead80 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages/create.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages/create.ts @@ -25,12 +25,12 @@ export const meta = { }, text: { - validator: $.optional.str.pipe(MessagingMessages.validateText) + validator: $.optional.str.pipe(MessagingMessages.validateText), }, fileId: { validator: $.optional.type(ID), - } + }, }, res: { @@ -43,45 +43,45 @@ export const meta = { recipientIsYourself: { message: 'You can not send a message to yourself.', code: 'RECIPIENT_IS_YOURSELF', - id: '17e2ba79-e22a-4cbc-bf91-d327643f4a7e' + id: '17e2ba79-e22a-4cbc-bf91-d327643f4a7e', }, noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '11795c64-40ea-4198-b06e-3c873ed9039d' + id: '11795c64-40ea-4198-b06e-3c873ed9039d', }, noSuchGroup: { message: 'No such group.', code: 'NO_SUCH_GROUP', - id: 'c94e2a5d-06aa-4914-8fa6-6a42e73d6537' + id: 'c94e2a5d-06aa-4914-8fa6-6a42e73d6537', }, groupAccessDenied: { message: 'You can not send messages to groups that you have not joined.', code: 'GROUP_ACCESS_DENIED', - id: 'd96b3cca-5ad1-438b-ad8b-02f931308fbd' + id: 'd96b3cca-5ad1-438b-ad8b-02f931308fbd', }, noSuchFile: { message: 'No such file.', code: 'NO_SUCH_FILE', - id: '4372b8e2-185d-4146-8749-2f68864a3e5f' + id: '4372b8e2-185d-4146-8749-2f68864a3e5f', }, contentRequired: { message: 'Content required. You need to set text or fileId.', code: 'CONTENT_REQUIRED', - id: '25587321-b0e6-449c-9239-f8925092942c' + id: '25587321-b0e6-449c-9239-f8925092942c', }, youHaveBeenBlocked: { message: 'You cannot send a message because you have been blocked by this user.', code: 'YOU_HAVE_BEEN_BLOCKED', - id: 'c15a5199-7422-4968-941a-2a462c478f7d' + id: 'c15a5199-7422-4968-941a-2a462c478f7d', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -119,7 +119,7 @@ export default define(meta, async (ps, user) => { // check joined const joining = await UserGroupJoinings.findOne({ userId: user.id, - userGroupId: recipientGroup.id + userGroupId: recipientGroup.id, }); if (joining == null) { @@ -131,7 +131,7 @@ export default define(meta, async (ps, user) => { if (ps.fileId != null) { file = await DriveFiles.findOne({ id: ps.fileId, - userId: user.id + userId: user.id, }); if (file == null) { diff --git a/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts b/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts index 25bf676383..dd1c2e8dee 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts @@ -16,28 +16,28 @@ export const meta = { limit: { duration: ms('1hour'), max: 300, - minInterval: ms('1sec') + minInterval: ms('1sec'), }, params: { messageId: { validator: $.type(ID), - } + }, }, errors: { noSuchMessage: { message: 'No such message.', code: 'NO_SUCH_MESSAGE', - id: '54b5b326-7925-42cf-8019-130fda8b56af' + id: '54b5b326-7925-42cf-8019-130fda8b56af', }, - } + }, }; export default define(meta, async (ps, user) => { const message = await MessagingMessages.findOne({ id: ps.messageId, - userId: user.id + userId: user.id, }); if (message == null) { diff --git a/packages/backend/src/server/api/endpoints/messaging/messages/read.ts b/packages/backend/src/server/api/endpoints/messaging/messages/read.ts index a1747310d3..96d68b2605 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages/read.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages/read.ts @@ -15,16 +15,16 @@ export const meta = { params: { messageId: { validator: $.type(ID), - } + }, }, errors: { noSuchMessage: { message: 'No such message.', code: 'NO_SUCH_MESSAGE', - id: '86d56a2f-a9c3-4afb-b13c-3e9bfef9aa14' + id: '86d56a2f-a9c3-4afb-b13c-3e9bfef9aa14', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index ce21556243..bced077c12 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -14,8 +14,8 @@ export const meta = { params: { detail: { validator: $.optional.bool, - default: true - } + default: true, + }, }, res: { @@ -24,16 +24,16 @@ export const meta = { properties: { maintainerName: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, maintainerEmail: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, version: { type: 'string' as const, optional: false as const, nullable: false as const, - example: config.version + example: config.version, }, name: { type: 'string' as const, @@ -43,7 +43,7 @@ export const meta = { type: 'string' as const, optional: false as const, nullable: false as const, format: 'url', - example: 'https://misskey.example.com' + example: 'https://misskey.example.com', }, description: { type: 'string' as const, @@ -54,27 +54,27 @@ export const meta = { optional: false as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const - } + optional: false as const, nullable: false as const, + }, }, tosUrl: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, repositoryUrl: { type: 'string' as const, optional: false as const, nullable: false as const, - default: 'https://github.com/misskey-dev/misskey' + default: 'https://github.com/misskey-dev/misskey', }, feedbackUrl: { type: 'string' as const, optional: false as const, nullable: false as const, - default: 'https://github.com/misskey-dev/misskey/issues/new' + default: 'https://github.com/misskey-dev/misskey/issues/new', }, secure: { type: 'boolean' as const, optional: false as const, nullable: false as const, - default: false + default: false, }, disableRegistration: { type: 'boolean' as const, @@ -90,66 +90,66 @@ export const meta = { }, driveCapacityPerLocalUserMb: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, driveCapacityPerRemoteUserMb: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, cacheRemoteFiles: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, proxyRemoteFiles: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, emailRequiredForSignup: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, enableHcaptcha: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, hcaptchaSiteKey: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, enableRecaptcha: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, recaptchaSiteKey: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, swPublickey: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, mascotImageUrl: { type: 'string' as const, optional: false as const, nullable: false as const, - default: '/assets/ai.png' + default: '/assets/ai.png', }, bannerUrl: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, errorImageUrl: { type: 'string' as const, optional: false as const, nullable: false as const, - default: 'https://xn--931a.moe/aiart/yubitun.png' + default: 'https://xn--931a.moe/aiart/yubitun.png', }, iconUrl: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, maxNoteTextLength: { type: 'number' as const, optional: false as const, nullable: false as const, - default: 500 + default: 500, }, emojis: { type: 'array' as const, @@ -161,31 +161,31 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, aliases: { type: 'array' as const, optional: false as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const - } + optional: false as const, nullable: false as const, + }, }, category: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, host: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, url: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'url' - } - } - } + format: 'url', + }, + }, + }, }, ads: { type: 'array' as const, @@ -196,53 +196,53 @@ export const meta = { properties: { place: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, url: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'url' + format: 'url', }, imageUrl: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'url' + format: 'url', }, - } - } + }, + }, }, requireSetup: { type: 'boolean' as const, optional: false as const, nullable: false as const, - example: false + example: false, }, enableEmail: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, enableTwitterIntegration: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, enableGithubIntegration: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, enableDiscordIntegration: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, enableServiceWorker: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, translatorAvailable: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, proxyAccountName: { type: 'string' as const, - optional: false as const, nullable: true as const + optional: false as const, nullable: true as const, }, features: { type: 'object' as const, @@ -250,54 +250,54 @@ export const meta = { properties: { registration: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, localTimeLine: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, globalTimeLine: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, elasticsearch: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, hcaptcha: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, recaptcha: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, objectStorage: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, twitter: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, github: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, discord: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, serviceWorker: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, miauth: { type: 'boolean' as const, optional: true as const, nullable: false as const, - default: true + default: true, }, - } + }, }, userStarForReactionFallback: { type: 'boolean' as const, @@ -308,144 +308,144 @@ export const meta = { optional: true as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const - } + optional: false as const, nullable: false as const, + }, }, hiddenTags: { type: 'array' as const, optional: true as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const - } + optional: false as const, nullable: false as const, + }, }, blockedHosts: { type: 'array' as const, optional: true as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const - } + optional: false as const, nullable: false as const, + }, }, hcaptchaSecretKey: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, recaptchaSecretKey: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, proxyAccountId: { type: 'string' as const, optional: true as const, nullable: true as const, - format: 'id' + format: 'id', }, twitterConsumerKey: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, twitterConsumerSecret: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, githubClientId: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, githubClientSecret: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, discordClientId: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, discordClientSecret: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, summaryProxy: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, email: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, smtpSecure: { type: 'boolean' as const, - optional: true as const, nullable: false as const + optional: true as const, nullable: false as const, }, smtpHost: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, smtpPort: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, smtpUser: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, smtpPass: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, swPrivateKey: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, useObjectStorage: { type: 'boolean' as const, - optional: true as const, nullable: false as const + optional: true as const, nullable: false as const, }, objectStorageBaseUrl: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, objectStorageBucket: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, objectStoragePrefix: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, objectStorageEndpoint: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, objectStorageRegion: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, objectStoragePort: { type: 'number' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, objectStorageAccessKey: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, objectStorageSecretKey: { type: 'string' as const, - optional: true as const, nullable: true as const + optional: true as const, nullable: true as const, }, objectStorageUseSSL: { type: 'boolean' as const, - optional: true as const, nullable: false as const + optional: true as const, nullable: false as const, }, objectStorageUseProxy: { type: 'boolean' as const, - optional: true as const, nullable: false as const + optional: true as const, nullable: false as const, }, objectStorageSetPublicRead: { type: 'boolean' as const, - optional: true as const, nullable: false as const - } - } - } + optional: true as const, nullable: false as const, + }, + }, + }, }; export default define(meta, async (ps, me) => { @@ -453,21 +453,21 @@ export default define(meta, async (ps, me) => { const emojis = await Emojis.find({ where: { - host: null + host: null, }, order: { category: 'ASC', - name: 'ASC' + name: 'ASC', }, cache: { id: 'meta_emojis', - milliseconds: 3600000 // 1 hour - } + milliseconds: 3600000, // 1 hour + }, }); const ads = await Ads.find({ where: { - expiresAt: MoreThan(new Date()) + expiresAt: MoreThan(new Date()), }, }); @@ -531,7 +531,7 @@ export default define(meta, async (ps, me) => { requireSetup: (await Users.count({ host: null, })) === 0, - } : {}) + } : {}), }; if (ps.detail) { diff --git a/packages/backend/src/server/api/endpoints/miauth/gen-token.ts b/packages/backend/src/server/api/endpoints/miauth/gen-token.ts index 321fa42fc9..29f109f369 100644 --- a/packages/backend/src/server/api/endpoints/miauth/gen-token.ts +++ b/packages/backend/src/server/api/endpoints/miauth/gen-token.ts @@ -13,11 +13,11 @@ export const meta = { params: { session: { - validator: $.nullable.str + validator: $.nullable.str, }, name: { - validator: $.nullable.optional.str + validator: $.nullable.optional.str, }, description: { @@ -39,10 +39,10 @@ export const meta = { properties: { token: { type: 'string' as const, - optional: false as const, nullable: false as const - } - } - } + optional: false as const, nullable: false as const, + }, + }, + }, }; export default define(meta, async (ps, user) => { @@ -67,6 +67,6 @@ export default define(meta, async (ps, user) => { }); return { - token: accessToken + token: accessToken, }; }); diff --git a/packages/backend/src/server/api/endpoints/mute/create.ts b/packages/backend/src/server/api/endpoints/mute/create.ts index 3fc64d3eba..703611f67f 100644 --- a/packages/backend/src/server/api/endpoints/mute/create.ts +++ b/packages/backend/src/server/api/endpoints/mute/create.ts @@ -25,21 +25,21 @@ export const meta = { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '6fef56f3-e765-4957-88e5-c6f65329b8a5' + id: '6fef56f3-e765-4957-88e5-c6f65329b8a5', }, muteeIsYourself: { message: 'Mutee is yourself.', code: 'MUTEE_IS_YOURSELF', - id: 'a4619cb2-5f23-484b-9301-94c903074e10' + id: 'a4619cb2-5f23-484b-9301-94c903074e10', }, alreadyMuting: { message: 'You are already muting that user.', code: 'ALREADY_MUTING', - id: '7e7359cb-160c-4956-b08f-4d1c653cd007' + id: '7e7359cb-160c-4956-b08f-4d1c653cd007', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -59,7 +59,7 @@ export default define(meta, async (ps, user) => { // Check if already muting const exist = await Mutings.findOne({ muterId: muter.id, - muteeId: mutee.id + muteeId: mutee.id, }); if (exist != null) { @@ -78,6 +78,6 @@ export default define(meta, async (ps, user) => { NoteWatchings.delete({ userId: muter.id, - noteUserId: mutee.id + noteUserId: mutee.id, }); }); diff --git a/packages/backend/src/server/api/endpoints/mute/delete.ts b/packages/backend/src/server/api/endpoints/mute/delete.ts index 3ffd1f4562..aa8c33d046 100644 --- a/packages/backend/src/server/api/endpoints/mute/delete.ts +++ b/packages/backend/src/server/api/endpoints/mute/delete.ts @@ -23,21 +23,21 @@ export const meta = { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: 'b851d00b-8ab1-4a56-8b1b-e24187cb48ef' + id: 'b851d00b-8ab1-4a56-8b1b-e24187cb48ef', }, muteeIsYourself: { message: 'Mutee is yourself.', code: 'MUTEE_IS_YOURSELF', - id: 'f428b029-6b39-4d48-a1d2-cc1ae6dd5cf9' + id: 'f428b029-6b39-4d48-a1d2-cc1ae6dd5cf9', }, notMuting: { message: 'You are not muting that user.', code: 'NOT_MUTING', - id: '5467d020-daa9-4553-81e1-135c0c35a96d' + id: '5467d020-daa9-4553-81e1-135c0c35a96d', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -57,7 +57,7 @@ export default define(meta, async (ps, user) => { // Check not muting const exist = await Mutings.findOne({ muterId: muter.id, - muteeId: mutee.id + muteeId: mutee.id, }); if (exist == null) { @@ -66,7 +66,7 @@ export default define(meta, async (ps, user) => { // Delete mute await Mutings.delete({ - id: exist.id + id: exist.id, }); publishUserEvent(user.id, 'unmute', mutee); diff --git a/packages/backend/src/server/api/endpoints/mute/list.ts b/packages/backend/src/server/api/endpoints/mute/list.ts index ae4c3a719d..48b6ddb060 100644 --- a/packages/backend/src/server/api/endpoints/mute/list.ts +++ b/packages/backend/src/server/api/endpoints/mute/list.ts @@ -14,7 +14,7 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 30 + default: 30, }, sinceId: { @@ -33,7 +33,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Muting', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/my/apps.ts b/packages/backend/src/server/api/endpoints/my/apps.ts index d91562b62f..1164f5f6f3 100644 --- a/packages/backend/src/server/api/endpoints/my/apps.ts +++ b/packages/backend/src/server/api/endpoints/my/apps.ts @@ -10,13 +10,13 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, offset: { validator: $.optional.num.min(0), - default: 0 - } + default: 0, + }, }, res: { @@ -28,27 +28,27 @@ export const meta = { properties: { id: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, name: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, callbackUrl: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, permission: { type: 'array' as const, optional: false as const, nullable: false as const, items: { type: 'string' as const, - optional: false as const, nullable: false as const - } + optional: false as const, nullable: false as const, + }, }, secret: { type: 'string' as const, - optional: true as const, nullable: false as const + optional: true as const, nullable: false as const, }, isAuthorized: { type: 'object' as const, @@ -56,22 +56,22 @@ export const meta = { properties: { appId: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, userId: { type: 'string' as const, - optional: false as const, nullable: false as const - } - } - } - } - } - } + optional: false as const, nullable: false as const, + }, + }, + }, + }, + }, + }, }; export default define(meta, async (ps, user) => { const query = { - userId: user.id + userId: user.id, }; const apps = await Apps.find({ @@ -81,6 +81,6 @@ export default define(meta, async (ps, user) => { }); return await Promise.all(apps.map(app => Apps.pack(app, user, { - detail: true + detail: true, }))); }); diff --git a/packages/backend/src/server/api/endpoints/notes.ts b/packages/backend/src/server/api/endpoints/notes.ts index a3f6e187f2..37d1b03dce 100644 --- a/packages/backend/src/server/api/endpoints/notes.ts +++ b/packages/backend/src/server/api/endpoints/notes.ts @@ -30,7 +30,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -49,7 +49,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/notes/children.ts b/packages/backend/src/server/api/endpoints/notes/children.ts index 49e5a2f84d..acd9d6f7e4 100644 --- a/packages/backend/src/server/api/endpoints/notes/children.ts +++ b/packages/backend/src/server/api/endpoints/notes/children.ts @@ -21,7 +21,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -40,7 +40,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/notes/clips.ts b/packages/backend/src/server/api/endpoints/notes/clips.ts index 6b303d87ec..deb14da16c 100644 --- a/packages/backend/src/server/api/endpoints/notes/clips.ts +++ b/packages/backend/src/server/api/endpoints/notes/clips.ts @@ -24,16 +24,16 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: '47db1a1c-b0af-458d-8fb4-986e4efafe1e' - } - } + id: '47db1a1c-b0af-458d-8fb4-986e4efafe1e', + }, + }, }; export default define(meta, async (ps, me) => { @@ -48,7 +48,7 @@ export default define(meta, async (ps, me) => { const clips = await Clips.find({ id: In(clipNotes.map(x => x.clipId)), - isPublic: true + isPublic: true, }); return await Promise.all(clips.map(x => Clips.pack(x))); diff --git a/packages/backend/src/server/api/endpoints/notes/conversation.ts b/packages/backend/src/server/api/endpoints/notes/conversation.ts index 0fe323ea00..8fdbb7fdeb 100644 --- a/packages/backend/src/server/api/endpoints/notes/conversation.ts +++ b/packages/backend/src/server/api/endpoints/notes/conversation.ts @@ -18,12 +18,12 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, offset: { validator: $.optional.num.min(0), - default: 0 + default: 0, }, }, @@ -34,16 +34,16 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: 'e1035875-9551-45ec-afa8-1ded1fcb53c8' - } - } + id: 'e1035875-9551-45ec-afa8-1ded1fcb53c8', + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index d2d1ede3c8..9567374c63 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -29,7 +29,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 300 + max: 300, }, kind: 'write:notes', @@ -106,10 +106,10 @@ export const meta = { .each(c => c.length > 0 && c.length < 50), multiple: $.optional.bool, expiresAt: $.optional.nullable.num.int(), - expiredAfter: $.optional.nullable.num.int().min(1) + expiredAfter: $.optional.nullable.num.int().min(1), }).strict(), - ref: 'poll' - } + ref: 'poll', + }, }, res: { @@ -120,59 +120,59 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } - } + }, + }, }, errors: { noSuchRenoteTarget: { message: 'No such renote target.', code: 'NO_SUCH_RENOTE_TARGET', - id: 'b5c90186-4ab0-49c8-9bba-a1f76c282ba4' + id: 'b5c90186-4ab0-49c8-9bba-a1f76c282ba4', }, cannotReRenote: { message: 'You can not Renote a pure Renote.', code: 'CANNOT_RENOTE_TO_A_PURE_RENOTE', - id: 'fd4cc33e-2a37-48dd-99cc-9b806eb2031a' + id: 'fd4cc33e-2a37-48dd-99cc-9b806eb2031a', }, noSuchReplyTarget: { message: 'No such reply target.', code: 'NO_SUCH_REPLY_TARGET', - id: '749ee0f6-d3da-459a-bf02-282e2da4292c' + id: '749ee0f6-d3da-459a-bf02-282e2da4292c', }, cannotReplyToPureRenote: { message: 'You can not reply to a pure Renote.', code: 'CANNOT_REPLY_TO_A_PURE_RENOTE', - id: '3ac74a84-8fd5-4bb0-870f-01804f82ce15' + id: '3ac74a84-8fd5-4bb0-870f-01804f82ce15', }, contentRequired: { message: 'Content required. You need to set text, fileIds, renoteId or poll.', code: 'CONTENT_REQUIRED', - id: '6f57e42b-c348-439b-bc45-993995cc515a' + id: '6f57e42b-c348-439b-bc45-993995cc515a', }, cannotCreateAlreadyExpiredPoll: { message: 'Poll is already expired.', code: 'CANNOT_CREATE_ALREADY_EXPIRED_POLL', - id: '04da457d-b083-4055-9082-955525eda5a5' + id: '04da457d-b083-4055-9082-955525eda5a5', }, noSuchChannel: { message: 'No such channel.', code: 'NO_SUCH_CHANNEL', - id: 'b1653923-5453-4edc-b786-7c4f39bb0bbb' + id: 'b1653923-5453-4edc-b786-7c4f39bb0bbb', }, youHaveBeenBlocked: { message: 'You have been blocked by this user.', code: 'YOU_HAVE_BEEN_BLOCKED', - id: 'b390d7e1-8a5e-46ed-b625-06271cafd3d3' + id: 'b390d7e1-8a5e-46ed-b625-06271cafd3d3', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -188,7 +188,7 @@ export default define(meta, async (ps, user) => { files = (await Promise.all(fileIds.map(fileId => DriveFiles.findOne({ id: fileId, - userId: user.id + userId: user.id, }) ))).filter(file => file != null) as DriveFile[]; } @@ -273,7 +273,7 @@ export default define(meta, async (ps, user) => { poll: ps.poll ? { choices: ps.poll.choices, multiple: ps.poll.multiple || false, - expiresAt: ps.poll.expiresAt ? new Date(ps.poll.expiresAt) : null + expiresAt: ps.poll.expiresAt ? new Date(ps.poll.expiresAt) : null, } : undefined, text: ps.text || undefined, reply, @@ -289,6 +289,6 @@ export default define(meta, async (ps, user) => { }); return { - createdNote: await Notes.pack(note, user) + createdNote: await Notes.pack(note, user), }; }); diff --git a/packages/backend/src/server/api/endpoints/notes/delete.ts b/packages/backend/src/server/api/endpoints/notes/delete.ts index 7f0d59669e..532213c725 100644 --- a/packages/backend/src/server/api/endpoints/notes/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/delete.ts @@ -17,28 +17,28 @@ export const meta = { limit: { duration: ms('1hour'), max: 300, - minInterval: ms('1sec') + minInterval: ms('1sec'), }, params: { noteId: { validator: $.type(ID), - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: '490be23f-8c1f-4796-819f-94cb4f9d1630' + id: '490be23f-8c1f-4796-819f-94cb4f9d1630', }, accessDenied: { message: 'Access denied.', code: 'ACCESS_DENIED', - id: 'fe8d7103-0ea8-4ec3-814d-f8b401dc69e9' - } - } + id: 'fe8d7103-0ea8-4ec3-814d-f8b401dc69e9', + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/notes/favorites/create.ts b/packages/backend/src/server/api/endpoints/notes/favorites/create.ts index 1bb25edd7f..14191eefde 100644 --- a/packages/backend/src/server/api/endpoints/notes/favorites/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/favorites/create.ts @@ -16,22 +16,22 @@ export const meta = { params: { noteId: { validator: $.type(ID), - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: '6dd26674-e060-4816-909a-45ba3f4da458' + id: '6dd26674-e060-4816-909a-45ba3f4da458', }, alreadyFavorited: { message: 'The note has already been marked as a favorite.', code: 'ALREADY_FAVORITED', - id: 'a402c12b-34dd-41d2-97d8-4d2ffd96a1a6' + id: 'a402c12b-34dd-41d2-97d8-4d2ffd96a1a6', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -44,7 +44,7 @@ export default define(meta, async (ps, user) => { // if already favorited const exist = await NoteFavorites.findOne({ noteId: note.id, - userId: user.id + userId: user.id, }); if (exist != null) { @@ -56,6 +56,6 @@ export default define(meta, async (ps, user) => { id: genId(), createdAt: new Date(), noteId: note.id, - userId: user.id + userId: user.id, }); }); diff --git a/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts b/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts index 75eb9a359a..f8d3b63026 100644 --- a/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/favorites/delete.ts @@ -15,22 +15,22 @@ export const meta = { params: { noteId: { validator: $.type(ID), - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: '80848a2c-398f-4343-baa9-df1d57696c56' + id: '80848a2c-398f-4343-baa9-df1d57696c56', }, notFavorited: { message: 'You have not marked that note a favorite.', code: 'NOT_FAVORITED', - id: 'b625fc69-635e-45e9-86f4-dbefbef35af5' + id: 'b625fc69-635e-45e9-86f4-dbefbef35af5', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -43,7 +43,7 @@ export default define(meta, async (ps, user) => { // if already favorited const exist = await NoteFavorites.findOne({ noteId: note.id, - userId: user.id + userId: user.id, }); if (exist == null) { diff --git a/packages/backend/src/server/api/endpoints/notes/featured.ts b/packages/backend/src/server/api/endpoints/notes/featured.ts index 8d33c0e73d..2a14c52abc 100644 --- a/packages/backend/src/server/api/endpoints/notes/featured.ts +++ b/packages/backend/src/server/api/endpoints/notes/featured.ts @@ -17,7 +17,7 @@ export const meta = { offset: { validator: $.optional.num.min(0), - default: 0 + default: 0, }, }, @@ -28,7 +28,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts index 7c80153b42..c3be042bfb 100644 --- a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts @@ -22,7 +22,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -34,11 +34,11 @@ export const meta = { }, sinceDate: { - validator: $.optional.num + validator: $.optional.num, }, untilDate: { - validator: $.optional.num + validator: $.optional.num, }, }, @@ -49,16 +49,16 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, errors: { gtlDisabled: { message: 'Global timeline has been disabled.', code: 'GTL_DISABLED', - id: '0332fc13-6ab2-4427-ae80-a9fadffd1a6b' + id: '0332fc13-6ab2-4427-ae80-a9fadffd1a6b', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts index 22babb5d0c..4a0b9d49d7 100644 --- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -69,16 +69,16 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, errors: { stlDisabled: { message: 'Hybrid timeline has been disabled.', code: 'STL_DISABLED', - id: '620763f4-f621-4533-ab33-0577a1a3c342' + id: '620763f4-f621-4533-ab33-0577a1a3c342', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts index f670d478bf..113268982b 100644 --- a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts @@ -33,7 +33,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -60,16 +60,16 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, errors: { ltlDisabled: { message: 'Local timeline has been disabled.', code: 'LTL_DISABLED', - id: '45a6eb02-7695-4393-b023-dd3be9aaaefd' + id: '45a6eb02-7695-4393-b023-dd3be9aaaefd', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/notes/mentions.ts b/packages/backend/src/server/api/endpoints/notes/mentions.ts index ffaebd6c95..916209ca71 100644 --- a/packages/backend/src/server/api/endpoints/notes/mentions.ts +++ b/packages/backend/src/server/api/endpoints/notes/mentions.ts @@ -18,12 +18,12 @@ export const meta = { params: { following: { validator: $.optional.bool, - default: false + default: false, }, limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -46,7 +46,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts index 0763f0c8fd..9f133c071e 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/recommendation.ts @@ -11,13 +11,13 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, offset: { validator: $.optional.num.min(0), - default: 0 - } + default: 0, + }, }, res: { @@ -26,9 +26,9 @@ export const meta = { items: { type: 'object' as const, optional: false as const, nullable: false as const, - ref: 'Note' - } - } + ref: 'Note', + }, + }, }; export default define(meta, async (ps, user) => { @@ -68,10 +68,10 @@ export default define(meta, async (ps, user) => { if (polls.length === 0) return []; const notes = await Notes.find({ - id: In(polls.map(poll => poll.noteId)) + id: In(polls.map(poll => poll.noteId)), }); return await Notes.packMany(notes, user, { - detail: true + detail: true, }); }); diff --git a/packages/backend/src/server/api/endpoints/notes/polls/vote.ts b/packages/backend/src/server/api/endpoints/notes/polls/vote.ts index e7a6537025..479034389a 100644 --- a/packages/backend/src/server/api/endpoints/notes/polls/vote.ts +++ b/packages/backend/src/server/api/endpoints/notes/polls/vote.ts @@ -27,7 +27,7 @@ export const meta = { }, choice: { - validator: $.num + validator: $.num, }, }, @@ -35,39 +35,39 @@ export const meta = { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: 'ecafbd2e-c283-4d6d-aecb-1a0a33b75396' + id: 'ecafbd2e-c283-4d6d-aecb-1a0a33b75396', }, noPoll: { message: 'The note does not attach a poll.', code: 'NO_POLL', - id: '5f979967-52d9-4314-a911-1c673727f92f' + id: '5f979967-52d9-4314-a911-1c673727f92f', }, invalidChoice: { message: 'Choice ID is invalid.', code: 'INVALID_CHOICE', - id: 'e0cc9a04-f2e8-41e4-a5f1-4127293260cc' + id: 'e0cc9a04-f2e8-41e4-a5f1-4127293260cc', }, alreadyVoted: { message: 'You have already voted.', code: 'ALREADY_VOTED', - id: '0963fc77-efac-419b-9424-b391608dc6d8' + id: '0963fc77-efac-419b-9424-b391608dc6d8', }, alreadyExpired: { message: 'The poll is already expired.', code: 'ALREADY_EXPIRED', - id: '1022a357-b085-4054-9083-8f8de358337e' + id: '1022a357-b085-4054-9083-8f8de358337e', }, youHaveBeenBlocked: { message: 'You cannot vote this poll because you have been blocked by this user.', code: 'YOU_HAVE_BEEN_BLOCKED', - id: '85a5377e-b1e9-4617-b0b9-5bea73331e49' + id: '85a5377e-b1e9-4617-b0b9-5bea73331e49', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -107,7 +107,7 @@ export default define(meta, async (ps, user) => { // if already voted const exist = await PollVotes.find({ noteId: note.id, - userId: user.id + userId: user.id, }); if (exist.length) { @@ -126,7 +126,7 @@ export default define(meta, async (ps, user) => { createdAt, noteId: note.id, userId: user.id, - choice: ps.choice + choice: ps.choice, }).then(x => PollVotes.findOneOrFail(x.identifiers[0])); // Increment votes count @@ -135,14 +135,14 @@ export default define(meta, async (ps, user) => { publishNoteStream(note.id, 'pollVoted', { choice: ps.choice, - userId: user.id + userId: user.id, }); // Notify createNotification(note.userId, 'pollVote', { notifierId: user.id, noteId: note.id, - choice: ps.choice + choice: ps.choice, }); // Fetch watchers @@ -154,7 +154,7 @@ export default define(meta, async (ps, user) => { createNotification(watcher.userId, 'pollVote', { notifierId: user.id, noteId: note.id, - choice: ps.choice + choice: ps.choice, }); } }); diff --git a/packages/backend/src/server/api/endpoints/notes/reactions.ts b/packages/backend/src/server/api/endpoints/notes/reactions.ts index 09dd6b600b..dca6deb06f 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions.ts @@ -23,12 +23,12 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, offset: { validator: $.optional.num, - default: 0 + default: 0, }, sinceId: { @@ -47,16 +47,16 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'NoteReaction', - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: '263fff3d-d0e1-4af4-bea7-8408059b451a' - } - } + id: '263fff3d-d0e1-4af4-bea7-8408059b451a', + }, + }, }; export default define(meta, async (ps, user) => { @@ -66,7 +66,7 @@ export default define(meta, async (ps, user) => { }); const query = { - noteId: note.id + noteId: note.id, } as DeepPartial; if (ps.type) { @@ -82,8 +82,8 @@ export default define(meta, async (ps, user) => { take: ps.limit!, skip: ps.offset, order: { - id: -1 - } + id: -1, + }, }); return await Promise.all(reactions.map(reaction => NoteReactions.pack(reaction, user))); diff --git a/packages/backend/src/server/api/endpoints/notes/reactions/create.ts b/packages/backend/src/server/api/endpoints/notes/reactions/create.ts index 24a73a8d4f..879b32cd07 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/create.ts @@ -19,28 +19,28 @@ export const meta = { reaction: { validator: $.str, - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: '033d0620-5bfe-4027-965d-980b0c85a3ea' + id: '033d0620-5bfe-4027-965d-980b0c85a3ea', }, alreadyReacted: { message: 'You are already reacting to that note.', code: 'ALREADY_REACTED', - id: '71efcf98-86d6-4e2b-b2ad-9d032369366b' + id: '71efcf98-86d6-4e2b-b2ad-9d032369366b', }, youHaveBeenBlocked: { message: 'You cannot react this note because you have been blocked by this user.', code: 'YOU_HAVE_BEEN_BLOCKED', - id: '20ef5475-9f38-4e4c-bd33-de6d979498ec' + id: '20ef5475-9f38-4e4c-bd33-de6d979498ec', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts index ea851458d2..eb9281f7a0 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts @@ -16,7 +16,7 @@ export const meta = { limit: { duration: ms('1hour'), max: 60, - minInterval: ms('3sec') + minInterval: ms('3sec'), }, params: { @@ -29,15 +29,15 @@ export const meta = { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: '764d9fce-f9f2-4a0e-92b1-6ceac9a7ad37' + id: '764d9fce-f9f2-4a0e-92b1-6ceac9a7ad37', }, notReacted: { message: 'You are not reacting to that note.', code: 'NOT_REACTED', - id: '92f4426d-4196-4125-aa5b-02943e2ec8fc' + id: '92f4426d-4196-4125-aa5b-02943e2ec8fc', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/notes/renotes.ts b/packages/backend/src/server/api/endpoints/notes/renotes.ts index 26bfc1657d..d53d725165 100644 --- a/packages/backend/src/server/api/endpoints/notes/renotes.ts +++ b/packages/backend/src/server/api/endpoints/notes/renotes.ts @@ -21,7 +21,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -30,7 +30,7 @@ export const meta = { untilId: { validator: $.optional.type(ID), - } + }, }, res: { @@ -40,16 +40,16 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: '12908022-2e21-46cd-ba6a-3edaf6093f46' - } - } + id: '12908022-2e21-46cd-ba6a-3edaf6093f46', + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/notes/replies.ts b/packages/backend/src/server/api/endpoints/notes/replies.ts index 0bb62413ae..e39878f4f2 100644 --- a/packages/backend/src/server/api/endpoints/notes/replies.ts +++ b/packages/backend/src/server/api/endpoints/notes/replies.ts @@ -27,7 +27,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, }, @@ -38,7 +38,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts index 40e1499736..2275f7c1ae 100644 --- a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts +++ b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts @@ -51,7 +51,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, }, @@ -62,7 +62,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/notes/search.ts b/packages/backend/src/server/api/endpoints/notes/search.ts index eb832a6b31..b49ee87199 100644 --- a/packages/backend/src/server/api/endpoints/notes/search.ts +++ b/packages/backend/src/server/api/endpoints/notes/search.ts @@ -17,7 +17,7 @@ export const meta = { params: { query: { - validator: $.str + validator: $.str, }, sinceId: { @@ -30,22 +30,22 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, host: { validator: $.optional.nullable.str, - default: undefined + default: undefined, }, userId: { validator: $.optional.nullable.type(ID), - default: null + default: null, }, channelId: { validator: $.optional.nullable.type(ID), - default: null + default: null, }, }, @@ -56,11 +56,11 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, errors: { - } + }, }; export default define(meta, async (ps, me) => { @@ -91,8 +91,8 @@ export default define(meta, async (ps, me) => { } else { const userQuery = ps.userId != null ? [{ term: { - userId: ps.userId - } + userId: ps.userId, + }, }] : []; const hostQuery = ps.userId == null ? @@ -100,14 +100,14 @@ export default define(meta, async (ps, me) => { bool: { must_not: { exists: { - field: 'userHost' - } - } - } + field: 'userHost', + }, + }, + }, }] : ps.host !== undefined ? [{ term: { - userHost: ps.host - } + userHost: ps.host, + }, }] : [] : []; @@ -122,15 +122,15 @@ export default define(meta, async (ps, me) => { simple_query_string: { fields: ['text'], query: ps.query.toLowerCase(), - default_operator: 'and' + default_operator: 'and', }, - }, ...hostQuery, ...userQuery] - } + }, ...hostQuery, ...userQuery], + }, }, sort: [{ - _doc: 'desc' - }] - } + _doc: 'desc', + }], + }, }); const hits = result.body.hits.hits.map((hit: any) => hit._id); @@ -140,11 +140,11 @@ export default define(meta, async (ps, me) => { // Fetch found notes const notes = await Notes.find({ where: { - id: In(hits) + id: In(hits), }, order: { - id: -1 - } + id: -1, + }, }); return await Notes.packMany(notes, me); diff --git a/packages/backend/src/server/api/endpoints/notes/show.ts b/packages/backend/src/server/api/endpoints/notes/show.ts index fad63d6483..1f7f84cbe4 100644 --- a/packages/backend/src/server/api/endpoints/notes/show.ts +++ b/packages/backend/src/server/api/endpoints/notes/show.ts @@ -13,7 +13,7 @@ export const meta = { params: { noteId: { validator: $.type(ID), - } + }, }, res: { @@ -26,9 +26,9 @@ export const meta = { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: '24fcbfc6-2e37-42b6-8388-c29b3861a08d' - } - } + id: '24fcbfc6-2e37-42b6-8388-c29b3861a08d', + }, + }, }; export default define(meta, async (ps, user) => { @@ -38,6 +38,6 @@ export default define(meta, async (ps, user) => { }); return await Notes.pack(note, user, { - detail: true + detail: true, }); }); diff --git a/packages/backend/src/server/api/endpoints/notes/state.ts b/packages/backend/src/server/api/endpoints/notes/state.ts index b3913a5e79..9673b5a77c 100644 --- a/packages/backend/src/server/api/endpoints/notes/state.ts +++ b/packages/backend/src/server/api/endpoints/notes/state.ts @@ -11,7 +11,7 @@ export const meta = { params: { noteId: { validator: $.type(ID), - } + }, }, res: { @@ -20,18 +20,18 @@ export const meta = { properties: { isFavorited: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isWatching: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isMutedThread: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, - } - } + }, + }, }; export default define(meta, async (ps, user) => { @@ -43,21 +43,21 @@ export default define(meta, async (ps, user) => { userId: user.id, noteId: note.id, }, - take: 1 + take: 1, }), NoteWatchings.count({ where: { userId: user.id, noteId: note.id, }, - take: 1 + take: 1, }), NoteThreadMutings.count({ where: { userId: user.id, threadId: note.threadId || note.id, }, - take: 1 + take: 1, }), ]); diff --git a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts index 2010d54331..dd2f887f01 100644 --- a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts @@ -17,16 +17,16 @@ export const meta = { params: { noteId: { validator: $.type(ID), - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: '5ff67ada-ed3b-2e71-8e87-a1a421e177d2' - } - } + id: '5ff67ada-ed3b-2e71-8e87-a1a421e177d2', + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts b/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts index 05d5691870..d34c99f901 100644 --- a/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/thread-muting/delete.ts @@ -15,16 +15,16 @@ export const meta = { params: { noteId: { validator: $.type(ID), - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: 'bddd57ac-ceb3-b29d-4334-86ea5fae481a' - } - } + id: 'bddd57ac-ceb3-b29d-4334-86ea5fae481a', + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index 7a69b1590d..211b8d4f40 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -67,7 +67,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, }; @@ -76,7 +76,7 @@ export default define(meta, async (ps, user) => { where: { followerId: user.id, }, - take: 1 + take: 1, })) !== 0; //#region Construct query diff --git a/packages/backend/src/server/api/endpoints/notes/translate.ts b/packages/backend/src/server/api/endpoints/notes/translate.ts index b56b1debdd..647ae4efe7 100644 --- a/packages/backend/src/server/api/endpoints/notes/translate.ts +++ b/packages/backend/src/server/api/endpoints/notes/translate.ts @@ -33,9 +33,9 @@ export const meta = { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: 'bea9b03f-36e0-49c5-a4db-627a029f8971' - } - } + id: 'bea9b03f-36e0-49c5-a4db-627a029f8971', + }, + }, }; export default define(meta, async (ps, user) => { @@ -73,7 +73,7 @@ export default define(meta, async (ps, user) => { headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'User-Agent': config.userAgent, - Accept: 'application/json, */*' + Accept: 'application/json, */*', }, body: params, timeout: 10000, @@ -84,6 +84,6 @@ export default define(meta, async (ps, user) => { return { sourceLang: json.translations[0].detected_source_language, - text: json.translations[0].text + text: json.translations[0].text, }; }); diff --git a/packages/backend/src/server/api/endpoints/notes/unrenote.ts b/packages/backend/src/server/api/endpoints/notes/unrenote.ts index d3fba66095..3661db4d86 100644 --- a/packages/backend/src/server/api/endpoints/notes/unrenote.ts +++ b/packages/backend/src/server/api/endpoints/notes/unrenote.ts @@ -17,22 +17,22 @@ export const meta = { limit: { duration: ms('1hour'), max: 300, - minInterval: ms('1sec') + minInterval: ms('1sec'), }, params: { noteId: { validator: $.type(ID), - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: 'efd4a259-2442-496b-8dd7-b255aa1a160f' + id: 'efd4a259-2442-496b-8dd7-b255aa1a160f', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -43,7 +43,7 @@ export default define(meta, async (ps, user) => { const renotes = await Notes.find({ userId: user.id, - renoteId: note.id + renoteId: note.id, }); for (const note of renotes) { diff --git a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts index 32c370004c..d614ddf453 100644 --- a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts @@ -66,22 +66,22 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, errors: { noSuchList: { message: 'No such list.', code: 'NO_SUCH_LIST', - id: '8fb1fbd5-e476-4c37-9fb0-43d55b63a2ff' - } - } + id: '8fb1fbd5-e476-4c37-9fb0-43d55b63a2ff', + }, + }, }; export default define(meta, async (ps, user) => { const list = await UserLists.findOne({ id: ps.listId, - userId: user.id + userId: user.id, }); if (list == null) { diff --git a/packages/backend/src/server/api/endpoints/notes/watching/create.ts b/packages/backend/src/server/api/endpoints/notes/watching/create.ts index 4d182d3715..7f724953df 100644 --- a/packages/backend/src/server/api/endpoints/notes/watching/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/watching/create.ts @@ -15,16 +15,16 @@ export const meta = { params: { noteId: { validator: $.type(ID), - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: 'ea0e37a6-90a3-4f58-ba6b-c328ca206fc7' - } - } + id: 'ea0e37a6-90a3-4f58-ba6b-c328ca206fc7', + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/notes/watching/delete.ts b/packages/backend/src/server/api/endpoints/notes/watching/delete.ts index dd58c52b57..76a368c51d 100644 --- a/packages/backend/src/server/api/endpoints/notes/watching/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/watching/delete.ts @@ -15,16 +15,16 @@ export const meta = { params: { noteId: { validator: $.type(ID), - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: '09b3695c-f72c-4731-a428-7cff825fc82e' - } - } + id: '09b3695c-f72c-4731-a428-7cff825fc82e', + }, + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/notifications/create.ts b/packages/backend/src/server/api/endpoints/notifications/create.ts index 8003c497ee..e285eae460 100644 --- a/packages/backend/src/server/api/endpoints/notifications/create.ts +++ b/packages/backend/src/server/api/endpoints/notifications/create.ts @@ -11,20 +11,20 @@ export const meta = { params: { body: { - validator: $.str + validator: $.str, }, header: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, icon: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, }, errors: { - } + }, }; export default define(meta, async (ps, user, token) => { diff --git a/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts b/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts index 8d4e512750..963af6cb43 100644 --- a/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts +++ b/packages/backend/src/server/api/endpoints/notifications/mark-all-as-read.ts @@ -7,7 +7,7 @@ export const meta = { requireCredential: true as const, - kind: 'write:notifications' + kind: 'write:notifications', }; export default define(meta, async (ps, user) => { @@ -16,7 +16,7 @@ export default define(meta, async (ps, user) => { notifieeId: user.id, isRead: false, }, { - isRead: true + isRead: true, }); // 全ての通知を読みましたよというイベントを発行 diff --git a/packages/backend/src/server/api/endpoints/notifications/read.ts b/packages/backend/src/server/api/endpoints/notifications/read.ts index 66bbc4efd7..9ff0bbeb83 100644 --- a/packages/backend/src/server/api/endpoints/notifications/read.ts +++ b/packages/backend/src/server/api/endpoints/notifications/read.ts @@ -23,7 +23,7 @@ export const meta = { noSuchNotification: { message: 'No such notification.', code: 'NO_SUCH_NOTIFICATION', - id: 'efa929d5-05b5-47d1-beec-e6a4dbed011e' + id: 'efa929d5-05b5-47d1-beec-e6a4dbed011e', }, }, }; diff --git a/packages/backend/src/server/api/endpoints/page-push.ts b/packages/backend/src/server/api/endpoints/page-push.ts index a0412e89f1..421eed5ea1 100644 --- a/packages/backend/src/server/api/endpoints/page-push.ts +++ b/packages/backend/src/server/api/endpoints/page-push.ts @@ -11,25 +11,25 @@ export const meta = { params: { pageId: { - validator: $.type(ID) + validator: $.type(ID), }, event: { - validator: $.str + validator: $.str, }, var: { - validator: $.optional.nullable.any - } + validator: $.optional.nullable.any, + }, }, errors: { noSuchPage: { message: 'No such page.', code: 'NO_SUCH_PAGE', - id: '4a13ad31-6729-46b4-b9af-e86b265c2e74' - } - } + id: '4a13ad31-6729-46b4-b9af-e86b265c2e74', + }, + }, }; export default define(meta, async (ps, user) => { @@ -44,7 +44,7 @@ export default define(meta, async (ps, user) => { var: ps.var, userId: user.id, user: await Users.pack(user.id, { id: page.userId }, { - detail: true - }) + detail: true, + }), }); }); diff --git a/packages/backend/src/server/api/endpoints/pages/create.ts b/packages/backend/src/server/api/endpoints/pages/create.ts index 0ec287c592..441ba54265 100644 --- a/packages/backend/src/server/api/endpoints/pages/create.ts +++ b/packages/backend/src/server/api/endpoints/pages/create.ts @@ -16,7 +16,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 300 + max: 300, }, params: { @@ -33,11 +33,11 @@ export const meta = { }, content: { - validator: $.arr($.obj()) + validator: $.arr($.obj()), }, variables: { - validator: $.arr($.obj()) + validator: $.arr($.obj()), }, script: { @@ -50,17 +50,17 @@ export const meta = { font: { validator: $.optional.str.or(['serif', 'sans-serif']), - default: 'sans-serif' + default: 'sans-serif', }, alignCenter: { validator: $.optional.bool, - default: false + default: false, }, hideTitleWhenPinned: { validator: $.optional.bool, - default: false + default: false, }, }, @@ -74,14 +74,14 @@ export const meta = { noSuchFile: { message: 'No such file.', code: 'NO_SUCH_FILE', - id: 'b7b97489-0f66-4b12-a5ff-b21bd63f6e1c' + id: 'b7b97489-0f66-4b12-a5ff-b21bd63f6e1c', }, nameAlreadyExists: { message: 'Specified name already exists.', code: 'NAME_ALREADY_EXISTS', - id: '4650348e-301c-499a-83c9-6aa988c66bc1' - } - } + id: '4650348e-301c-499a-83c9-6aa988c66bc1', + }, + }, }; export default define(meta, async (ps, user) => { @@ -89,7 +89,7 @@ export default define(meta, async (ps, user) => { if (ps.eyeCatchingImageId != null) { eyeCatchingImage = await DriveFiles.findOne({ id: ps.eyeCatchingImageId, - userId: user.id + userId: user.id, }); if (eyeCatchingImage == null) { @@ -99,7 +99,7 @@ export default define(meta, async (ps, user) => { await Pages.find({ userId: user.id, - name: ps.name + name: ps.name, }).then(result => { if (result.length > 0) { throw new ApiError(meta.errors.nameAlreadyExists); @@ -121,7 +121,7 @@ export default define(meta, async (ps, user) => { visibility: 'public', alignCenter: ps.alignCenter, hideTitleWhenPinned: ps.hideTitleWhenPinned, - font: ps.font + font: ps.font, })); return await Pages.pack(page); diff --git a/packages/backend/src/server/api/endpoints/pages/delete.ts b/packages/backend/src/server/api/endpoints/pages/delete.ts index b1f8c8a709..7a45237697 100644 --- a/packages/backend/src/server/api/endpoints/pages/delete.ts +++ b/packages/backend/src/server/api/endpoints/pages/delete.ts @@ -21,15 +21,15 @@ export const meta = { noSuchPage: { message: 'No such page.', code: 'NO_SUCH_PAGE', - id: 'eb0c6e1d-d519-4764-9486-52a7e1c6392a' + id: 'eb0c6e1d-d519-4764-9486-52a7e1c6392a', }, accessDenied: { message: 'Access denied.', code: 'ACCESS_DENIED', - id: '8b741b3e-2c22-44b3-a15f-29949aa1601e' + id: '8b741b3e-2c22-44b3-a15f-29949aa1601e', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/pages/featured.ts b/packages/backend/src/server/api/endpoints/pages/featured.ts index f891c45f05..1dcfb8dd83 100644 --- a/packages/backend/src/server/api/endpoints/pages/featured.ts +++ b/packages/backend/src/server/api/endpoints/pages/featured.ts @@ -13,7 +13,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Page', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/pages/like.ts b/packages/backend/src/server/api/endpoints/pages/like.ts index a95a377802..f48359ab2d 100644 --- a/packages/backend/src/server/api/endpoints/pages/like.ts +++ b/packages/backend/src/server/api/endpoints/pages/like.ts @@ -15,28 +15,28 @@ export const meta = { params: { pageId: { validator: $.type(ID), - } + }, }, errors: { noSuchPage: { message: 'No such page.', code: 'NO_SUCH_PAGE', - id: 'cc98a8a2-0dc3-4123-b198-62c71df18ed3' + id: 'cc98a8a2-0dc3-4123-b198-62c71df18ed3', }, yourPage: { message: 'You cannot like your page.', code: 'YOUR_PAGE', - id: '28800466-e6db-40f2-8fae-bf9e82aa92b8' + id: '28800466-e6db-40f2-8fae-bf9e82aa92b8', }, alreadyLiked: { message: 'The page has already been liked.', code: 'ALREADY_LIKED', - id: 'cc98a8a2-0dc3-4123-b198-62c71df18ed3' + id: 'cc98a8a2-0dc3-4123-b198-62c71df18ed3', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -52,7 +52,7 @@ export default define(meta, async (ps, user) => { // if already liked const exist = await PageLikes.findOne({ pageId: page.id, - userId: user.id + userId: user.id, }); if (exist != null) { @@ -64,7 +64,7 @@ export default define(meta, async (ps, user) => { id: genId(), createdAt: new Date(), pageId: page.id, - userId: user.id + userId: user.id, }); Pages.increment({ id: page.id }, 'likedCount', 1); diff --git a/packages/backend/src/server/api/endpoints/pages/show.ts b/packages/backend/src/server/api/endpoints/pages/show.ts index 7c55d4a9e6..d94c7457da 100644 --- a/packages/backend/src/server/api/endpoints/pages/show.ts +++ b/packages/backend/src/server/api/endpoints/pages/show.ts @@ -34,9 +34,9 @@ export const meta = { noSuchPage: { message: 'No such page.', code: 'NO_SUCH_PAGE', - id: '222120c0-3ead-4528-811b-b96f233388d7' - } - } + id: '222120c0-3ead-4528-811b-b96f233388d7', + }, + }, }; export default define(meta, async (ps, user) => { @@ -47,12 +47,12 @@ export default define(meta, async (ps, user) => { } else if (ps.name && ps.username) { const author = await Users.findOne({ host: null, - usernameLower: ps.username.toLowerCase() + usernameLower: ps.username.toLowerCase(), }); if (author) { page = await Pages.findOne({ name: ps.name, - userId: author.id + userId: author.id, }); } } diff --git a/packages/backend/src/server/api/endpoints/pages/unlike.ts b/packages/backend/src/server/api/endpoints/pages/unlike.ts index facf2d6d5f..5a2b68e425 100644 --- a/packages/backend/src/server/api/endpoints/pages/unlike.ts +++ b/packages/backend/src/server/api/endpoints/pages/unlike.ts @@ -14,22 +14,22 @@ export const meta = { params: { pageId: { validator: $.type(ID), - } + }, }, errors: { noSuchPage: { message: 'No such page.', code: 'NO_SUCH_PAGE', - id: 'a0d41e20-1993-40bd-890e-f6e560ae648e' + id: 'a0d41e20-1993-40bd-890e-f6e560ae648e', }, notLiked: { message: 'You have not liked that page.', code: 'NOT_LIKED', - id: 'f5e586b0-ce93-4050-b0e3-7f31af5259ee' + id: 'f5e586b0-ce93-4050-b0e3-7f31af5259ee', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -40,7 +40,7 @@ export default define(meta, async (ps, user) => { const exist = await PageLikes.findOne({ pageId: page.id, - userId: user.id + userId: user.id, }); if (exist == null) { diff --git a/packages/backend/src/server/api/endpoints/pages/update.ts b/packages/backend/src/server/api/endpoints/pages/update.ts index 4aaf2aed5d..f980d9207b 100644 --- a/packages/backend/src/server/api/endpoints/pages/update.ts +++ b/packages/backend/src/server/api/endpoints/pages/update.ts @@ -15,7 +15,7 @@ export const meta = { limit: { duration: ms('1hour'), - max: 300 + max: 300, }, params: { @@ -36,11 +36,11 @@ export const meta = { }, content: { - validator: $.arr($.obj()) + validator: $.arr($.obj()), }, variables: { - validator: $.arr($.obj()) + validator: $.arr($.obj()), }, script: { @@ -68,26 +68,26 @@ export const meta = { noSuchPage: { message: 'No such page.', code: 'NO_SUCH_PAGE', - id: '21149b9e-3616-4778-9592-c4ce89f5a864' + id: '21149b9e-3616-4778-9592-c4ce89f5a864', }, accessDenied: { message: 'Access denied.', code: 'ACCESS_DENIED', - id: '3c15cd52-3b4b-4274-967d-6456fc4f792b' + id: '3c15cd52-3b4b-4274-967d-6456fc4f792b', }, noSuchFile: { message: 'No such file.', code: 'NO_SUCH_FILE', - id: 'cfc23c7c-3887-490e-af30-0ed576703c82' + id: 'cfc23c7c-3887-490e-af30-0ed576703c82', }, nameAlreadyExists: { message: 'Specified name already exists.', code: 'NAME_ALREADY_EXISTS', - id: '2298a392-d4a1-44c5-9ebb-ac1aeaa5a9ab' - } - } + id: '2298a392-d4a1-44c5-9ebb-ac1aeaa5a9ab', + }, + }, }; export default define(meta, async (ps, user) => { @@ -103,7 +103,7 @@ export default define(meta, async (ps, user) => { if (ps.eyeCatchingImageId != null) { eyeCatchingImage = await DriveFiles.findOne({ id: ps.eyeCatchingImageId, - userId: user.id + userId: user.id, }); if (eyeCatchingImage == null) { @@ -114,7 +114,7 @@ export default define(meta, async (ps, user) => { await Pages.find({ id: Not(ps.pageId), userId: user.id, - name: ps.name + name: ps.name, }).then(result => { if (result.length > 0) { throw new ApiError(meta.errors.nameAlreadyExists); diff --git a/packages/backend/src/server/api/endpoints/ping.ts b/packages/backend/src/server/api/endpoints/ping.ts index 0b1bb6e164..c8f67981f5 100644 --- a/packages/backend/src/server/api/endpoints/ping.ts +++ b/packages/backend/src/server/api/endpoints/ping.ts @@ -16,8 +16,8 @@ export const meta = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } - } + }, + }, }; export default define(meta, async () => { diff --git a/packages/backend/src/server/api/endpoints/pinned-users.ts b/packages/backend/src/server/api/endpoints/pinned-users.ts index 39cf7b0df1..9d8d3963b4 100644 --- a/packages/backend/src/server/api/endpoints/pinned-users.ts +++ b/packages/backend/src/server/api/endpoints/pinned-users.ts @@ -19,7 +19,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'User', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/promo/read.ts b/packages/backend/src/server/api/endpoints/promo/read.ts index ae57bf9cf1..ac3cd9cd0b 100644 --- a/packages/backend/src/server/api/endpoints/promo/read.ts +++ b/packages/backend/src/server/api/endpoints/promo/read.ts @@ -14,16 +14,16 @@ export const meta = { params: { noteId: { validator: $.type(ID), - } + }, }, errors: { noSuchNote: { message: 'No such note.', code: 'NO_SUCH_NOTE', - id: 'd785b897-fcd3-4fe9-8fc3-b85c26e6c932' + id: 'd785b897-fcd3-4fe9-8fc3-b85c26e6c932', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -34,7 +34,7 @@ export default define(meta, async (ps, user) => { const exist = await PromoReads.findOne({ noteId: note.id, - userId: user.id + userId: user.id, }); if (exist != null) { @@ -45,6 +45,6 @@ export default define(meta, async (ps, user) => { id: genId(), createdAt: new Date(), noteId: note.id, - userId: user.id + userId: user.id, }); }); diff --git a/packages/backend/src/server/api/endpoints/request-reset-password.ts b/packages/backend/src/server/api/endpoints/request-reset-password.ts index 7bb50bf6a6..6caf572222 100644 --- a/packages/backend/src/server/api/endpoints/request-reset-password.ts +++ b/packages/backend/src/server/api/endpoints/request-reset-password.ts @@ -15,28 +15,28 @@ export const meta = { limit: { duration: ms('1hour'), - max: 3 + max: 3, }, params: { username: { - validator: $.str + validator: $.str, }, email: { - validator: $.str + validator: $.str, }, }, errors: { - } + }, }; export default define(meta, async (ps) => { const user = await Users.findOne({ usernameLower: ps.username.toLowerCase(), - host: IsNull() + host: IsNull(), }); // 合致するユーザーが登録されていなかったら無視 @@ -62,7 +62,7 @@ export default define(meta, async (ps) => { id: genId(), createdAt: new Date(), userId: profile.userId, - token + token, }); const link = `${config.url}/reset-password/${token}`; diff --git a/packages/backend/src/server/api/endpoints/reset-db.ts b/packages/backend/src/server/api/endpoints/reset-db.ts index f0a9dae4ff..f6fd5735d9 100644 --- a/packages/backend/src/server/api/endpoints/reset-db.ts +++ b/packages/backend/src/server/api/endpoints/reset-db.ts @@ -11,7 +11,7 @@ export const meta = { errors: { - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/reset-password.ts b/packages/backend/src/server/api/endpoints/reset-password.ts index 53b0bfde0b..706f0a32c0 100644 --- a/packages/backend/src/server/api/endpoints/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/reset-password.ts @@ -10,17 +10,17 @@ export const meta = { params: { token: { - validator: $.str + validator: $.str, }, password: { - validator: $.str - } + validator: $.str, + }, }, errors: { - } + }, }; export default define(meta, async (ps, user) => { @@ -38,7 +38,7 @@ export default define(meta, async (ps, user) => { const hash = await bcrypt.hash(ps.password, salt); await UserProfiles.update(req.userId, { - password: hash + password: hash, }); PasswordResetRequests.delete(req.id); diff --git a/packages/backend/src/server/api/endpoints/room/show.ts b/packages/backend/src/server/api/endpoints/room/show.ts index a6461d4a6e..ec53982ebb 100644 --- a/packages/backend/src/server/api/endpoints/room/show.ts +++ b/packages/backend/src/server/api/endpoints/room/show.ts @@ -16,11 +16,11 @@ export const meta = { }, username: { - validator: $.optional.str + validator: $.optional.str, }, host: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, }, @@ -28,8 +28,8 @@ export const meta = { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '7ad3fa3e-5e12-42f0-b23a-f3d13f10ee4b' - } + id: '7ad3fa3e-5e12-42f0-b23a-f3d13f10ee4b', + }, }, res: { @@ -39,7 +39,7 @@ export const meta = { roomType: { type: 'string' as const, optional: false as const, nullable: false as const, - enum: ['default', 'washitsu'] + enum: ['default', 'washitsu'], }, furnitures: { type: 'array' as const, @@ -50,11 +50,11 @@ export const meta = { properties: { id: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, type: { type: 'string' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, props: { type: 'object' as const, @@ -66,17 +66,17 @@ export const meta = { properties: { x: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, y: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, z: { type: 'number' as const, - optional: false as const, nullable: false as const - } - } + optional: false as const, nullable: false as const, + }, + }, }, rotation: { type: 'object' as const, @@ -84,29 +84,29 @@ export const meta = { properties: { x: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, y: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, z: { type: 'number' as const, - optional: false as const, nullable: false as const - } - } - } - } - } + optional: false as const, nullable: false as const, + }, + }, + }, + }, + }, }, carpetColor: { type: 'string' as const, optional: false as const, nullable: false as const, format: 'hex', - example: '#85CAF0' - } - } - } + example: '#85CAF0', + }, + }, + }, }; export default define(meta, async (ps, me) => { @@ -124,8 +124,8 @@ export default define(meta, async (ps, me) => { await UserProfiles.update(user.id, { room: { furnitures: [], - ...profile.room - } + ...profile.room, + }, }); profile.room.furnitures = []; @@ -136,8 +136,8 @@ export default define(meta, async (ps, me) => { await UserProfiles.update(user.id, { room: { roomType: initialType as any, - ...profile.room - } + ...profile.room, + }, }); profile.room.roomType = initialType; @@ -148,8 +148,8 @@ export default define(meta, async (ps, me) => { await UserProfiles.update(user.id, { room: { carpetColor: initialColor as any, - ...profile.room - } + ...profile.room, + }, }); profile.room.carpetColor = initialColor; diff --git a/packages/backend/src/server/api/endpoints/room/update.ts b/packages/backend/src/server/api/endpoints/room/update.ts index 8c4cfbdea6..f9fc2b278e 100644 --- a/packages/backend/src/server/api/endpoints/room/update.ts +++ b/packages/backend/src/server/api/endpoints/room/update.ts @@ -27,20 +27,20 @@ export const meta = { props: $.optional.nullable.obj(), })), roomType: $.str, - carpetColor: $.str - }) + carpetColor: $.str, + }), }, }, }; export default define(meta, async (ps, user) => { await UserProfiles.update(user.id, { - room: ps.room as any + room: ps.room as any, }); const iObj = await Users.pack(user.id, user, { detail: true, - includeSecrets: true + includeSecrets: true, }); // Publish meUpdated event diff --git a/packages/backend/src/server/api/endpoints/server-info.ts b/packages/backend/src/server/api/endpoints/server-info.ts index 4e636d331c..be502cf24a 100644 --- a/packages/backend/src/server/api/endpoints/server-info.ts +++ b/packages/backend/src/server/api/endpoints/server-info.ts @@ -22,10 +22,10 @@ export default define(meta, async () => { machine: os.hostname(), cpu: { model: os.cpus()[0].model, - cores: os.cpus().length + cores: os.cpus().length, }, mem: { - total: memStats.total + total: memStats.total, }, fs: { total: fsStats[0].size, diff --git a/packages/backend/src/server/api/endpoints/stats.ts b/packages/backend/src/server/api/endpoints/stats.ts index 15c8001742..f47b0d0a2b 100644 --- a/packages/backend/src/server/api/endpoints/stats.ts +++ b/packages/backend/src/server/api/endpoints/stats.ts @@ -36,14 +36,14 @@ export const meta = { }, driveUsageLocal: { type: 'number' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, driveUsageRemote: { type: 'number' as const, - optional: false as const, nullable: false as const - } - } - } + optional: false as const, nullable: false as const, + }, + }, + }, }; export default define(meta, async () => { @@ -56,7 +56,7 @@ export default define(meta, async () => { //originalReactionsCount, instances, driveUsageLocal, - driveUsageRemote + driveUsageRemote, ] = await Promise.all([ Notes.count({ cache: 3600000 }), // 1 hour Notes.count({ where: { userHost: null }, cache: 3600000 }), @@ -78,6 +78,6 @@ export default define(meta, async () => { //originalReactionsCount, instances, driveUsageLocal, - driveUsageRemote + driveUsageRemote, }; }); diff --git a/packages/backend/src/server/api/endpoints/sw/register.ts b/packages/backend/src/server/api/endpoints/sw/register.ts index 6e14ba2669..9734746770 100644 --- a/packages/backend/src/server/api/endpoints/sw/register.ts +++ b/packages/backend/src/server/api/endpoints/sw/register.ts @@ -11,16 +11,16 @@ export const meta = { params: { endpoint: { - validator: $.str + validator: $.str, }, auth: { - validator: $.str + validator: $.str, }, publickey: { - validator: $.str - } + validator: $.str, + }, }, res: { @@ -30,14 +30,14 @@ export const meta = { state: { type: 'string' as const, optional: false as const, nullable: false as const, - enum: ['already-subscribed', 'subscribed'] + enum: ['already-subscribed', 'subscribed'], }, key: { type: 'string' as const, - optional: false as const, nullable: false as const - } - } - } + optional: false as const, nullable: false as const, + }, + }, + }, }; export default define(meta, async (ps, user) => { @@ -54,7 +54,7 @@ export default define(meta, async (ps, user) => { if (exist != null) { return { state: 'already-subscribed', - key: instance.swPublicKey + key: instance.swPublicKey, }; } @@ -64,11 +64,11 @@ export default define(meta, async (ps, user) => { userId: user.id, endpoint: ps.endpoint, auth: ps.auth, - publickey: ps.publickey + publickey: ps.publickey, }); return { state: 'subscribed', - key: instance.swPublicKey + key: instance.swPublicKey, }; }); diff --git a/packages/backend/src/server/api/endpoints/sw/unregister.ts b/packages/backend/src/server/api/endpoints/sw/unregister.ts index 817ad1f517..24ee861f16 100644 --- a/packages/backend/src/server/api/endpoints/sw/unregister.ts +++ b/packages/backend/src/server/api/endpoints/sw/unregister.ts @@ -9,9 +9,9 @@ export const meta = { params: { endpoint: { - validator: $.str + validator: $.str, }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/username/available.ts b/packages/backend/src/server/api/endpoints/username/available.ts index 1ae75448ea..f1b46a2b65 100644 --- a/packages/backend/src/server/api/endpoints/username/available.ts +++ b/packages/backend/src/server/api/endpoints/username/available.ts @@ -9,8 +9,8 @@ export const meta = { params: { username: { - validator: $.use(Users.validateLocalUsername) - } + validator: $.use(Users.validateLocalUsername), + }, }, res: { @@ -20,21 +20,21 @@ export const meta = { available: { type: 'boolean' as const, optional: false as const, nullable: false as const, - } - } - } + }, + }, + }, }; export default define(meta, async (ps) => { // Get exist const exist = await Users.count({ host: null, - usernameLower: ps.username.toLowerCase() + usernameLower: ps.username.toLowerCase(), }); const exist2 = await UsedUsernames.count({ username: ps.username.toLowerCase() }); return { - available: exist === 0 && exist2 === 0 + available: exist === 0 && exist2 === 0, }; }); diff --git a/packages/backend/src/server/api/endpoints/users.ts b/packages/backend/src/server/api/endpoints/users.ts index 930dcc7616..601578de27 100644 --- a/packages/backend/src/server/api/endpoints/users.ts +++ b/packages/backend/src/server/api/endpoints/users.ts @@ -12,12 +12,12 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, offset: { validator: $.optional.num.min(0), - default: 0 + default: 0, }, sort: { @@ -37,9 +37,9 @@ export const meta = { 'admin', 'moderator', 'adminOrModerator', - 'alive' + 'alive', ]), - default: 'all' + default: 'all', }, origin: { @@ -48,8 +48,8 @@ export const meta = { 'local', 'remote', ]), - default: 'local' - } + default: 'local', + }, }, res: { @@ -59,7 +59,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'User', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/users/clips.ts b/packages/backend/src/server/api/endpoints/users/clips.ts index 8feca9422a..f5964c54db 100644 --- a/packages/backend/src/server/api/endpoints/users/clips.ts +++ b/packages/backend/src/server/api/endpoints/users/clips.ts @@ -14,7 +14,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -24,7 +24,7 @@ export const meta = { untilId: { validator: $.optional.type(ID), }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/users/followers.ts b/packages/backend/src/server/api/endpoints/users/followers.ts index 6d042a2861..535b10412e 100644 --- a/packages/backend/src/server/api/endpoints/users/followers.ts +++ b/packages/backend/src/server/api/endpoints/users/followers.ts @@ -17,11 +17,11 @@ export const meta = { }, username: { - validator: $.optional.str + validator: $.optional.str, }, host: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, sinceId: { @@ -34,7 +34,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, }, @@ -45,22 +45,22 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Following', - } + }, }, errors: { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '27fa5435-88ab-43de-9360-387de88727cd' + id: '27fa5435-88ab-43de-9360-387de88727cd', }, forbidden: { message: 'Forbidden.', code: 'FORBIDDEN', - id: '3c6a84db-d619-26af-ca14-06232a21df8a' + id: '3c6a84db-d619-26af-ca14-06232a21df8a', }, - } + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/users/following.ts b/packages/backend/src/server/api/endpoints/users/following.ts index 1033117ef8..58c72bb957 100644 --- a/packages/backend/src/server/api/endpoints/users/following.ts +++ b/packages/backend/src/server/api/endpoints/users/following.ts @@ -17,11 +17,11 @@ export const meta = { }, username: { - validator: $.optional.str + validator: $.optional.str, }, host: { - validator: $.optional.nullable.str + validator: $.optional.nullable.str, }, sinceId: { @@ -34,7 +34,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, }, @@ -45,22 +45,22 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Following', - } + }, }, errors: { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '63e4aba4-4156-4e53-be25-c9559e42d71b' + id: '63e4aba4-4156-4e53-be25-c9559e42d71b', }, forbidden: { message: 'Forbidden.', code: 'FORBIDDEN', - id: 'f6cdb0df-c19f-ec5c-7dbb-0ba84a1f92ba' + id: 'f6cdb0df-c19f-ec5c-7dbb-0ba84a1f92ba', }, - } + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/users/gallery/posts.ts b/packages/backend/src/server/api/endpoints/users/gallery/posts.ts index 845de1089c..6ef884deda 100644 --- a/packages/backend/src/server/api/endpoints/users/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/users/gallery/posts.ts @@ -14,7 +14,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -24,7 +24,7 @@ export const meta = { untilId: { validator: $.optional.type(ID), }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts b/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts index 32ebfd683a..a88de7ac83 100644 --- a/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts +++ b/packages/backend/src/server/api/endpoints/users/get-frequently-replied-users.ts @@ -19,7 +19,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, }, @@ -30,16 +30,16 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'User', - } + }, }, errors: { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: 'e6965129-7b2a-40a4-bae2-cd84cd434822' - } - } + id: 'e6965129-7b2a-40a4-bae2-cd84cd434822', + }, + }, }; export default define(meta, async (ps, me) => { @@ -53,13 +53,13 @@ export default define(meta, async (ps, me) => { const recentNotes = await Notes.find({ where: { userId: user.id, - replyId: Not(IsNull()) + replyId: Not(IsNull()), }, order: { - id: -1 + id: -1, }, take: 1000, - select: ['replyId'] + select: ['replyId'], }); // 投稿が少なかったら中断 @@ -72,7 +72,7 @@ export default define(meta, async (ps, me) => { where: { id: In(recentNotes.map(p => p.replyId)), }, - select: ['userId'] + select: ['userId'], }); const repliedUsers: any = {}; @@ -98,7 +98,7 @@ export default define(meta, async (ps, me) => { // Make replies object (includes weights) const repliesObj = await Promise.all(topRepliedUsers.map(async (user) => ({ user: await Users.pack(user, me, { detail: true }), - weight: repliedUsers[user] / peak + weight: repliedUsers[user] / peak, }))); return repliesObj; diff --git a/packages/backend/src/server/api/endpoints/users/groups/create.ts b/packages/backend/src/server/api/endpoints/users/groups/create.ts index dc1ee3879e..12ee11ba55 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/create.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/create.ts @@ -14,8 +14,8 @@ export const meta = { params: { name: { - validator: $.str.range(1, 100) - } + validator: $.str.range(1, 100), + }, }, res: { @@ -38,7 +38,7 @@ export default define(meta, async (ps, user) => { id: genId(), createdAt: new Date(), userId: user.id, - userGroupId: userGroup.id + userGroupId: userGroup.id, } as UserGroupJoining); return await UserGroups.pack(userGroup); diff --git a/packages/backend/src/server/api/endpoints/users/groups/delete.ts b/packages/backend/src/server/api/endpoints/users/groups/delete.ts index 7da1b4a273..dbc77dd8fe 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/delete.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/delete.ts @@ -14,22 +14,22 @@ export const meta = { params: { groupId: { validator: $.type(ID), - } + }, }, errors: { noSuchGroup: { message: 'No such group.', code: 'NO_SUCH_GROUP', - id: '63dbd64c-cd77-413f-8e08-61781e210b38' - } - } + id: '63dbd64c-cd77-413f-8e08-61781e210b38', + }, + }, }; export default define(meta, async (ps, user) => { const userGroup = await UserGroups.findOne({ id: ps.groupId, - userId: user.id + userId: user.id, }); if (userGroup == null) { diff --git a/packages/backend/src/server/api/endpoints/users/groups/invitations/accept.ts b/packages/backend/src/server/api/endpoints/users/groups/invitations/accept.ts index 09e6ae2647..fef94c306f 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/invitations/accept.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/invitations/accept.ts @@ -23,9 +23,9 @@ export const meta = { noSuchInvitation: { message: 'No such invitation.', code: 'NO_SUCH_INVITATION', - id: '98c11eca-c890-4f42-9806-c8c8303ebb5e' + id: '98c11eca-c890-4f42-9806-c8c8303ebb5e', }, - } + }, }; export default define(meta, async (ps, user) => { @@ -47,7 +47,7 @@ export default define(meta, async (ps, user) => { id: genId(), createdAt: new Date(), userId: user.id, - userGroupId: invitation.userGroupId + userGroupId: invitation.userGroupId, } as UserGroupJoining); UserGroupInvitations.delete(invitation.id); diff --git a/packages/backend/src/server/api/endpoints/users/groups/invitations/reject.ts b/packages/backend/src/server/api/endpoints/users/groups/invitations/reject.ts index 741fcefb35..33a202f029 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/invitations/reject.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/invitations/reject.ts @@ -21,9 +21,9 @@ export const meta = { noSuchInvitation: { message: 'No such invitation.', code: 'NO_SUCH_INVITATION', - id: 'ad7471d4-2cd9-44b4-ac68-e7136b4ce656' + id: 'ad7471d4-2cd9-44b4-ac68-e7136b4ce656', }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/users/groups/invite.ts b/packages/backend/src/server/api/endpoints/users/groups/invite.ts index f1ee8bf8b7..4dee18fcb0 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/invite.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/invite.ts @@ -29,27 +29,27 @@ export const meta = { noSuchGroup: { message: 'No such group.', code: 'NO_SUCH_GROUP', - id: '583f8bc0-8eee-4b78-9299-1e14fc91e409' + id: '583f8bc0-8eee-4b78-9299-1e14fc91e409', }, noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: 'da52de61-002c-475b-90e1-ba64f9cf13a8' + id: 'da52de61-002c-475b-90e1-ba64f9cf13a8', }, alreadyAdded: { message: 'That user has already been added to that group.', code: 'ALREADY_ADDED', - id: '7e35c6a0-39b2-4488-aea6-6ee20bd5da2c' + id: '7e35c6a0-39b2-4488-aea6-6ee20bd5da2c', }, alreadyInvited: { message: 'That user has already been invited to that group.', code: 'ALREADY_INVITED', - id: 'ee0f58b4-b529-4d13-b761-b9a3e69f97e6' - } - } + id: 'ee0f58b4-b529-4d13-b761-b9a3e69f97e6', + }, + }, }; export default define(meta, async (ps, me) => { @@ -71,7 +71,7 @@ export default define(meta, async (ps, me) => { const joining = await UserGroupJoinings.findOne({ userGroupId: userGroup.id, - userId: user.id + userId: user.id, }); if (joining) { @@ -80,7 +80,7 @@ export default define(meta, async (ps, me) => { const existInvitation = await UserGroupInvitations.findOne({ userGroupId: userGroup.id, - userId: user.id + userId: user.id, }); if (existInvitation) { @@ -91,12 +91,12 @@ export default define(meta, async (ps, me) => { id: genId(), createdAt: new Date(), userId: user.id, - userGroupId: userGroup.id + userGroupId: userGroup.id, } as UserGroupInvitation).then(x => UserGroupInvitations.findOneOrFail(x.identifiers[0])); // 通知を作成 createNotification(user.id, 'groupInvited', { notifierId: me.id, - userGroupInvitationId: invitation.id + userGroupInvitationId: invitation.id, }); }); diff --git a/packages/backend/src/server/api/endpoints/users/groups/joined.ts b/packages/backend/src/server/api/endpoints/users/groups/joined.ts index d5e8fe4032..1bd065ca00 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/joined.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/joined.ts @@ -16,7 +16,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'UserGroup', - } + }, }, }; @@ -28,8 +28,8 @@ export default define(meta, async (ps, me) => { const joinings = await UserGroupJoinings.find({ userId: me.id, ...(ownedGroups.length > 0 ? { - userGroupId: Not(In(ownedGroups.map(x => x.id))) - } : {}) + userGroupId: Not(In(ownedGroups.map(x => x.id))), + } : {}), }); return await Promise.all(joinings.map(x => UserGroups.pack(x.userGroupId))); diff --git a/packages/backend/src/server/api/endpoints/users/groups/leave.ts b/packages/backend/src/server/api/endpoints/users/groups/leave.ts index 0e52f2abdf..9a41175d63 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/leave.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/leave.ts @@ -21,15 +21,15 @@ export const meta = { noSuchGroup: { message: 'No such group.', code: 'NO_SUCH_GROUP', - id: '62780270-1f67-5dc0-daca-3eb510612e31' + id: '62780270-1f67-5dc0-daca-3eb510612e31', }, youAreOwner: { message: 'Your are the owner.', code: 'YOU_ARE_OWNER', - id: 'b6d6e0c2-ef8a-9bb8-653d-79f4a3107c69' + id: 'b6d6e0c2-ef8a-9bb8-653d-79f4a3107c69', }, - } + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/users/groups/owned.ts b/packages/backend/src/server/api/endpoints/users/groups/owned.ts index 17de370dbc..69e4c85717 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/owned.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/owned.ts @@ -15,7 +15,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'UserGroup', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/users/groups/pull.ts b/packages/backend/src/server/api/endpoints/users/groups/pull.ts index ce4d2e2881..70c1457dcd 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/pull.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/pull.ts @@ -26,21 +26,21 @@ export const meta = { noSuchGroup: { message: 'No such group.', code: 'NO_SUCH_GROUP', - id: '4662487c-05b1-4b78-86e5-fd46998aba74' + id: '4662487c-05b1-4b78-86e5-fd46998aba74', }, noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '0b5cc374-3681-41da-861e-8bc1146f7a55' + id: '0b5cc374-3681-41da-861e-8bc1146f7a55', }, isOwner: { message: 'The user is the owner.', code: 'IS_OWNER', - id: '1546eed5-4414-4dea-81c1-b0aec4f6d2af' + id: '1546eed5-4414-4dea-81c1-b0aec4f6d2af', }, - } + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/users/groups/show.ts b/packages/backend/src/server/api/endpoints/users/groups/show.ts index 3c030bf3a5..0bb06f8df4 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/show.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/show.ts @@ -27,9 +27,9 @@ export const meta = { noSuchGroup: { message: 'No such group.', code: 'NO_SUCH_GROUP', - id: 'ea04751e-9b7e-487b-a509-330fb6bd6b9b' + id: 'ea04751e-9b7e-487b-a509-330fb6bd6b9b', }, - } + }, }; export default define(meta, async (ps, me) => { @@ -44,7 +44,7 @@ export default define(meta, async (ps, me) => { const joining = await UserGroupJoinings.findOne({ userId: me.id, - userGroupId: userGroup.id + userGroupId: userGroup.id, }); if (joining == null && userGroup.userId !== me.id) { diff --git a/packages/backend/src/server/api/endpoints/users/groups/transfer.ts b/packages/backend/src/server/api/endpoints/users/groups/transfer.ts index 17c42e1127..54cf8197e7 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/transfer.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/transfer.ts @@ -32,21 +32,21 @@ export const meta = { noSuchGroup: { message: 'No such group.', code: 'NO_SUCH_GROUP', - id: '8e31d36b-2f88-4ccd-a438-e2d78a9162db' + id: '8e31d36b-2f88-4ccd-a438-e2d78a9162db', }, noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '711f7ebb-bbb9-4dfa-b540-b27809fed5e9' + id: '711f7ebb-bbb9-4dfa-b540-b27809fed5e9', }, noSuchGroupMember: { message: 'No such group member.', code: 'NO_SUCH_GROUP_MEMBER', - id: 'd31bebee-196d-42c2-9a3e-9474d4be6cc4' + id: 'd31bebee-196d-42c2-9a3e-9474d4be6cc4', }, - } + }, }; export default define(meta, async (ps, me) => { @@ -68,7 +68,7 @@ export default define(meta, async (ps, me) => { const joining = await UserGroupJoinings.findOne({ userGroupId: userGroup.id, - userId: user.id + userId: user.id, }); if (joining == null) { @@ -76,7 +76,7 @@ export default define(meta, async (ps, me) => { } await UserGroups.update(userGroup.id, { - userId: ps.userId + userId: ps.userId, }); return await UserGroups.pack(userGroup.id); diff --git a/packages/backend/src/server/api/endpoints/users/groups/update.ts b/packages/backend/src/server/api/endpoints/users/groups/update.ts index 127bbc47a1..d16f1ac42b 100644 --- a/packages/backend/src/server/api/endpoints/users/groups/update.ts +++ b/packages/backend/src/server/api/endpoints/users/groups/update.ts @@ -18,7 +18,7 @@ export const meta = { name: { validator: $.str.range(1, 100), - } + }, }, res: { @@ -31,16 +31,16 @@ export const meta = { noSuchGroup: { message: 'No such group.', code: 'NO_SUCH_GROUP', - id: '9081cda3-7a9e-4fac-a6ce-908d70f282f6' + id: '9081cda3-7a9e-4fac-a6ce-908d70f282f6', }, - } + }, }; export default define(meta, async (ps, me) => { // Fetch the group const userGroup = await UserGroups.findOne({ id: ps.groupId, - userId: me.id + userId: me.id, }); if (userGroup == null) { @@ -48,7 +48,7 @@ export default define(meta, async (ps, me) => { } await UserGroups.update(userGroup.id, { - name: ps.name + name: ps.name, }); return await UserGroups.pack(userGroup.id); diff --git a/packages/backend/src/server/api/endpoints/users/lists/create.ts b/packages/backend/src/server/api/endpoints/users/lists/create.ts index e0bfe611fc..8372139f84 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/create.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/create.ts @@ -13,8 +13,8 @@ export const meta = { params: { name: { - validator: $.str.range(1, 100) - } + validator: $.str.range(1, 100), + }, }, res: { diff --git a/packages/backend/src/server/api/endpoints/users/lists/delete.ts b/packages/backend/src/server/api/endpoints/users/lists/delete.ts index 5fe3bfb03d..fac4e90dbf 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/delete.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/delete.ts @@ -14,22 +14,22 @@ export const meta = { params: { listId: { validator: $.type(ID), - } + }, }, errors: { noSuchList: { message: 'No such list.', code: 'NO_SUCH_LIST', - id: '78436795-db79-42f5-b1e2-55ea2cf19166' - } - } + id: '78436795-db79-42f5-b1e2-55ea2cf19166', + }, + }, }; export default define(meta, async (ps, user) => { const userList = await UserLists.findOne({ id: ps.listId, - userId: user.id + userId: user.id, }); if (userList == null) { diff --git a/packages/backend/src/server/api/endpoints/users/lists/list.ts b/packages/backend/src/server/api/endpoints/users/lists/list.ts index cf0c92bb84..222c930d0e 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/list.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/list.ts @@ -15,7 +15,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'UserList', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/users/lists/pull.ts b/packages/backend/src/server/api/endpoints/users/lists/pull.ts index d4357fc5e7..86daa9b2e1 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/pull.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/pull.ts @@ -27,15 +27,15 @@ export const meta = { noSuchList: { message: 'No such list.', code: 'NO_SUCH_LIST', - id: '7f44670e-ab16-43b8-b4c1-ccd2ee89cc02' + id: '7f44670e-ab16-43b8-b4c1-ccd2ee89cc02', }, noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '588e7f72-c744-4a61-b180-d354e912bda2' - } - } + id: '588e7f72-c744-4a61-b180-d354e912bda2', + }, + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/users/lists/push.ts b/packages/backend/src/server/api/endpoints/users/lists/push.ts index 8e21059d3d..77ecb4a223 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/push.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/push.ts @@ -27,27 +27,27 @@ export const meta = { noSuchList: { message: 'No such list.', code: 'NO_SUCH_LIST', - id: '2214501d-ac96-4049-b717-91e42272a711' + id: '2214501d-ac96-4049-b717-91e42272a711', }, noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: 'a89abd3d-f0bc-4cce-beb1-2f446f4f1e6a' + id: 'a89abd3d-f0bc-4cce-beb1-2f446f4f1e6a', }, alreadyAdded: { message: 'That user has already been added to that list.', code: 'ALREADY_ADDED', - id: '1de7c884-1595-49e9-857e-61f12f4d4fc5' + id: '1de7c884-1595-49e9-857e-61f12f4d4fc5', }, youHaveBeenBlocked: { message: 'You cannot push this user because you have been blocked by this user.', code: 'YOU_HAVE_BEEN_BLOCKED', - id: '990232c5-3f9d-4d83-9f3f-ef27b6332a4b' + id: '990232c5-3f9d-4d83-9f3f-ef27b6332a4b', }, - } + }, }; export default define(meta, async (ps, me) => { @@ -80,7 +80,7 @@ export default define(meta, async (ps, me) => { const exist = await UserListJoinings.findOne({ userListId: userList.id, - userId: user.id + userId: user.id, }); if (exist) { diff --git a/packages/backend/src/server/api/endpoints/users/lists/show.ts b/packages/backend/src/server/api/endpoints/users/lists/show.ts index f9a35cdab3..9c985bb091 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/show.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/show.ts @@ -27,9 +27,9 @@ export const meta = { noSuchList: { message: 'No such list.', code: 'NO_SUCH_LIST', - id: '7bc05c21-1d7a-41ae-88f1-66820f4dc686' + id: '7bc05c21-1d7a-41ae-88f1-66820f4dc686', }, - } + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/users/lists/update.ts b/packages/backend/src/server/api/endpoints/users/lists/update.ts index 1185af5043..8a0f96a5d9 100644 --- a/packages/backend/src/server/api/endpoints/users/lists/update.ts +++ b/packages/backend/src/server/api/endpoints/users/lists/update.ts @@ -18,7 +18,7 @@ export const meta = { name: { validator: $.str.range(1, 100), - } + }, }, res: { @@ -31,16 +31,16 @@ export const meta = { noSuchList: { message: 'No such list.', code: 'NO_SUCH_LIST', - id: '796666fe-3dff-4d39-becb-8a5932c1d5b7' + id: '796666fe-3dff-4d39-becb-8a5932c1d5b7', }, - } + }, }; export default define(meta, async (ps, user) => { // Fetch the list const userList = await UserLists.findOne({ id: ps.listId, - userId: user.id + userId: user.id, }); if (userList == null) { @@ -48,7 +48,7 @@ export default define(meta, async (ps, user) => { } await UserLists.update(userList.id, { - name: ps.name + name: ps.name, }); return await UserLists.pack(userList.id); diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index e461672534..da8e858119 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -72,16 +72,16 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'Note', - } + }, }, errors: { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '27e494ba-2ac2-48e8-893b-10d4d8c2387b' - } - } + id: '27e494ba-2ac2-48e8-893b-10d4d8c2387b', + }, + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/users/pages.ts b/packages/backend/src/server/api/endpoints/users/pages.ts index 24e9e207fd..4763303a70 100644 --- a/packages/backend/src/server/api/endpoints/users/pages.ts +++ b/packages/backend/src/server/api/endpoints/users/pages.ts @@ -14,7 +14,7 @@ export const meta = { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, sinceId: { @@ -24,7 +24,7 @@ export const meta = { untilId: { validator: $.optional.type(ID), }, - } + }, }; export default define(meta, async (ps, user) => { diff --git a/packages/backend/src/server/api/endpoints/users/reactions.ts b/packages/backend/src/server/api/endpoints/users/reactions.ts index fe5e4d84a9..626487176b 100644 --- a/packages/backend/src/server/api/endpoints/users/reactions.ts +++ b/packages/backend/src/server/api/endpoints/users/reactions.ts @@ -45,16 +45,16 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'NoteReaction', - } + }, }, errors: { reactionsNotPublic: { message: 'Reactions of the user is not public.', code: 'REACTIONS_NOT_PUBLIC', - id: '673a7dd2-6924-1093-e0c0-e68456ceae5c' + id: '673a7dd2-6924-1093-e0c0-e68456ceae5c', }, - } + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/users/recommendation.ts b/packages/backend/src/server/api/endpoints/users/recommendation.ts index 7c775c4dcf..71c564c980 100644 --- a/packages/backend/src/server/api/endpoints/users/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/users/recommendation.ts @@ -15,13 +15,13 @@ export const meta = { params: { limit: { validator: $.optional.num.range(1, 100), - default: 10 + default: 10, }, offset: { validator: $.optional.num.min(0), - default: 0 - } + default: 0, + }, }, res: { @@ -31,7 +31,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'User', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/users/relation.ts b/packages/backend/src/server/api/endpoints/users/relation.ts index 32d76a5322..af1984fa2b 100644 --- a/packages/backend/src/server/api/endpoints/users/relation.ts +++ b/packages/backend/src/server/api/endpoints/users/relation.ts @@ -11,7 +11,7 @@ export const meta = { params: { userId: { validator: $.either($.type(ID), $.arr($.type(ID)).unique()), - } + }, }, res: { @@ -23,37 +23,37 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, isFollowing: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, hasPendingFollowRequestFromYou: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, hasPendingFollowRequestToYou: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isFollowed: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isBlocking: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isBlocked: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isMuted: { type: 'boolean' as const, - optional: false as const, nullable: false as const - } - } + optional: false as const, nullable: false as const, + }, + }, }, { type: 'array' as const, @@ -65,41 +65,41 @@ export const meta = { id: { type: 'string' as const, optional: false as const, nullable: false as const, - format: 'id' + format: 'id', }, isFollowing: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, hasPendingFollowRequestFromYou: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, hasPendingFollowRequestToYou: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isFollowed: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isBlocking: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isBlocked: { type: 'boolean' as const, - optional: false as const, nullable: false as const + optional: false as const, nullable: false as const, }, isMuted: { type: 'boolean' as const, - optional: false as const, nullable: false as const - } - } - } - } - ] - } + optional: false as const, nullable: false as const, + }, + }, + }, + }, + ], + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts index 1ec5e1a743..58a8d929f7 100644 --- a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts +++ b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts @@ -37,7 +37,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'User', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/users/search.ts b/packages/backend/src/server/api/endpoints/users/search.ts index 9aa988d9ed..f87088688c 100644 --- a/packages/backend/src/server/api/endpoints/users/search.ts +++ b/packages/backend/src/server/api/endpoints/users/search.ts @@ -42,7 +42,7 @@ export const meta = { type: 'object' as const, optional: false as const, nullable: false as const, ref: 'User', - } + }, }, }; diff --git a/packages/backend/src/server/api/endpoints/users/show.ts b/packages/backend/src/server/api/endpoints/users/show.ts index f056983636..eacb2aee16 100644 --- a/packages/backend/src/server/api/endpoints/users/show.ts +++ b/packages/backend/src/server/api/endpoints/users/show.ts @@ -23,12 +23,12 @@ export const meta = { }, username: { - validator: $.optional.str + validator: $.optional.str, }, host: { - validator: $.optional.nullable.str - } + validator: $.optional.nullable.str, + }, }, res: { @@ -42,15 +42,15 @@ export const meta = { message: 'Failed to resolve remote user.', code: 'FAILED_TO_RESOLVE_REMOTE_USER', id: 'ef7b9be4-9cba-4e6f-ab41-90ed171c7d3c', - kind: 'server' as const + kind: 'server' as const, }, noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '4362f8dc-731f-4ad8-a694-be5a88922a24' + id: '4362f8dc-731f-4ad8-a694-be5a88922a24', }, - } + }, }; export default define(meta, async (ps, me) => { @@ -64,10 +64,10 @@ export default define(meta, async (ps, me) => { } const users = await Users.find(isAdminOrModerator ? { - id: In(ps.userIds) + id: In(ps.userIds), } : { id: In(ps.userIds), - isSuspended: false + isSuspended: false, }); // リクエストされた通りに並べ替え @@ -77,7 +77,7 @@ export default define(meta, async (ps, me) => { } return await Promise.all(_users.map(u => Users.pack(u, me, { - detail: true + detail: true, }))); } else { // Lookup user @@ -99,7 +99,7 @@ export default define(meta, async (ps, me) => { } return await Users.pack(user, me, { - detail: true + detail: true, }); } }); diff --git a/packages/backend/src/server/api/endpoints/users/stats.ts b/packages/backend/src/server/api/endpoints/users/stats.ts index ef8afd5625..b8564218ac 100644 --- a/packages/backend/src/server/api/endpoints/users/stats.ts +++ b/packages/backend/src/server/api/endpoints/users/stats.ts @@ -19,9 +19,9 @@ export const meta = { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '9e638e45-3b25-4ef7-8f95-07e8498f1819' + id: '9e638e45-3b25-4ef7-8f95-07e8498f1819', }, - } + }, }; export default define(meta, async (ps, me) => { diff --git a/packages/backend/src/server/api/error.ts b/packages/backend/src/server/api/error.ts index cb0bdc9f47..3f0861fdb1 100644 --- a/packages/backend/src/server/api/error.ts +++ b/packages/backend/src/server/api/error.ts @@ -14,7 +14,7 @@ export class ApiError extends Error { code: 'INTERNAL_ERROR', id: '5d37dbcb-891e-41ca-a3d6-e690c97775ac', kind: 'server', - httpStatusCode: 500 + httpStatusCode: 500, }; super(e.message); diff --git a/packages/backend/src/server/api/index.ts b/packages/backend/src/server/api/index.ts index 82579075eb..8f8a9d999e 100644 --- a/packages/backend/src/server/api/index.ts +++ b/packages/backend/src/server/api/index.ts @@ -23,7 +23,7 @@ import config from '@/config'; const app = new Koa(); app.use(cors({ - origin: '*' + origin: '*', })); // No caching @@ -34,7 +34,7 @@ app.use(async (ctx, next) => { app.use(bodyParser({ // リクエストが multipart/form-data でない限りはJSONだと見なす - detectJSON: ctx => !ctx.is('multipart/form-data') + detectJSON: ctx => !ctx.is('multipart/form-data'), })); // Init multer instance @@ -43,7 +43,7 @@ const upload = multer({ limits: { fileSize: config.maxFileSize || 262144000, files: 1, - } + }, }); // Init router @@ -74,7 +74,7 @@ router.use(twitter.routes()); router.get('/v1/instance/peers', async ctx => { const instances = await Instances.find({ - select: ['host'] + select: ['host'], }); ctx.body = instances.map(instance => instance.host); @@ -82,18 +82,18 @@ router.get('/v1/instance/peers', async ctx => { router.post('/miauth/:session/check', async ctx => { const token = await AccessTokens.findOne({ - session: ctx.params.session + session: ctx.params.session, }); if (token && token.session != null && !token.fetched) { AccessTokens.update(token.id, { - fetched: true + fetched: true, }); ctx.body = { ok: true, token: token.token, - user: await Users.pack(token.userId, null, { detail: true }) + user: await Users.pack(token.userId, null, { detail: true }), }; } else { ctx.body = { diff --git a/packages/backend/src/server/api/limiter.ts b/packages/backend/src/server/api/limiter.ts index 82a8613c90..5f617771e0 100644 --- a/packages/backend/src/server/api/limiter.ts +++ b/packages/backend/src/server/api/limiter.ts @@ -35,7 +35,7 @@ export default (endpoint: IEndpoint, user: User) => new Promise((ok, rejec id: `${user.id}:${key}:min`, duration: limitation.minInterval, max: 1, - db: redisClient + db: redisClient, }); minIntervalLimiter.get((err, info) => { @@ -63,7 +63,7 @@ export default (endpoint: IEndpoint, user: User) => new Promise((ok, rejec id: `${user.id}:${key}`, duration: limitation.duration, max: limitation.max, - db: redisClient + db: redisClient, }); limiter.get((err, info) => { diff --git a/packages/backend/src/server/api/openapi/errors.ts b/packages/backend/src/server/api/openapi/errors.ts index 43bcc323ba..d7f791c6da 100644 --- a/packages/backend/src/server/api/openapi/errors.ts +++ b/packages/backend/src/server/api/openapi/errors.ts @@ -7,9 +7,9 @@ export const errors = { message: 'Invalid param.', code: 'INVALID_PARAM', id: '3d81ceae-475f-4600-b2a8-2bc116157532', - } - } - } + }, + }, + }, }, '401': { 'CREDENTIAL_REQUIRED': { @@ -18,9 +18,9 @@ export const errors = { message: 'Credential required.', code: 'CREDENTIAL_REQUIRED', id: '1384574d-a912-4b81-8601-c7b1c4085df1', - } - } - } + }, + }, + }, }, '403': { 'AUTHENTICATION_FAILED': { @@ -29,9 +29,9 @@ export const errors = { message: 'Authentication failed. Please ensure your token is correct.', code: 'AUTHENTICATION_FAILED', id: 'b0a7f5f8-dc2f-4171-b91f-de88ad238e14', - } - } - } + }, + }, + }, }, '418': { 'I_AM_AI': { @@ -40,9 +40,9 @@ export const errors = { message: 'You sent a request to Ai-chan, Misskey\'s showgirl, instead of the server.', code: 'I_AM_AI', id: '60c46cd1-f23a-46b1-bebe-5d2b73951a84', - } - } - } + }, + }, + }, }, '429': { 'RATE_LIMIT_EXCEEDED': { @@ -51,9 +51,9 @@ export const errors = { message: 'Rate limit exceeded. Please try again later.', code: 'RATE_LIMIT_EXCEEDED', id: 'd5826d14-3982-4d2e-8011-b9e9f02499ef', - } - } - } + }, + }, + }, }, '500': { 'INTERNAL_ERROR': { @@ -62,8 +62,8 @@ export const errors = { message: 'Internal error occurred. Please contact us if the error persists.', code: 'INTERNAL_ERROR', id: '5d37dbcb-891e-41ca-a3d6-e690c97775ac', - } - } - } - } + }, + }, + }, + }, }; diff --git a/packages/backend/src/server/api/openapi/gen-spec.ts b/packages/backend/src/server/api/openapi/gen-spec.ts index 48b819727f..1c521f212f 100644 --- a/packages/backend/src/server/api/openapi/gen-spec.ts +++ b/packages/backend/src/server/api/openapi/gen-spec.ts @@ -11,16 +11,16 @@ export function genOpenapiSpec(lang = 'ja-JP') { info: { version: 'v1', title: 'Misskey API', - 'x-logo': { url: '/static-assets/api-doc.png' } + 'x-logo': { url: '/static-assets/api-doc.png' }, }, externalDocs: { description: 'Repository', - url: 'https://github.com/misskey-dev/misskey' + url: 'https://github.com/misskey-dev/misskey', }, servers: [{ - url: config.apiUrl + url: config.apiUrl, }], paths: {} as any, @@ -32,10 +32,10 @@ export function genOpenapiSpec(lang = 'ja-JP') { ApiKeyAuth: { type: 'apiKey', in: 'body', - name: 'i' - } - } - } + name: 'i', + }, + }, + }, }; function genProps(props: { [key: string]: Context; }) { @@ -69,11 +69,11 @@ export function genOpenapiSpec(lang = 'ja-JP') { } : {}), ...(param.name === 'Object' ? { ...(required.length > 0 ? { required } : {}), - properties: (param as any).props ? genProps((param as any).props) : {} + properties: (param as any).props ? genProps((param as any).props) : {}, } : {}), ...(param.name === 'Array' ? { - items: (param as any).ctx ? genProp((param as any).ctx) : {} - } : {}) + items: (param as any).ctx ? genProp((param as any).ctx) : {}, + } : {}), }; } @@ -85,8 +85,8 @@ export function genOpenapiSpec(lang = 'ja-JP') { for (const e of Object.values(endpoint.meta.errors)) { errors[e.code] = { value: { - error: e - } + error: e, + }, }; } } @@ -118,15 +118,15 @@ export function genOpenapiSpec(lang = 'ja-JP') { description: desc, externalDocs: { description: 'Source code', - url: `https://github.com/misskey-dev/misskey/blob/develop/src/server/api/endpoints/${endpoint.name}.ts` + url: `https://github.com/misskey-dev/misskey/blob/develop/src/server/api/endpoints/${endpoint.name}.ts`, }, ...(endpoint.meta.tags ? { - tags: [endpoint.meta.tags[0]] + tags: [endpoint.meta.tags[0]], } : {}), ...(endpoint.meta.requireCredential ? { security: [{ - ApiKeyAuth: [] - }] + ApiKeyAuth: [], + }], } : {}), requestBody: { required: true, @@ -135,10 +135,10 @@ export function genOpenapiSpec(lang = 'ja-JP') { schema: { type: 'object', ...(required.length > 0 ? { required } : {}), - properties: endpoint.meta.params ? genProps(porops) : {} - } - } - } + properties: endpoint.meta.params ? genProps(porops) : {}, + }, + }, + }, }, responses: { ...(endpoint.meta.res ? { @@ -146,58 +146,58 @@ export function genOpenapiSpec(lang = 'ja-JP') { description: 'OK (with results)', content: { 'application/json': { - schema: resSchema - } - } - } + schema: resSchema, + }, + }, + }, } : { '204': { description: 'OK (without any results)', - } + }, }), '400': { description: 'Client error', content: { 'application/json': { schema: { - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/Error', }, - examples: { ...errors, ...basicErrors['400'] } - } - } + examples: { ...errors, ...basicErrors['400'] }, + }, + }, }, '401': { description: 'Authentication error', content: { 'application/json': { schema: { - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/Error', }, - examples: basicErrors['401'] - } - } + examples: basicErrors['401'], + }, + }, }, '403': { description: 'Forbidden error', content: { 'application/json': { schema: { - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/Error', }, - examples: basicErrors['403'] - } - } + examples: basicErrors['403'], + }, + }, }, '418': { description: 'I\'m Ai', content: { 'application/json': { schema: { - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/Error', }, - examples: basicErrors['418'] - } - } + examples: basicErrors['418'], + }, + }, }, ...(endpoint.meta.limit ? { '429': { @@ -205,29 +205,29 @@ export function genOpenapiSpec(lang = 'ja-JP') { content: { 'application/json': { schema: { - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/Error', }, - examples: basicErrors['429'] - } - } - } + examples: basicErrors['429'], + }, + }, + }, } : {}), '500': { description: 'Internal server error', content: { 'application/json': { schema: { - $ref: '#/components/schemas/Error' + $ref: '#/components/schemas/Error', }, - examples: basicErrors['500'] - } - } + examples: basicErrors['500'], + }, + }, }, - } + }, }; spec.paths['/' + endpoint.name] = { - post: info + post: info, }; } diff --git a/packages/backend/src/server/api/openapi/schemas.ts b/packages/backend/src/server/api/openapi/schemas.ts index 12fc207c47..723b3e884a 100644 --- a/packages/backend/src/server/api/openapi/schemas.ts +++ b/packages/backend/src/server/api/openapi/schemas.ts @@ -42,12 +42,12 @@ export const schemas = { type: 'string', format: 'uuid', description: 'An error ID. This ID is static.', - } + }, }, - required: ['code', 'id', 'message'] + required: ['code', 'id', 'message'], }, }, - required: ['error'] + required: ['error'], }, ...Object.fromEntries( diff --git a/packages/backend/src/server/api/private/signin.ts b/packages/backend/src/server/api/private/signin.ts index 83c3dfee94..7b733b768d 100644 --- a/packages/backend/src/server/api/private/signin.ts +++ b/packages/backend/src/server/api/private/signin.ts @@ -41,7 +41,7 @@ export default async (ctx: Koa.Context) => { // Fetch user const user = await Users.findOne({ usernameLower: username.toLowerCase(), - host: null + host: null, }) as ILocalUser; if (user == null) { @@ -71,7 +71,7 @@ export default async (ctx: Koa.Context) => { userId: user.id, ip: ctx.ip, headers: ctx.headers, - success: false + success: false, }); error(status || 500, failure || { id: '4e30e80c-e338-45a0-8c8f-44455efa3b76' }); @@ -83,7 +83,7 @@ export default async (ctx: Koa.Context) => { return; } else { await fail(403, { - id: '932c904e-9460-45b7-9ce6-7ed33be7eb2c' + id: '932c904e-9460-45b7-9ce6-7ed33be7eb2c', }); return; } @@ -92,7 +92,7 @@ export default async (ctx: Koa.Context) => { if (token) { if (!same) { await fail(403, { - id: '932c904e-9460-45b7-9ce6-7ed33be7eb2c' + id: '932c904e-9460-45b7-9ce6-7ed33be7eb2c', }); return; } @@ -101,7 +101,7 @@ export default async (ctx: Koa.Context) => { secret: profile.twoFactorSecret, encoding: 'base32', token: token, - window: 2 + window: 2, }); if (verified) { @@ -109,14 +109,14 @@ export default async (ctx: Koa.Context) => { return; } else { await fail(403, { - id: 'cdf1235b-ac71-46d4-a3a6-84ccce48df6f' + id: 'cdf1235b-ac71-46d4-a3a6-84ccce48df6f', }); return; } } else if (body.credentialId) { if (!same && !profile.usePasswordLessLogin) { await fail(403, { - id: '932c904e-9460-45b7-9ce6-7ed33be7eb2c' + id: '932c904e-9460-45b7-9ce6-7ed33be7eb2c', }); return; } @@ -127,24 +127,24 @@ export default async (ctx: Koa.Context) => { userId: user.id, id: body.challengeId, registrationChallenge: false, - challenge: hash(clientData.challenge).toString('hex') + challenge: hash(clientData.challenge).toString('hex'), }); if (!challenge) { await fail(403, { - id: '2715a88a-2125-4013-932f-aa6fe72792da' + id: '2715a88a-2125-4013-932f-aa6fe72792da', }); return; } await AttestationChallenges.delete({ userId: user.id, - id: body.challengeId + id: body.challengeId, }); if (new Date().getTime() - challenge.createdAt.getTime() >= 5 * 60 * 1000) { await fail(403, { - id: '2715a88a-2125-4013-932f-aa6fe72792da' + id: '2715a88a-2125-4013-932f-aa6fe72792da', }); return; } @@ -155,12 +155,12 @@ export default async (ctx: Koa.Context) => { .replace(/-/g, '+') .replace(/_/g, '/'), 'base64' - ).toString('hex') + ).toString('hex'), }); if (!securityKey) { await fail(403, { - id: '66269679-aeaf-4474-862b-eb761197e046' + id: '66269679-aeaf-4474-862b-eb761197e046', }); return; } @@ -171,7 +171,7 @@ export default async (ctx: Koa.Context) => { clientDataJSON, clientData, signature: Buffer.from(body.signature, 'hex'), - challenge: challenge.challenge + challenge: challenge.challenge, }); if (isValid) { @@ -179,25 +179,25 @@ export default async (ctx: Koa.Context) => { return; } else { await fail(403, { - id: '93b86c4b-72f9-40eb-9815-798928603d1e' + id: '93b86c4b-72f9-40eb-9815-798928603d1e', }); return; } } else { if (!same && !profile.usePasswordLessLogin) { await fail(403, { - id: '932c904e-9460-45b7-9ce6-7ed33be7eb2c' + id: '932c904e-9460-45b7-9ce6-7ed33be7eb2c', }); return; } const keys = await UserSecurityKeys.find({ - userId: user.id + userId: user.id, }); if (keys.length === 0) { await fail(403, { - id: 'f27fd449-9af4-4841-9249-1f989b9fa4a4' + id: 'f27fd449-9af4-4841-9249-1f989b9fa4a4', }); return; } @@ -215,15 +215,15 @@ export default async (ctx: Koa.Context) => { id: challengeId, challenge: hash(Buffer.from(challenge, 'utf-8')).toString('hex'), createdAt: new Date(), - registrationChallenge: false + registrationChallenge: false, }); ctx.body = { challenge, challengeId, securityKeys: keys.map(key => ({ - id: key.id - })) + id: key.id, + })), }; ctx.status = 200; return; diff --git a/packages/backend/src/server/api/private/signup.ts b/packages/backend/src/server/api/private/signup.ts index 2b6a3eb00c..eaab8e7111 100644 --- a/packages/backend/src/server/api/private/signup.ts +++ b/packages/backend/src/server/api/private/signup.ts @@ -57,7 +57,7 @@ export default async (ctx: Koa.Context) => { } const ticket = await RegistrationTickets.findOne({ - code: invitationCode + code: invitationCode, }); if (ticket == null) { @@ -94,12 +94,12 @@ export default async (ctx: Koa.Context) => { } else { try { const { account, secret } = await signup({ - username, password, host + username, password, host, }); const res = await Users.pack(account, account, { detail: true, - includeSecrets: true + includeSecrets: true, }); (res as any).token = secret; diff --git a/packages/backend/src/server/api/service/discord.ts b/packages/backend/src/server/api/service/discord.ts index dd52a23376..f574fe3878 100644 --- a/packages/backend/src/server/api/service/discord.ts +++ b/packages/backend/src/server/api/service/discord.ts @@ -42,7 +42,7 @@ router.get('/disconnect/discord', async ctx => { const user = await Users.findOneOrFail({ host: null, - token: userToken + token: userToken, }); const profile = await UserProfiles.findOneOrFail(user.id); @@ -58,7 +58,7 @@ router.get('/disconnect/discord', async ctx => { // Publish i updated event publishMainStream(user.id, 'meUpdated', await Users.pack(user, user, { detail: true, - includeSecrets: true + includeSecrets: true, })); }); @@ -93,7 +93,7 @@ router.get('/connect/discord', async ctx => { redirect_uri: `${config.url}/api/dc/cb`, scope: ['identify'], state: uuid(), - response_type: 'code' + response_type: 'code', }; redisClient.set(userToken, JSON.stringify(params)); @@ -109,13 +109,13 @@ router.get('/signin/discord', async ctx => { redirect_uri: `${config.url}/api/dc/cb`, scope: ['identify'], state: uuid(), - response_type: 'code' + response_type: 'code', }; ctx.cookies.set('signin_with_discord_sid', sessid, { path: '/', secure: config.url.startsWith('https'), - httpOnly: true + httpOnly: true, }); redisClient.set(sessid, JSON.stringify(params)); @@ -158,7 +158,7 @@ router.get('/dc/cb', async ctx => { const { accessToken, refreshToken, expiresDate } = await new Promise((res, rej) => oauth2!.getOAuthAccessToken(code, { grant_type: 'authorization_code', - redirect_uri + redirect_uri, }, (err, accessToken, refreshToken, result) => { if (err) { rej(err); @@ -168,7 +168,7 @@ router.get('/dc/cb', async ctx => { res({ accessToken, refreshToken, - expiresDate: Date.now() + Number(result.expires_in) * 1000 + expiresDate: Date.now() + Number(result.expires_in) * 1000, }); } })); @@ -201,8 +201,8 @@ router.get('/dc/cb', async ctx => { refreshToken: refreshToken, expiresDate: expiresDate, username: username, - discriminator: discriminator - } + discriminator: discriminator, + }, }, }); @@ -229,7 +229,7 @@ router.get('/dc/cb', async ctx => { const { accessToken, refreshToken, expiresDate } = await new Promise((res, rej) => oauth2!.getOAuthAccessToken(code, { grant_type: 'authorization_code', - redirect_uri + redirect_uri, }, (err, accessToken, refreshToken, result) => { if (err) { rej(err); @@ -239,7 +239,7 @@ router.get('/dc/cb', async ctx => { res({ accessToken, refreshToken, - expiresDate: Date.now() + Number(result.expires_in) * 1000 + expiresDate: Date.now() + Number(result.expires_in) * 1000, }); } })); @@ -254,7 +254,7 @@ router.get('/dc/cb', async ctx => { const user = await Users.findOneOrFail({ host: null, - token: userToken + token: userToken, }); const profile = await UserProfiles.findOneOrFail(user.id); @@ -268,9 +268,9 @@ router.get('/dc/cb', async ctx => { expiresDate: expiresDate, id: id, username: username, - discriminator: discriminator - } - } + discriminator: discriminator, + }, + }, }); ctx.body = `Discord: @${username}#${discriminator} を、Misskey: @${user.username} に接続しました!`; @@ -278,7 +278,7 @@ router.get('/dc/cb', async ctx => { // Publish i updated event publishMainStream(user.id, 'meUpdated', await Users.pack(user, user, { detail: true, - includeSecrets: true + includeSecrets: true, })); } }); diff --git a/packages/backend/src/server/api/service/github.ts b/packages/backend/src/server/api/service/github.ts index 07b4fe717e..5e0839df93 100644 --- a/packages/backend/src/server/api/service/github.ts +++ b/packages/backend/src/server/api/service/github.ts @@ -92,7 +92,7 @@ router.get('/connect/github', async ctx => { const params = { redirect_uri: `${config.url}/api/gh/cb`, scope: ['read:user'], - state: uuid() + state: uuid(), }; redisClient.set(userToken, JSON.stringify(params)); @@ -107,13 +107,13 @@ router.get('/signin/github', async ctx => { const params = { redirect_uri: `${config.url}/api/gh/cb`, scope: ['read:user'], - state: uuid() + state: uuid(), }; ctx.cookies.set('signin_with_github_sid', sessid, { path: '/', secure: config.url.startsWith('https'), - httpOnly: true + httpOnly: true, }); redisClient.set(sessid, JSON.stringify(params)); @@ -155,7 +155,7 @@ router.get('/gh/cb', async ctx => { const { accessToken } = await new Promise((res, rej) => oauth2!.getOAuthAccessToken(code, { - redirect_uri + redirect_uri, }, (err, accessToken, refresh, result) => { if (err) { rej(err); @@ -167,7 +167,7 @@ router.get('/gh/cb', async ctx => { })); const { login, id } = await getJson('https://api.github.com/user', 'application/vnd.github.v3+json', 10 * 1000, { - 'Authorization': `bearer ${accessToken}` + 'Authorization': `bearer ${accessToken}`, }); if (!login || !id) { ctx.throw(400, 'invalid session'); @@ -219,7 +219,7 @@ router.get('/gh/cb', async ctx => { })); const { login, id } = await getJson('https://api.github.com/user', 'application/vnd.github.v3+json', 10 * 1000, { - 'Authorization': `bearer ${accessToken}` + 'Authorization': `bearer ${accessToken}`, }); if (!login || !id) { @@ -229,7 +229,7 @@ router.get('/gh/cb', async ctx => { const user = await Users.findOneOrFail({ host: null, - token: userToken + token: userToken, }); const profile = await UserProfiles.findOneOrFail(user.id); @@ -241,8 +241,8 @@ router.get('/gh/cb', async ctx => { accessToken: accessToken, id: id, login: login, - } - } + }, + }, }); ctx.body = `GitHub: @${login} を、Misskey: @${user.username} に接続しました!`; @@ -250,7 +250,7 @@ router.get('/gh/cb', async ctx => { // Publish i updated event publishMainStream(user.id, 'meUpdated', await Users.pack(user, user, { detail: true, - includeSecrets: true + includeSecrets: true, })); } }); diff --git a/packages/backend/src/server/api/service/twitter.ts b/packages/backend/src/server/api/service/twitter.ts index 8a6a58aeee..8659b82cbe 100644 --- a/packages/backend/src/server/api/service/twitter.ts +++ b/packages/backend/src/server/api/service/twitter.ts @@ -41,7 +41,7 @@ router.get('/disconnect/twitter', async ctx => { const user = await Users.findOneOrFail({ host: null, - token: userToken + token: userToken, }); const profile = await UserProfiles.findOneOrFail(user.id); @@ -57,7 +57,7 @@ router.get('/disconnect/twitter', async ctx => { // Publish i updated event publishMainStream(user.id, 'meUpdated', await Users.pack(user, user, { detail: true, - includeSecrets: true + includeSecrets: true, })); }); @@ -68,7 +68,7 @@ async function getTwAuth() { return autwh({ consumerKey: meta.twitterConsumerKey, consumerSecret: meta.twitterConsumerSecret, - callbackUrl: `${config.url}/api/tw/cb` + callbackUrl: `${config.url}/api/tw/cb`, }); } else { return null; @@ -104,7 +104,7 @@ router.get('/signin/twitter', async ctx => { ctx.cookies.set('signin_with_twitter_sid', sessid, { path: '/', secure: config.url.startsWith('https'), - httpOnly: true + httpOnly: true, }); ctx.redirect(twCtx.url); @@ -164,7 +164,7 @@ router.get('/tw/cb', async ctx => { const user = await Users.findOneOrFail({ host: null, - token: userToken + token: userToken, }); const profile = await UserProfiles.findOneOrFail(user.id); @@ -177,7 +177,7 @@ router.get('/tw/cb', async ctx => { accessTokenSecret: result.accessTokenSecret, userId: result.userId, screenName: result.screenName, - } + }, }, }); @@ -186,7 +186,7 @@ router.get('/tw/cb', async ctx => { // Publish i updated event publishMainStream(user.id, 'meUpdated', await Users.pack(user, user, { detail: true, - includeSecrets: true + includeSecrets: true, })); } }); diff --git a/packages/backend/src/server/api/stream/channel.ts b/packages/backend/src/server/api/stream/channel.ts index 2824d7d1b8..98337bb318 100644 --- a/packages/backend/src/server/api/stream/channel.ts +++ b/packages/backend/src/server/api/stream/channel.ts @@ -52,7 +52,7 @@ export default abstract class Channel { this.connection.sendMessageToWs('channel', { id: this.id, type: type, - body: body + body: body, }); } diff --git a/packages/backend/src/server/api/stream/channels/channel.ts b/packages/backend/src/server/api/stream/channels/channel.ts index bf7942f522..1e51a81c4b 100644 --- a/packages/backend/src/server/api/stream/channels/channel.ts +++ b/packages/backend/src/server/api/stream/channels/channel.ts @@ -32,13 +32,13 @@ export default class extends Channel { // リプライなら再pack if (note.replyId != null) { note.reply = await Notes.pack(note.replyId, this.user, { - detail: true + detail: true, }); } // Renoteなら再pack if (note.renoteId != null) { note.renote = await Notes.pack(note.renoteId, this.user, { - detail: true + detail: true, }); } diff --git a/packages/backend/src/server/api/stream/channels/games/reversi-game.ts b/packages/backend/src/server/api/stream/channels/games/reversi-game.ts index bfdbf1d266..314db48b5e 100644 --- a/packages/backend/src/server/api/stream/channels/games/reversi-game.ts +++ b/packages/backend/src/server/api/stream/channels/games/reversi-game.ts @@ -95,12 +95,12 @@ export default class extends Channel { if (!['map', 'bw', 'isLlotheo', 'canPutEverywhere', 'loopedBoard'].includes(key)) return; await ReversiGames.update(this.gameId!, { - [key]: value + [key]: value, }); publishReversiGameStream(this.gameId!, 'updateSettings', { key: key, - value: value + value: value, }); } @@ -115,16 +115,16 @@ export default class extends Channel { if ((game.user1Id !== this.user.id) && (game.user2Id !== this.user.id)) return; const set = game.user1Id === this.user.id ? { - form1: form + form1: form, } : { - form2: form + form2: form, }; await ReversiGames.update(this.gameId!, set); publishReversiGameStream(this.gameId!, 'initForm', { userId: this.user.id, - form + form, }); } @@ -147,9 +147,9 @@ export default class extends Channel { item.value = value; const set = game.user1Id === this.user.id ? { - form2: form + form2: form, } : { - form1: form + form1: form, }; await ReversiGames.update(this.gameId!, set); @@ -157,7 +157,7 @@ export default class extends Channel { publishReversiGameStream(this.gameId!, 'updateForm', { userId: this.user.id, id, - value + value, }); } @@ -168,7 +168,7 @@ export default class extends Channel { message.id = Math.random(); publishReversiGameStream(this.gameId!, 'message', { userId: this.user.id, - message + message, }); } @@ -185,23 +185,23 @@ export default class extends Channel { if (game.user1Id === this.user.id) { await ReversiGames.update(this.gameId!, { - user1Accepted: accept + user1Accepted: accept, }); publishReversiGameStream(this.gameId!, 'changeAccepts', { user1: accept, - user2: game.user2Accepted + user2: game.user2Accepted, }); if (accept && game.user2Accepted) bothAccepted = true; } else if (game.user2Id === this.user.id) { await ReversiGames.update(this.gameId!, { - user2Accepted: accept + user2Accepted: accept, }); publishReversiGameStream(this.gameId!, 'changeAccepts', { user1: game.user1Accepted, - user2: accept + user2: accept, }); if (accept && game.user1Accepted) bothAccepted = true; @@ -235,14 +235,14 @@ export default class extends Channel { startedAt: new Date(), isStarted: true, black: bw, - map: map + map: map, }); //#region 盤面に最初から石がないなどして始まった瞬間に勝敗が決定する場合があるのでその処理 const o = new Reversi(map, { isLlotheo: freshGame.isLlotheo, canPutEverywhere: freshGame.canPutEverywhere, - loopedBoard: freshGame.loopedBoard + loopedBoard: freshGame.loopedBoard, }); if (o.isEnded) { @@ -257,12 +257,12 @@ export default class extends Channel { await ReversiGames.update(this.gameId!, { isEnded: true, - winnerId: winner + winnerId: winner, }); publishReversiGameStream(this.gameId!, 'ended', { winnerId: winner, - game: await ReversiGames.pack(this.gameId!, this.user) + game: await ReversiGames.pack(this.gameId!, this.user), }); } //#endregion @@ -293,7 +293,7 @@ export default class extends Channel { const o = new Reversi(game.map, { isLlotheo: game.isLlotheo, canPutEverywhere: game.canPutEverywhere, - loopedBoard: game.loopedBoard + loopedBoard: game.loopedBoard, }); // 盤面の状態を再生 @@ -320,7 +320,7 @@ export default class extends Channel { const log = { at: new Date(), color: myColor, - pos + pos, }; const crc32 = CRC32.str(game.logs.map(x => x.pos.toString()).join('') + pos.toString()).toString(); @@ -331,17 +331,17 @@ export default class extends Channel { crc32, isEnded: o.isEnded, winnerId: winner, - logs: game.logs + logs: game.logs, }); publishReversiGameStream(this.gameId!, 'set', Object.assign(log, { - next: o.turn + next: o.turn, })); if (o.isEnded) { publishReversiGameStream(this.gameId!, 'ended', { winnerId: winner, - game: await ReversiGames.pack(this.gameId!, this.user) + game: await ReversiGames.pack(this.gameId!, this.user), }); } } diff --git a/packages/backend/src/server/api/stream/channels/games/reversi.ts b/packages/backend/src/server/api/stream/channels/games/reversi.ts index 399750c26a..121560ff87 100644 --- a/packages/backend/src/server/api/stream/channels/games/reversi.ts +++ b/packages/backend/src/server/api/stream/channels/games/reversi.ts @@ -23,7 +23,7 @@ export default class extends Channel { if (body.id == null) return; const matching = await ReversiMatchings.findOne({ parentId: this.user!.id, - childId: body.id + childId: body.id, }); if (matching == null) return; publishMainStream(matching.childId, 'reversiInvited', await ReversiMatchings.pack(matching, { id: matching.childId })); diff --git a/packages/backend/src/server/api/stream/channels/global-timeline.ts b/packages/backend/src/server/api/stream/channels/global-timeline.ts index 3c37b16dd7..f14f597aac 100644 --- a/packages/backend/src/server/api/stream/channels/global-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts @@ -32,13 +32,13 @@ export default class extends Channel { // リプライなら再pack if (note.replyId != null) { note.reply = await Notes.pack(note.replyId, this.user, { - detail: true + detail: true, }); } // Renoteなら再pack if (note.renoteId != null) { note.renote = await Notes.pack(note.renoteId, this.user, { - detail: true + detail: true, }); } diff --git a/packages/backend/src/server/api/stream/channels/hashtag.ts b/packages/backend/src/server/api/stream/channels/hashtag.ts index 281be4f2eb..820095dfcf 100644 --- a/packages/backend/src/server/api/stream/channels/hashtag.ts +++ b/packages/backend/src/server/api/stream/channels/hashtag.ts @@ -31,7 +31,7 @@ export default class extends Channel { // Renoteなら再pack if (note.renoteId != null) { note.renote = await Notes.pack(note.renoteId, this.user, { - detail: true + detail: true, }); } diff --git a/packages/backend/src/server/api/stream/channels/home-timeline.ts b/packages/backend/src/server/api/stream/channels/home-timeline.ts index 24fb3bd40b..3bd491421d 100644 --- a/packages/backend/src/server/api/stream/channels/home-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts @@ -32,7 +32,7 @@ export default class extends Channel { if (['followers', 'specified'].includes(note.visibility)) { note = await Notes.pack(note.id, this.user!, { - detail: true + detail: true, }); if (note.isHidden) { @@ -42,13 +42,13 @@ export default class extends Channel { // リプライなら再pack if (note.replyId != null) { note.reply = await Notes.pack(note.replyId, this.user!, { - detail: true + detail: true, }); } // Renoteなら再pack if (note.renoteId != null) { note.renote = await Notes.pack(note.renoteId, this.user!, { - detail: true + detail: true, }); } } diff --git a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts index 615cc4540f..0ae19aa7ce 100644 --- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts @@ -37,7 +37,7 @@ export default class extends Channel { if (['followers', 'specified'].includes(note.visibility)) { note = await Notes.pack(note.id, this.user!, { - detail: true + detail: true, }); if (note.isHidden) { @@ -47,13 +47,13 @@ export default class extends Channel { // リプライなら再pack if (note.replyId != null) { note.reply = await Notes.pack(note.replyId, this.user!, { - detail: true + detail: true, }); } // Renoteなら再pack if (note.renoteId != null) { note.renote = await Notes.pack(note.renoteId, this.user!, { - detail: true + detail: true, }); } } diff --git a/packages/backend/src/server/api/stream/channels/index.ts b/packages/backend/src/server/api/stream/channels/index.ts index 1841573043..89d93f2da3 100644 --- a/packages/backend/src/server/api/stream/channels/index.ts +++ b/packages/backend/src/server/api/stream/channels/index.ts @@ -33,5 +33,5 @@ export default { channel, admin, gamesReversi, - gamesReversiGame + gamesReversiGame, }; diff --git a/packages/backend/src/server/api/stream/channels/local-timeline.ts b/packages/backend/src/server/api/stream/channels/local-timeline.ts index a6166c2be2..3178b1d511 100644 --- a/packages/backend/src/server/api/stream/channels/local-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/local-timeline.ts @@ -32,13 +32,13 @@ export default class extends Channel { // リプライなら再pack if (note.replyId != null) { note.reply = await Notes.pack(note.replyId, this.user, { - detail: true + detail: true, }); } // Renoteなら再pack if (note.renoteId != null) { note.renote = await Notes.pack(note.renoteId, this.user, { - detail: true + detail: true, }); } diff --git a/packages/backend/src/server/api/stream/channels/main.ts b/packages/backend/src/server/api/stream/channels/main.ts index 925263aef0..b41eae7c71 100644 --- a/packages/backend/src/server/api/stream/channels/main.ts +++ b/packages/backend/src/server/api/stream/channels/main.ts @@ -20,7 +20,7 @@ export default class extends Channel { if (data.body.note && data.body.note.isHidden) { const note = await Notes.pack(data.body.note.id, this.user, { - detail: true + detail: true, }); this.connection.cacheNote(note); data.body.note = note; @@ -33,7 +33,7 @@ export default class extends Channel { if (this.muting.has(data.body.userId)) return; if (data.body.isHidden) { const note = await Notes.pack(data.body.id, this.user, { - detail: true + detail: true, }); this.connection.cacheNote(note); data.body = note; diff --git a/packages/backend/src/server/api/stream/channels/messaging.ts b/packages/backend/src/server/api/stream/channels/messaging.ts index c049e880b9..d8fccf0763 100644 --- a/packages/backend/src/server/api/stream/channels/messaging.ts +++ b/packages/backend/src/server/api/stream/channels/messaging.ts @@ -28,7 +28,7 @@ export default class extends Channel { if (this.groupId) { const joining = await UserGroupJoinings.findOne({ userId: this.user!.id, - userGroupId: this.groupId + userGroupId: this.groupId, }); if (joining == null) { diff --git a/packages/backend/src/server/api/stream/channels/queue-stats.ts b/packages/backend/src/server/api/stream/channels/queue-stats.ts index 0bda0cfcb9..be18438fa3 100644 --- a/packages/backend/src/server/api/stream/channels/queue-stats.ts +++ b/packages/backend/src/server/api/stream/channels/queue-stats.ts @@ -28,7 +28,7 @@ export default class extends Channel { }); ev.emit('requestQueueStatsLog', { id: body.id, - length: body.length + length: body.length, }); break; } diff --git a/packages/backend/src/server/api/stream/channels/server-stats.ts b/packages/backend/src/server/api/stream/channels/server-stats.ts index d245a7f70c..df89b4c750 100644 --- a/packages/backend/src/server/api/stream/channels/server-stats.ts +++ b/packages/backend/src/server/api/stream/channels/server-stats.ts @@ -28,7 +28,7 @@ export default class extends Channel { }); ev.emit('requestServerStatsLog', { id: body.id, - length: body.length + length: body.length, }); break; } diff --git a/packages/backend/src/server/api/stream/channels/user-list.ts b/packages/backend/src/server/api/stream/channels/user-list.ts index 63b254605b..b75920a180 100644 --- a/packages/backend/src/server/api/stream/channels/user-list.ts +++ b/packages/backend/src/server/api/stream/channels/user-list.ts @@ -21,7 +21,7 @@ export default class extends Channel { // Check existence and owner const list = await UserLists.findOne({ id: this.listId, - userId: this.user!.id + userId: this.user!.id, }); if (!list) return; @@ -40,7 +40,7 @@ export default class extends Channel { where: { userListId: this.listId, }, - select: ['userId'] + select: ['userId'], }); this.listUsers = users.map(x => x.userId); @@ -52,7 +52,7 @@ export default class extends Channel { if (['followers', 'specified'].includes(note.visibility)) { note = await Notes.pack(note.id, this.user, { - detail: true + detail: true, }); if (note.isHidden) { @@ -62,13 +62,13 @@ export default class extends Channel { // リプライなら再pack if (note.replyId != null) { note.reply = await Notes.pack(note.replyId, this.user, { - detail: true + detail: true, }); } // Renoteなら再pack if (note.renoteId != null) { note.renote = await Notes.pack(note.renoteId, this.user, { - detail: true + detail: true, }); } } diff --git a/packages/backend/src/server/api/stream/index.ts b/packages/backend/src/server/api/stream/index.ts index da4ea5ec99..84689bca1a 100644 --- a/packages/backend/src/server/api/stream/index.ts +++ b/packages/backend/src/server/api/stream/index.ts @@ -203,8 +203,8 @@ export default class Connection { code: e.code, id: e.id, kind: e.kind, - ...(e.info ? { info: e.info } : {}) - } + ...(e.info ? { info: e.info } : {}), + }, }); }); } @@ -281,7 +281,7 @@ export default class Connection { public sendMessageToWs(type: string, payload: any) { this.wsConnection.send(JSON.stringify({ type: type, - body: payload + body: payload, })); } @@ -305,7 +305,7 @@ export default class Connection { if (pong) { this.sendMessageToWs('connected', { - id: id + id: id, }); } } @@ -358,9 +358,9 @@ export default class Connection { private async updateFollowing() { const followings = await Followings.find({ where: { - followerId: this.user!.id + followerId: this.user!.id, }, - select: ['followeeId'] + select: ['followeeId'], }); this.following = new Set(followings.map(x => x.followeeId)); @@ -370,9 +370,9 @@ export default class Connection { private async updateMuting() { const mutings = await Mutings.find({ where: { - muterId: this.user!.id + muterId: this.user!.id, }, - select: ['muteeId'] + select: ['muteeId'], }); this.muting = new Set(mutings.map(x => x.muteeId)); @@ -382,9 +382,9 @@ export default class Connection { private async updateBlocking() { // ここでいうBlockingは被Blockingの意 const blockings = await Blockings.find({ where: { - blockeeId: this.user!.id + blockeeId: this.user!.id, }, - select: ['blockerId'] + select: ['blockerId'], }); this.blocking = new Set(blockings.map(x => x.blockerId)); @@ -394,9 +394,9 @@ export default class Connection { private async updateFollowingChannels() { const followings = await ChannelFollowings.find({ where: { - followerId: this.user!.id + followerId: this.user!.id, }, - select: ['followeeId'] + select: ['followeeId'], }); this.followingChannels = new Set(followings.map(x => x.followeeId)); @@ -405,7 +405,7 @@ export default class Connection { @autobind private async updateUserProfile() { this.userProfile = await UserProfiles.findOne({ - userId: this.user!.id + userId: this.user!.id, }); } diff --git a/packages/backend/src/server/api/streaming.ts b/packages/backend/src/server/api/streaming.ts index 8808bc9860..ad87311064 100644 --- a/packages/backend/src/server/api/streaming.ts +++ b/packages/backend/src/server/api/streaming.ts @@ -11,7 +11,7 @@ import { Users } from '@/models/index'; module.exports = (server: http.Server) => { // Init websocket server const ws = new websocket.server({ - httpServer: server + httpServer: server, }); ws.on('request', async (request) => { diff --git a/packages/backend/src/server/file/send-drive-file.ts b/packages/backend/src/server/file/send-drive-file.ts index 1908c969a5..8bb5655b4f 100644 --- a/packages/backend/src/server/file/send-drive-file.ts +++ b/packages/backend/src/server/file/send-drive-file.ts @@ -108,7 +108,7 @@ export default async function(ctx: Koa.Context) { const { mime, ext } = await detectType(InternalStorage.resolvePath(key)); const filename = rename(file.name, { suffix: isThumbnail ? '-thumb' : '-web', - extname: ext ? `.${ext}` : undefined + extname: ext ? `.${ext}` : undefined, }).toString(); ctx.body = InternalStorage.read(key); diff --git a/packages/backend/src/server/index.ts b/packages/backend/src/server/index.ts index 507178a46c..85fe21accb 100644 --- a/packages/backend/src/server/index.ts +++ b/packages/backend/src/server/index.ts @@ -43,7 +43,7 @@ if (!['production', 'test'].includes(process.env.NODE_ENV || '')) { // Delay if (envOption.slow) { app.use(slow({ - delay: 3000 + delay: 3000, })); } } @@ -74,7 +74,7 @@ router.get('/avatar/@:acct', async ctx => { const user = await Users.findOne({ usernameLower: username.toLowerCase(), host: host === config.host ? null : host, - isSuspended: false + isSuspended: false, }); if (user) { @@ -93,7 +93,7 @@ router.get('/random-avatar/:x', async ctx => { router.get('/verify-email/:code', async ctx => { const profile = await UserProfiles.findOne({ - emailVerifyCode: ctx.params.code + emailVerifyCode: ctx.params.code, }); if (profile != null) { @@ -102,12 +102,12 @@ router.get('/verify-email/:code', async ctx => { await UserProfiles.update({ userId: profile.userId }, { emailVerified: true, - emailVerifyCode: null + emailVerifyCode: null, }); publishMainStream(profile.userId, 'meUpdated', await Users.pack(profile.userId, { id: profile.userId }, { detail: true, - includeSecrets: true + includeSecrets: true, })); } else { ctx.status = 404; diff --git a/packages/backend/src/server/nodeinfo.ts b/packages/backend/src/server/nodeinfo.ts index 6a864fcc52..097c6c664d 100644 --- a/packages/backend/src/server/nodeinfo.ts +++ b/packages/backend/src/server/nodeinfo.ts @@ -15,7 +15,7 @@ export const links = [/* (awaiting release) { href: config.url + nodeinfo2_1path }, */{ rel: 'http://nodeinfo.diaspora.software/ns/schema/2.0', - href: config.url + nodeinfo2_0path + href: config.url + nodeinfo2_0path, }]; const nodeinfo2 = async () => { @@ -46,11 +46,11 @@ const nodeinfo2 = async () => { protocols: ['activitypub'], services: { inbound: [] as string[], - outbound: ['atom1.0', 'rss2.0'] + outbound: ['atom1.0', 'rss2.0'], }, openRegistrations: !meta.disableRegistration, usage: { - users: {} // { total, activeHalfyear, activeMonth }, + users: {}, // { total, activeHalfyear, activeMonth }, // localPosts, // localComments }, @@ -59,7 +59,7 @@ const nodeinfo2 = async () => { nodeDescription: meta.description, maintainer: { name: meta.maintainerName, - email: meta.maintainerEmail + email: meta.maintainerEmail, }, langs: meta.langs, tosUrl: meta.ToSUrl, @@ -78,7 +78,7 @@ const nodeinfo2 = async () => { enableEmail: meta.enableEmail, enableServiceWorker: meta.enableServiceWorker, proxyAccountName: proxyAccount ? proxyAccount.username : null, - } + }, }; }; diff --git a/packages/backend/src/server/web/feed.ts b/packages/backend/src/server/web/feed.ts index 1d4c47dafb..db589e086b 100644 --- a/packages/backend/src/server/web/feed.ts +++ b/packages/backend/src/server/web/feed.ts @@ -7,7 +7,7 @@ import { In } from 'typeorm'; export default async function(user: User) { const author = { link: `${config.url}/@${user.username}`, - name: user.name || user.username + name: user.name || user.username, }; const profile = await UserProfiles.findOneOrFail(user.id); @@ -16,10 +16,10 @@ export default async function(user: User) { where: { userId: user.id, renoteId: null, - visibility: In(['public', 'home']) + visibility: In(['public', 'home']), }, order: { createdAt: -1 }, - take: 20 + take: 20, }); const feed = new Feed({ @@ -35,12 +35,12 @@ export default async function(user: User) { atom: `${author.link}.atom`, }, author, - copyright: user.name || user.username + copyright: user.name || user.username, }); for (const note of notes) { const files = note.fileIds.length > 0 ? await DriveFiles.find({ - id: In(note.fileIds) + id: In(note.fileIds), }) : []; const file = files.find(file => file.type.startsWith('image/')); @@ -50,7 +50,7 @@ export default async function(user: User) { date: note.createdAt, description: note.cw || undefined, content: note.text || undefined, - image: file ? DriveFiles.getPublicUrl(file) || undefined : undefined + image: file ? DriveFiles.getPublicUrl(file) || undefined : undefined, }); } diff --git a/packages/backend/src/server/web/index.ts b/packages/backend/src/server/web/index.ts index d80d73f252..5623f7db83 100644 --- a/packages/backend/src/server/web/index.ts +++ b/packages/backend/src/server/web/index.ts @@ -34,8 +34,8 @@ app.use(views(_dirname + '/views', { extension: 'pug', options: { version: config.version, - config - } + config, + }, })); // Serve favicon @@ -77,7 +77,7 @@ router.get('/assets/(.*)', async ctx => { // Apple touch icon router.get('/apple-touch-icon.png', async ctx => { await send(ctx as any, '/apple-touch-icon.png', { - root: staticAssets + root: staticAssets, }); }); @@ -100,7 +100,7 @@ router.get('/twemoji/(.*)', async ctx => { // ServiceWorker router.get('/sw.js', async ctx => { await send(ctx as any, `/sw.${config.version}.js`, { - root: assets + root: assets, }); }); @@ -109,7 +109,7 @@ router.get('/manifest.json', require('./manifest')); router.get('/robots.txt', async ctx => { await send(ctx as any, '/robots.txt', { - root: staticAssets + root: staticAssets, }); }); @@ -118,7 +118,7 @@ router.get('/robots.txt', async ctx => { // Docs router.get('/api-doc', async ctx => { await send(ctx as any, '/redoc.html', { - root: staticAssets + root: staticAssets, }); }); @@ -134,7 +134,7 @@ const getFeed = async (acct: string) => { const user = await Users.findOne({ usernameLower: username.toLowerCase(), host, - isSuspended: false + isSuspended: false, }); return user && await packFeed(user); @@ -183,7 +183,7 @@ router.get(['/@:user', '/@:user/:sub'], async (ctx, next) => { const user = await Users.findOne({ usernameLower: username.toLowerCase(), host, - isSuspended: false + isSuspended: false, }); if (user != null) { @@ -199,7 +199,7 @@ router.get(['/@:user', '/@:user/:sub'], async (ctx, next) => { user, profile, me, sub: ctx.params.sub, instanceName: meta.name || 'Misskey', - icon: meta.iconUrl + icon: meta.iconUrl, }); ctx.set('Cache-Control', 'public, max-age=30'); } else { @@ -213,7 +213,7 @@ router.get('/users/:user', async ctx => { const user = await Users.findOne({ id: ctx.params.user, host: null, - isSuspended: false + isSuspended: false, }); if (user == null) { @@ -238,7 +238,7 @@ router.get('/notes/:note', async (ctx, next) => { // TODO: Let locale changeable by instance setting summary: getNoteSummary(_note), instanceName: meta.name || 'Misskey', - icon: meta.iconUrl + icon: meta.iconUrl, }); if (['public', 'home'].includes(note.visibility)) { @@ -258,14 +258,14 @@ router.get('/@:user/pages/:page', async (ctx, next) => { const { username, host } = Acct.parse(ctx.params.user); const user = await Users.findOne({ usernameLower: username.toLowerCase(), - host + host, }); if (user == null) return; const page = await Pages.findOne({ name: ctx.params.page, - userId: user.id + userId: user.id, }); if (page) { @@ -275,7 +275,7 @@ router.get('/@:user/pages/:page', async (ctx, next) => { await ctx.render('page', { page: _page, profile, - instanceName: meta.name || 'Misskey' + instanceName: meta.name || 'Misskey', }); if (['public'].includes(page.visibility)) { @@ -304,7 +304,7 @@ router.get('/clips/:clip', async (ctx, next) => { await ctx.render('clip', { clip: _clip, profile, - instanceName: meta.name || 'Misskey' + instanceName: meta.name || 'Misskey', }); ctx.set('Cache-Control', 'public, max-age=180'); @@ -327,7 +327,7 @@ router.get('/gallery/:post', async (ctx, next) => { post: _post, profile, instanceName: meta.name || 'Misskey', - icon: meta.iconUrl + icon: meta.iconUrl, }); ctx.set('Cache-Control', 'public, max-age=180'); @@ -349,7 +349,7 @@ router.get('/channels/:channel', async (ctx, next) => { const meta = await fetchMeta(); await ctx.render('channel', { channel: _channel, - instanceName: meta.name || 'Misskey' + instanceName: meta.name || 'Misskey', }); ctx.set('Cache-Control', 'public, max-age=180'); @@ -371,7 +371,7 @@ router.get('/_info_card_', async ctx => { host: config.host, meta: meta, originalUsersCount: await Users.count({ host: null }), - originalNotesCount: await Notes.count({ userHost: null }) + originalNotesCount: await Notes.count({ userHost: null }), }); }); @@ -411,7 +411,7 @@ router.get('(.*)', async ctx => { title: meta.name || 'Misskey', instanceName: meta.name || 'Misskey', desc: meta.description, - icon: meta.iconUrl + icon: meta.iconUrl, }); ctx.set('Cache-Control', 'public, max-age=300'); }); diff --git a/packages/backend/src/server/web/url-preview.ts b/packages/backend/src/server/web/url-preview.ts index 1375420c0a..71465c8083 100644 --- a/packages/backend/src/server/web/url-preview.ts +++ b/packages/backend/src/server/web/url-preview.ts @@ -18,10 +18,10 @@ module.exports = async (ctx: Koa.Context) => { try { const summary = meta.summalyProxy ? await getJson(`${meta.summalyProxy}?${query({ url: ctx.query.url, - lang: ctx.query.lang || 'ja-JP' + lang: ctx.query.lang || 'ja-JP', })}`) : await summaly(ctx.query.url, { followRedirects: false, - lang: ctx.query.lang || 'ja-JP' + lang: ctx.query.lang || 'ja-JP', }); logger.succ(`Got preview of ${ctx.query.url}: ${summary.title}`); @@ -46,7 +46,7 @@ function wrap(url?: string): string | null { ? url.match(/^https?:\/\//) ? `${config.url}/proxy/preview.jpg?${query({ url, - preview: '1' + preview: '1', })}` : url : null; diff --git a/packages/backend/src/server/well-known.ts b/packages/backend/src/server/well-known.ts index 0f65f6e58c..d1f13b70bb 100644 --- a/packages/backend/src/server/well-known.ts +++ b/packages/backend/src/server/well-known.ts @@ -69,7 +69,7 @@ router.get(webFingerPath, async ctx => { const fromId = (id: User['id']): Record => ({ id, host: null, - isSuspended: false + isSuspended: false, }); const generateQuery = (resource: string) => @@ -84,7 +84,7 @@ router.get(webFingerPath, async ctx => { !acct.host || acct.host === config.host.toLowerCase() ? { usernameLower: acct.username, host: null, - isSuspended: false + isSuspended: false, } : 422; if (typeof ctx.query.resource !== 'string') { @@ -110,16 +110,16 @@ router.get(webFingerPath, async ctx => { const self = { rel: 'self', type: 'application/activity+json', - href: `${config.url}/users/${user.id}` + href: `${config.url}/users/${user.id}`, }; const profilePage = { rel: 'http://webfinger.net/rel/profile-page', type: 'text/html', - href: `${config.url}/@${user.username}` + href: `${config.url}/@${user.username}`, }; const subscribe = { rel: 'http://ostatus.org/schema/1.0/subscribe', - template: `${config.url}/authorize-follow?acct={uri}` + template: `${config.url}/authorize-follow?acct={uri}`, }; if (ctx.accepts(jrd, xrd) === xrd) { @@ -132,7 +132,7 @@ router.get(webFingerPath, async ctx => { } else { ctx.body = { subject, - links: [self, profilePage, subscribe] + links: [self, profilePage, subscribe], }; ctx.type = jrd; } diff --git a/packages/backend/src/services/add-note-to-antenna.ts b/packages/backend/src/services/add-note-to-antenna.ts index 3aedbd2c32..168e3a614d 100644 --- a/packages/backend/src/services/add-note-to-antenna.ts +++ b/packages/backend/src/services/add-note-to-antenna.ts @@ -22,14 +22,14 @@ export async function addNoteToAntenna(antenna: Antenna, note: Note, noteUser: { if (!read) { const mutings = await Mutings.find({ where: { - muterId: antenna.userId + muterId: antenna.userId, }, - select: ['muteeId'] + select: ['muteeId'], }); // Copy const _note: Note = { - ...note + ...note, }; if (note.replyId != null) { diff --git a/packages/backend/src/services/blocking/create.ts b/packages/backend/src/services/blocking/create.ts index 6aadc847a9..907e4c3116 100644 --- a/packages/backend/src/services/blocking/create.ts +++ b/packages/backend/src/services/blocking/create.ts @@ -36,7 +36,7 @@ export default async function(blocker: User, blockee: User) { async function cancelRequest(follower: User, followee: User) { const request = await FollowRequests.findOne({ followeeId: followee.id, - followerId: follower.id + followerId: follower.id, }); if (request == null) { @@ -45,18 +45,18 @@ async function cancelRequest(follower: User, followee: User) { await FollowRequests.delete({ followeeId: followee.id, - followerId: follower.id + followerId: follower.id, }); if (Users.isLocalUser(followee)) { Users.pack(followee, followee, { - detail: true + detail: true, }).then(packed => publishMainStream(followee.id, 'meUpdated', packed)); } if (Users.isLocalUser(follower)) { Users.pack(followee, follower, { - detail: true + detail: true, }).then(packed => { publishUserEvent(follower.id, 'unfollow', packed); publishMainStream(follower.id, 'unfollow', packed); @@ -79,7 +79,7 @@ async function cancelRequest(follower: User, followee: User) { async function unFollow(follower: User, followee: User) { const following = await Followings.findOne({ followerId: follower.id, - followeeId: followee.id + followeeId: followee.id, }); if (following == null) { @@ -101,7 +101,7 @@ async function unFollow(follower: User, followee: User) { // Publish unfollow event if (Users.isLocalUser(follower)) { Users.pack(followee, follower, { - detail: true + detail: true, }).then(packed => { publishUserEvent(follower.id, 'unfollow', packed); publishMainStream(follower.id, 'unfollow', packed); diff --git a/packages/backend/src/services/blocking/delete.ts b/packages/backend/src/services/blocking/delete.ts index de7efb1558..271bf4854a 100644 --- a/packages/backend/src/services/blocking/delete.ts +++ b/packages/backend/src/services/blocking/delete.ts @@ -11,7 +11,7 @@ const logger = new Logger('blocking/delete'); export default async function(blocker: User, blockee: User) { const blocking = await Blockings.findOne({ blockerId: blocker.id, - blockeeId: blockee.id + blockeeId: blockee.id, }); if (blocking == null) { diff --git a/packages/backend/src/services/chart/charts/classes/active-users.ts b/packages/backend/src/services/chart/charts/classes/active-users.ts index f80d8a3322..029e93a391 100644 --- a/packages/backend/src/services/chart/charts/classes/active-users.ts +++ b/packages/backend/src/services/chart/charts/classes/active-users.ts @@ -37,11 +37,11 @@ export default class ActiveUsersChart extends Chart { @autobind public async update(user: { id: User['id'], host: User['host'] }) { const update: Obj = { - users: [user.id] + users: [user.id], }; await this.inc({ - [Users.isLocalUser(user) ? 'local' : 'remote']: update + [Users.isLocalUser(user) ? 'local' : 'remote']: update, }); } } diff --git a/packages/backend/src/services/chart/charts/classes/drive.ts b/packages/backend/src/services/chart/charts/classes/drive.ts index 93eabf3096..2ed8e7fad1 100644 --- a/packages/backend/src/services/chart/charts/classes/drive.ts +++ b/packages/backend/src/services/chart/charts/classes/drive.ts @@ -23,7 +23,7 @@ export default class DriveChart extends Chart { remote: { totalCount: latest.remote.totalCount, totalSize: latest.remote.totalSize, - } + }, }; } @@ -55,7 +55,7 @@ export default class DriveChart extends Chart { DriveFiles.count({ userHost: null }), DriveFiles.count({ userHost: Not(IsNull()) }), DriveFiles.calcDriveUsageOfLocal(), - DriveFiles.calcDriveUsageOfRemote() + DriveFiles.calcDriveUsageOfRemote(), ]); return { @@ -66,7 +66,7 @@ export default class DriveChart extends Chart { remote: { totalCount: remoteCount, totalSize: remoteSize, - } + }, }; } @@ -85,7 +85,7 @@ export default class DriveChart extends Chart { } await this.inc({ - [file.userHost === null ? 'local' : 'remote']: update + [file.userHost === null ? 'local' : 'remote']: update, }); } } diff --git a/packages/backend/src/services/chart/charts/classes/federation.ts b/packages/backend/src/services/chart/charts/classes/federation.ts index 5f918b294f..9f8b7ec0ae 100644 --- a/packages/backend/src/services/chart/charts/classes/federation.ts +++ b/packages/backend/src/services/chart/charts/classes/federation.ts @@ -16,7 +16,7 @@ export default class FederationChart extends Chart { return { instance: { total: latest.instance.total, - } + }, }; } @@ -34,13 +34,13 @@ export default class FederationChart extends Chart { @autobind protected async fetchActual(): Promise> { const [total] = await Promise.all([ - Instances.count({}) + Instances.count({}), ]); return { instance: { total: total, - } + }, }; } @@ -56,7 +56,7 @@ export default class FederationChart extends Chart { } await this.inc({ - instance: update + instance: update, }); } } diff --git a/packages/backend/src/services/chart/charts/classes/hashtag.ts b/packages/backend/src/services/chart/charts/classes/hashtag.ts index f7f5e17dec..53774e566d 100644 --- a/packages/backend/src/services/chart/charts/classes/hashtag.ts +++ b/packages/backend/src/services/chart/charts/classes/hashtag.ts @@ -37,11 +37,11 @@ export default class HashtagChart extends Chart { @autobind public async update(hashtag: string, user: { id: User['id'], host: User['host'] }) { const update: Obj = { - users: [user.id] + users: [user.id], }; await this.inc({ - [Users.isLocalUser(user) ? 'local' : 'remote']: update + [Users.isLocalUser(user) ? 'local' : 'remote']: update, }, hashtag); } } diff --git a/packages/backend/src/services/chart/charts/classes/instance.ts b/packages/backend/src/services/chart/charts/classes/instance.ts index 1032de7bc0..8e7902d163 100644 --- a/packages/backend/src/services/chart/charts/classes/instance.ts +++ b/packages/backend/src/services/chart/charts/classes/instance.ts @@ -32,7 +32,7 @@ export default class InstanceChart extends Chart { drive: { totalFiles: latest.drive.totalFiles, totalUsage: latest.drive.totalUsage, - } + }, }; } @@ -114,7 +114,7 @@ export default class InstanceChart extends Chart { drive: { totalFiles: driveFiles, totalUsage: driveUsage, - } + }, }; } @@ -122,8 +122,8 @@ export default class InstanceChart extends Chart { public async requestReceived(host: string) { await this.inc({ requests: { - received: 1 - } + received: 1, + }, }, toPuny(host)); } @@ -138,7 +138,7 @@ export default class InstanceChart extends Chart { } await this.inc({ - requests: update + requests: update, }, toPuny(host)); } @@ -147,8 +147,8 @@ export default class InstanceChart extends Chart { await this.inc({ users: { total: 1, - inc: 1 - } + inc: 1, + }, }, toPuny(host)); } @@ -169,8 +169,8 @@ export default class InstanceChart extends Chart { total: isAdditional ? 1 : -1, inc: isAdditional ? 1 : 0, dec: isAdditional ? 0 : 1, - diffs: diffs - } + diffs: diffs, + }, }, toPuny(host)); } @@ -181,7 +181,7 @@ export default class InstanceChart extends Chart { total: isAdditional ? 1 : -1, inc: isAdditional ? 1 : 0, dec: isAdditional ? 0 : 1, - } + }, }, toPuny(host)); } @@ -192,7 +192,7 @@ export default class InstanceChart extends Chart { total: isAdditional ? 1 : -1, inc: isAdditional ? 1 : 0, dec: isAdditional ? 0 : 1, - } + }, }, toPuny(host)); } @@ -211,7 +211,7 @@ export default class InstanceChart extends Chart { } await this.inc({ - drive: update + drive: update, }, file.userHost); } } diff --git a/packages/backend/src/services/chart/charts/classes/network.ts b/packages/backend/src/services/chart/charts/classes/network.ts index 2ce75e0b34..838eec4916 100644 --- a/packages/backend/src/services/chart/charts/classes/network.ts +++ b/packages/backend/src/services/chart/charts/classes/network.ts @@ -37,7 +37,7 @@ export default class NetworkChart extends Chart { incomingRequests: incomingRequests, totalTime: time, incomingBytes: incomingBytes, - outgoingBytes: outgoingBytes + outgoingBytes: outgoingBytes, }; await this.inc(inc); diff --git a/packages/backend/src/services/chart/charts/classes/notes.ts b/packages/backend/src/services/chart/charts/classes/notes.ts index 0675d346d1..f8a580b3c0 100644 --- a/packages/backend/src/services/chart/charts/classes/notes.ts +++ b/packages/backend/src/services/chart/charts/classes/notes.ts @@ -21,7 +21,7 @@ export default class NotesChart extends Chart { }, remote: { total: latest.remote.total, - } + }, }; } @@ -55,7 +55,7 @@ export default class NotesChart extends Chart { protected async fetchActual(): Promise> { const [localCount, remoteCount] = await Promise.all([ Notes.count({ userHost: null }), - Notes.count({ userHost: Not(IsNull()) }) + Notes.count({ userHost: Not(IsNull()) }), ]); return { @@ -64,14 +64,14 @@ export default class NotesChart extends Chart { }, remote: { total: remoteCount, - } + }, }; } @autobind public async update(note: Note, isAdditional: boolean) { const update: Obj = { - diffs: {} + diffs: {}, }; update.total = isAdditional ? 1 : -1; @@ -91,7 +91,7 @@ export default class NotesChart extends Chart { } await this.inc({ - [note.userHost === null ? 'local' : 'remote']: update + [note.userHost === null ? 'local' : 'remote']: update, }); } } diff --git a/packages/backend/src/services/chart/charts/classes/per-user-drive.ts b/packages/backend/src/services/chart/charts/classes/per-user-drive.ts index f28987191b..33d49d9ebb 100644 --- a/packages/backend/src/services/chart/charts/classes/per-user-drive.ts +++ b/packages/backend/src/services/chart/charts/classes/per-user-drive.ts @@ -36,7 +36,7 @@ export default class PerUserDriveChart extends Chart { protected async fetchActual(group: string): Promise> { const [count, size] = await Promise.all([ DriveFiles.count({ userId: group }), - DriveFiles.calcDriveUsageOf(group) + DriveFiles.calcDriveUsageOf(group), ]); return { diff --git a/packages/backend/src/services/chart/charts/classes/per-user-following.ts b/packages/backend/src/services/chart/charts/classes/per-user-following.ts index 08a9ad1d2b..67b623057d 100644 --- a/packages/backend/src/services/chart/charts/classes/per-user-following.ts +++ b/packages/backend/src/services/chart/charts/classes/per-user-following.ts @@ -22,7 +22,7 @@ export default class PerUserFollowingChart extends Chart { }, followers: { total: latest.local.followers.total, - } + }, }, remote: { followings: { @@ -30,8 +30,8 @@ export default class PerUserFollowingChart extends Chart { }, followers: { total: latest.remote.followers.total, - } - } + }, + }, }; } @@ -71,12 +71,12 @@ export default class PerUserFollowingChart extends Chart { localFollowingsCount, localFollowersCount, remoteFollowingsCount, - remoteFollowersCount + remoteFollowersCount, ] = await Promise.all([ Followings.count({ followerId: group, followeeHost: null }), Followings.count({ followeeId: group, followerHost: null }), Followings.count({ followerId: group, followeeHost: Not(IsNull()) }), - Followings.count({ followeeId: group, followerHost: Not(IsNull()) }) + Followings.count({ followeeId: group, followerHost: Not(IsNull()) }), ]); return { @@ -86,7 +86,7 @@ export default class PerUserFollowingChart extends Chart { }, followers: { total: localFollowersCount, - } + }, }, remote: { followings: { @@ -94,8 +94,8 @@ export default class PerUserFollowingChart extends Chart { }, followers: { total: remoteFollowersCount, - } - } + }, + }, }; } @@ -112,10 +112,10 @@ export default class PerUserFollowingChart extends Chart { } this.inc({ - [Users.isLocalUser(follower) ? 'local' : 'remote']: { followings: update } + [Users.isLocalUser(follower) ? 'local' : 'remote']: { followings: update }, }, follower.id); this.inc({ - [Users.isLocalUser(followee) ? 'local' : 'remote']: { followers: update } + [Users.isLocalUser(followee) ? 'local' : 'remote']: { followers: update }, }, followee.id); } } diff --git a/packages/backend/src/services/chart/charts/classes/per-user-notes.ts b/packages/backend/src/services/chart/charts/classes/per-user-notes.ts index 0e808766f5..94760c0492 100644 --- a/packages/backend/src/services/chart/charts/classes/per-user-notes.ts +++ b/packages/backend/src/services/chart/charts/classes/per-user-notes.ts @@ -48,7 +48,7 @@ export default class PerUserNotesChart extends Chart { @autobind public async update(user: { id: User['id'] }, note: Note, isAdditional: boolean) { const update: Obj = { - diffs: {} + diffs: {}, }; update.total = isAdditional ? 1 : -1; diff --git a/packages/backend/src/services/chart/charts/classes/per-user-reactions.ts b/packages/backend/src/services/chart/charts/classes/per-user-reactions.ts index e71bcb71c4..62508eacdf 100644 --- a/packages/backend/src/services/chart/charts/classes/per-user-reactions.ts +++ b/packages/backend/src/services/chart/charts/classes/per-user-reactions.ts @@ -38,7 +38,7 @@ export default class PerUserReactionsChart extends Chart { @autobind public async update(user: { id: User['id'], host: User['host'] }, note: Note) { this.inc({ - [Users.isLocalUser(user) ? 'local' : 'remote']: { count: 1 } + [Users.isLocalUser(user) ? 'local' : 'remote']: { count: 1 }, }, note.userId); } } diff --git a/packages/backend/src/services/chart/charts/classes/test-grouped.ts b/packages/backend/src/services/chart/charts/classes/test-grouped.ts index 84e6d5e33f..2b11930af2 100644 --- a/packages/backend/src/services/chart/charts/classes/test-grouped.ts +++ b/packages/backend/src/services/chart/charts/classes/test-grouped.ts @@ -52,7 +52,7 @@ export default class TestGroupedChart extends Chart { this.total[group]++; await this.inc({ - foo: update + foo: update, }, group); } } diff --git a/packages/backend/src/services/chart/charts/classes/test-unique.ts b/packages/backend/src/services/chart/charts/classes/test-unique.ts index 559fda13c9..f8655804d4 100644 --- a/packages/backend/src/services/chart/charts/classes/test-unique.ts +++ b/packages/backend/src/services/chart/charts/classes/test-unique.ts @@ -30,7 +30,7 @@ export default class TestUniqueChart extends Chart { @autobind public async uniqueIncrement(key: string) { await this.inc({ - foo: [key] + foo: [key], }); } } diff --git a/packages/backend/src/services/chart/charts/classes/test.ts b/packages/backend/src/services/chart/charts/classes/test.ts index a91d5e1895..b3f6b76a44 100644 --- a/packages/backend/src/services/chart/charts/classes/test.ts +++ b/packages/backend/src/services/chart/charts/classes/test.ts @@ -50,7 +50,7 @@ export default class TestChart extends Chart { this.total++; await this.inc({ - foo: update + foo: update, }); } @@ -63,7 +63,7 @@ export default class TestChart extends Chart { this.total--; await this.inc({ - foo: update + foo: update, }); } } diff --git a/packages/backend/src/services/chart/charts/classes/users.ts b/packages/backend/src/services/chart/charts/classes/users.ts index 89b480ef77..6762410abf 100644 --- a/packages/backend/src/services/chart/charts/classes/users.ts +++ b/packages/backend/src/services/chart/charts/classes/users.ts @@ -21,7 +21,7 @@ export default class UsersChart extends Chart { }, remote: { total: latest.remote.total, - } + }, }; } @@ -45,7 +45,7 @@ export default class UsersChart extends Chart { protected async fetchActual(): Promise> { const [localCount, remoteCount] = await Promise.all([ Users.count({ host: null }), - Users.count({ host: Not(IsNull()) }) + Users.count({ host: Not(IsNull()) }), ]); return { @@ -54,7 +54,7 @@ export default class UsersChart extends Chart { }, remote: { total: remoteCount, - } + }, }; } @@ -70,7 +70,7 @@ export default class UsersChart extends Chart { } await this.inc({ - [Users.isLocalUser(user) ? 'local' : 'remote']: update + [Users.isLocalUser(user) ? 'local' : 'remote']: update, }); } } diff --git a/packages/backend/src/services/chart/charts/schemas/active-users.ts b/packages/backend/src/services/chart/charts/schemas/active-users.ts index 1d65f280b0..322fdb8691 100644 --- a/packages/backend/src/services/chart/charts/schemas/active-users.ts +++ b/packages/backend/src/services/chart/charts/schemas/active-users.ts @@ -8,7 +8,7 @@ export const logSchema = { items: { type: 'string' as const, optional: false as const, nullable: false as const, - } + }, }, }; @@ -22,14 +22,14 @@ export const schema = { local: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, remote: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, - } + }, }; export const name = 'activeUsers'; diff --git a/packages/backend/src/services/chart/charts/schemas/drive.ts b/packages/backend/src/services/chart/charts/schemas/drive.ts index 133b47846a..e7d3267931 100644 --- a/packages/backend/src/services/chart/charts/schemas/drive.ts +++ b/packages/backend/src/services/chart/charts/schemas/drive.ts @@ -55,14 +55,14 @@ export const schema = { local: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, remote: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, - } + }, }; export const name = 'drive'; diff --git a/packages/backend/src/services/chart/charts/schemas/federation.ts b/packages/backend/src/services/chart/charts/schemas/federation.ts index dca4587cac..1b8bbce0a8 100644 --- a/packages/backend/src/services/chart/charts/schemas/federation.ts +++ b/packages/backend/src/services/chart/charts/schemas/federation.ts @@ -21,9 +21,9 @@ export const schema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } - } - } + }, + }, + }, }; export const name = 'federation'; diff --git a/packages/backend/src/services/chart/charts/schemas/hashtag.ts b/packages/backend/src/services/chart/charts/schemas/hashtag.ts index 4e7c542bbc..6b4eca2978 100644 --- a/packages/backend/src/services/chart/charts/schemas/hashtag.ts +++ b/packages/backend/src/services/chart/charts/schemas/hashtag.ts @@ -8,7 +8,7 @@ export const logSchema = { items: { type: 'string' as const, optional: false as const, nullable: false as const, - } + }, }, }; @@ -22,14 +22,14 @@ export const schema = { local: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, remote: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, - } + }, }; export const name = 'hashtag'; diff --git a/packages/backend/src/services/chart/charts/schemas/instance.ts b/packages/backend/src/services/chart/charts/schemas/instance.ts index 785d6ae7ce..5f17ac0d11 100644 --- a/packages/backend/src/services/chart/charts/schemas/instance.ts +++ b/packages/backend/src/services/chart/charts/schemas/instance.ts @@ -21,7 +21,7 @@ export const schema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } + }, }, notes: { @@ -59,9 +59,9 @@ export const schema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } + }, }, - } + }, }, users: { @@ -80,7 +80,7 @@ export const schema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } + }, }, following: { @@ -99,7 +99,7 @@ export const schema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } + }, }, followers: { @@ -118,7 +118,7 @@ export const schema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } + }, }, drive: { @@ -149,9 +149,9 @@ export const schema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } + }, }, - } + }, }; export const name = 'instance'; diff --git a/packages/backend/src/services/chart/charts/schemas/network.ts b/packages/backend/src/services/chart/charts/schemas/network.ts index 49a364debc..1aeb2a8ad5 100644 --- a/packages/backend/src/services/chart/charts/schemas/network.ts +++ b/packages/backend/src/services/chart/charts/schemas/network.ts @@ -25,7 +25,7 @@ export const schema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } + }, }; export const name = 'network'; diff --git a/packages/backend/src/services/chart/charts/schemas/notes.ts b/packages/backend/src/services/chart/charts/schemas/notes.ts index 2b5105348c..a33e7aa8b9 100644 --- a/packages/backend/src/services/chart/charts/schemas/notes.ts +++ b/packages/backend/src/services/chart/charts/schemas/notes.ts @@ -32,7 +32,7 @@ const logSchema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } + }, }, }; @@ -43,14 +43,14 @@ export const schema = { local: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, remote: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, - } + }, }; export const name = 'notes'; diff --git a/packages/backend/src/services/chart/charts/schemas/per-user-drive.ts b/packages/backend/src/services/chart/charts/schemas/per-user-drive.ts index 856f1e0439..1c7c57afda 100644 --- a/packages/backend/src/services/chart/charts/schemas/per-user-drive.ts +++ b/packages/backend/src/services/chart/charts/schemas/per-user-drive.ts @@ -49,7 +49,7 @@ export const schema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } + }, }; export const name = 'perUserDrive'; diff --git a/packages/backend/src/services/chart/charts/schemas/per-user-following.ts b/packages/backend/src/services/chart/charts/schemas/per-user-following.ts index eaf74aaf77..9e7e71f3bb 100644 --- a/packages/backend/src/services/chart/charts/schemas/per-user-following.ts +++ b/packages/backend/src/services/chart/charts/schemas/per-user-following.ts @@ -29,7 +29,7 @@ export const logSchema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } + }, }, /** @@ -62,7 +62,7 @@ export const logSchema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } + }, }, }; @@ -73,14 +73,14 @@ export const schema = { local: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, remote: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, - } + }, }; export const name = 'perUserFollowing'; diff --git a/packages/backend/src/services/chart/charts/schemas/per-user-notes.ts b/packages/backend/src/services/chart/charts/schemas/per-user-notes.ts index 72b3ff0210..55b4ff40c0 100644 --- a/packages/backend/src/services/chart/charts/schemas/per-user-notes.ts +++ b/packages/backend/src/services/chart/charts/schemas/per-user-notes.ts @@ -35,9 +35,9 @@ export const schema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } + }, }, - } + }, }; export const name = 'perUserNotes'; diff --git a/packages/backend/src/services/chart/charts/schemas/per-user-reactions.ts b/packages/backend/src/services/chart/charts/schemas/per-user-reactions.ts index 2a8520db37..9af6c3cd54 100644 --- a/packages/backend/src/services/chart/charts/schemas/per-user-reactions.ts +++ b/packages/backend/src/services/chart/charts/schemas/per-user-reactions.ts @@ -18,14 +18,14 @@ export const schema = { local: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, remote: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, - } + }, }; export const name = 'perUserReaction'; diff --git a/packages/backend/src/services/chart/charts/schemas/test-grouped.ts b/packages/backend/src/services/chart/charts/schemas/test-grouped.ts index f8c8250e79..c2f2e7e886 100644 --- a/packages/backend/src/services/chart/charts/schemas/test-grouped.ts +++ b/packages/backend/src/services/chart/charts/schemas/test-grouped.ts @@ -20,9 +20,9 @@ export const schema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } - } - } + }, + }, + }, }; export const name = 'testGrouped'; diff --git a/packages/backend/src/services/chart/charts/schemas/test-unique.ts b/packages/backend/src/services/chart/charts/schemas/test-unique.ts index 51280400ac..b8da60dc53 100644 --- a/packages/backend/src/services/chart/charts/schemas/test-unique.ts +++ b/packages/backend/src/services/chart/charts/schemas/test-unique.ts @@ -8,9 +8,9 @@ export const schema = { items: { type: 'string' as const, optional: false as const, nullable: false as const, - } + }, }, - } + }, }; export const name = 'testUnique'; diff --git a/packages/backend/src/services/chart/charts/schemas/test.ts b/packages/backend/src/services/chart/charts/schemas/test.ts index 4b48d4d417..19c732fece 100644 --- a/packages/backend/src/services/chart/charts/schemas/test.ts +++ b/packages/backend/src/services/chart/charts/schemas/test.ts @@ -20,9 +20,9 @@ export const schema = { type: 'number' as const, optional: false as const, nullable: false as const, }, - } - } - } + }, + }, + }, }; export const name = 'test'; diff --git a/packages/backend/src/services/chart/charts/schemas/users.ts b/packages/backend/src/services/chart/charts/schemas/users.ts index 2bf9d3c50f..47e7791974 100644 --- a/packages/backend/src/services/chart/charts/schemas/users.ts +++ b/packages/backend/src/services/chart/charts/schemas/users.ts @@ -31,14 +31,14 @@ export const schema = { local: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, remote: { type: 'object' as const, optional: false as const, nullable: false as const, - properties: logSchema + properties: logSchema, }, - } + }, }; export const name = 'users'; diff --git a/packages/backend/src/services/chart/core.ts b/packages/backend/src/services/chart/core.ts index 78b7dd1359..59149dbc08 100644 --- a/packages/backend/src/services/chart/core.ts +++ b/packages/backend/src/services/chart/core.ts @@ -188,7 +188,7 @@ export default abstract class Chart> { id: { type: 'integer', primary: true, - generated: true + generated: true, }, date: { type: 'integer', @@ -196,9 +196,9 @@ export default abstract class Chart> { group: { type: 'varchar', length: 128, - nullable: true + nullable: true, }, - ...Chart.convertSchemaToFlatColumnDefinitions(schema) + ...Chart.convertSchemaToFlatColumnDefinitions(schema), }, indices: [{ columns: ['date', 'group'], @@ -206,8 +206,8 @@ export default abstract class Chart> { }, { // groupにnullが含まれると↑のuniqueは機能しないので↓の部分インデックスでカバー columns: ['date'], unique: true, - where: '"group" IS NULL' - }] + where: '"group" IS NULL', + }], }); } @@ -220,7 +220,7 @@ export default abstract class Chart> { if (grouped) keys.push('group'); entity.options.uniques = [{ - columns: keys + columns: keys, }]; this.repository = getRepository(entity); @@ -252,8 +252,8 @@ export default abstract class Chart> { group: group, }, { order: { - date: -1 - } + date: -1, + }, }).then(x => x || null); } @@ -266,7 +266,7 @@ export default abstract class Chart> { // 現在(=今のHour)のログ const currentLog = await this.repository.findOne({ date: Chart.dateToTimestamp(current), - ...(group ? { group: group } : {}) + ...(group ? { group: group } : {}), }); // ログがあればそれを返して終了 @@ -308,7 +308,7 @@ export default abstract class Chart> { // ロック内でもう1回チェックする const currentLog = await this.repository.findOne({ date: date, - ...(group ? { group: group } : {}) + ...(group ? { group: group } : {}), }); // ログがあればそれを返して終了 @@ -318,7 +318,7 @@ export default abstract class Chart> { log = await this.repository.insert({ group: group, date: date, - ...Chart.convertObjectToFlattenColumns(data) + ...Chart.convertObjectToFlattenColumns(data), }).then(x => this.repository.findOneOrFail(x.identifiers[0])); logger.info(`${this.name + (group ? `:${group}` : '')}: New commit created`); @@ -424,10 +424,10 @@ export default abstract class Chart> { let logs = await this.repository.find({ where: { group: group, - date: Between(Chart.dateToTimestamp(gt), Chart.dateToTimestamp(lt)) + date: Between(Chart.dateToTimestamp(gt), Chart.dateToTimestamp(lt)), }, order: { - date: -1 + date: -1, }, }); @@ -439,7 +439,7 @@ export default abstract class Chart> { group: group, }, { order: { - date: -1 + date: -1, }, }); @@ -453,10 +453,10 @@ export default abstract class Chart> { // (隙間埋めできないため) const outdatedLog = await this.repository.findOne({ group: group, - date: LessThan(Chart.dateToTimestamp(gt)) + date: LessThan(Chart.dateToTimestamp(gt)), }, { order: { - date: -1 + date: -1, }, }); diff --git a/packages/backend/src/services/chart/entities.ts b/packages/backend/src/services/chart/entities.ts index 23a97607eb..9d96a8a7ee 100644 --- a/packages/backend/src/services/chart/entities.ts +++ b/packages/backend/src/services/chart/entities.ts @@ -11,5 +11,5 @@ export const entities = Object.values(require('require-all')({ filter: /^.+\.[jt]s$/, resolve: (x: any) => { return Chart.schemaToEntity(x.name, x.schema); - } + }, })); diff --git a/packages/backend/src/services/create-notification.ts b/packages/backend/src/services/create-notification.ts index 5398d486c0..fc43ab29d7 100644 --- a/packages/backend/src/services/create-notification.ts +++ b/packages/backend/src/services/create-notification.ts @@ -27,7 +27,7 @@ export async function createNotification( type: type, // 相手がこの通知をミュートしているようなら、既読を予めつけておく isRead: isMuted, - ...data + ...data, } as Partial); const packed = await Notifications.pack(notification, {}); @@ -43,7 +43,7 @@ export async function createNotification( //#region ただしミュートしているユーザーからの通知なら無視 const mutings = await Mutings.find({ - muterId: notifieeId + muterId: notifieeId, }); if (data.notifierId && mutings.map(m => m.muteeId).includes(data.notifierId)) { return; diff --git a/packages/backend/src/services/create-system-user.ts b/packages/backend/src/services/create-system-user.ts index 71be8d4abf..82130dd593 100644 --- a/packages/backend/src/services/create-system-user.ts +++ b/packages/backend/src/services/create-system-user.ts @@ -27,7 +27,7 @@ export async function createSystemUser(username: string) { await getConnection().transaction(async transactionalEntityManager => { const exist = await transactionalEntityManager.findOne(User, { usernameLower: username.toLowerCase(), - host: null + host: null, }); if (exist) throw new Error('the user is already exists'); @@ -48,7 +48,7 @@ export async function createSystemUser(username: string) { await transactionalEntityManager.insert(UserKeypair, { publicKey: keyPair.publicKey, privateKey: keyPair.privateKey, - userId: account.id + userId: account.id, }); await transactionalEntityManager.insert(UserProfile, { diff --git a/packages/backend/src/services/drive/add-file.ts b/packages/backend/src/services/drive/add-file.ts index a57f9cf068..ee4d51a96d 100644 --- a/packages/backend/src/services/drive/add-file.ts +++ b/packages/backend/src/services/drive/add-file.ts @@ -66,7 +66,7 @@ async function save(file: DriveFile, path: string, name: string, type: string, h //#region Uploads logger.info(`uploading original: ${key}`); const uploads = [ - upload(key, fs.createReadStream(path), type, name) + upload(key, fs.createReadStream(path), type, name), ]; if (alts.webpublic) { @@ -149,13 +149,13 @@ export async function generateAlts(path: string, type: string, generateWeb: bool const thumbnail = await GenerateVideoThumbnail(path); return { webpublic: null, - thumbnail + thumbnail, }; } catch (e) { logger.warn(`GenerateVideoThumbnail failed: ${e}`); return { webpublic: null, - thumbnail: null + thumbnail: null, }; } } @@ -164,7 +164,7 @@ export async function generateAlts(path: string, type: string, generateWeb: bool logger.debug(`web image and thumbnail not created (not an required file)`); return { webpublic: null, - thumbnail: null + thumbnail: null, }; } @@ -179,14 +179,14 @@ export async function generateAlts(path: string, type: string, generateWeb: bool if (isAnimated) { return { webpublic: null, - thumbnail: null + thumbnail: null, }; } } catch (e) { logger.warn(`sharp failed: ${e}`); return { webpublic: null, - thumbnail: null + thumbnail: null, }; } @@ -258,7 +258,7 @@ async function upload(key: string, stream: fs.ReadStream | Buffer, type: string, const s3 = getS3(meta); const upload = s3.upload(params, { - partSize: s3.endpoint?.hostname === 'storage.googleapis.com' ? 500 * 1024 * 1024 : 8 * 1024 * 1024 + partSize: s3.endpoint?.hostname === 'storage.googleapis.com' ? 500 * 1024 * 1024 : 8 * 1024 * 1024, }); const result = await upload.promise(); @@ -361,7 +361,7 @@ export default async function( const driveFolder = await DriveFolders.findOne({ id: folderId, - userId: user ? user.id : null + userId: user ? user.id : null, }); if (driveFolder == null) throw new Error('folder-not-found'); @@ -436,7 +436,7 @@ export default async function( file = await DriveFiles.findOne({ uri: file.uri, - userId: user ? user.id : null + userId: user ? user.id : null, }) as DriveFile; } else { logger.error(e); diff --git a/packages/backend/src/services/drive/delete-file.ts b/packages/backend/src/services/drive/delete-file.ts index 2ac11b8295..5cda32c7d5 100644 --- a/packages/backend/src/services/drive/delete-file.ts +++ b/packages/backend/src/services/drive/delete-file.ts @@ -98,6 +98,6 @@ export async function deleteObjectStorageFile(key: string) { await s3.deleteObject({ Bucket: meta.objectStorageBucket!, - Key: key + Key: key, }).promise(); } diff --git a/packages/backend/src/services/drive/generate-video-thumbnail.ts b/packages/backend/src/services/drive/generate-video-thumbnail.ts index f0adc7c338..e8cc952b9a 100644 --- a/packages/backend/src/services/drive/generate-video-thumbnail.ts +++ b/packages/backend/src/services/drive/generate-video-thumbnail.ts @@ -13,7 +13,7 @@ export async function GenerateVideoThumbnail(path: string): Promise { await new Promise((res, rej) => { FFmpeg({ - source: path + source: path, }) .on('end', res) .on('error', rej) @@ -21,7 +21,7 @@ export async function GenerateVideoThumbnail(path: string): Promise { folder: outDir, filename: 'output.png', count: 1, - timestamps: ['5%'] + timestamps: ['5%'], }); }); diff --git a/packages/backend/src/services/drive/image-processor.ts b/packages/backend/src/services/drive/image-processor.ts index 493bf5c1cc..f3c4a2abd9 100644 --- a/packages/backend/src/services/drive/image-processor.ts +++ b/packages/backend/src/services/drive/image-processor.ts @@ -18,19 +18,19 @@ export async function convertSharpToJpeg(sharp: sharp.Sharp, width: number, heig const data = await sharp .resize(width, height, { fit: 'inside', - withoutEnlargement: true + withoutEnlargement: true, }) .rotate() .jpeg({ quality: 85, - progressive: true + progressive: true, }) .toBuffer(); return { data, ext: 'jpg', - type: 'image/jpeg' + type: 'image/jpeg', }; } @@ -46,18 +46,18 @@ export async function convertSharpToWebp(sharp: sharp.Sharp, width: number, heig const data = await sharp .resize(width, height, { fit: 'inside', - withoutEnlargement: true + withoutEnlargement: true, }) .rotate() .webp({ - quality: 85 + quality: 85, }) .toBuffer(); return { data, ext: 'webp', - type: 'image/webp' + type: 'image/webp', }; } @@ -73,7 +73,7 @@ export async function convertSharpToPng(sharp: sharp.Sharp, width: number, heigh const data = await sharp .resize(width, height, { fit: 'inside', - withoutEnlargement: true + withoutEnlargement: true, }) .rotate() .png() @@ -82,7 +82,7 @@ export async function convertSharpToPng(sharp: sharp.Sharp, width: number, heigh return { data, ext: 'png', - type: 'image/png' + type: 'image/png', }; } diff --git a/packages/backend/src/services/drive/s3.ts b/packages/backend/src/services/drive/s3.ts index f473c4a203..42bf6e187c 100644 --- a/packages/backend/src/services/drive/s3.ts +++ b/packages/backend/src/services/drive/s3.ts @@ -18,7 +18,7 @@ export function getS3(meta: Meta) { ? false : meta.objectStorageS3ForcePathStyle, httpOptions: { - agent: getAgentByUrl(new URL(u), !meta.objectStorageUseProxy) - } + agent: getAgentByUrl(new URL(u), !meta.objectStorageUseProxy), + }, }); } diff --git a/packages/backend/src/services/drive/upload-from-url.ts b/packages/backend/src/services/drive/upload-from-url.ts index 29788c4af4..28f42bc344 100644 --- a/packages/backend/src/services/drive/upload-from-url.ts +++ b/packages/backend/src/services/drive/upload-from-url.ts @@ -47,7 +47,7 @@ export default async ( error = e; logger.error(`Failed to create drive file: ${e}`, { url: url, - e: e + e: e, }); } diff --git a/packages/backend/src/services/following/create.ts b/packages/backend/src/services/following/create.ts index 4d0754b504..45bd226588 100644 --- a/packages/backend/src/services/following/create.ts +++ b/packages/backend/src/services/following/create.ts @@ -34,7 +34,7 @@ export async function insertFollowingDoc(followee: { id: User['id']; host: User[ followerSharedInbox: Users.isRemoteUser(follower) ? follower.sharedInbox : null, followeeHost: followee.host, followeeInbox: Users.isRemoteUser(followee) ? followee.inbox : null, - followeeSharedInbox: Users.isRemoteUser(followee) ? followee.sharedInbox : null + followeeSharedInbox: Users.isRemoteUser(followee) ? followee.sharedInbox : null, }).catch(e => { if (isDuplicateKeyValueError(e) && Users.isRemoteUser(follower) && Users.isLocalUser(followee)) { logger.info(`Insert duplicated ignore. ${follower.id} => ${followee.id}`); @@ -46,13 +46,13 @@ export async function insertFollowingDoc(followee: { id: User['id']; host: User[ const req = await FollowRequests.findOne({ followeeId: followee.id, - followerId: follower.id + followerId: follower.id, }); if (req) { await FollowRequests.delete({ followeeId: followee.id, - followerId: follower.id + followerId: follower.id, }); // 通知を作成 @@ -87,7 +87,7 @@ export async function insertFollowingDoc(followee: { id: User['id']; host: User[ // Publish follow event if (Users.isLocalUser(follower)) { Users.pack(followee.id, follower, { - detail: true + detail: true, }).then(packed => { publishUserEvent(follower.id, 'follow', packed); publishMainStream(follower.id, 'follow', packed); @@ -100,7 +100,7 @@ export async function insertFollowingDoc(followee: { id: User['id']; host: User[ // 通知を作成 createNotification(followee.id, 'follow', { - notifierId: follower.id + notifierId: follower.id, }); } } @@ -108,7 +108,7 @@ export async function insertFollowingDoc(followee: { id: User['id']; host: User[ export default async function(_follower: { id: User['id'] }, _followee: { id: User['id'] }, requestId?: string) { const [follower, followee] = await Promise.all([ Users.findOneOrFail(_follower.id), - Users.findOneOrFail(_followee.id) + Users.findOneOrFail(_followee.id), ]); // check blocking @@ -120,7 +120,7 @@ export default async function(_follower: { id: User['id'] }, _followee: { id: Us Blockings.findOne({ blockerId: followee.id, blockeeId: follower.id, - }) + }), ]); if (Users.isRemoteUser(follower) && Users.isLocalUser(followee) && blocked) { @@ -159,7 +159,7 @@ export default async function(_follower: { id: User['id'] }, _followee: { id: Us if (!autoAccept && (Users.isLocalUser(followee) && followeeProfile.autoAcceptFollowed)) { const followed = await Followings.findOne({ followerId: followee.id, - followeeId: follower.id + followeeId: follower.id, }); if (followed) autoAccept = true; diff --git a/packages/backend/src/services/following/delete.ts b/packages/backend/src/services/following/delete.ts index ea612147df..9b7d72e86d 100644 --- a/packages/backend/src/services/following/delete.ts +++ b/packages/backend/src/services/following/delete.ts @@ -15,7 +15,7 @@ const logger = new Logger('following/delete'); export default async function(follower: { id: User['id']; host: User['host']; uri: User['host']; inbox: User['inbox']; sharedInbox: User['sharedInbox']; }, followee: { id: User['id']; host: User['host']; uri: User['host']; inbox: User['inbox']; sharedInbox: User['sharedInbox']; }, silent = false) { const following = await Followings.findOne({ followerId: follower.id, - followeeId: followee.id + followeeId: followee.id, }); if (following == null) { @@ -30,7 +30,7 @@ export default async function(follower: { id: User['id']; host: User['host']; ur // Publish unfollow event if (!silent && Users.isLocalUser(follower)) { Users.pack(followee.id, follower, { - detail: true + detail: true, }).then(packed => { publishUserEvent(follower.id, 'unfollow', packed); publishMainStream(follower.id, 'unfollow', packed); diff --git a/packages/backend/src/services/following/reject.ts b/packages/backend/src/services/following/reject.ts index 0ec4d7d00c..1deabea4f8 100644 --- a/packages/backend/src/services/following/reject.ts +++ b/packages/backend/src/services/following/reject.ts @@ -56,7 +56,7 @@ export async function remoteReject(actor: Remote, follower: Local) { async function removeFollowRequest(followee: Both, follower: Both) { const request = await FollowRequests.findOne({ followeeId: followee.id, - followerId: follower.id + followerId: follower.id, }); if (!request) return; @@ -70,7 +70,7 @@ async function removeFollowRequest(followee: Both, follower: Both) { async function removeFollow(followee: Both, follower: Both) { const following = await Followings.findOne({ followeeId: followee.id, - followerId: follower.id + followerId: follower.id, }); if (!following) return; @@ -85,7 +85,7 @@ async function removeFollow(followee: Both, follower: Both) { async function deliverReject(followee: Local, follower: Remote) { const request = await FollowRequests.findOne({ followeeId: followee.id, - followerId: follower.id + followerId: follower.id, }); const content = renderActivity(renderReject(renderFollow(follower, followee, request?.requestId || undefined), followee)); @@ -97,7 +97,7 @@ async function deliverReject(followee: Local, follower: Remote) { */ async function publishUnfollow(followee: Both, follower: Local) { const packedFollowee = await Users.pack(followee.id, follower, { - detail: true + detail: true, }); publishUserEvent(follower.id, 'unfollow', packedFollowee); diff --git a/packages/backend/src/services/following/requests/accept-all.ts b/packages/backend/src/services/following/requests/accept-all.ts index 23b4fd0a46..06ff835c02 100644 --- a/packages/backend/src/services/following/requests/accept-all.ts +++ b/packages/backend/src/services/following/requests/accept-all.ts @@ -8,7 +8,7 @@ import { FollowRequests, Users } from '@/models/index'; */ export default async function(user: { id: User['id']; host: User['host']; uri: User['host']; inbox: User['inbox']; sharedInbox: User['sharedInbox']; }) { const requests = await FollowRequests.find({ - followeeId: user.id + followeeId: user.id, }); for (const request of requests) { diff --git a/packages/backend/src/services/following/requests/accept.ts b/packages/backend/src/services/following/requests/accept.ts index 316a6f1c12..fcda49758e 100644 --- a/packages/backend/src/services/following/requests/accept.ts +++ b/packages/backend/src/services/following/requests/accept.ts @@ -11,7 +11,7 @@ import { IdentifiableError } from '@/misc/identifiable-error'; export default async function(followee: { id: User['id']; host: User['host']; uri: User['host']; inbox: User['inbox']; sharedInbox: User['sharedInbox']; }, follower: User) { const request = await FollowRequests.findOne({ followeeId: followee.id, - followerId: follower.id + followerId: follower.id, }); if (request == null) { @@ -26,6 +26,6 @@ export default async function(followee: { id: User['id']; host: User['host']; ur } Users.pack(followee.id, followee, { - detail: true + detail: true, }).then(packed => publishMainStream(followee.id, 'meUpdated', packed)); } diff --git a/packages/backend/src/services/following/requests/cancel.ts b/packages/backend/src/services/following/requests/cancel.ts index 8895849857..53e54f2a1b 100644 --- a/packages/backend/src/services/following/requests/cancel.ts +++ b/packages/backend/src/services/following/requests/cancel.ts @@ -18,7 +18,7 @@ export default async function(followee: { id: User['id']; host: User['host']; ur const request = await FollowRequests.findOne({ followeeId: followee.id, - followerId: follower.id + followerId: follower.id, }); if (request == null) { @@ -27,10 +27,10 @@ export default async function(followee: { id: User['id']; host: User['host']; ur await FollowRequests.delete({ followeeId: followee.id, - followerId: follower.id + followerId: follower.id, }); Users.pack(followee.id, followee, { - detail: true + detail: true, }).then(packed => publishMainStream(followee.id, 'meUpdated', packed)); } diff --git a/packages/backend/src/services/following/requests/create.ts b/packages/backend/src/services/following/requests/create.ts index 507cb2b7d1..cc1abcce19 100644 --- a/packages/backend/src/services/following/requests/create.ts +++ b/packages/backend/src/services/following/requests/create.ts @@ -19,7 +19,7 @@ export default async function(follower: { id: User['id']; host: User['host']; ur Blockings.findOne({ blockerId: followee.id, blockeeId: follower.id, - }) + }), ]); if (blocking != null) throw new Error('blocking'); @@ -38,7 +38,7 @@ export default async function(follower: { id: User['id']; host: User['host']; ur followerSharedInbox: Users.isRemoteUser(follower) ? follower.sharedInbox : undefined, followeeHost: followee.host, followeeInbox: Users.isRemoteUser(followee) ? followee.inbox : undefined, - followeeSharedInbox: Users.isRemoteUser(followee) ? followee.sharedInbox : undefined + followeeSharedInbox: Users.isRemoteUser(followee) ? followee.sharedInbox : undefined, }); // Publish receiveRequest event @@ -46,13 +46,13 @@ export default async function(follower: { id: User['id']; host: User['host']; ur Users.pack(follower.id, followee).then(packed => publishMainStream(followee.id, 'receiveFollowRequest', packed)); Users.pack(followee.id, followee, { - detail: true + detail: true, }).then(packed => publishMainStream(followee.id, 'meUpdated', packed)); // 通知を作成 createNotification(followee.id, 'receiveFollowRequest', { notifierId: follower.id, - followRequestId: followRequest.id + followRequestId: followRequest.id, }); } diff --git a/packages/backend/src/services/i/pin.ts b/packages/backend/src/services/i/pin.ts index b31beb6e1a..167dfc10c1 100644 --- a/packages/backend/src/services/i/pin.ts +++ b/packages/backend/src/services/i/pin.ts @@ -20,7 +20,7 @@ export async function addPinned(user: { id: User['id']; host: User['host']; }, n // Fetch pinee const note = await Notes.findOne({ id: noteId, - userId: user.id + userId: user.id, }); if (note == null) { @@ -41,7 +41,7 @@ export async function addPinned(user: { id: User['id']; host: User['host']; }, n id: genId(), createdAt: new Date(), userId: user.id, - noteId: note.id + noteId: note.id, } as UserNotePining); // Deliver to remote followers @@ -59,7 +59,7 @@ export async function removePinned(user: { id: User['id']; host: User['host']; } // Fetch unpinee const note = await Notes.findOne({ id: noteId, - userId: user.id + userId: user.id, }); if (note == null) { @@ -68,7 +68,7 @@ export async function removePinned(user: { id: User['id']; host: User['host']; } UserNotePinings.delete({ userId: user.id, - noteId: note.id + noteId: note.id, }); // Deliver to remote followers diff --git a/packages/backend/src/services/insert-moderation-log.ts b/packages/backend/src/services/insert-moderation-log.ts index 00397652ee..affed4095f 100644 --- a/packages/backend/src/services/insert-moderation-log.ts +++ b/packages/backend/src/services/insert-moderation-log.ts @@ -8,6 +8,6 @@ export async function insertModerationLog(moderator: { id: User['id'] }, type: s createdAt: new Date(), userId: moderator.id, type: type, - info: info || {} + info: info || {}, }); } diff --git a/packages/backend/src/services/instance-actor.ts b/packages/backend/src/services/instance-actor.ts index b3625226c3..6f2e32667a 100644 --- a/packages/backend/src/services/instance-actor.ts +++ b/packages/backend/src/services/instance-actor.ts @@ -13,7 +13,7 @@ export async function getInstanceActor(): Promise { const user = await Users.findOne({ host: null, - username: ACTOR_USERNAME + username: ACTOR_USERNAME, }) as ILocalUser | undefined; if (user) { diff --git a/packages/backend/src/services/logger.ts b/packages/backend/src/services/logger.ts index 709b9bae5c..626cc6b44c 100644 --- a/packages/backend/src/services/logger.ts +++ b/packages/backend/src/services/logger.ts @@ -36,7 +36,7 @@ export default class Logger { server: { target: config.syslog.host, port: config.syslog.port, - } + }, }); } } diff --git a/packages/backend/src/services/messages/create.ts b/packages/backend/src/services/messages/create.ts index 948b6726b9..e1bef09a79 100644 --- a/packages/backend/src/services/messages/create.ts +++ b/packages/backend/src/services/messages/create.ts @@ -24,7 +24,7 @@ export async function createMessage(user: { id: User['id']; host: User['host']; userId: user.id, isRead: false, reads: [] as any[], - uri + uri, } as MessagingMessage; await MessagingMessages.insert(message); @@ -96,7 +96,7 @@ export async function createMessage(user: { id: User['id']; host: User['host']; mentionedRemoteUsers: JSON.stringify([ recipientUser ].map(u => ({ uri: u.uri, username: u.username, - host: u.host + host: u.host, }))), } as Note; diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index 8f6c2fe3a5..fb22bd6593 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -65,7 +65,7 @@ class NotificationManager { } else { this.queue.push({ reason: reason, - target: notifiee + target: notifiee, }); } } @@ -74,7 +74,7 @@ class NotificationManager { for (const x of this.queue) { // ミュート情報を取得 const mentioneeMutes = await Mutings.find({ - muterId: x.target + muterId: x.target, }); const mentioneesMutedUserIds = mentioneeMutes.map(m => m.muteeId); @@ -83,7 +83,7 @@ class NotificationManager { if (!mentioneesMutedUserIds.includes(this.notifier.id)) { createNotification(x.target, x.reason, { notifierId: this.notifier.id, - noteId: this.note.id + noteId: this.note.id, }); } } @@ -242,7 +242,7 @@ export default async (user: { id: User['id']; username: User['username']; host: // Word mute // TODO: cache UserProfiles.find({ - enableWordMute: true + enableWordMute: true, }).then(us => { for (const u of us) { checkWordMute(note, { id: u.userId }, u.mutedWords).then(shouldMute => { @@ -450,7 +450,7 @@ function incRenoteCount(renote: Note) { Notes.createQueryBuilder().update() .set({ renoteCount: () => '"renoteCount" + 1', - score: () => '"score" + 1' + score: () => '"score" + 1', }) .where('id = :id', { id: renote.id }) .execute(); @@ -508,7 +508,7 @@ async function insertNote(user: { id: User['id']; host: User['host']; }, data: O uri: u.uri, url: url == null ? undefined : url, username: u.username, - host: u.host + host: u.host, } as IMentionedRemoteUsers[0]; })); } @@ -528,7 +528,7 @@ async function insertNote(user: { id: User['id']; host: User['host']; }, data: O votes: new Array(data.poll!.choices.length).fill(0), noteVisibility: insert.visibility, userId: user.id, - userHost: user.host + userHost: user.host, }); await transactionalEntityManager.insert(Poll, poll); @@ -561,15 +561,15 @@ function index(note: Note) { body: { text: normalizeForSearch(note.text), userId: note.userId, - userHost: note.userHost - } + userHost: note.userHost, + }, }); } async function notifyToWatchersOfRenotee(renote: Note, user: { id: User['id']; }, nm: NotificationManager, type: NotificationType) { const watchers = await NoteWatchings.find({ noteId: renote.id, - userId: Not(user.id) + userId: Not(user.id), }); for (const watcher of watchers) { @@ -580,7 +580,7 @@ async function notifyToWatchersOfRenotee(renote: Note, user: { id: User['id']; } async function notifyToWatchersOfReplyee(reply: Note, user: { id: User['id']; }, nm: NotificationManager) { const watchers = await NoteWatchings.find({ noteId: reply.id, - userId: Not(user.id) + userId: Not(user.id), }); for (const watcher of watchers) { @@ -600,7 +600,7 @@ async function createMentionedEvents(mentionedUsers: User[], note: Note, nm: Not } const detailPackedNote = await Notes.pack(note, u, { - detail: true + detail: true, }); publishMainStream(u.id, 'mention', detailPackedNote); @@ -618,7 +618,7 @@ function incNotesCountOfUser(user: { id: User['id']; }) { Users.createQueryBuilder().update() .set({ updatedAt: new Date(), - notesCount: () => '"notesCount" + 1' + notesCount: () => '"notesCount" + 1', }) .where('id = :id', { id: user.id }) .execute(); diff --git a/packages/backend/src/services/note/delete.ts b/packages/backend/src/services/note/delete.ts index a14d84e7b2..64383ee928 100644 --- a/packages/backend/src/services/note/delete.ts +++ b/packages/backend/src/services/note/delete.ts @@ -31,7 +31,7 @@ export default async function(user: User, note: Note, quiet = false) { if (!quiet) { publishNoteStream(note.id, 'deleted', { - deletedAt: deletedAt + deletedAt: deletedAt, }); //#region ローカルの投稿なら削除アクティビティを配送 @@ -41,7 +41,7 @@ export default async function(user: User, note: Note, quiet = false) { // if deletd note is renote if (note.renoteId && note.text == null && !note.hasPoll && (note.fileIds == null || note.fileIds.length == 0)) { renote = await Notes.findOne({ - id: note.renoteId + id: note.renoteId, }); } @@ -76,7 +76,7 @@ export default async function(user: User, note: Note, quiet = false) { await Notes.delete({ id: note.id, - userId: user.id + userId: user.id, }); } @@ -116,14 +116,14 @@ async function getMentionedRemoteUsers(note: Note) { // renote / quote if (note.renoteUserId) { where.push({ - id: note.renoteUserId + id: note.renoteUserId, }); } if (where.length === 0) return []; return await Users.find({ - where + where, }) as IRemoteUser[]; } diff --git a/packages/backend/src/services/note/polls/vote.ts b/packages/backend/src/services/note/polls/vote.ts index 886a09dde9..25c62f3e3d 100644 --- a/packages/backend/src/services/note/polls/vote.ts +++ b/packages/backend/src/services/note/polls/vote.ts @@ -28,7 +28,7 @@ export default async function(user: User, note: Note, choice: number) { // if already voted const exist = await PollVotes.find({ noteId: note.id, - userId: user.id + userId: user.id, }); if (poll.multiple) { @@ -45,7 +45,7 @@ export default async function(user: User, note: Note, choice: number) { createdAt: new Date(), noteId: note.id, userId: user.id, - choice: choice + choice: choice, }); // Increment votes count @@ -54,14 +54,14 @@ export default async function(user: User, note: Note, choice: number) { publishNoteStream(note.id, 'pollVoted', { choice: choice, - userId: user.id + userId: user.id, }); // Notify createNotification(note.userId, 'pollVote', { notifierId: user.id, noteId: note.id, - choice: choice + choice: choice, }); // Fetch watchers @@ -74,7 +74,7 @@ export default async function(user: User, note: Note, choice: number) { createNotification(watcher.userId, 'pollVote', { notifierId: user.id, noteId: note.id, - choice: choice + choice: choice, }); } }); diff --git a/packages/backend/src/services/note/reaction/create.ts b/packages/backend/src/services/note/reaction/create.ts index 308bd4dff7..e0baa6a096 100644 --- a/packages/backend/src/services/note/reaction/create.ts +++ b/packages/backend/src/services/note/reaction/create.ts @@ -35,7 +35,7 @@ export default async (user: { id: User['id']; host: User['host']; }, note: Note, createdAt: new Date(), noteId: note.id, userId: user.id, - reaction + reaction, }; // Create reaction @@ -66,7 +66,7 @@ export default async (user: { id: User['id']; host: User['host']; }, note: Note, await Notes.createQueryBuilder().update() .set({ reactions: () => sql, - score: () => '"score" + 1' + score: () => '"score" + 1', }) .where('id = :id', { id: note.id }) .execute(); @@ -79,22 +79,22 @@ export default async (user: { id: User['id']; host: User['host']; }, note: Note, let emoji = await Emojis.findOne({ where: { name: decodedReaction.name, - host: decodedReaction.host + host: decodedReaction.host, }, - select: ['name', 'host', 'url'] + select: ['name', 'host', 'url'], }); if (emoji) { emoji = { name: emoji.host ? `${emoji.name}@${emoji.host}` : `${emoji.name}@.`, - url: emoji.url + url: emoji.url, } as any; } publishNoteStream(note.id, 'reacted', { reaction: decodedReaction.reaction, emoji: emoji, - userId: user.id + userId: user.id, }); // リアクションされたユーザーがローカルユーザーなら通知を作成 @@ -102,20 +102,20 @@ export default async (user: { id: User['id']; host: User['host']; }, note: Note, createNotification(note.userId, 'reaction', { notifierId: user.id, noteId: note.id, - reaction: reaction + reaction: reaction, }); } // Fetch watchers NoteWatchings.find({ noteId: note.id, - userId: Not(user.id) + userId: Not(user.id), }).then(watchers => { for (const watcher of watchers) { createNotification(watcher.userId, 'reaction', { notifierId: user.id, noteId: note.id, - reaction: reaction + reaction: reaction, }); } }); diff --git a/packages/backend/src/services/note/reaction/delete.ts b/packages/backend/src/services/note/reaction/delete.ts index 062dbad6f1..21af819532 100644 --- a/packages/backend/src/services/note/reaction/delete.ts +++ b/packages/backend/src/services/note/reaction/delete.ts @@ -40,7 +40,7 @@ export default async (user: { id: User['id']; host: User['host']; }, note: Note) publishNoteStream(note.id, 'unreacted', { reaction: decodeReaction(exist.reaction).reaction, - userId: user.id + userId: user.id, }); //#region 配信 diff --git a/packages/backend/src/services/note/read.ts b/packages/backend/src/services/note/read.ts index f25f86da9c..aaf1c5ed71 100644 --- a/packages/backend/src/services/note/read.ts +++ b/packages/backend/src/services/note/read.ts @@ -22,15 +22,15 @@ export default async function( ) { const following = info?.following ? info.following : new Set((await Followings.find({ where: { - followerId: userId + followerId: userId, }, - select: ['followeeId'] + select: ['followeeId'], })).map(x => x.followeeId)); const followingChannels = info?.followingChannels ? info.followingChannels : new Set((await ChannelFollowings.find({ where: { - followerId: userId + followerId: userId, }, - select: ['followeeId'] + select: ['followeeId'], })).map(x => x.followeeId)); const myAntennas = (await getAntennas()).filter(a => a.userId === userId); @@ -70,7 +70,7 @@ export default async function( NoteUnreads.count({ userId: userId, - isMentioned: true + isMentioned: true, }).then(mentionsCount => { if (mentionsCount === 0) { // 全て既読になったイベントを発行 @@ -80,7 +80,7 @@ export default async function( NoteUnreads.count({ userId: userId, - isSpecified: true + isSpecified: true, }).then(specifiedCount => { if (specifiedCount === 0) { // 全て既読になったイベントを発行 @@ -90,7 +90,7 @@ export default async function( NoteUnreads.count({ userId: userId, - noteChannelId: Not(IsNull()) + noteChannelId: Not(IsNull()), }).then(channelNoteCount => { if (channelNoteCount === 0) { // 全て既読になったイベントを発行 @@ -106,16 +106,16 @@ export default async function( if (readAntennaNotes.length > 0) { await AntennaNotes.update({ antennaId: In(myAntennas.map(a => a.id)), - noteId: In(readAntennaNotes.map(n => n.id)) + noteId: In(readAntennaNotes.map(n => n.id)), }, { - read: true + read: true, }); // TODO: まとめてクエリしたい for (const antenna of myAntennas) { const count = await AntennaNotes.count({ antennaId: antenna.id, - read: false + read: false, }); if (count === 0) { diff --git a/packages/backend/src/services/note/unread.ts b/packages/backend/src/services/note/unread.ts index 29d2b54af8..0b2b5b8d75 100644 --- a/packages/backend/src/services/note/unread.ts +++ b/packages/backend/src/services/note/unread.ts @@ -12,7 +12,7 @@ export async function insertNoteUnread(userId: User['id'], note: Note, params: { //#region ミュートしているなら無視 // TODO: 現在の仕様ではChannelにミュートは適用されないのでよしなにケアする const mute = await Mutings.find({ - muterId: userId + muterId: userId, }); if (mute.map(m => m.muteeId).includes(note.userId)) return; //#endregion diff --git a/packages/backend/src/services/note/unwatch.ts b/packages/backend/src/services/note/unwatch.ts index 8ea02fe33c..befdb2aa77 100644 --- a/packages/backend/src/services/note/unwatch.ts +++ b/packages/backend/src/services/note/unwatch.ts @@ -5,6 +5,6 @@ import { Note } from '@/models/entities/note'; export default async (me: User['id'], note: Note) => { await NoteWatchings.delete({ noteId: note.id, - userId: me + userId: me, }); }; diff --git a/packages/backend/src/services/note/watch.ts b/packages/backend/src/services/note/watch.ts index e457191d99..ebaaf35936 100644 --- a/packages/backend/src/services/note/watch.ts +++ b/packages/backend/src/services/note/watch.ts @@ -15,6 +15,6 @@ export default async (me: User['id'], note: Note) => { createdAt: new Date(), noteId: note.id, userId: me, - noteUserId: note.userId + noteUserId: note.userId, } as NoteWatching); }; diff --git a/packages/backend/src/services/push-notification.ts b/packages/backend/src/services/push-notification.ts index 5949d11b3b..616bc74411 100644 --- a/packages/backend/src/services/push-notification.ts +++ b/packages/backend/src/services/push-notification.ts @@ -19,7 +19,7 @@ export default async function(userId: string, type: notificationType, body: noti // Fetch const subscriptions = await SwSubscriptions.find({ - userId: userId + userId: userId, }); for (const subscription of subscriptions) { @@ -27,14 +27,14 @@ export default async function(userId: string, type: notificationType, body: noti endpoint: subscription.endpoint, keys: { auth: subscription.auth, - p256dh: subscription.publickey - } + p256dh: subscription.publickey, + }, }; push.sendNotification(pushSubscription, JSON.stringify({ - type, body + type, body, }), { - proxy: config.proxy + proxy: config.proxy, }).catch((err: any) => { //swLogger.info(err.statusCode); //swLogger.info(err.headers); @@ -45,7 +45,7 @@ export default async function(userId: string, type: notificationType, body: noti userId: userId, endpoint: subscription.endpoint, auth: subscription.auth, - publickey: subscription.publickey + publickey: subscription.publickey, }); } }); diff --git a/packages/backend/src/services/relay.ts b/packages/backend/src/services/relay.ts index 04775524fa..422da88846 100644 --- a/packages/backend/src/services/relay.ts +++ b/packages/backend/src/services/relay.ts @@ -12,7 +12,7 @@ const ACTOR_USERNAME = 'relay.actor' as const; export async function getRelayActor(): Promise { const user = await Users.findOne({ host: null, - username: ACTOR_USERNAME + username: ACTOR_USERNAME, }); if (user) return user as ILocalUser; @@ -25,7 +25,7 @@ export async function addRelay(inbox: string) { const relay = await Relays.save({ id: genId(), inbox, - status: 'requesting' + status: 'requesting', }); const relayActor = await getRelayActor(); @@ -38,7 +38,7 @@ export async function addRelay(inbox: string) { export async function removeRelay(inbox: string) { const relay = await Relays.findOne({ - inbox + inbox, }); if (relay == null) { @@ -61,7 +61,7 @@ export async function listRelay() { export async function relayAccepted(id: string) { const result = await Relays.update(id, { - status: 'accepted' + status: 'accepted', }); return JSON.stringify(result); @@ -69,7 +69,7 @@ export async function relayAccepted(id: string) { export async function relayRejected(id: string) { const result = await Relays.update(id, { - status: 'rejected' + status: 'rejected', }); return JSON.stringify(result); @@ -79,7 +79,7 @@ export async function deliverToRelays(user: { id: User['id']; host: null; }, act if (activity == null) return; const relays = await Relays.find({ - status: 'accepted' + status: 'accepted', }); if (relays.length === 0) return; diff --git a/packages/backend/src/services/stream.ts b/packages/backend/src/services/stream.ts index 0901857c33..7d11ff3f45 100644 --- a/packages/backend/src/services/stream.ts +++ b/packages/backend/src/services/stream.ts @@ -23,7 +23,7 @@ import { ReversiGameStreamTypes, ReversiStreamTypes, UserListStreamTypes, - UserStreamTypes + UserStreamTypes, } from '@/server/api/stream/types'; import { Packed } from '@/misc/schema'; @@ -35,7 +35,7 @@ class Publisher { redisClient.publish(config.host, JSON.stringify({ channel: channel, - message: message + message: message, })); }; @@ -62,7 +62,7 @@ class Publisher { public publishNoteStream = (noteId: Note['id'], type: K, value?: NoteStreamTypes[K]): void => { this.publish(`noteStream:${noteId}`, type, { id: noteId, - body: value + body: value, }); }; diff --git a/packages/backend/src/services/suspend-user.ts b/packages/backend/src/services/suspend-user.ts index 55be63172f..262c8df5b2 100644 --- a/packages/backend/src/services/suspend-user.ts +++ b/packages/backend/src/services/suspend-user.ts @@ -16,9 +16,9 @@ export async function doPostSuspend(user: { id: User['id']; host: User['host'] } const followings = await Followings.find({ where: [ { followerSharedInbox: Not(IsNull()) }, - { followeeSharedInbox: Not(IsNull()) } + { followeeSharedInbox: Not(IsNull()) }, ], - select: ['followerSharedInbox', 'followeeSharedInbox'] + select: ['followerSharedInbox', 'followeeSharedInbox'], }); const inboxes = followings.map(x => x.followerSharedInbox || x.followeeSharedInbox); diff --git a/packages/backend/src/services/unsuspend-user.ts b/packages/backend/src/services/unsuspend-user.ts index bfffa036e5..04ad65a361 100644 --- a/packages/backend/src/services/unsuspend-user.ts +++ b/packages/backend/src/services/unsuspend-user.ts @@ -17,9 +17,9 @@ export async function doPostUnsuspend(user: User) { const followings = await Followings.find({ where: [ { followerSharedInbox: Not(IsNull()) }, - { followeeSharedInbox: Not(IsNull()) } + { followeeSharedInbox: Not(IsNull()) }, ], - select: ['followerSharedInbox', 'followeeSharedInbox'] + select: ['followerSharedInbox', 'followeeSharedInbox'], }); const inboxes = followings.map(x => x.followerSharedInbox || x.followeeSharedInbox); diff --git a/packages/backend/src/services/user-list/push.ts b/packages/backend/src/services/user-list/push.ts index 29d561b519..2b862ca9cc 100644 --- a/packages/backend/src/services/user-list/push.ts +++ b/packages/backend/src/services/user-list/push.ts @@ -12,7 +12,7 @@ export async function pushUserToUserList(target: User, list: UserList) { id: genId(), createdAt: new Date(), userId: target.id, - userListId: list.id + userListId: list.id, } as UserListJoining); publishUserListStream(list.id, 'userAdded', await Users.pack(target)); diff --git a/packages/backend/src/tools/add-emoji.ts b/packages/backend/src/tools/add-emoji.ts index 6c750bcab0..a3f4b54c7e 100644 --- a/packages/backend/src/tools/add-emoji.ts +++ b/packages/backend/src/tools/add-emoji.ts @@ -13,7 +13,7 @@ async function main(name: string, url: string, alias?: string): Promise { name, url, aliases, - updatedAt: new Date() + updatedAt: new Date(), }); } diff --git a/packages/backend/src/tools/demote-admin.ts b/packages/backend/src/tools/demote-admin.ts index b326c946ef..45e32b513c 100644 --- a/packages/backend/src/tools/demote-admin.ts +++ b/packages/backend/src/tools/demote-admin.ts @@ -9,9 +9,9 @@ async function main(username: string) { const res = await Users.update({ usernameLower: username.toLowerCase(), - host: null + host: null, }, { - isAdmin: false + isAdmin: false, }); if (res.affected !== 1) { diff --git a/packages/backend/src/tools/mark-admin.ts b/packages/backend/src/tools/mark-admin.ts index 0833f22266..88d59518ab 100644 --- a/packages/backend/src/tools/mark-admin.ts +++ b/packages/backend/src/tools/mark-admin.ts @@ -9,9 +9,9 @@ async function main(username: string) { const res = await Users.update({ usernameLower: username.toLowerCase(), - host: null + host: null, }, { - isAdmin: true + isAdmin: true, }); if (res.affected !== 1) { diff --git a/packages/backend/src/tools/show-signin-history.ts b/packages/backend/src/tools/show-signin-history.ts index 1291a1b22f..7db84ece02 100644 --- a/packages/backend/src/tools/show-signin-history.ts +++ b/packages/backend/src/tools/show-signin-history.ts @@ -21,7 +21,7 @@ async function main(username: string, headers?: string[]) { if (user == null) throw new Error('User not found'); const history = await Signins.find({ - userId: user.id + userId: user.id, }); for (const signin of history) { From 980a99b6c904deed9e4aa5a70817a4a0ce439614 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 10 Dec 2021 00:10:10 +0900 Subject: [PATCH 18/43] Update .eslintrc.js --- packages/shared/.eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/shared/.eslintrc.js b/packages/shared/.eslintrc.js index 9eccf3bd58..dbdd148aca 100644 --- a/packages/shared/.eslintrc.js +++ b/packages/shared/.eslintrc.js @@ -60,6 +60,7 @@ module.exports = { '@typescript-eslint/no-inferrable-types': ['warn'], '@typescript-eslint/no-empty-function': ['off'], '@typescript-eslint/no-non-null-assertion': ['warn'], + '@typescript-eslint/explicit-function-return-type': ['warn'], '@typescript-eslint/no-misused-promises': ['error', { 'checksVoidReturn': false, }], From 46c02807647bf61188267bfb05db0eeb53660be8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 10 Dec 2021 01:22:22 +0900 Subject: [PATCH 19/43] refactor(client): :sparkles: --- packages/client/src/components/post-form.vue | 4 ++-- packages/client/src/pages/admin/emojis.vue | 4 ++-- packages/client/src/pages/channel-editor.vue | 2 +- packages/client/src/pages/gallery/edit.vue | 4 ++-- .../src/pages/messaging/messaging-room.form.vue | 2 +- packages/client/src/pages/page-editor/page-editor.vue | 2 +- packages/client/src/pages/room/room.vue | 2 +- packages/client/src/pages/settings/theme.vue | 2 +- packages/client/src/scripts/select-file.ts | 11 ++++++++++- packages/client/src/ui/chat/post-form.vue | 4 ++-- 10 files changed, 23 insertions(+), 14 deletions(-) diff --git a/packages/client/src/components/post-form.vue b/packages/client/src/components/post-form.vue index 9bad9a84f8..4265c575e2 100644 --- a/packages/client/src/components/post-form.vue +++ b/packages/client/src/components/post-form.vue @@ -74,7 +74,7 @@ import { formatTimeString } from '@/scripts/format-time-string'; import { Autocomplete } from '@/scripts/autocomplete'; import { noteVisibilities } from 'misskey-js'; import * as os from '@/os'; -import { selectFile } from '@/scripts/select-file'; +import { selectFiles } from '@/scripts/select-file'; import { defaultStore, notePostInterruptors, postFormActions } from '@/store'; import { throttle } from 'throttle-debounce'; import MkInfo from '@/components/ui/info.vue'; @@ -456,7 +456,7 @@ export default defineComponent({ }, chooseFileFrom(ev) { - selectFile(ev.currentTarget || ev.target, this.$ts.attachFile, true).then(files => { + selectFiles(ev.currentTarget || ev.target, this.$ts.attachFile).then(files => { for (const file of files) { this.files.push(file); } diff --git a/packages/client/src/pages/admin/emojis.vue b/packages/client/src/pages/admin/emojis.vue index 9c9b3b2d4f..a4ac5dcebf 100644 --- a/packages/client/src/pages/admin/emojis.vue +++ b/packages/client/src/pages/admin/emojis.vue @@ -53,7 +53,7 @@ import MkButton from '@/components/ui/button.vue'; import MkInput from '@/components/form/input.vue'; import MkPagination from '@/components/ui/pagination.vue'; import MkTab from '@/components/tab.vue'; -import { selectFile } from '@/scripts/select-file'; +import { selectFiles } from '@/scripts/select-file'; import * as os from '@/os'; import * as symbols from '@/symbols'; @@ -117,7 +117,7 @@ export default defineComponent({ methods: { async add(e) { - const files = await selectFile(e.currentTarget || e.target, null, true); + const files = await selectFiles(e.currentTarget || e.target, null); const promise = Promise.all(files.map(file => os.api('admin/emoji/add', { fileId: file.id, diff --git a/packages/client/src/pages/channel-editor.vue b/packages/client/src/pages/channel-editor.vue index 3843ea9795..67b839bc3d 100644 --- a/packages/client/src/pages/channel-editor.vue +++ b/packages/client/src/pages/channel-editor.vue @@ -112,7 +112,7 @@ export default defineComponent({ }, setBannerImage(e) { - selectFile(e.currentTarget || e.target, null, false).then(file => { + selectFile(e.currentTarget || e.target, null).then(file => { this.bannerId = file.id; }); }, diff --git a/packages/client/src/pages/gallery/edit.vue b/packages/client/src/pages/gallery/edit.vue index 08f31d0db2..caca6aed4b 100644 --- a/packages/client/src/pages/gallery/edit.vue +++ b/packages/client/src/pages/gallery/edit.vue @@ -37,7 +37,7 @@ import FormTuple from '@/components/debobigego/tuple.vue'; import FormBase from '@/components/debobigego/base.vue'; import FormGroup from '@/components/debobigego/group.vue'; import FormSuspense from '@/components/debobigego/suspense.vue'; -import { selectFile } from '@/scripts/select-file'; +import { selectFiles } from '@/scripts/select-file'; import * as os from '@/os'; import * as symbols from '@/symbols'; @@ -95,7 +95,7 @@ export default defineComponent({ methods: { selectFile(e) { - selectFile(e.currentTarget || e.target, null, true).then(files => { + selectFiles(e.currentTarget || e.target, null).then(files => { this.files = this.files.concat(files); }); }, diff --git a/packages/client/src/pages/messaging/messaging-room.form.vue b/packages/client/src/pages/messaging/messaging-room.form.vue index 0ce589f034..8d92c430f1 100644 --- a/packages/client/src/pages/messaging/messaging-room.form.vue +++ b/packages/client/src/pages/messaging/messaging-room.form.vue @@ -152,7 +152,7 @@ export default defineComponent({ }, chooseFile(e) { - selectFile(e.currentTarget || e.target, this.$ts.selectFile, false).then(file => { + selectFile(e.currentTarget || e.target, this.$ts.selectFile).then(file => { this.file = file; }); }, diff --git a/packages/client/src/pages/page-editor/page-editor.vue b/packages/client/src/pages/page-editor/page-editor.vue index 52f6858b0b..fe207555f8 100644 --- a/packages/client/src/pages/page-editor/page-editor.vue +++ b/packages/client/src/pages/page-editor/page-editor.vue @@ -448,7 +448,7 @@ export default defineComponent({ }, setEyeCatchingImage(e) { - selectFile(e.currentTarget || e.target, null, false).then(file => { + selectFile(e.currentTarget || e.target, null).then(file => { this.eyeCatchingImageId = file.id; }); }, diff --git a/packages/client/src/pages/room/room.vue b/packages/client/src/pages/room/room.vue index fa35d7d93e..eb85d39dc4 100644 --- a/packages/client/src/pages/room/room.vue +++ b/packages/client/src/pages/room/room.vue @@ -210,7 +210,7 @@ export default defineComponent({ }, chooseImage(key, e) { - selectFile(e.currentTarget || e.target, null, false).then(file => { + selectFile(e.currentTarget || e.target, null).then(file => { room.updateProp(key, `/proxy/?${urlQuery({ url: file.thumbnailUrl })}`); this.$refs.preview.selected(room.getSelectedObject()); this.changed = true; diff --git a/packages/client/src/pages/settings/theme.vue b/packages/client/src/pages/settings/theme.vue index 2f4daa26c0..357b2ab830 100644 --- a/packages/client/src/pages/settings/theme.vue +++ b/packages/client/src/pages/settings/theme.vue @@ -188,7 +188,7 @@ export default defineComponent({ themesCount, wallpaper, setWallpaper(e) { - selectFile(e.currentTarget || e.target, null, false).then(file => { + selectFile(e.currentTarget || e.target, null).then(file => { wallpaper.value = file.url; }); }, diff --git a/packages/client/src/scripts/select-file.ts b/packages/client/src/scripts/select-file.ts index 0c6bd7ccde..6019890444 100644 --- a/packages/client/src/scripts/select-file.ts +++ b/packages/client/src/scripts/select-file.ts @@ -1,8 +1,9 @@ import * as os from '@/os'; import { i18n } from '@/i18n'; import { defaultStore } from '@/store'; +import { DriveFile } from 'misskey-js/built/entities'; -export function selectFile(src: any, label: string | null, multiple = false) { +function select(src: any, label: string | null, multiple: boolean): Promise { return new Promise((res, rej) => { const chooseFileFromPc = () => { const input = document.createElement('input'); @@ -86,3 +87,11 @@ export function selectFile(src: any, label: string | null, multiple = false) { }], src); }); } + +export function selectFile(src: any, label: string | null = null): Promise { + return select(src, label, false) as Promise; +} + +export function selectFiles(src: any, label: string | null = null): Promise { + return select(src, label, true) as Promise; +} diff --git a/packages/client/src/ui/chat/post-form.vue b/packages/client/src/ui/chat/post-form.vue index e22bedf6bd..8c572e3b1c 100644 --- a/packages/client/src/ui/chat/post-form.vue +++ b/packages/client/src/ui/chat/post-form.vue @@ -59,7 +59,7 @@ import * as Acct from 'misskey-js/built/acct'; import { formatTimeString } from '@/scripts/format-time-string'; import { Autocomplete } from '@/scripts/autocomplete'; import * as os from '@/os'; -import { selectFile } from '@/scripts/select-file'; +import { selectFiles } from '@/scripts/select-file'; import { notePostInterruptors, postFormActions } from '@/store'; import { throttle } from 'throttle-debounce'; @@ -342,7 +342,7 @@ export default defineComponent({ }, chooseFileFrom(ev) { - selectFile(ev.currentTarget || ev.target, this.$ts.attachFile, true).then(files => { + selectFiles(ev.currentTarget || ev.target, this.$ts.attachFile).then(files => { for (const file of files) { this.files.push(file); } From 20134a53678fa0654aa4f1a56aebbef6347f9320 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 10 Dec 2021 01:22:35 +0900 Subject: [PATCH 20/43] feat: improve follow export --- CHANGELOG.md | 2 + locales/ja-JP.yml | 2 + packages/backend/src/queue/index.ts | 4 +- .../queue/processors/db/export-following.ts | 31 +-- packages/backend/src/queue/types.ts | 2 + .../api/endpoints/i/export-following.ts | 13 +- .../src/pages/settings/import-export.vue | 186 +++++++++++------- 7 files changed, 156 insertions(+), 84 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5f505dc2c..777e83ba5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ ### Improvements - Added a user-level instance mute in user settings +- フォローエクスポートでミュートしているユーザーを含めないオプションを追加 +- フォローエクスポートで使われていないアカウントを含めないオプションを追加 ### Bugfixes - クライアント: タッチ機能付きディスプレイを使っていてマウス操作をしている場合に一部機能が動作しない問題を修正 diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 2a8d0bd9e8..469c606930 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1318,6 +1318,8 @@ _exportOrImport: muteList: "ミュート" blockingList: "ブロック" userLists: "リスト" + excludeMutingUsers: "ミュートしているユーザーを除外" + excludeInactiveUsers: "使われていないアカウントを除外" _charts: federationInstancesIncDec: "連合の増減" diff --git a/packages/backend/src/queue/index.ts b/packages/backend/src/queue/index.ts index 199c83cf65..c5a07673bd 100644 --- a/packages/backend/src/queue/index.ts +++ b/packages/backend/src/queue/index.ts @@ -126,9 +126,11 @@ export function createExportNotesJob(user: ThinUser) { }); } -export function createExportFollowingJob(user: ThinUser) { +export function createExportFollowingJob(user: ThinUser, excludeMuting = false, excludeInactive = false) { return dbQueue.add('exportFollowing', { user: user, + excludeMuting, + excludeInactive, }, { removeOnComplete: true, removeOnFail: true, diff --git a/packages/backend/src/queue/processors/db/export-following.ts b/packages/backend/src/queue/processors/db/export-following.ts index 54e3b11372..fbb9e25247 100644 --- a/packages/backend/src/queue/processors/db/export-following.ts +++ b/packages/backend/src/queue/processors/db/export-following.ts @@ -6,13 +6,14 @@ import { queueLogger } from '../../logger'; import addFile from '@/services/drive/add-file'; import * as dateFormat from 'dateformat'; import { getFullApAccount } from '@/misc/convert-host'; -import { Users, Followings } from '@/models/index'; -import { MoreThan } from 'typeorm'; +import { Users, Followings, Mutings } from '@/models/index'; +import { In, MoreThan, Not } from 'typeorm'; import { DbUserJobData } from '@/queue/types'; +import { Following } from '@/models/entities/following'; const logger = queueLogger.createSubLogger('export-following'); -export async function exportFollowing(job: Bull.Job, done: any): Promise { +export async function exportFollowing(job: Bull.Job, done: () => void): Promise { logger.info(`Exporting following of ${job.data.user.id} ...`); const user = await Users.findOne(job.data.user.id); @@ -22,7 +23,7 @@ export async function exportFollowing(job: Bull.Job, done: any): } // Create temp file - const [path, cleanup] = await new Promise<[string, any]>((res, rej) => { + const [path, cleanup] = await new Promise<[string, () => void]>((res, rej) => { tmp.file((e, path, fd, cleanup) => { if (e) return rej(e); res([path, cleanup]); @@ -33,13 +34,17 @@ export async function exportFollowing(job: Bull.Job, done: any): const stream = fs.createWriteStream(path, { flags: 'a' }); - let exportedCount = 0; - let cursor: any = null; + let cursor: Following['id'] | null = null; + + const mutings = job.data.excludeMuting ? await Mutings.find({ + muterId: user.id, + }) : []; while (true) { const followings = await Followings.find({ where: { followerId: user.id, + ...(mutings.length > 0 ? { followeeId: Not(In(mutings.map(x => x.muteeId))) } : {}), ...(cursor ? { id: MoreThan(cursor) } : {}), }, take: 100, @@ -49,7 +54,6 @@ export async function exportFollowing(job: Bull.Job, done: any): }); if (followings.length === 0) { - job.progress(100); break; } @@ -58,7 +62,11 @@ export async function exportFollowing(job: Bull.Job, done: any): for (const following of followings) { const u = await Users.findOne({ id: following.followeeId }); if (u == null) { - exportedCount++; continue; + continue; + } + + if (job.data.excludeInactive && u.updatedAt && (Date.now() - u.updatedAt.getTime() > 1000 * 60 * 60 * 24 * 90)) { + continue; } const content = getFullApAccount(u.username, u.host); @@ -72,14 +80,7 @@ export async function exportFollowing(job: Bull.Job, done: any): } }); }); - exportedCount++; } - - const total = await Followings.count({ - followerId: user.id, - }); - - job.progress(exportedCount / total); } stream.end(); diff --git a/packages/backend/src/queue/types.ts b/packages/backend/src/queue/types.ts index c8c7147152..91036177dc 100644 --- a/packages/backend/src/queue/types.ts +++ b/packages/backend/src/queue/types.ts @@ -21,6 +21,8 @@ export type DbJobData = DbUserJobData | DbUserImportJobData | DbUserDeleteJobDat export type DbUserJobData = { user: ThinUser; + excludeMuting: boolean; + excludeInactive: boolean; }; export type DbUserDeleteJobData = { diff --git a/packages/backend/src/server/api/endpoints/i/export-following.ts b/packages/backend/src/server/api/endpoints/i/export-following.ts index a351161111..15c09941e8 100644 --- a/packages/backend/src/server/api/endpoints/i/export-following.ts +++ b/packages/backend/src/server/api/endpoints/i/export-following.ts @@ -1,3 +1,4 @@ +import $ from 'cafy'; import define from '../../define'; import { createExportFollowingJob } from '@/queue/index'; import ms from 'ms'; @@ -9,8 +10,18 @@ export const meta = { duration: ms('1hour'), max: 1, }, + params: { + excludeMuting: { + validator: $.optional.bool, + default: false, + }, + excludeInactive: { + validator: $.optional.bool, + default: false, + }, + }, }; export default define(meta, async (ps, user) => { - createExportFollowingJob(user); + createExportFollowingJob(user, ps.excludeMuting, ps.excludeInactive); }); diff --git a/packages/client/src/pages/settings/import-export.vue b/packages/client/src/pages/settings/import-export.vue index 5b5b704695..a1dd6a1539 100644 --- a/packages/client/src/pages/settings/import-export.vue +++ b/packages/client/src/pages/settings/import-export.vue @@ -2,106 +2,158 @@
- {{ $ts.export }} + {{ $ts.export }} - {{ $ts.export }} - {{ $ts.import }} + + + {{ $ts._exportOrImport.excludeMutingUsers }} + + + {{ $ts._exportOrImport.excludeInactiveUsers }} + + {{ $ts.export }} + + + {{ $ts.import }} + - {{ $ts.export }} - {{ $ts.import }} + {{ $ts.export }} + {{ $ts.import }} - {{ $ts.export }} - {{ $ts.import }} + {{ $ts.export }} + {{ $ts.import }} - {{ $ts.export }} - {{ $ts.import }} + {{ $ts.export }} + {{ $ts.import }}
From d15c8afcdf6e150769890c8f499e9da0ddcc6984 Mon Sep 17 00:00:00 2001 From: Robin B Date: Fri, 10 Dec 2021 02:05:18 +0100 Subject: [PATCH 21/43] Fix japanese instanceMuteDescription string (#8047) --- locales/ja-JP.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 469c606930..766c7da74f 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1023,7 +1023,7 @@ _wordMute: mutedNotes: "ミュートされたノート" _instanceMute: - instanceMuteDescription: "ミュートしたインスタンスのユーザーからの返信を含めて、設定したインスタンスの全てのノートとRenoteをミュートします。" + instanceMuteDescription: "ミュートしたインスタンスのユーザーへの返信を含めて、設定したインスタンスの全てのノートとRenoteをミュートします。" instanceMuteDescription2: "改行で区切って設定します" title: "設定したインスタンスのノートを隠します。" heading: "ミュートするインスタンス" From d3c7c0ebe3d46b831e3df4e10032230e1c1a7bac Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 10 Dec 2021 10:46:29 +0900 Subject: [PATCH 22/43] client: tweak style --- .../client/src/components/drive-file-thumbnail.vue | 13 +++++++------ packages/client/src/components/drive.file.vue | 2 +- packages/client/src/components/drive.vue | 5 +++-- packages/client/src/pages/drive.vue | 2 ++ packages/client/src/style.scss | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/client/src/components/drive-file-thumbnail.vue b/packages/client/src/components/drive-file-thumbnail.vue index b374ac1cfd..e94b6b8bcb 100644 --- a/packages/client/src/components/drive-file-thumbnail.vue +++ b/packages/client/src/components/drive-file-thumbnail.vue @@ -85,6 +85,10 @@ export default defineComponent({ diff --git a/packages/client/src/components/drive.file.vue b/packages/client/src/components/drive.file.vue index 62fd56d487..511647229e 100644 --- a/packages/client/src/components/drive.file.vue +++ b/packages/client/src/components/drive.file.vue @@ -210,7 +210,7 @@ export default defineComponent({ position: relative; padding: 8px 0 0 0; min-height: 180px; - border-radius: 4px; + border-radius: 8px; &, * { cursor: pointer; diff --git a/packages/client/src/components/drive.vue b/packages/client/src/components/drive.vue index 1e59de7055..46bcd42558 100644 --- a/packages/client/src/components/drive.vue +++ b/packages/client/src/components/drive.vue @@ -657,14 +657,14 @@ export default defineComponent({ > .path { display: inline-block; vertical-align: bottom; - line-height: 38px; + line-height: 50px; white-space: nowrap; > * { display: inline-block; margin: 0; padding: 0 8px; - line-height: 38px; + line-height: 50px; cursor: pointer; * { @@ -699,6 +699,7 @@ export default defineComponent({ > .menu { margin-left: auto; + padding: 0 12px; } } diff --git a/packages/client/src/pages/drive.vue b/packages/client/src/pages/drive.vue index 5d7d3b2f5a..f30000367f 100644 --- a/packages/client/src/pages/drive.vue +++ b/packages/client/src/pages/drive.vue @@ -20,6 +20,8 @@ export default defineComponent({ [symbols.PAGE_INFO]: { title: computed(() => this.folder ? this.folder.name : this.$ts.drive), icon: 'fas fa-cloud', + bg: 'var(--bg)', + hideHeader: true, }, folder: null, }; diff --git a/packages/client/src/style.scss b/packages/client/src/style.scss index eeb8d1e82d..cd866f3da9 100644 --- a/packages/client/src/style.scss +++ b/packages/client/src/style.scss @@ -346,7 +346,7 @@ hr { ._popup { background: var(--popup); border-radius: var(--radius); - contain: layout; // ふき出しがボックスから飛び出て表示されるようなデザインをする場合もあるので paint は contain することができない + contain: contain; } // TODO: 廃止 From 640fc337afad7f4bd44e1121aef297d5ea7725ab Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 10 Dec 2021 11:56:23 +0900 Subject: [PATCH 23/43] client: tweak style --- packages/client/src/pages/settings/index.vue | 130 +++++++++---------- 1 file changed, 64 insertions(+), 66 deletions(-) diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index 2e26870d8b..fe0e03cf68 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -1,23 +1,25 @@ From 0f7241c2c2c74285469d25c0416d43f51a22ccec Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 10 Dec 2021 20:42:01 +0900 Subject: [PATCH 30/43] Update CONTRIBUTING.md --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d9a9e725f7..fe3df853b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,6 +85,11 @@ TODO Misskey uses GitHub Actions for executing automated tests. Configuration files are located in [`/.github/workflows`](/.github/workflows). +## Vue +Misskey uses Vue(v3) as its front-end framework. +**When creating a new component, please use the Composition API instead of the Options API.** +Some of the existing components are implemented in the Options API, but it is an old implementation. Refactors that migrate those components to the Composition API are also welcome. + ## Adding MisskeyRoom items * Use English for material, object and texture names. * Use meter for unit of length. From 48212e7a444b7dc39d8d0549a93c5748ca89d983 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 10 Dec 2021 21:41:37 +0900 Subject: [PATCH 31/43] tweak component --- packages/client/src/pages/admin/emojis.vue | 129 +++++++++++++-------- 1 file changed, 79 insertions(+), 50 deletions(-) diff --git a/packages/client/src/pages/admin/emojis.vue b/packages/client/src/pages/admin/emojis.vue index a4ac5dcebf..49277325a0 100644 --- a/packages/client/src/pages/admin/emojis.vue +++ b/packages/client/src/pages/admin/emojis.vue @@ -1,50 +1,54 @@