diff --git a/CALCKEY.md b/CALCKEY.md index 6121323ece..923cbe6805 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -5,15 +5,14 @@ - Stucture - [DragonflyDB](https://dragonflydb.io/) support as a Redis alternative - Optionally use [ScyllaDB](https://www.scylladb.com/open-source-nosql-database/) for storing notes - - Rewrite backend in Rust and [Axum](https://github.com/tokio-rs/axum) - - Use [Magic ReGeXP](https://regexp.dev/) for ReGeX 🦄 + - Rewrite backend in Rust and [Rocket](https://rocket.rs/) + - Use [Magic RegExP](https://regexp.dev/) for RegEx 🦄 - Function - Federate with note edits - User "choices" (recommended users) like Mastodon and Soapbox - Join Reason system like Mastodon/Pleroma - Option to publicize instance blocks - Build flag to remove NSFW/AI stuff - - Timeline filters - Filter notifications by user - Exclude self from antenna - Form @@ -21,6 +20,7 @@ - Personal notes for all accounts - Fully revamp non-logged-in screen - Classic mode make instance icon bring up new context menu + - Lookup/details for post/file/instance - [Rat mode?](https://stop.voring.me/notes/933fx97bmd) ## Work in progress @@ -34,7 +34,7 @@ - Admin custom CSS - Add back time machine (jump to date) - Improve accesibility -- Non-nyaify cat mode +- Timeline filters ## Implemented @@ -111,9 +111,17 @@ - New dashboard - Backfill follower counts - Improved emoji licensing + - This feature was ported from Misskey. + - https://github.com/misskey-dev/misskey/commit/8ae9d2eaa8b0842671558370f787902e94b7f5a3: enhance: カスタム絵文字にライセンス情報を付与できるように + - https://github.com/misskey-dev/misskey/commit/ed51209172441927d24339f0759a5badbee3c9b6: 絵文字のライセンスを表示できるように - Compile time compression - Sonic search - Popular color schemes, including Nord, Gruvbox, and Catppuccin +- Non-nyaify cat mode + +## Implemented (remote) + + - MissV: [fix Misskey Forkbomb](https://code.vtopia.live/Vtopia/MissV/commit/40b23c070bd4adbb3188c73546c6c625138fb3c1) - [Make showing ads optional](https://github.com/misskey-dev/misskey/pull/8996) - [Tapping avatar in mobile opens account modal](https://github.com/misskey-dev/misskey/pull/9056) @@ -127,32 +135,32 @@ - [Add additional background for acrylic popups if backdrop-filter is unsupported](https://github.com/misskey-dev/misskey/pull/8671) - [Add parameters to MFM rotate](https://github.com/misskey-dev/misskey/pull/8549) - Many changes from [Foundkey](https://akkoma.dev/FoundKeyGang/Foundkey) - - 0ece67b04c3f0365057624c1068808276ccab981: refactor pages/auth.form.vue to composition API - - 0ece67b04c3f0365057624c1068808276ccab981: refactor pages/auth.form.vue to composition API - - 4bc9610d8bf5af736b5e89e4782395705de45d7d: remove unnecessary joins - - 9ee609d70082f7a6dc119a5d83c0e7c5e1208676: enhance privacy of notes - - 0fec6e10477b1c1b95d9469fbaf4e249a3722f12: remove ms dependency - - 46fff77accbe8bf0fd3cc88170d67b997bf2bdc3: client uses new API for child notes depth - - c35372a20d22cddb75e93a0b407f2b652cd7faf0: pack children without detail - - aca724e0bfff3e58b4d273f3ee744e3f3aa9c39b: enable to fetch replies recursively - - 2fe64c11502fd8d89c126558cd715e095c83754e: Refactor components/page/page.textarea.vue to composition API - - 6d3181f9835955e5b79bde5484c74bd70e7f9535: Refactor components/page/page.text.vue to composition API - - b630cd7eacd695bb705e6748c87f38425ec4ed45: refactor: add NoteReactions.packMany - - 3fe351df6d4e21f7748c46adfa6ca165abd030c0: fix: catch errors from packing with detail - - 63591da33e233b2ed0ab331ae6bb3c9eff5020ae: refactor: colours in queue chart - - 0f6d94f1e7e1f58cfbf8d07e5f835f8de626842e: backend: improve mutes and blocks - - e2bf2715a6462ed377b033956d65260157f042ea: fix spelling error - - 09a7eabda137e77f81ab31f65d69329670693c8d: backend: fix lint "no-throw-literal" - - 4fbe2e065e75ed3e5b4dfdfd4be3baa03cc447c3: client: fix lint "quotes" - - 585e4f5c42cfafb6cdf7eb601ab435d6a4d85a96: fix textarea not updating properly - - 30d8bc9259cb6b72ed76d67b21dbb4cdceca8327: refactor: welcome.setup.vue to composition api - - 751921e24f37ed707fe44a40d88eebb1299efa35: make emoji picker case insensitive - - 298febeb9c9501e3e3df16982c08657d1da474e0: enhance: add re-collapsing to quoted notes - - b0fdedb264db87575063abed45e52ad71ce4a6af: fix lints in folder.vue - - 6fed87f85d132304eb84b0a59b84dce299a1822f: fix pagination.vue lints - - Tosti's security fixes - - 384e8c49b738f576ba8843296de6cebf01c1b247: server: allow to like own gallery posts - - 4c5aa9e53887cca5561fcec6ab0754e018f589a5: server: allow to like own pages - - 923c93da1228458dd65be47483c198a1a9191bcf: use await for notes.countBy - - ca90cedba0a0704b503c2778694230f5a7dfbace: server: reduce dead instance detection to 7 days - - e9ab42c10afb4e27516c2d2b5e3e06630efe9edd: Alt text in image viewer + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/0ece67b04c3f0365057624c1068808276ccab981: refactor pages/auth.form.vue to composition API + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/4bc9610d8bf5af736b5e89e4782395705de45d7d: remove unnecessary joins + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/9ee609d70082f7a6dc119a5d83c0e7c5e1208676: enhance privacy of notes + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/0fec6e10477b1c1b95d9469fbaf4e249a3722f12: remove ms dependency + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/46fff77accbe8bf0fd3cc88170d67b997bf2bdc3: client uses new API for child notes depth + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/c35372a20d22cddb75e93a0b407f2b652cd7faf0: pack children without detail + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/aca724e0bfff3e58b4d273f3ee744e3f3aa9c39b: enable to fetch replies recursively + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/2fe64c11502fd8d89c126558cd715e095c83754e: Refactor components/page/page.textarea.vue to composition API + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/6d3181f9835955e5b79bde5484c74bd70e7f9535: Refactor components/page/page.text.vue to composition API + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/b630cd7eacd695bb705e6748c87f38425ec4ed45: refactor: add NoteReactions.packMany + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/3fe351df6d4e21f7748c46adfa6ca165abd030c0: fix: catch errors from packing with detail + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/63591da33e233b2ed0ab331ae6bb3c9eff5020ae: refactor: colours in queue chart + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/0f6d94f1e7e1f58cfbf8d07e5f835f8de626842e: backend: improve mutes and blocks + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/e2bf2715a6462ed377b033956d65260157f042ea: fix spelling error + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/09a7eabda137e77f81ab31f65d69329670693c8d: backend: fix lint "no-throw-literal" + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/4fbe2e065e75ed3e5b4dfdfd4be3baa03cc447c3: client: fix lint "quotes" + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/585e4f5c42cfafb6cdf7eb601ab435d6a4d85a96: fix textarea not updating properly + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/30d8bc9259cb6b72ed76d67b21dbb4cdceca8327: refactor: welcome.setup.vue to composition api + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/751921e24f37ed707fe44a40d88eebb1299efa35: make emoji picker case insensitive + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/298febeb9c9501e3e3df16982c08657d1da474e0: enhance: add re-collapsing to quoted notes + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/b0fdedb264db87575063abed45e52ad71ce4a6af: fix lints in folder.vue + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/6fed87f85d132304eb84b0a59b84dce299a1822f: fix pagination.vue lints + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/384e8c49b738f576ba8843296de6cebf01c1b247: server: allow to like own gallery posts + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/4c5aa9e53887cca5561fcec6ab0754e018f589a5: server: allow to like own pages + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/923c93da1228458dd65be47483c198a1a9191bcf: use await for notes.countBy + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/ca90cedba0a0704b503c2778694230f5a7dfbace: server: reduce dead instance detection to 7 days + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/e9ab42c10afb4e27516c2d2b5e3e06630efe9edd: Alt text in image viewer + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/ed9d4023d41bba7c4ac53a1a3422246feed37de2: add argon2 support + - https://akkoma.dev/FoundKeyGang/FoundKey/commit/c414f24a2c123774246c7eca65edda4d3afaf8b3: feat: per-user renote muting diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f824432e29..7a1fdee31d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,8 +48,8 @@ Thank you for your PR! Before creating a PR, please check the following: - If there is an Issue which will be resolved by this PR, please include a reference to the Issue in the text. Good examples include `Closing: #21` or `Resolves: #21` - Check if there are any documents that need to be created or updated due to this change. - If you have added a feature or fixed a bug, please add a test case if possible. -- Please make sure that tests and Lint are passed in advance. - - You can run it with `pnpm run test` and `pnpm run lint`. [See more info](#testing) +- Please make sure that formatting, tests and Lint are passed in advance. + - You can run it with `pnpm run format`, `pnpm run test` and `pnpm run lint`. [See more info](#testing) - If this PR includes UI changes, please attach a screenshot in the text. Thanks for your cooperation 🤗 diff --git a/Dockerfile b/Dockerfile index 1a1a0aac64..bdf11a9df4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ COPY package.json pnpm*.yaml ./ COPY packages/backend/package.json packages/backend/package.json COPY packages/client/package.json packages/client/package.json COPY packages/sw/package.json packages/sw/package.json +COPY packages/calckey-js/package.json packages/calckey-js/package.json COPY packages/backend/native-utils/package.json packages/backend/native-utils/package.json COPY packages/backend/native-utils/npm/linux-x64-musl/package.json packages/backend/native-utils/npm/linux-x64-musl/package.json COPY packages/backend/native-utils/npm/linux-arm64-musl/package.json packages/backend/native-utils/npm/linux-arm64-musl/package.json @@ -43,6 +44,7 @@ COPY --from=build /calckey/node_modules /calckey/node_modules COPY --from=build /calckey/packages/backend/node_modules /calckey/packages/backend/node_modules COPY --from=build /calckey/packages/sw/node_modules /calckey/packages/sw/node_modules COPY --from=build /calckey/packages/client/node_modules /calckey/packages/client/node_modules +COPY --from=build /calckey/packages/calckey-js/node_modules /calckey/packages/calckey-js/node_modules # Copy the finished compiled files COPY --from=build /calckey/built /calckey/built diff --git a/locales/en-US.yml b/locales/en-US.yml index f4913e9041..fcc8ad0816 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -12,6 +12,7 @@ fetchingAsApObject: "Fetching from the Fediverse" ok: "OK" gotIt: "Got it!" cancel: "Cancel" +noThankYou: "No thank you" enterUsername: "Enter username" renotedBy: "Boosted by {user}" noNotes: "No posts" @@ -120,6 +121,8 @@ unmarkAsSensitive: "Unmark as NSFW" enterFileName: "Enter filename" mute: "Mute" unmute: "Unmute" +renoteMute: "Mute boosts" +renoteUnmute: "Unmute boosts" block: "Block" unblock: "Unblock" suspend: "Suspend" @@ -162,7 +165,7 @@ removeWallpaper: "Remove wallpaper" searchWith: "Search: {q}" youHaveNoLists: "You don't have any lists" followConfirm: "Are you sure that you want to follow {name}?" -proxyAccount: "Proxy account" +proxyAccount: "Proxy Account" proxyAccountDescription: "A proxy account is an account that acts as a remote follower for users under certain conditions. For example, when a user adds a remote user to the list, the remote user's activity will not be delivered to the instance if no local user is following that user, so the proxy account will follow instead." host: "Host" selectUser: "Select a user" @@ -200,6 +203,8 @@ clearCachedFiles: "Clear cache" clearCachedFilesConfirm: "Are you sure that you want to delete all cached remote files?" blockedInstances: "Blocked Instances" blockedInstancesDescription: "List the hostnames of the instances that you want to block. Listed instances will no longer be able to communicate with this instance." +hiddenTags: "Hidden Hashtags" +hiddenTagsDescription: "List the hashtags (without the #) of the hashtags you wish to hide from trending and explore. Hidden hashtags are still discoverable via other means." muteAndBlock: "Mutes and Blocks" mutedUsers: "Muted users" blockedUsers: "Blocked users" @@ -611,6 +616,7 @@ regexpError: "Regular Expression error" regexpErrorDescription: "An error occurred in the regular expression on line {line} of your {tab} word mutes:" instanceMute: "Instance Mutes" userSaysSomething: "{name} said something" +userSaysSomethingReason: "{name} said {reason}" makeActive: "Activate" display: "Display" copy: "Copy" @@ -916,6 +922,13 @@ navbar: "Navigation bar" shuffle: "Shuffle" account: "Account" move: "Move" +pushNotification: "Push notifications" +subscribePushNotification: "Enable push notifications" +unsubscribePushNotification: "Disable push notifications" +pushNotificationAlreadySubscribed: "Push notifications are already enabled" +pushNotificationNotSupported: "Your browser or instance does not support push notifications" +sendPushNotificationReadMessage: "Delete push notifications once the relevant notifications or messages have been read" +sendPushNotificationReadMessageCaption: "A notification containing the text \"{emptyPushNotificationMessage}\" will be displayed for a short time. This may increase the battery usage of your device, if applicable." showAds: "Show ads" enterSendsMessage: "Press Return in Messaging to send message (off is Ctrl + Return)" adminCustomCssWarn: "This setting should only be used if you know what it does. Entering improper values may cause EVERYONE'S clients to stop functioning normally. Please ensure your CSS works properly by testing it in your user settings." @@ -944,12 +957,13 @@ moveFromDescription: "This will set an alias of your old account so that you can migrationConfirm: "Are you absolutely sure you want to migrate your acccount to {account}? Once you do this, you won't be able to reverse it, and you won't be able to use your account normally again.\nAlso, please ensure that you've set this current account as the account you're moving from." defaultReaction: "Default emoji reaction for outgoing and incoming posts" license: "License" -indexPosts: "Index posts" +indexPosts: "Index Posts" indexFrom: "Index from Post ID onwards (leave blank to index every post)" indexNotice: "Now indexing. This will probably take a while, please don't restart your server for at least an hour." -customKaTeXMacro: "Custom KaTeX Macro" +customKaTeXMacro: "Custom KaTeX macros" customKaTeXMacroDescription: "Set up macros to write mathematical expressions easily! The notation conforms to the LaTeX command definitions and is written as \\newcommand{\\name}{content} or \\newcommand{\\name}[number of arguments]{content}. For example, \\newcommand{\\add}[2]{#1 + #2} will expand \\add{3}{foo} to 3 + foo. The curly brackets surrounding the macro name can be changed to round or square brackets. This affects the brackets used for arguments. One (and only one) macro can be defined per line, and you can't break the line in the middle of the definition. Invalid lines are simply ignored. Only simple string substitution functions are supported; advanced syntax, such as conditional branching, cannot be used here." -enableCustomKaTeXMacro: "Enable custom KaTeX macro" +enableCustomKaTeXMacro: "Enable custom KaTeX macros" +noteId: "Post ID" _sensitiveMediaDetection: description: "Reduces the effort of server moderation through automatically recognizing NSFW media via Machine Learning. This will slightly increase the load on the server." diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 64d804928e..0f1c700fd8 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -12,6 +12,7 @@ fetchingAsApObject: "連合宇宙から取得中" ok: "OK" gotIt: "わかった!" cancel: "キャンセル" +noThankYou: "やめておく" enterUsername: "ユーザー名を入力" renotedBy: "{user}がブースト" noNotes: "投稿はありません" @@ -120,6 +121,8 @@ unmarkAsSensitive: "閲覧注意を解除する" enterFileName: "ファイル名を入力" mute: "ミュート" unmute: "ミュート解除" +renoteMute: "ブーストをミュート" +renoteUnmute: "ブーストのミュートを解除" block: "ブロック" unblock: "ブロック解除" suspend: "凍結" @@ -611,6 +614,7 @@ regexpError: "正規表現エラー" regexpErrorDescription: "{tab}ワードミュートの{line}行目の正規表現にエラーが発生しました:" instanceMute: "インスタンスミュート" userSaysSomething: "{name}が何かを言いました" +userSaysSomethingReason: "{name}が{reason}と言いました" makeActive: "アクティブにする" display: "表示" copy: "コピー" @@ -918,6 +922,13 @@ navbar: "ナビゲーションバー" shuffle: "シャッフル" account: "アカウント" move: "移動" +pushNotification: "プッシュ通知" +subscribePushNotification: "プッシュ通知を有効化" +unsubscribePushNotification: "プッシュ通知を停止する" +pushNotificationAlreadySubscribed: "プッシュ通知は有効です" +pushNotificationNotSupported: "ブラウザかサーバーがプッシュ通知に非対応" +sendPushNotificationReadMessage: "通知やメッセージが既読になったらプッシュ通知を削除する" +sendPushNotificationReadMessageCaption: "「{emptyPushNotificationMessage}」という通知が一瞬表示されるようになります。端末の電池消費量が増加する可能性があります。" adminCustomCssWarn: "この設定は、それが何をするものであるかを知っている場合のみ使用してください。不適切な値を入力すると、クライアントが正常に動作しなくなる可能性があります。ユーザー設定でCSSをテストし、正しく動作することを確認してください。" customMOTD: "カスタムMOTD(スプラッシュスクリーンメッセージ)" customMOTDDescription: "ユーザがページをロード/リロードするたびにランダムに表示される、改行で区切られたMOTD(スプラッシュスクリーン)用のカスタムメッセージ" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index aa2700c570..e891e3d886 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -1,5 +1,5 @@ --- -_lang_: "中文(简体)" +_lang_: "简体中文" headlineMisskey: "通过帖子连接在一起的网络" introMisskey: "欢迎!Misskey是一个开源的、去中心化的“微博客”服务。\n通过编写「帖文」来和大家分享你的以及你周围的事情吧!📡\n通过「回应」功能,可以让你快速地对大家的帖文表达反馈👍\n来探索新的世界吧!🚀" monthAndDay: "{month}月 {day}日" @@ -116,6 +116,8 @@ unmarkAsSensitive: "取消标记为敏感内容" enterFileName: "请输入文件名" mute: "屏蔽" unmute: "解除屏蔽" +renoteMute: "屏蔽转帖" +renoteUnmute: "解除屏蔽转帖" block: "拉黑" unblock: "取消拉黑" suspend: "冻结" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index 46be6f8e1c..4471444e98 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -116,6 +116,8 @@ unmarkAsSensitive: "取消標記為敏感內容" enterFileName: "請輸入檔案名稱" mute: "靜音" unmute: "解除靜音" +renoteMute: "靜音轉發貼文" +renoteUnmute: "解除靜音轉發貼文" block: "封鎖" unblock: "解除封鎖" suspend: "凍結" diff --git a/package.json b/package.json index aafdd7beab..b00a50d2f9 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "calckey", - "version": "13.2.0-beta5", + "version": "13.2.0-beta6", "codename": "aqua", "repository": { "type": "git", "url": "https://codeberg.org/calckey/calckey.git" }, - "packageManager": "pnpm@8.1.0", + "packageManager": "pnpm@8.2.0", "private": true, "scripts": { "rebuild": "pnpm run clean && pnpm -r run build && pnpm run gulp", @@ -27,7 +27,7 @@ "e2e": "start-server-and-test start:test http://localhost:61812 cy:run", "mocha": "pnpm --filter backend run mocha", "test": "pnpm run mocha", - "format": "gulp format", + "format": "pnpm rome format packages/**/* --write && pnpm --filter client run format", "clean": "pnpm node ./scripts/clean.js", "clean-all": "pnpm node ./scripts/clean-all.js", "cleanall": "pnpm run clean-all" @@ -40,7 +40,6 @@ "@bull-board/ui": "^4.10.2", "@napi-rs/cli": "^2.15.0", "@tensorflow/tfjs": "^3.21.0", - "calckey-js": "^0.0.22", "js-yaml": "4.1.0", "seedrandom": "^3.0.5" }, diff --git a/packages/backend/check_connect.js b/packages/backend/check_connect.js index 8bf134a105..7c1e716b3e 100644 --- a/packages/backend/check_connect.js +++ b/packages/backend/check_connect.js @@ -1,10 +1,10 @@ -import {loadConfig} from './built/config.js'; -import {createRedisConnection} from "./built/redis.js"; +import { loadConfig } from "./built/config.js"; +import { createRedisConnection } from "./built/redis.js"; const config = loadConfig(); const redis = createRedisConnection(config); -redis.on('connect', () => redis.disconnect()); -redis.on('error', (e) => { - throw e; +redis.on("connect", () => redis.disconnect()); +redis.on("error", (e) => { + throw e; }); diff --git a/packages/backend/migration/1000000000000-Init.js b/packages/backend/migration/1000000000000-Init.js index 1140be7e84..c07500e358 100644 --- a/packages/backend/migration/1000000000000-Init.js +++ b/packages/backend/migration/1000000000000-Init.js @@ -1,482 +1,1068 @@ - - export class Init1000000000000 { - async up(queryRunner) { - await queryRunner.query(`CREATE TYPE "log_level_enum" AS ENUM('error', 'warning', 'info', 'success', 'debug')`); - await queryRunner.query(`CREATE TABLE "log" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "domain" character varying(64) array NOT NULL DEFAULT '{}'::varchar[], "level" "log_level_enum" NOT NULL, "worker" character varying(8) NOT NULL, "machine" character varying(128) NOT NULL, "message" character varying(1024) NOT NULL, "data" jsonb NOT NULL DEFAULT '{}', CONSTRAINT "PK_350604cbdf991d5930d9e618fbd" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_8e4eb51a35d81b64dda28eed0a" ON "log" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_8cb40cfc8f3c28261e6f887b03" ON "log" ("domain") `); - await queryRunner.query(`CREATE INDEX "IDX_584b536b49e53ac81beb39a177" ON "log" ("level") `); - await queryRunner.query(`CREATE TABLE "drive_folder" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "name" character varying(128) NOT NULL, "userId" character varying(32), "parentId" character varying(32), CONSTRAINT "PK_7a0c089191f5ebdc214e0af808a" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_02878d441ceae15ce060b73daf" ON "drive_folder" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_f4fc06e49c0171c85f1c48060d" ON "drive_folder" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_00ceffb0cdc238b3233294f08f" ON "drive_folder" ("parentId") `); - await queryRunner.query(`CREATE TABLE "drive_file" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32), "userHost" character varying(128), "md5" character varying(32) NOT NULL, "name" character varying(256) NOT NULL, "type" character varying(128) NOT NULL, "size" integer NOT NULL, "comment" character varying(512), "properties" jsonb NOT NULL DEFAULT '{}', "storedInternal" boolean NOT NULL, "url" character varying(512) NOT NULL, "thumbnailUrl" character varying(512), "webpublicUrl" character varying(512), "accessKey" character varying(256), "thumbnailAccessKey" character varying(256), "webpublicAccessKey" character varying(256), "uri" character varying(512), "src" character varying(512), "folderId" character varying(32), "isSensitive" boolean NOT NULL DEFAULT false, "isLink" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_43ddaaaf18c9e68029b7cbb032e" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_c8dfad3b72196dd1d6b5db168a" ON "drive_file" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_860fa6f6c7df5bb887249fba22" ON "drive_file" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_92779627994ac79277f070c91e" ON "drive_file" ("userHost") `); - await queryRunner.query(`CREATE INDEX "IDX_37bb9a1b4585f8a3beb24c62d6" ON "drive_file" ("md5") `); - await queryRunner.query(`CREATE INDEX "IDX_a40b8df8c989d7db937ea27cf6" ON "drive_file" ("type") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_d85a184c2540d2deba33daf642" ON "drive_file" ("accessKey") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_e74022ce9a074b3866f70e0d27" ON "drive_file" ("thumbnailAccessKey") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_c55b2b7c284d9fef98026fc88e" ON "drive_file" ("webpublicAccessKey") `); - await queryRunner.query(`CREATE INDEX "IDX_e5848eac4940934e23dbc17581" ON "drive_file" ("uri") `); - await queryRunner.query(`CREATE INDEX "IDX_bb90d1956dafc4068c28aa7560" ON "drive_file" ("folderId") `); - await queryRunner.query(`CREATE TABLE "user" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE, "lastFetchedAt" TIMESTAMP WITH TIME ZONE, "username" character varying(128) NOT NULL, "usernameLower" character varying(128) NOT NULL, "name" character varying(128), "followersCount" integer NOT NULL DEFAULT 0, "followingCount" integer NOT NULL DEFAULT 0, "notesCount" integer NOT NULL DEFAULT 0, "avatarId" character varying(32), "bannerId" character varying(32), "tags" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "avatarUrl" character varying(512), "bannerUrl" character varying(512), "avatarColor" character varying(32), "bannerColor" character varying(32), "isSuspended" boolean NOT NULL DEFAULT false, "isSilenced" boolean NOT NULL DEFAULT false, "isLocked" boolean NOT NULL DEFAULT false, "isBot" boolean NOT NULL DEFAULT false, "isCat" boolean NOT NULL DEFAULT false, "isAdmin" boolean NOT NULL DEFAULT false, "isModerator" boolean NOT NULL DEFAULT false, "isVerified" boolean NOT NULL DEFAULT false, "emojis" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "host" character varying(128), "inbox" character varying(512), "sharedInbox" character varying(512), "featured" character varying(512), "uri" character varying(512), "token" character(16), CONSTRAINT "UQ_a854e557b1b14814750c7c7b0c9" UNIQUE ("token"), CONSTRAINT "REL_58f5c71eaab331645112cf8cfa" UNIQUE ("avatarId"), CONSTRAINT "REL_afc64b53f8db3707ceb34eb28e" UNIQUE ("bannerId"), CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_e11e649824a45d8ed01d597fd9" ON "user" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_80ca6e6ef65fb9ef34ea8c90f4" ON "user" ("updatedAt") `); - await queryRunner.query(`CREATE INDEX "IDX_a27b942a0d6dcff90e3ee9b5e8" ON "user" ("usernameLower") `); - await queryRunner.query(`CREATE INDEX "IDX_fa99d777623947a5b05f394cae" ON "user" ("tags") `); - await queryRunner.query(`CREATE INDEX "IDX_3252a5df8d5bbd16b281f7799e" ON "user" ("host") `); - await queryRunner.query(`CREATE INDEX "IDX_be623adaa4c566baf5d29ce0c8" ON "user" ("uri") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a854e557b1b14814750c7c7b0c" ON "user" ("token") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_5deb01ae162d1d70b80d064c27" ON "user" ("usernameLower", "host") `); - await queryRunner.query(`CREATE TABLE "app" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32), "secret" character varying(64) NOT NULL, "name" character varying(128) NOT NULL, "description" character varying(512) NOT NULL, "permission" character varying(64) array NOT NULL, "callbackUrl" character varying(512), CONSTRAINT "PK_9478629fc093d229df09e560aea" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_048a757923ed8b157e9895da53" ON "app" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_3f5b0899ef90527a3462d7c2cb" ON "app" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_f49922d511d666848f250663c4" ON "app" ("secret") `); - await queryRunner.query(`CREATE TABLE "access_token" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "token" character varying(128) NOT NULL, "hash" character varying(128) NOT NULL, "userId" character varying(32) NOT NULL, "appId" character varying(32) NOT NULL, CONSTRAINT "PK_f20f028607b2603deabd8182d12" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_70ba8f6af34bc924fc9e12adb8" ON "access_token" ("token") `); - await queryRunner.query(`CREATE INDEX "IDX_64c327441248bae40f7d92f34f" ON "access_token" ("hash") `); - await queryRunner.query(`CREATE INDEX "IDX_9949557d0e1b2c19e5344c171e" ON "access_token" ("userId") `); - await queryRunner.query(`CREATE TYPE "note_visibility_enum" AS ENUM('public', 'home', 'followers', 'specified')`); - await queryRunner.query(`CREATE TABLE "note" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "replyId" character varying(32), "renoteId" character varying(32), "text" text, "name" character varying(256), "cw" character varying(512), "appId" character varying(32), "userId" character varying(32) NOT NULL, "viaMobile" boolean NOT NULL DEFAULT false, "localOnly" boolean NOT NULL DEFAULT false, "renoteCount" smallint NOT NULL DEFAULT 0, "repliesCount" smallint NOT NULL DEFAULT 0, "reactions" jsonb NOT NULL DEFAULT '{}', "visibility" "note_visibility_enum" NOT NULL, "uri" character varying(512), "score" integer NOT NULL DEFAULT 0, "fileIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], "attachedFileTypes" character varying(256) array NOT NULL DEFAULT '{}'::varchar[], "visibleUserIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], "mentions" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], "mentionedRemoteUsers" text NOT NULL DEFAULT '[]', "emojis" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "tags" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "hasPoll" boolean NOT NULL DEFAULT false, "geo" jsonb DEFAULT null, "userHost" character varying(128), "replyUserId" character varying(32), "replyUserHost" character varying(128), "renoteUserId" character varying(32), "renoteUserHost" character varying(128), CONSTRAINT "PK_96d0c172a4fba276b1bbed43058" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_e7c0567f5261063592f022e9b5" ON "note" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_17cb3553c700a4985dff5a30ff" ON "note" ("replyId") `); - await queryRunner.query(`CREATE INDEX "IDX_52ccc804d7c69037d558bac4c9" ON "note" ("renoteId") `); - await queryRunner.query(`CREATE INDEX "IDX_5b87d9d19127bd5d92026017a7" ON "note" ("userId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_153536c67d05e9adb24e99fc2b" ON "note" ("uri") `); - await queryRunner.query(`CREATE INDEX "IDX_51c063b6a133a9cb87145450f5" ON "note" ("fileIds") `); - await queryRunner.query(`CREATE INDEX "IDX_25dfc71b0369b003a4cd434d0b" ON "note" ("attachedFileTypes") `); - await queryRunner.query(`CREATE INDEX "IDX_796a8c03959361f97dc2be1d5c" ON "note" ("visibleUserIds") `); - await queryRunner.query(`CREATE INDEX "IDX_54ebcb6d27222913b908d56fd8" ON "note" ("mentions") `); - await queryRunner.query(`CREATE INDEX "IDX_88937d94d7443d9a99a76fa5c0" ON "note" ("tags") `); - await queryRunner.query(`CREATE INDEX "IDX_7125a826ab192eb27e11d358a5" ON "note" ("userHost") `); - await queryRunner.query(`CREATE TABLE "poll_vote" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "choice" integer NOT NULL, CONSTRAINT "PK_fd002d371201c472490ba89c6a0" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_0fb627e1c2f753262a74f0562d" ON "poll_vote" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_66d2bd2ee31d14bcc23069a89f" ON "poll_vote" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_aecfbd5ef60374918e63ee95fa" ON "poll_vote" ("noteId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_50bd7164c5b78f1f4a42c4d21f" ON "poll_vote" ("userId", "noteId", "choice") `); - await queryRunner.query(`CREATE TABLE "note_reaction" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "reaction" character varying(128) NOT NULL, CONSTRAINT "PK_767ec729b108799b587a3fcc9cf" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_01f4581f114e0ebd2bbb876f0b" ON "note_reaction" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_13761f64257f40c5636d0ff95e" ON "note_reaction" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_45145e4953780f3cd5656f0ea6" ON "note_reaction" ("noteId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_ad0c221b25672daf2df320a817" ON "note_reaction" ("userId", "noteId") `); - await queryRunner.query(`CREATE TABLE "note_watching" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "noteUserId" character varying(32) NOT NULL, CONSTRAINT "PK_49286fdb23725945a74aa27d757" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_318cdf42a9cfc11f479bd802bb" ON "note_watching" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_b0134ec406e8d09a540f818288" ON "note_watching" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_03e7028ab8388a3f5e3ce2a861" ON "note_watching" ("noteId") `); - await queryRunner.query(`CREATE INDEX "IDX_44499765eec6b5489d72c4253b" ON "note_watching" ("noteUserId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a42c93c69989ce1d09959df4cf" ON "note_watching" ("userId", "noteId") `); - await queryRunner.query(`CREATE TABLE "note_unread" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "noteUserId" character varying(32) NOT NULL, "isSpecified" boolean NOT NULL, CONSTRAINT "PK_1904eda61a784f57e6e51fa9c1f" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_56b0166d34ddae49d8ef7610bb" ON "note_unread" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_e637cba4dc4410218c4251260e" ON "note_unread" ("noteId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_d908433a4953cc13216cd9c274" ON "note_unread" ("userId", "noteId") `); - await queryRunner.query(`CREATE TABLE "notification" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "notifieeId" character varying(32) NOT NULL, "notifierId" character varying(32) NOT NULL, "type" character varying(32) NOT NULL, "isRead" boolean NOT NULL DEFAULT false, "noteId" character varying(32), "reaction" character varying(128), "choice" integer, CONSTRAINT "PK_705b6c7cdf9b2c2ff7ac7872cb7" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_b11a5e627c41d4dc3170f1d370" ON "notification" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_3c601b70a1066d2c8b517094cb" ON "notification" ("notifieeId") `); - await queryRunner.query(`CREATE TABLE "meta" ("id" character varying(32) NOT NULL, "name" character varying(128), "description" character varying(1024), "maintainerName" character varying(128), "maintainerEmail" character varying(128), "announcements" jsonb NOT NULL DEFAULT '[]', "disableRegistration" boolean NOT NULL DEFAULT false, "disableLocalTimeline" boolean NOT NULL DEFAULT false, "disableGlobalTimeline" boolean NOT NULL DEFAULT false, "enableEmojiReaction" boolean NOT NULL DEFAULT true, "useStarForReactionFallback" boolean NOT NULL DEFAULT false, "langs" character varying(64) array NOT NULL DEFAULT '{}'::varchar[], "hiddenTags" character varying(256) array NOT NULL DEFAULT '{}'::varchar[], "blockedHosts" character varying(256) array NOT NULL DEFAULT '{}'::varchar[], "mascotImageUrl" character varying(512) DEFAULT '/assets/ai.png', "bannerUrl" character varying(512), "errorImageUrl" character varying(512) DEFAULT 'https://xn--931a.moe/aiart/yubitun.png', "iconUrl" character varying(512), "cacheRemoteFiles" boolean NOT NULL DEFAULT true, "proxyAccount" character varying(128), "enableRecaptcha" boolean NOT NULL DEFAULT false, "recaptchaSiteKey" character varying(64), "recaptchaSecretKey" character varying(64), "localDriveCapacityMb" integer NOT NULL DEFAULT 1024, "remoteDriveCapacityMb" integer NOT NULL DEFAULT 32, "maxNoteTextLength" integer NOT NULL DEFAULT 500, "summalyProxy" character varying(128), "enableEmail" boolean NOT NULL DEFAULT false, "email" character varying(128), "smtpSecure" boolean NOT NULL DEFAULT false, "smtpHost" character varying(128), "smtpPort" integer, "smtpUser" character varying(128), "smtpPass" character varying(128), "enableServiceWorker" boolean NOT NULL DEFAULT false, "swPublicKey" character varying(128), "swPrivateKey" character varying(128), "enableTwitterIntegration" boolean NOT NULL DEFAULT false, "twitterConsumerKey" character varying(128), "twitterConsumerSecret" character varying(128), "enableGithubIntegration" boolean NOT NULL DEFAULT false, "githubClientId" character varying(128), "githubClientSecret" character varying(128), "enableDiscordIntegration" boolean NOT NULL DEFAULT false, "discordClientId" character varying(128), "discordClientSecret" character varying(128), CONSTRAINT "PK_c4c17a6c2bd7651338b60fc590b" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TABLE "following" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "followeeId" character varying(32) NOT NULL, "followerId" character varying(32) NOT NULL, "followerHost" character varying(128), "followerInbox" character varying(512), "followerSharedInbox" character varying(512), "followeeHost" character varying(128), "followeeInbox" character varying(512), "followeeSharedInbox" character varying(512), CONSTRAINT "PK_c76c6e044bdf76ecf8bfb82a645" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_582f8fab771a9040a12961f3e7" ON "following" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_24e0042143a18157b234df186c" ON "following" ("followeeId") `); - await queryRunner.query(`CREATE INDEX "IDX_6516c5a6f3c015b4eed39978be" ON "following" ("followerId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_307be5f1d1252e0388662acb96" ON "following" ("followerId", "followeeId") `); - await queryRunner.query(`CREATE TABLE "instance" ("id" character varying(32) NOT NULL, "caughtAt" TIMESTAMP WITH TIME ZONE NOT NULL, "host" character varying(128) NOT NULL, "system" character varying(64), "usersCount" integer NOT NULL DEFAULT 0, "notesCount" integer NOT NULL DEFAULT 0, "followingCount" integer NOT NULL DEFAULT 0, "followersCount" integer NOT NULL DEFAULT 0, "driveUsage" integer NOT NULL DEFAULT 0, "driveFiles" integer NOT NULL DEFAULT 0, "latestRequestSentAt" TIMESTAMP WITH TIME ZONE, "latestStatus" integer, "latestRequestReceivedAt" TIMESTAMP WITH TIME ZONE, "lastCommunicatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "isNotResponding" boolean NOT NULL DEFAULT false, "isMarkedAsClosed" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_eaf60e4a0c399c9935413e06474" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_2cd3b2a6b4cf0b910b260afe08" ON "instance" ("caughtAt") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_8d5afc98982185799b160e10eb" ON "instance" ("host") `); - await queryRunner.query(`CREATE TABLE "muting" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "muteeId" character varying(32) NOT NULL, "muterId" character varying(32) NOT NULL, CONSTRAINT "PK_2e92d06c8b5c602eeb27ca9ba48" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_f86d57fbca33c7a4e6897490cc" ON "muting" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_ec96b4fed9dae517e0dbbe0675" ON "muting" ("muteeId") `); - await queryRunner.query(`CREATE INDEX "IDX_93060675b4a79a577f31d260c6" ON "muting" ("muterId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_1eb9d9824a630321a29fd3b290" ON "muting" ("muterId", "muteeId") `); - await queryRunner.query(`CREATE TABLE "sw_subscription" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "endpoint" character varying(512) NOT NULL, "auth" character varying(256) NOT NULL, "publickey" character varying(128) NOT NULL, CONSTRAINT "PK_e8f763631530051b95eb6279b91" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_97754ca6f2baff9b4abb7f853d" ON "sw_subscription" ("userId") `); - await queryRunner.query(`CREATE TABLE "blocking" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "blockeeId" character varying(32) NOT NULL, "blockerId" character varying(32) NOT NULL, CONSTRAINT "PK_e5d9a541cc1965ee7e048ea09dd" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_b9a354f7941c1e779f3b33aea6" ON "blocking" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_2cd4a2743a99671308f5417759" ON "blocking" ("blockeeId") `); - await queryRunner.query(`CREATE INDEX "IDX_0627125f1a8a42c9a1929edb55" ON "blocking" ("blockerId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_98a1bc5cb30dfd159de056549f" ON "blocking" ("blockerId", "blockeeId") `); - await queryRunner.query(`CREATE TABLE "user_list" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, CONSTRAINT "PK_87bab75775fd9b1ff822b656402" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_b7fcefbdd1c18dce86687531f9" ON "user_list" ("userId") `); - await queryRunner.query(`CREATE TABLE "user_list_joining" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "userListId" character varying(32) NOT NULL, CONSTRAINT "PK_11abb3768da1c5f8de101c9df45" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_d844bfc6f3f523a05189076efa" ON "user_list_joining" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_605472305f26818cc93d1baaa7" ON "user_list_joining" ("userListId") `); - await queryRunner.query(`CREATE TABLE "hashtag" ("id" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "mentionedUserIds" character varying(32) array NOT NULL, "mentionedUsersCount" integer NOT NULL DEFAULT 0, "mentionedLocalUserIds" character varying(32) array NOT NULL, "mentionedLocalUsersCount" integer NOT NULL DEFAULT 0, "mentionedRemoteUserIds" character varying(32) array NOT NULL, "mentionedRemoteUsersCount" integer NOT NULL DEFAULT 0, "attachedUserIds" character varying(32) array NOT NULL, "attachedUsersCount" integer NOT NULL DEFAULT 0, "attachedLocalUserIds" character varying(32) array NOT NULL, "attachedLocalUsersCount" integer NOT NULL DEFAULT 0, "attachedRemoteUserIds" character varying(32) array NOT NULL, "attachedRemoteUsersCount" integer NOT NULL DEFAULT 0, CONSTRAINT "PK_cb36eb8af8412bfa978f1165d78" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_347fec870eafea7b26c8a73bac" ON "hashtag" ("name") `); - await queryRunner.query(`CREATE INDEX "IDX_2710a55f826ee236ea1a62698f" ON "hashtag" ("mentionedUsersCount") `); - await queryRunner.query(`CREATE INDEX "IDX_0e206cec573f1edff4a3062923" ON "hashtag" ("mentionedLocalUsersCount") `); - await queryRunner.query(`CREATE INDEX "IDX_4c02d38a976c3ae132228c6fce" ON "hashtag" ("mentionedRemoteUsersCount") `); - await queryRunner.query(`CREATE INDEX "IDX_d57f9030cd3af7f63ffb1c267c" ON "hashtag" ("attachedUsersCount") `); - await queryRunner.query(`CREATE INDEX "IDX_0c44bf4f680964145f2a68a341" ON "hashtag" ("attachedLocalUsersCount") `); - await queryRunner.query(`CREATE INDEX "IDX_0b03cbcd7e6a7ce068efa8ecc2" ON "hashtag" ("attachedRemoteUsersCount") `); - await queryRunner.query(`CREATE TABLE "note_favorite" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, CONSTRAINT "PK_af0da35a60b9fa4463a62082b36" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_47f4b1892f5d6ba8efb3057d81" ON "note_favorite" ("userId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0f4fb9ad355f3effff221ef245" ON "note_favorite" ("userId", "noteId") `); - await queryRunner.query(`CREATE TABLE "abuse_user_report" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "reporterId" character varying(32) NOT NULL, "comment" character varying(512) NOT NULL, CONSTRAINT "PK_87873f5f5cc5c321a1306b2d18c" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_db2098070b2b5a523c58181f74" ON "abuse_user_report" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_d049123c413e68ca52abe73420" ON "abuse_user_report" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_04cc96756f89d0b7f9473e8cdf" ON "abuse_user_report" ("reporterId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_5cd442c3b2e74fdd99dae20243" ON "abuse_user_report" ("userId", "reporterId") `); - await queryRunner.query(`CREATE TABLE "registration_ticket" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "code" character varying(64) NOT NULL, CONSTRAINT "PK_f11696b6fafcf3662d4292734f8" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0ff69e8dfa9fe31bb4a4660f59" ON "registration_ticket" ("code") `); - await queryRunner.query(`CREATE TABLE "messaging_message" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "recipientId" character varying(32) NOT NULL, "text" character varying(4096), "isRead" boolean NOT NULL DEFAULT false, "fileId" character varying(32), CONSTRAINT "PK_db398fd79dc95d0eb8c30456eaa" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_e21cd3646e52ef9c94aaf17c2e" ON "messaging_message" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_5377c307783fce2b6d352e1203" ON "messaging_message" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_cac14a4e3944454a5ce7daa514" ON "messaging_message" ("recipientId") `); - await queryRunner.query(`CREATE TABLE "signin" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "ip" character varying(128) NOT NULL, "headers" jsonb NOT NULL, "success" boolean NOT NULL, CONSTRAINT "PK_9e96ddc025712616fc492b3b588" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_2c308dbdc50d94dc625670055f" ON "signin" ("userId") `); - await queryRunner.query(`CREATE TABLE "auth_session" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "token" character varying(128) NOT NULL, "userId" character varying(32), "appId" character varying(32) NOT NULL, CONSTRAINT "PK_19354ed146424a728c1112a8cbf" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_62cb09e1129f6ec024ef66e183" ON "auth_session" ("token") `); - await queryRunner.query(`CREATE TABLE "follow_request" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "followeeId" character varying(32) NOT NULL, "followerId" character varying(32) NOT NULL, "requestId" character varying(128), "followerHost" character varying(128), "followerInbox" character varying(512), "followerSharedInbox" character varying(512), "followeeHost" character varying(128), "followeeInbox" character varying(512), "followeeSharedInbox" character varying(512), CONSTRAINT "PK_53a9aa3725f7a3deb150b39dbfc" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_12c01c0d1a79f77d9f6c15fadd" ON "follow_request" ("followeeId") `); - await queryRunner.query(`CREATE INDEX "IDX_a7fd92dd6dc519e6fb435dd108" ON "follow_request" ("followerId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_d54a512b822fac7ed52800f6b4" ON "follow_request" ("followerId", "followeeId") `); - await queryRunner.query(`CREATE TABLE "emoji" ("id" character varying(32) NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE, "name" character varying(128) NOT NULL, "host" character varying(128), "url" character varying(512) NOT NULL, "uri" character varying(512), "type" character varying(64), "aliases" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], CONSTRAINT "PK_df74ce05e24999ee01ea0bc50a3" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_b37dafc86e9af007e3295c2781" ON "emoji" ("name") `); - await queryRunner.query(`CREATE INDEX "IDX_5900e907bb46516ddf2871327c" ON "emoji" ("host") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_4f4d35e1256c84ae3d1f0eab10" ON "emoji" ("name", "host") `); - await queryRunner.query(`CREATE TABLE "reversi_game" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "startedAt" TIMESTAMP WITH TIME ZONE, "user1Id" character varying(32) NOT NULL, "user2Id" character varying(32) NOT NULL, "user1Accepted" boolean NOT NULL DEFAULT false, "user2Accepted" boolean NOT NULL DEFAULT false, "black" integer, "isStarted" boolean NOT NULL DEFAULT false, "isEnded" boolean NOT NULL DEFAULT false, "winnerId" character varying(32), "surrendered" character varying(32), "logs" jsonb NOT NULL DEFAULT '[]', "map" character varying(64) array NOT NULL, "bw" character varying(32) NOT NULL, "isLlotheo" boolean NOT NULL DEFAULT false, "canPutEverywhere" boolean NOT NULL DEFAULT false, "loopedBoard" boolean NOT NULL DEFAULT false, "form1" jsonb DEFAULT null, "form2" jsonb DEFAULT null, "crc32" character varying(32), CONSTRAINT "PK_76b30eeba71b1193ad7c5311c3f" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_b46ec40746efceac604142be1c" ON "reversi_game" ("createdAt") `); - await queryRunner.query(`CREATE TABLE "reversi_matching" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "parentId" character varying(32) NOT NULL, "childId" character varying(32) NOT NULL, CONSTRAINT "PK_880bd0afbab232f21c8b9d146cf" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_b604d92d6c7aec38627f6eaf16" ON "reversi_matching" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_3b25402709dd9882048c2bbade" ON "reversi_matching" ("parentId") `); - await queryRunner.query(`CREATE INDEX "IDX_e247b23a3c9b45f89ec1299d06" ON "reversi_matching" ("childId") `); - await queryRunner.query(`CREATE TABLE "user_note_pining" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, CONSTRAINT "PK_a6a2dad4ae000abce2ea9d9b103" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_bfbc6f79ba4007b4ce5097f08d" ON "user_note_pining" ("userId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_410cd649884b501c02d6e72738" ON "user_note_pining" ("userId", "noteId") `); - await queryRunner.query(`CREATE TYPE "poll_notevisibility_enum" AS ENUM('public', 'home', 'followers', 'specified')`); - await queryRunner.query(`CREATE TABLE "poll" ("noteId" character varying(32) NOT NULL, "expiresAt" TIMESTAMP WITH TIME ZONE, "multiple" boolean NOT NULL, "choices" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "votes" integer array NOT NULL, "noteVisibility" "poll_notevisibility_enum" NOT NULL, "userId" character varying(32) NOT NULL, "userHost" character varying(128), CONSTRAINT "REL_da851e06d0dfe2ef397d8b1bf1" UNIQUE ("noteId"), CONSTRAINT "PK_da851e06d0dfe2ef397d8b1bf1b" PRIMARY KEY ("noteId"))`); - await queryRunner.query(`CREATE INDEX "IDX_0610ebcfcfb4a18441a9bcdab2" ON "poll" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_7fa20a12319c7f6dc3aed98c0a" ON "poll" ("userHost") `); - await queryRunner.query(`CREATE TABLE "user_keypair" ("userId" character varying(32) NOT NULL, "publicKey" character varying(4096) NOT NULL, "privateKey" character varying(4096) NOT NULL, CONSTRAINT "REL_f4853eb41ab722fe05f81cedeb" UNIQUE ("userId"), CONSTRAINT "PK_f4853eb41ab722fe05f81cedeb6" PRIMARY KEY ("userId"))`); - await queryRunner.query(`CREATE TABLE "user_publickey" ("userId" character varying(32) NOT NULL, "keyId" character varying(256) NOT NULL, "keyPem" character varying(4096) NOT NULL, CONSTRAINT "REL_10c146e4b39b443ede016f6736" UNIQUE ("userId"), CONSTRAINT "PK_10c146e4b39b443ede016f6736d" PRIMARY KEY ("userId"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_171e64971c780ebd23fae140bb" ON "user_publickey" ("keyId") `); - await queryRunner.query(`CREATE TABLE "user_profile" ("userId" character varying(32) NOT NULL, "location" character varying(128), "birthday" character(10), "description" character varying(1024), "fields" jsonb NOT NULL DEFAULT '[]', "url" character varying(512), "email" character varying(128), "emailVerifyCode" character varying(128), "emailVerified" boolean NOT NULL DEFAULT false, "twoFactorTempSecret" character varying(128), "twoFactorSecret" character varying(128), "twoFactorEnabled" boolean NOT NULL DEFAULT false, "password" character varying(128), "clientData" jsonb NOT NULL DEFAULT '{}', "autoWatch" boolean NOT NULL DEFAULT false, "autoAcceptFollowed" boolean NOT NULL DEFAULT false, "alwaysMarkNsfw" boolean NOT NULL DEFAULT false, "carefulBot" boolean NOT NULL DEFAULT false, "twitter" boolean NOT NULL DEFAULT false, "twitterAccessToken" character varying(64) DEFAULT null, "twitterAccessTokenSecret" character varying(64) DEFAULT null, "twitterUserId" character varying(64) DEFAULT null, "twitterScreenName" character varying(64) DEFAULT null, "github" boolean NOT NULL DEFAULT false, "githubAccessToken" character varying(64) DEFAULT null, "githubId" integer DEFAULT null, "githubLogin" character varying(64) DEFAULT null, "discord" boolean NOT NULL DEFAULT false, "discordAccessToken" character varying(64) DEFAULT null, "discordRefreshToken" character varying(64) DEFAULT null, "discordExpiresDate" integer DEFAULT null, "discordId" character varying(64) DEFAULT null, "discordUsername" character varying(64) DEFAULT null, "discordDiscriminator" character varying(64) DEFAULT null, "userHost" character varying(128), CONSTRAINT "REL_51cb79b5555effaf7d69ba1cff" UNIQUE ("userId"), CONSTRAINT "PK_51cb79b5555effaf7d69ba1cff9" PRIMARY KEY ("userId"))`); - await queryRunner.query(`CREATE INDEX "IDX_dce530b98e454793dac5ec2f5a" ON "user_profile" ("userHost") `); - await queryRunner.query(`CREATE TYPE "__chart__active_users_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__active_users" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__active_users_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_count" bigint NOT NULL, "___remote_count" bigint NOT NULL, CONSTRAINT "PK_317237a9f733b970604a11e314f" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__drive_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__drive" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__drive_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_totalCount" bigint NOT NULL, "___local_totalSize" bigint NOT NULL, "___local_incCount" bigint NOT NULL, "___local_incSize" bigint NOT NULL, "___local_decCount" bigint NOT NULL, "___local_decSize" bigint NOT NULL, "___remote_totalCount" bigint NOT NULL, "___remote_totalSize" bigint NOT NULL, "___remote_incCount" bigint NOT NULL, "___remote_incSize" bigint NOT NULL, "___remote_decCount" bigint NOT NULL, "___remote_decSize" bigint NOT NULL, CONSTRAINT "PK_f96bc548a765cd4b3b354221ce7" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__federation_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__federation" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__federation_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___instance_total" bigint NOT NULL, "___instance_inc" bigint NOT NULL, "___instance_dec" bigint NOT NULL, CONSTRAINT "PK_b39dcd31a0fe1a7757e348e85fd" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__hashtag_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__hashtag" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__hashtag_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_count" bigint NOT NULL, "___remote_count" bigint NOT NULL, CONSTRAINT "PK_c32f1ea2b44a5d2f7881e37f8f9" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__instance_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__instance" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__instance_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___requests_failed" bigint NOT NULL, "___requests_succeeded" bigint NOT NULL, "___requests_received" bigint NOT NULL, "___notes_total" bigint NOT NULL, "___notes_inc" bigint NOT NULL, "___notes_dec" bigint NOT NULL, "___notes_diffs_normal" bigint NOT NULL, "___notes_diffs_reply" bigint NOT NULL, "___notes_diffs_renote" bigint NOT NULL, "___users_total" bigint NOT NULL, "___users_inc" bigint NOT NULL, "___users_dec" bigint NOT NULL, "___following_total" bigint NOT NULL, "___following_inc" bigint NOT NULL, "___following_dec" bigint NOT NULL, "___followers_total" bigint NOT NULL, "___followers_inc" bigint NOT NULL, "___followers_dec" bigint NOT NULL, "___drive_totalFiles" bigint NOT NULL, "___drive_totalUsage" bigint NOT NULL, "___drive_incFiles" bigint NOT NULL, "___drive_incUsage" bigint NOT NULL, "___drive_decFiles" bigint NOT NULL, "___drive_decUsage" bigint NOT NULL, CONSTRAINT "PK_1267c67c7c2d47b4903975f2c00" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__network_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__network" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__network_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___incomingRequests" bigint NOT NULL, "___outgoingRequests" bigint NOT NULL, "___totalTime" bigint NOT NULL, "___incomingBytes" bigint NOT NULL, "___outgoingBytes" bigint NOT NULL, CONSTRAINT "PK_bc4290c2e27fad14ef0c1ca93f3" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__notes_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__notes" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__notes_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_total" bigint NOT NULL, "___local_inc" bigint NOT NULL, "___local_dec" bigint NOT NULL, "___local_diffs_normal" bigint NOT NULL, "___local_diffs_reply" bigint NOT NULL, "___local_diffs_renote" bigint NOT NULL, "___remote_total" bigint NOT NULL, "___remote_inc" bigint NOT NULL, "___remote_dec" bigint NOT NULL, "___remote_diffs_normal" bigint NOT NULL, "___remote_diffs_reply" bigint NOT NULL, "___remote_diffs_renote" bigint NOT NULL, CONSTRAINT "PK_0aec823fa85c7f901bdb3863b14" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__per_user_drive_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__per_user_drive" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__per_user_drive_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___totalCount" bigint NOT NULL, "___totalSize" bigint NOT NULL, "___incCount" bigint NOT NULL, "___incSize" bigint NOT NULL, "___decCount" bigint NOT NULL, "___decSize" bigint NOT NULL, CONSTRAINT "PK_d0ef23d24d666e1a44a0cd3d208" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__per_user_following_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__per_user_following" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__per_user_following_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_followings_total" bigint NOT NULL, "___local_followings_inc" bigint NOT NULL, "___local_followings_dec" bigint NOT NULL, "___local_followers_total" bigint NOT NULL, "___local_followers_inc" bigint NOT NULL, "___local_followers_dec" bigint NOT NULL, "___remote_followings_total" bigint NOT NULL, "___remote_followings_inc" bigint NOT NULL, "___remote_followings_dec" bigint NOT NULL, "___remote_followers_total" bigint NOT NULL, "___remote_followers_inc" bigint NOT NULL, "___remote_followers_dec" bigint NOT NULL, CONSTRAINT "PK_85bb1b540363a29c2fec83bd907" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__per_user_notes_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__per_user_notes" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__per_user_notes_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___total" bigint NOT NULL, "___inc" bigint NOT NULL, "___dec" bigint NOT NULL, "___diffs_normal" bigint NOT NULL, "___diffs_reply" bigint NOT NULL, "___diffs_renote" bigint NOT NULL, CONSTRAINT "PK_334acf6e915af2f29edc11b8e50" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__per_user_reaction_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__per_user_reaction" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__per_user_reaction_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_count" bigint NOT NULL, "___remote_count" bigint NOT NULL, CONSTRAINT "PK_984f54dae441e65b633e8d27a7f" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__test_grouped_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__test_grouped" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__test_grouped_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___foo_total" bigint NOT NULL, "___foo_inc" bigint NOT NULL, "___foo_dec" bigint NOT NULL, CONSTRAINT "PK_f4a2b175d308695af30d4293272" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__test_unique_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__test_unique" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__test_unique_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___foo" bigint NOT NULL, CONSTRAINT "PK_409bac9c97cc612d8500012319d" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__test_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__test" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__test_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___foo_total" bigint NOT NULL, "___foo_inc" bigint NOT NULL, "___foo_dec" bigint NOT NULL, CONSTRAINT "PK_b4bc31dffbd1b785276a3ecfc1e" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE TYPE "__chart__users_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`CREATE TABLE "__chart__users" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__users_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_total" bigint NOT NULL, "___local_inc" bigint NOT NULL, "___local_dec" bigint NOT NULL, "___remote_total" bigint NOT NULL, "___remote_inc" bigint NOT NULL, "___remote_dec" bigint NOT NULL, CONSTRAINT "PK_4dfcf2c78d03524b9eb2c99d328" PRIMARY KEY ("id"))`); - await queryRunner.query(`ALTER TABLE "drive_folder" ADD CONSTRAINT "FK_f4fc06e49c0171c85f1c48060d2" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "drive_folder" ADD CONSTRAINT "FK_00ceffb0cdc238b3233294f08f2" FOREIGN KEY ("parentId") REFERENCES "drive_folder"("id") ON DELETE SET NULL ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "drive_file" ADD CONSTRAINT "FK_860fa6f6c7df5bb887249fba22e" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "drive_file" ADD CONSTRAINT "FK_bb90d1956dafc4068c28aa7560a" FOREIGN KEY ("folderId") REFERENCES "drive_folder"("id") ON DELETE SET NULL ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "FK_58f5c71eaab331645112cf8cfa5" FOREIGN KEY ("avatarId") REFERENCES "drive_file"("id") ON DELETE SET NULL ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "FK_afc64b53f8db3707ceb34eb28e2" FOREIGN KEY ("bannerId") REFERENCES "drive_file"("id") ON DELETE SET NULL ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "app" ADD CONSTRAINT "FK_3f5b0899ef90527a3462d7c2cb3" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "access_token" ADD CONSTRAINT "FK_9949557d0e1b2c19e5344c171e9" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "access_token" ADD CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "note" ADD CONSTRAINT "FK_17cb3553c700a4985dff5a30ff5" FOREIGN KEY ("replyId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "note" ADD CONSTRAINT "FK_52ccc804d7c69037d558bac4c96" FOREIGN KEY ("renoteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "note" ADD CONSTRAINT "FK_ec5c201576192ba8904c345c5cc" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE SET NULL ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "note" ADD CONSTRAINT "FK_5b87d9d19127bd5d92026017a7b" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "poll_vote" ADD CONSTRAINT "FK_66d2bd2ee31d14bcc23069a89f8" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "poll_vote" ADD CONSTRAINT "FK_aecfbd5ef60374918e63ee95fa7" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "note_reaction" ADD CONSTRAINT "FK_13761f64257f40c5636d0ff95ee" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "note_reaction" ADD CONSTRAINT "FK_45145e4953780f3cd5656f0ea6a" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "note_watching" ADD CONSTRAINT "FK_b0134ec406e8d09a540f8182888" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "note_watching" ADD CONSTRAINT "FK_03e7028ab8388a3f5e3ce2a8619" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "note_unread" ADD CONSTRAINT "FK_56b0166d34ddae49d8ef7610bb9" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "note_unread" ADD CONSTRAINT "FK_e637cba4dc4410218c4251260e4" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "notification" ADD CONSTRAINT "FK_3c601b70a1066d2c8b517094cb9" FOREIGN KEY ("notifieeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "notification" ADD CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710" FOREIGN KEY ("notifierId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "notification" ADD CONSTRAINT "FK_769cb6b73a1efe22ddf733ac453" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "following" ADD CONSTRAINT "FK_24e0042143a18157b234df186c3" FOREIGN KEY ("followeeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "following" ADD CONSTRAINT "FK_6516c5a6f3c015b4eed39978be5" FOREIGN KEY ("followerId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "muting" ADD CONSTRAINT "FK_ec96b4fed9dae517e0dbbe0675c" FOREIGN KEY ("muteeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "muting" ADD CONSTRAINT "FK_93060675b4a79a577f31d260c67" FOREIGN KEY ("muterId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "sw_subscription" ADD CONSTRAINT "FK_97754ca6f2baff9b4abb7f853dd" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "blocking" ADD CONSTRAINT "FK_2cd4a2743a99671308f5417759e" FOREIGN KEY ("blockeeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "blocking" ADD CONSTRAINT "FK_0627125f1a8a42c9a1929edb552" FOREIGN KEY ("blockerId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user_list" ADD CONSTRAINT "FK_b7fcefbdd1c18dce86687531f99" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user_list_joining" ADD CONSTRAINT "FK_d844bfc6f3f523a05189076efaa" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user_list_joining" ADD CONSTRAINT "FK_605472305f26818cc93d1baaa74" FOREIGN KEY ("userListId") REFERENCES "user_list"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "note_favorite" ADD CONSTRAINT "FK_47f4b1892f5d6ba8efb3057d81a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "note_favorite" ADD CONSTRAINT "FK_0e00498f180193423c992bc4370" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_d049123c413e68ca52abe734203" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_04cc96756f89d0b7f9473e8cdf3" FOREIGN KEY ("reporterId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "messaging_message" ADD CONSTRAINT "FK_5377c307783fce2b6d352e1203b" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "messaging_message" ADD CONSTRAINT "FK_cac14a4e3944454a5ce7daa5142" FOREIGN KEY ("recipientId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "messaging_message" ADD CONSTRAINT "FK_535def119223ac05ad3fa9ef64b" FOREIGN KEY ("fileId") REFERENCES "drive_file"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "signin" ADD CONSTRAINT "FK_2c308dbdc50d94dc625670055f7" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "auth_session" ADD CONSTRAINT "FK_c072b729d71697f959bde66ade0" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "auth_session" ADD CONSTRAINT "FK_dbe037d4bddd17b03a1dc778dee" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "follow_request" ADD CONSTRAINT "FK_12c01c0d1a79f77d9f6c15fadd2" FOREIGN KEY ("followeeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "follow_request" ADD CONSTRAINT "FK_a7fd92dd6dc519e6fb435dd108f" FOREIGN KEY ("followerId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "reversi_game" ADD CONSTRAINT "FK_f7467510c60a45ce5aca6292743" FOREIGN KEY ("user1Id") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "reversi_game" ADD CONSTRAINT "FK_6649a4e8c5d5cf32fb03b5da9f6" FOREIGN KEY ("user2Id") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "reversi_matching" ADD CONSTRAINT "FK_3b25402709dd9882048c2bbade0" FOREIGN KEY ("parentId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "reversi_matching" ADD CONSTRAINT "FK_e247b23a3c9b45f89ec1299d066" FOREIGN KEY ("childId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user_note_pining" ADD CONSTRAINT "FK_bfbc6f79ba4007b4ce5097f08d6" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user_note_pining" ADD CONSTRAINT "FK_68881008f7c3588ad7ecae471cf" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "poll" ADD CONSTRAINT "FK_da851e06d0dfe2ef397d8b1bf1b" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user_keypair" ADD CONSTRAINT "FK_f4853eb41ab722fe05f81cedeb6" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user_publickey" ADD CONSTRAINT "FK_10c146e4b39b443ede016f6736d" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user_profile" ADD CONSTRAINT "FK_51cb79b5555effaf7d69ba1cff9" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP CONSTRAINT "FK_51cb79b5555effaf7d69ba1cff9"`); - await queryRunner.query(`ALTER TABLE "user_publickey" DROP CONSTRAINT "FK_10c146e4b39b443ede016f6736d"`); - await queryRunner.query(`ALTER TABLE "user_keypair" DROP CONSTRAINT "FK_f4853eb41ab722fe05f81cedeb6"`); - await queryRunner.query(`ALTER TABLE "poll" DROP CONSTRAINT "FK_da851e06d0dfe2ef397d8b1bf1b"`); - await queryRunner.query(`ALTER TABLE "user_note_pining" DROP CONSTRAINT "FK_68881008f7c3588ad7ecae471cf"`); - await queryRunner.query(`ALTER TABLE "user_note_pining" DROP CONSTRAINT "FK_bfbc6f79ba4007b4ce5097f08d6"`); - await queryRunner.query(`ALTER TABLE "reversi_matching" DROP CONSTRAINT "FK_e247b23a3c9b45f89ec1299d066"`); - await queryRunner.query(`ALTER TABLE "reversi_matching" DROP CONSTRAINT "FK_3b25402709dd9882048c2bbade0"`); - await queryRunner.query(`ALTER TABLE "reversi_game" DROP CONSTRAINT "FK_6649a4e8c5d5cf32fb03b5da9f6"`); - await queryRunner.query(`ALTER TABLE "reversi_game" DROP CONSTRAINT "FK_f7467510c60a45ce5aca6292743"`); - await queryRunner.query(`ALTER TABLE "follow_request" DROP CONSTRAINT "FK_a7fd92dd6dc519e6fb435dd108f"`); - await queryRunner.query(`ALTER TABLE "follow_request" DROP CONSTRAINT "FK_12c01c0d1a79f77d9f6c15fadd2"`); - await queryRunner.query(`ALTER TABLE "auth_session" DROP CONSTRAINT "FK_dbe037d4bddd17b03a1dc778dee"`); - await queryRunner.query(`ALTER TABLE "auth_session" DROP CONSTRAINT "FK_c072b729d71697f959bde66ade0"`); - await queryRunner.query(`ALTER TABLE "signin" DROP CONSTRAINT "FK_2c308dbdc50d94dc625670055f7"`); - await queryRunner.query(`ALTER TABLE "messaging_message" DROP CONSTRAINT "FK_535def119223ac05ad3fa9ef64b"`); - await queryRunner.query(`ALTER TABLE "messaging_message" DROP CONSTRAINT "FK_cac14a4e3944454a5ce7daa5142"`); - await queryRunner.query(`ALTER TABLE "messaging_message" DROP CONSTRAINT "FK_5377c307783fce2b6d352e1203b"`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_04cc96756f89d0b7f9473e8cdf3"`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_d049123c413e68ca52abe734203"`); - await queryRunner.query(`ALTER TABLE "note_favorite" DROP CONSTRAINT "FK_0e00498f180193423c992bc4370"`); - await queryRunner.query(`ALTER TABLE "note_favorite" DROP CONSTRAINT "FK_47f4b1892f5d6ba8efb3057d81a"`); - await queryRunner.query(`ALTER TABLE "user_list_joining" DROP CONSTRAINT "FK_605472305f26818cc93d1baaa74"`); - await queryRunner.query(`ALTER TABLE "user_list_joining" DROP CONSTRAINT "FK_d844bfc6f3f523a05189076efaa"`); - await queryRunner.query(`ALTER TABLE "user_list" DROP CONSTRAINT "FK_b7fcefbdd1c18dce86687531f99"`); - await queryRunner.query(`ALTER TABLE "blocking" DROP CONSTRAINT "FK_0627125f1a8a42c9a1929edb552"`); - await queryRunner.query(`ALTER TABLE "blocking" DROP CONSTRAINT "FK_2cd4a2743a99671308f5417759e"`); - await queryRunner.query(`ALTER TABLE "sw_subscription" DROP CONSTRAINT "FK_97754ca6f2baff9b4abb7f853dd"`); - await queryRunner.query(`ALTER TABLE "muting" DROP CONSTRAINT "FK_93060675b4a79a577f31d260c67"`); - await queryRunner.query(`ALTER TABLE "muting" DROP CONSTRAINT "FK_ec96b4fed9dae517e0dbbe0675c"`); - await queryRunner.query(`ALTER TABLE "following" DROP CONSTRAINT "FK_6516c5a6f3c015b4eed39978be5"`); - await queryRunner.query(`ALTER TABLE "following" DROP CONSTRAINT "FK_24e0042143a18157b234df186c3"`); - await queryRunner.query(`ALTER TABLE "notification" DROP CONSTRAINT "FK_769cb6b73a1efe22ddf733ac453"`); - await queryRunner.query(`ALTER TABLE "notification" DROP CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710"`); - await queryRunner.query(`ALTER TABLE "notification" DROP CONSTRAINT "FK_3c601b70a1066d2c8b517094cb9"`); - await queryRunner.query(`ALTER TABLE "note_unread" DROP CONSTRAINT "FK_e637cba4dc4410218c4251260e4"`); - await queryRunner.query(`ALTER TABLE "note_unread" DROP CONSTRAINT "FK_56b0166d34ddae49d8ef7610bb9"`); - await queryRunner.query(`ALTER TABLE "note_watching" DROP CONSTRAINT "FK_03e7028ab8388a3f5e3ce2a8619"`); - await queryRunner.query(`ALTER TABLE "note_watching" DROP CONSTRAINT "FK_b0134ec406e8d09a540f8182888"`); - await queryRunner.query(`ALTER TABLE "note_reaction" DROP CONSTRAINT "FK_45145e4953780f3cd5656f0ea6a"`); - await queryRunner.query(`ALTER TABLE "note_reaction" DROP CONSTRAINT "FK_13761f64257f40c5636d0ff95ee"`); - await queryRunner.query(`ALTER TABLE "poll_vote" DROP CONSTRAINT "FK_aecfbd5ef60374918e63ee95fa7"`); - await queryRunner.query(`ALTER TABLE "poll_vote" DROP CONSTRAINT "FK_66d2bd2ee31d14bcc23069a89f8"`); - await queryRunner.query(`ALTER TABLE "note" DROP CONSTRAINT "FK_5b87d9d19127bd5d92026017a7b"`); - await queryRunner.query(`ALTER TABLE "note" DROP CONSTRAINT "FK_ec5c201576192ba8904c345c5cc"`); - await queryRunner.query(`ALTER TABLE "note" DROP CONSTRAINT "FK_52ccc804d7c69037d558bac4c96"`); - await queryRunner.query(`ALTER TABLE "note" DROP CONSTRAINT "FK_17cb3553c700a4985dff5a30ff5"`); - await queryRunner.query(`ALTER TABLE "access_token" DROP CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560"`); - await queryRunner.query(`ALTER TABLE "access_token" DROP CONSTRAINT "FK_9949557d0e1b2c19e5344c171e9"`); - await queryRunner.query(`ALTER TABLE "app" DROP CONSTRAINT "FK_3f5b0899ef90527a3462d7c2cb3"`); - await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_afc64b53f8db3707ceb34eb28e2"`); - await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_58f5c71eaab331645112cf8cfa5"`); - await queryRunner.query(`ALTER TABLE "drive_file" DROP CONSTRAINT "FK_bb90d1956dafc4068c28aa7560a"`); - await queryRunner.query(`ALTER TABLE "drive_file" DROP CONSTRAINT "FK_860fa6f6c7df5bb887249fba22e"`); - await queryRunner.query(`ALTER TABLE "drive_folder" DROP CONSTRAINT "FK_00ceffb0cdc238b3233294f08f2"`); - await queryRunner.query(`ALTER TABLE "drive_folder" DROP CONSTRAINT "FK_f4fc06e49c0171c85f1c48060d2"`); - await queryRunner.query(`DROP TABLE "__chart__users"`); - await queryRunner.query(`DROP TYPE "__chart__users_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__test"`); - await queryRunner.query(`DROP TYPE "__chart__test_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__test_unique"`); - await queryRunner.query(`DROP TYPE "__chart__test_unique_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__test_grouped"`); - await queryRunner.query(`DROP TYPE "__chart__test_grouped_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__per_user_reaction"`); - await queryRunner.query(`DROP TYPE "__chart__per_user_reaction_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__per_user_notes"`); - await queryRunner.query(`DROP TYPE "__chart__per_user_notes_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__per_user_following"`); - await queryRunner.query(`DROP TYPE "__chart__per_user_following_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__per_user_drive"`); - await queryRunner.query(`DROP TYPE "__chart__per_user_drive_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__notes"`); - await queryRunner.query(`DROP TYPE "__chart__notes_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__network"`); - await queryRunner.query(`DROP TYPE "__chart__network_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__instance"`); - await queryRunner.query(`DROP TYPE "__chart__instance_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__hashtag"`); - await queryRunner.query(`DROP TYPE "__chart__hashtag_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__federation"`); - await queryRunner.query(`DROP TYPE "__chart__federation_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__drive"`); - await queryRunner.query(`DROP TYPE "__chart__drive_span_enum"`); - await queryRunner.query(`DROP TABLE "__chart__active_users"`); - await queryRunner.query(`DROP TYPE "__chart__active_users_span_enum"`); - await queryRunner.query(`DROP INDEX "IDX_dce530b98e454793dac5ec2f5a"`); - await queryRunner.query(`DROP TABLE "user_profile"`); - await queryRunner.query(`DROP INDEX "IDX_171e64971c780ebd23fae140bb"`); - await queryRunner.query(`DROP TABLE "user_publickey"`); - await queryRunner.query(`DROP TABLE "user_keypair"`); - await queryRunner.query(`DROP INDEX "IDX_7fa20a12319c7f6dc3aed98c0a"`); - await queryRunner.query(`DROP INDEX "IDX_0610ebcfcfb4a18441a9bcdab2"`); - await queryRunner.query(`DROP TABLE "poll"`); - await queryRunner.query(`DROP TYPE "poll_notevisibility_enum"`); - await queryRunner.query(`DROP INDEX "IDX_410cd649884b501c02d6e72738"`); - await queryRunner.query(`DROP INDEX "IDX_bfbc6f79ba4007b4ce5097f08d"`); - await queryRunner.query(`DROP TABLE "user_note_pining"`); - await queryRunner.query(`DROP INDEX "IDX_e247b23a3c9b45f89ec1299d06"`); - await queryRunner.query(`DROP INDEX "IDX_3b25402709dd9882048c2bbade"`); - await queryRunner.query(`DROP INDEX "IDX_b604d92d6c7aec38627f6eaf16"`); - await queryRunner.query(`DROP TABLE "reversi_matching"`); - await queryRunner.query(`DROP INDEX "IDX_b46ec40746efceac604142be1c"`); - await queryRunner.query(`DROP TABLE "reversi_game"`); - await queryRunner.query(`DROP INDEX "IDX_4f4d35e1256c84ae3d1f0eab10"`); - await queryRunner.query(`DROP INDEX "IDX_5900e907bb46516ddf2871327c"`); - await queryRunner.query(`DROP INDEX "IDX_b37dafc86e9af007e3295c2781"`); - await queryRunner.query(`DROP TABLE "emoji"`); - await queryRunner.query(`DROP INDEX "IDX_d54a512b822fac7ed52800f6b4"`); - await queryRunner.query(`DROP INDEX "IDX_a7fd92dd6dc519e6fb435dd108"`); - await queryRunner.query(`DROP INDEX "IDX_12c01c0d1a79f77d9f6c15fadd"`); - await queryRunner.query(`DROP TABLE "follow_request"`); - await queryRunner.query(`DROP INDEX "IDX_62cb09e1129f6ec024ef66e183"`); - await queryRunner.query(`DROP TABLE "auth_session"`); - await queryRunner.query(`DROP INDEX "IDX_2c308dbdc50d94dc625670055f"`); - await queryRunner.query(`DROP TABLE "signin"`); - await queryRunner.query(`DROP INDEX "IDX_cac14a4e3944454a5ce7daa514"`); - await queryRunner.query(`DROP INDEX "IDX_5377c307783fce2b6d352e1203"`); - await queryRunner.query(`DROP INDEX "IDX_e21cd3646e52ef9c94aaf17c2e"`); - await queryRunner.query(`DROP TABLE "messaging_message"`); - await queryRunner.query(`DROP INDEX "IDX_0ff69e8dfa9fe31bb4a4660f59"`); - await queryRunner.query(`DROP TABLE "registration_ticket"`); - await queryRunner.query(`DROP INDEX "IDX_5cd442c3b2e74fdd99dae20243"`); - await queryRunner.query(`DROP INDEX "IDX_04cc96756f89d0b7f9473e8cdf"`); - await queryRunner.query(`DROP INDEX "IDX_d049123c413e68ca52abe73420"`); - await queryRunner.query(`DROP INDEX "IDX_db2098070b2b5a523c58181f74"`); - await queryRunner.query(`DROP TABLE "abuse_user_report"`); - await queryRunner.query(`DROP INDEX "IDX_0f4fb9ad355f3effff221ef245"`); - await queryRunner.query(`DROP INDEX "IDX_47f4b1892f5d6ba8efb3057d81"`); - await queryRunner.query(`DROP TABLE "note_favorite"`); - await queryRunner.query(`DROP INDEX "IDX_0b03cbcd7e6a7ce068efa8ecc2"`); - await queryRunner.query(`DROP INDEX "IDX_0c44bf4f680964145f2a68a341"`); - await queryRunner.query(`DROP INDEX "IDX_d57f9030cd3af7f63ffb1c267c"`); - await queryRunner.query(`DROP INDEX "IDX_4c02d38a976c3ae132228c6fce"`); - await queryRunner.query(`DROP INDEX "IDX_0e206cec573f1edff4a3062923"`); - await queryRunner.query(`DROP INDEX "IDX_2710a55f826ee236ea1a62698f"`); - await queryRunner.query(`DROP INDEX "IDX_347fec870eafea7b26c8a73bac"`); - await queryRunner.query(`DROP TABLE "hashtag"`); - await queryRunner.query(`DROP INDEX "IDX_605472305f26818cc93d1baaa7"`); - await queryRunner.query(`DROP INDEX "IDX_d844bfc6f3f523a05189076efa"`); - await queryRunner.query(`DROP TABLE "user_list_joining"`); - await queryRunner.query(`DROP INDEX "IDX_b7fcefbdd1c18dce86687531f9"`); - await queryRunner.query(`DROP TABLE "user_list"`); - await queryRunner.query(`DROP INDEX "IDX_98a1bc5cb30dfd159de056549f"`); - await queryRunner.query(`DROP INDEX "IDX_0627125f1a8a42c9a1929edb55"`); - await queryRunner.query(`DROP INDEX "IDX_2cd4a2743a99671308f5417759"`); - await queryRunner.query(`DROP INDEX "IDX_b9a354f7941c1e779f3b33aea6"`); - await queryRunner.query(`DROP TABLE "blocking"`); - await queryRunner.query(`DROP INDEX "IDX_97754ca6f2baff9b4abb7f853d"`); - await queryRunner.query(`DROP TABLE "sw_subscription"`); - await queryRunner.query(`DROP INDEX "IDX_1eb9d9824a630321a29fd3b290"`); - await queryRunner.query(`DROP INDEX "IDX_93060675b4a79a577f31d260c6"`); - await queryRunner.query(`DROP INDEX "IDX_ec96b4fed9dae517e0dbbe0675"`); - await queryRunner.query(`DROP INDEX "IDX_f86d57fbca33c7a4e6897490cc"`); - await queryRunner.query(`DROP TABLE "muting"`); - await queryRunner.query(`DROP INDEX "IDX_8d5afc98982185799b160e10eb"`); - await queryRunner.query(`DROP INDEX "IDX_2cd3b2a6b4cf0b910b260afe08"`); - await queryRunner.query(`DROP TABLE "instance"`); - await queryRunner.query(`DROP INDEX "IDX_307be5f1d1252e0388662acb96"`); - await queryRunner.query(`DROP INDEX "IDX_6516c5a6f3c015b4eed39978be"`); - await queryRunner.query(`DROP INDEX "IDX_24e0042143a18157b234df186c"`); - await queryRunner.query(`DROP INDEX "IDX_582f8fab771a9040a12961f3e7"`); - await queryRunner.query(`DROP TABLE "following"`); - await queryRunner.query(`DROP TABLE "meta"`); - await queryRunner.query(`DROP INDEX "IDX_3c601b70a1066d2c8b517094cb"`); - await queryRunner.query(`DROP INDEX "IDX_b11a5e627c41d4dc3170f1d370"`); - await queryRunner.query(`DROP TABLE "notification"`); - await queryRunner.query(`DROP INDEX "IDX_d908433a4953cc13216cd9c274"`); - await queryRunner.query(`DROP INDEX "IDX_e637cba4dc4410218c4251260e"`); - await queryRunner.query(`DROP INDEX "IDX_56b0166d34ddae49d8ef7610bb"`); - await queryRunner.query(`DROP TABLE "note_unread"`); - await queryRunner.query(`DROP INDEX "IDX_a42c93c69989ce1d09959df4cf"`); - await queryRunner.query(`DROP INDEX "IDX_44499765eec6b5489d72c4253b"`); - await queryRunner.query(`DROP INDEX "IDX_03e7028ab8388a3f5e3ce2a861"`); - await queryRunner.query(`DROP INDEX "IDX_b0134ec406e8d09a540f818288"`); - await queryRunner.query(`DROP INDEX "IDX_318cdf42a9cfc11f479bd802bb"`); - await queryRunner.query(`DROP TABLE "note_watching"`); - await queryRunner.query(`DROP INDEX "IDX_ad0c221b25672daf2df320a817"`); - await queryRunner.query(`DROP INDEX "IDX_45145e4953780f3cd5656f0ea6"`); - await queryRunner.query(`DROP INDEX "IDX_13761f64257f40c5636d0ff95e"`); - await queryRunner.query(`DROP INDEX "IDX_01f4581f114e0ebd2bbb876f0b"`); - await queryRunner.query(`DROP TABLE "note_reaction"`); - await queryRunner.query(`DROP INDEX "IDX_50bd7164c5b78f1f4a42c4d21f"`); - await queryRunner.query(`DROP INDEX "IDX_aecfbd5ef60374918e63ee95fa"`); - await queryRunner.query(`DROP INDEX "IDX_66d2bd2ee31d14bcc23069a89f"`); - await queryRunner.query(`DROP INDEX "IDX_0fb627e1c2f753262a74f0562d"`); - await queryRunner.query(`DROP TABLE "poll_vote"`); - await queryRunner.query(`DROP INDEX "IDX_7125a826ab192eb27e11d358a5"`); - await queryRunner.query(`DROP INDEX "IDX_88937d94d7443d9a99a76fa5c0"`); - await queryRunner.query(`DROP INDEX "IDX_54ebcb6d27222913b908d56fd8"`); - await queryRunner.query(`DROP INDEX "IDX_796a8c03959361f97dc2be1d5c"`); - await queryRunner.query(`DROP INDEX "IDX_25dfc71b0369b003a4cd434d0b"`); - await queryRunner.query(`DROP INDEX "IDX_51c063b6a133a9cb87145450f5"`); - await queryRunner.query(`DROP INDEX "IDX_153536c67d05e9adb24e99fc2b"`); - await queryRunner.query(`DROP INDEX "IDX_5b87d9d19127bd5d92026017a7"`); - await queryRunner.query(`DROP INDEX "IDX_52ccc804d7c69037d558bac4c9"`); - await queryRunner.query(`DROP INDEX "IDX_17cb3553c700a4985dff5a30ff"`); - await queryRunner.query(`DROP INDEX "IDX_e7c0567f5261063592f022e9b5"`); - await queryRunner.query(`DROP TABLE "note"`); - await queryRunner.query(`DROP TYPE "note_visibility_enum"`); - await queryRunner.query(`DROP INDEX "IDX_9949557d0e1b2c19e5344c171e"`); - await queryRunner.query(`DROP INDEX "IDX_64c327441248bae40f7d92f34f"`); - await queryRunner.query(`DROP INDEX "IDX_70ba8f6af34bc924fc9e12adb8"`); - await queryRunner.query(`DROP TABLE "access_token"`); - await queryRunner.query(`DROP INDEX "IDX_f49922d511d666848f250663c4"`); - await queryRunner.query(`DROP INDEX "IDX_3f5b0899ef90527a3462d7c2cb"`); - await queryRunner.query(`DROP INDEX "IDX_048a757923ed8b157e9895da53"`); - await queryRunner.query(`DROP TABLE "app"`); - await queryRunner.query(`DROP INDEX "IDX_5deb01ae162d1d70b80d064c27"`); - await queryRunner.query(`DROP INDEX "IDX_a854e557b1b14814750c7c7b0c"`); - await queryRunner.query(`DROP INDEX "IDX_be623adaa4c566baf5d29ce0c8"`); - await queryRunner.query(`DROP INDEX "IDX_3252a5df8d5bbd16b281f7799e"`); - await queryRunner.query(`DROP INDEX "IDX_fa99d777623947a5b05f394cae"`); - await queryRunner.query(`DROP INDEX "IDX_a27b942a0d6dcff90e3ee9b5e8"`); - await queryRunner.query(`DROP INDEX "IDX_80ca6e6ef65fb9ef34ea8c90f4"`); - await queryRunner.query(`DROP INDEX "IDX_e11e649824a45d8ed01d597fd9"`); - await queryRunner.query(`DROP TABLE "user"`); - await queryRunner.query(`DROP INDEX "IDX_bb90d1956dafc4068c28aa7560"`); - await queryRunner.query(`DROP INDEX "IDX_e5848eac4940934e23dbc17581"`); - await queryRunner.query(`DROP INDEX "IDX_c55b2b7c284d9fef98026fc88e"`); - await queryRunner.query(`DROP INDEX "IDX_e74022ce9a074b3866f70e0d27"`); - await queryRunner.query(`DROP INDEX "IDX_d85a184c2540d2deba33daf642"`); - await queryRunner.query(`DROP INDEX "IDX_a40b8df8c989d7db937ea27cf6"`); - await queryRunner.query(`DROP INDEX "IDX_37bb9a1b4585f8a3beb24c62d6"`); - await queryRunner.query(`DROP INDEX "IDX_92779627994ac79277f070c91e"`); - await queryRunner.query(`DROP INDEX "IDX_860fa6f6c7df5bb887249fba22"`); - await queryRunner.query(`DROP INDEX "IDX_c8dfad3b72196dd1d6b5db168a"`); - await queryRunner.query(`DROP TABLE "drive_file"`); - await queryRunner.query(`DROP INDEX "IDX_00ceffb0cdc238b3233294f08f"`); - await queryRunner.query(`DROP INDEX "IDX_f4fc06e49c0171c85f1c48060d"`); - await queryRunner.query(`DROP INDEX "IDX_02878d441ceae15ce060b73daf"`); - await queryRunner.query(`DROP TABLE "drive_folder"`); - await queryRunner.query(`DROP INDEX "IDX_584b536b49e53ac81beb39a177"`); - await queryRunner.query(`DROP INDEX "IDX_8cb40cfc8f3c28261e6f887b03"`); - await queryRunner.query(`DROP INDEX "IDX_8e4eb51a35d81b64dda28eed0a"`); - await queryRunner.query(`DROP TABLE "log"`); - await queryRunner.query(`DROP TYPE "log_level_enum"`); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE TYPE "log_level_enum" AS ENUM('error', 'warning', 'info', 'success', 'debug')`, + ); + await queryRunner.query( + `CREATE TABLE "log" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "domain" character varying(64) array NOT NULL DEFAULT '{}'::varchar[], "level" "log_level_enum" NOT NULL, "worker" character varying(8) NOT NULL, "machine" character varying(128) NOT NULL, "message" character varying(1024) NOT NULL, "data" jsonb NOT NULL DEFAULT '{}', CONSTRAINT "PK_350604cbdf991d5930d9e618fbd" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_8e4eb51a35d81b64dda28eed0a" ON "log" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_8cb40cfc8f3c28261e6f887b03" ON "log" ("domain") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_584b536b49e53ac81beb39a177" ON "log" ("level") `, + ); + await queryRunner.query( + `CREATE TABLE "drive_folder" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "name" character varying(128) NOT NULL, "userId" character varying(32), "parentId" character varying(32), CONSTRAINT "PK_7a0c089191f5ebdc214e0af808a" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_02878d441ceae15ce060b73daf" ON "drive_folder" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f4fc06e49c0171c85f1c48060d" ON "drive_folder" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_00ceffb0cdc238b3233294f08f" ON "drive_folder" ("parentId") `, + ); + await queryRunner.query( + `CREATE TABLE "drive_file" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32), "userHost" character varying(128), "md5" character varying(32) NOT NULL, "name" character varying(256) NOT NULL, "type" character varying(128) NOT NULL, "size" integer NOT NULL, "comment" character varying(512), "properties" jsonb NOT NULL DEFAULT '{}', "storedInternal" boolean NOT NULL, "url" character varying(512) NOT NULL, "thumbnailUrl" character varying(512), "webpublicUrl" character varying(512), "accessKey" character varying(256), "thumbnailAccessKey" character varying(256), "webpublicAccessKey" character varying(256), "uri" character varying(512), "src" character varying(512), "folderId" character varying(32), "isSensitive" boolean NOT NULL DEFAULT false, "isLink" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_43ddaaaf18c9e68029b7cbb032e" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_c8dfad3b72196dd1d6b5db168a" ON "drive_file" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_860fa6f6c7df5bb887249fba22" ON "drive_file" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_92779627994ac79277f070c91e" ON "drive_file" ("userHost") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_37bb9a1b4585f8a3beb24c62d6" ON "drive_file" ("md5") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a40b8df8c989d7db937ea27cf6" ON "drive_file" ("type") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_d85a184c2540d2deba33daf642" ON "drive_file" ("accessKey") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_e74022ce9a074b3866f70e0d27" ON "drive_file" ("thumbnailAccessKey") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_c55b2b7c284d9fef98026fc88e" ON "drive_file" ("webpublicAccessKey") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e5848eac4940934e23dbc17581" ON "drive_file" ("uri") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_bb90d1956dafc4068c28aa7560" ON "drive_file" ("folderId") `, + ); + await queryRunner.query( + `CREATE TABLE "user" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE, "lastFetchedAt" TIMESTAMP WITH TIME ZONE, "username" character varying(128) NOT NULL, "usernameLower" character varying(128) NOT NULL, "name" character varying(128), "followersCount" integer NOT NULL DEFAULT 0, "followingCount" integer NOT NULL DEFAULT 0, "notesCount" integer NOT NULL DEFAULT 0, "avatarId" character varying(32), "bannerId" character varying(32), "tags" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "avatarUrl" character varying(512), "bannerUrl" character varying(512), "avatarColor" character varying(32), "bannerColor" character varying(32), "isSuspended" boolean NOT NULL DEFAULT false, "isSilenced" boolean NOT NULL DEFAULT false, "isLocked" boolean NOT NULL DEFAULT false, "isBot" boolean NOT NULL DEFAULT false, "isCat" boolean NOT NULL DEFAULT false, "isAdmin" boolean NOT NULL DEFAULT false, "isModerator" boolean NOT NULL DEFAULT false, "isVerified" boolean NOT NULL DEFAULT false, "emojis" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "host" character varying(128), "inbox" character varying(512), "sharedInbox" character varying(512), "featured" character varying(512), "uri" character varying(512), "token" character(16), CONSTRAINT "UQ_a854e557b1b14814750c7c7b0c9" UNIQUE ("token"), CONSTRAINT "REL_58f5c71eaab331645112cf8cfa" UNIQUE ("avatarId"), CONSTRAINT "REL_afc64b53f8db3707ceb34eb28e" UNIQUE ("bannerId"), CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e11e649824a45d8ed01d597fd9" ON "user" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_80ca6e6ef65fb9ef34ea8c90f4" ON "user" ("updatedAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a27b942a0d6dcff90e3ee9b5e8" ON "user" ("usernameLower") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_fa99d777623947a5b05f394cae" ON "user" ("tags") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_3252a5df8d5bbd16b281f7799e" ON "user" ("host") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_be623adaa4c566baf5d29ce0c8" ON "user" ("uri") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_a854e557b1b14814750c7c7b0c" ON "user" ("token") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_5deb01ae162d1d70b80d064c27" ON "user" ("usernameLower", "host") `, + ); + await queryRunner.query( + `CREATE TABLE "app" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32), "secret" character varying(64) NOT NULL, "name" character varying(128) NOT NULL, "description" character varying(512) NOT NULL, "permission" character varying(64) array NOT NULL, "callbackUrl" character varying(512), CONSTRAINT "PK_9478629fc093d229df09e560aea" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_048a757923ed8b157e9895da53" ON "app" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_3f5b0899ef90527a3462d7c2cb" ON "app" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f49922d511d666848f250663c4" ON "app" ("secret") `, + ); + await queryRunner.query( + `CREATE TABLE "access_token" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "token" character varying(128) NOT NULL, "hash" character varying(128) NOT NULL, "userId" character varying(32) NOT NULL, "appId" character varying(32) NOT NULL, CONSTRAINT "PK_f20f028607b2603deabd8182d12" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_70ba8f6af34bc924fc9e12adb8" ON "access_token" ("token") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_64c327441248bae40f7d92f34f" ON "access_token" ("hash") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_9949557d0e1b2c19e5344c171e" ON "access_token" ("userId") `, + ); + await queryRunner.query( + `CREATE TYPE "note_visibility_enum" AS ENUM('public', 'home', 'followers', 'specified')`, + ); + await queryRunner.query( + `CREATE TABLE "note" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "replyId" character varying(32), "renoteId" character varying(32), "text" text, "name" character varying(256), "cw" character varying(512), "appId" character varying(32), "userId" character varying(32) NOT NULL, "viaMobile" boolean NOT NULL DEFAULT false, "localOnly" boolean NOT NULL DEFAULT false, "renoteCount" smallint NOT NULL DEFAULT 0, "repliesCount" smallint NOT NULL DEFAULT 0, "reactions" jsonb NOT NULL DEFAULT '{}', "visibility" "note_visibility_enum" NOT NULL, "uri" character varying(512), "score" integer NOT NULL DEFAULT 0, "fileIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], "attachedFileTypes" character varying(256) array NOT NULL DEFAULT '{}'::varchar[], "visibleUserIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], "mentions" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], "mentionedRemoteUsers" text NOT NULL DEFAULT '[]', "emojis" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "tags" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "hasPoll" boolean NOT NULL DEFAULT false, "geo" jsonb DEFAULT null, "userHost" character varying(128), "replyUserId" character varying(32), "replyUserHost" character varying(128), "renoteUserId" character varying(32), "renoteUserHost" character varying(128), CONSTRAINT "PK_96d0c172a4fba276b1bbed43058" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e7c0567f5261063592f022e9b5" ON "note" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_17cb3553c700a4985dff5a30ff" ON "note" ("replyId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_52ccc804d7c69037d558bac4c9" ON "note" ("renoteId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_5b87d9d19127bd5d92026017a7" ON "note" ("userId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_153536c67d05e9adb24e99fc2b" ON "note" ("uri") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_51c063b6a133a9cb87145450f5" ON "note" ("fileIds") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_25dfc71b0369b003a4cd434d0b" ON "note" ("attachedFileTypes") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_796a8c03959361f97dc2be1d5c" ON "note" ("visibleUserIds") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_54ebcb6d27222913b908d56fd8" ON "note" ("mentions") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_88937d94d7443d9a99a76fa5c0" ON "note" ("tags") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7125a826ab192eb27e11d358a5" ON "note" ("userHost") `, + ); + await queryRunner.query( + `CREATE TABLE "poll_vote" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "choice" integer NOT NULL, CONSTRAINT "PK_fd002d371201c472490ba89c6a0" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0fb627e1c2f753262a74f0562d" ON "poll_vote" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_66d2bd2ee31d14bcc23069a89f" ON "poll_vote" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_aecfbd5ef60374918e63ee95fa" ON "poll_vote" ("noteId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_50bd7164c5b78f1f4a42c4d21f" ON "poll_vote" ("userId", "noteId", "choice") `, + ); + await queryRunner.query( + `CREATE TABLE "note_reaction" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "reaction" character varying(128) NOT NULL, CONSTRAINT "PK_767ec729b108799b587a3fcc9cf" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_01f4581f114e0ebd2bbb876f0b" ON "note_reaction" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_13761f64257f40c5636d0ff95e" ON "note_reaction" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_45145e4953780f3cd5656f0ea6" ON "note_reaction" ("noteId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_ad0c221b25672daf2df320a817" ON "note_reaction" ("userId", "noteId") `, + ); + await queryRunner.query( + `CREATE TABLE "note_watching" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "noteUserId" character varying(32) NOT NULL, CONSTRAINT "PK_49286fdb23725945a74aa27d757" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_318cdf42a9cfc11f479bd802bb" ON "note_watching" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b0134ec406e8d09a540f818288" ON "note_watching" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_03e7028ab8388a3f5e3ce2a861" ON "note_watching" ("noteId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_44499765eec6b5489d72c4253b" ON "note_watching" ("noteUserId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_a42c93c69989ce1d09959df4cf" ON "note_watching" ("userId", "noteId") `, + ); + await queryRunner.query( + `CREATE TABLE "note_unread" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "noteUserId" character varying(32) NOT NULL, "isSpecified" boolean NOT NULL, CONSTRAINT "PK_1904eda61a784f57e6e51fa9c1f" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_56b0166d34ddae49d8ef7610bb" ON "note_unread" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e637cba4dc4410218c4251260e" ON "note_unread" ("noteId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_d908433a4953cc13216cd9c274" ON "note_unread" ("userId", "noteId") `, + ); + await queryRunner.query( + `CREATE TABLE "notification" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "notifieeId" character varying(32) NOT NULL, "notifierId" character varying(32) NOT NULL, "type" character varying(32) NOT NULL, "isRead" boolean NOT NULL DEFAULT false, "noteId" character varying(32), "reaction" character varying(128), "choice" integer, CONSTRAINT "PK_705b6c7cdf9b2c2ff7ac7872cb7" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b11a5e627c41d4dc3170f1d370" ON "notification" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_3c601b70a1066d2c8b517094cb" ON "notification" ("notifieeId") `, + ); + await queryRunner.query( + `CREATE TABLE "meta" ("id" character varying(32) NOT NULL, "name" character varying(128), "description" character varying(1024), "maintainerName" character varying(128), "maintainerEmail" character varying(128), "announcements" jsonb NOT NULL DEFAULT '[]', "disableRegistration" boolean NOT NULL DEFAULT false, "disableLocalTimeline" boolean NOT NULL DEFAULT false, "disableGlobalTimeline" boolean NOT NULL DEFAULT false, "enableEmojiReaction" boolean NOT NULL DEFAULT true, "useStarForReactionFallback" boolean NOT NULL DEFAULT false, "langs" character varying(64) array NOT NULL DEFAULT '{}'::varchar[], "hiddenTags" character varying(256) array NOT NULL DEFAULT '{}'::varchar[], "blockedHosts" character varying(256) array NOT NULL DEFAULT '{}'::varchar[], "mascotImageUrl" character varying(512) DEFAULT '/assets/ai.png', "bannerUrl" character varying(512), "errorImageUrl" character varying(512) DEFAULT 'https://xn--931a.moe/aiart/yubitun.png', "iconUrl" character varying(512), "cacheRemoteFiles" boolean NOT NULL DEFAULT true, "proxyAccount" character varying(128), "enableRecaptcha" boolean NOT NULL DEFAULT false, "recaptchaSiteKey" character varying(64), "recaptchaSecretKey" character varying(64), "localDriveCapacityMb" integer NOT NULL DEFAULT 1024, "remoteDriveCapacityMb" integer NOT NULL DEFAULT 32, "maxNoteTextLength" integer NOT NULL DEFAULT 500, "summalyProxy" character varying(128), "enableEmail" boolean NOT NULL DEFAULT false, "email" character varying(128), "smtpSecure" boolean NOT NULL DEFAULT false, "smtpHost" character varying(128), "smtpPort" integer, "smtpUser" character varying(128), "smtpPass" character varying(128), "enableServiceWorker" boolean NOT NULL DEFAULT false, "swPublicKey" character varying(128), "swPrivateKey" character varying(128), "enableTwitterIntegration" boolean NOT NULL DEFAULT false, "twitterConsumerKey" character varying(128), "twitterConsumerSecret" character varying(128), "enableGithubIntegration" boolean NOT NULL DEFAULT false, "githubClientId" character varying(128), "githubClientSecret" character varying(128), "enableDiscordIntegration" boolean NOT NULL DEFAULT false, "discordClientId" character varying(128), "discordClientSecret" character varying(128), CONSTRAINT "PK_c4c17a6c2bd7651338b60fc590b" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TABLE "following" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "followeeId" character varying(32) NOT NULL, "followerId" character varying(32) NOT NULL, "followerHost" character varying(128), "followerInbox" character varying(512), "followerSharedInbox" character varying(512), "followeeHost" character varying(128), "followeeInbox" character varying(512), "followeeSharedInbox" character varying(512), CONSTRAINT "PK_c76c6e044bdf76ecf8bfb82a645" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_582f8fab771a9040a12961f3e7" ON "following" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_24e0042143a18157b234df186c" ON "following" ("followeeId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_6516c5a6f3c015b4eed39978be" ON "following" ("followerId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_307be5f1d1252e0388662acb96" ON "following" ("followerId", "followeeId") `, + ); + await queryRunner.query( + `CREATE TABLE "instance" ("id" character varying(32) NOT NULL, "caughtAt" TIMESTAMP WITH TIME ZONE NOT NULL, "host" character varying(128) NOT NULL, "system" character varying(64), "usersCount" integer NOT NULL DEFAULT 0, "notesCount" integer NOT NULL DEFAULT 0, "followingCount" integer NOT NULL DEFAULT 0, "followersCount" integer NOT NULL DEFAULT 0, "driveUsage" integer NOT NULL DEFAULT 0, "driveFiles" integer NOT NULL DEFAULT 0, "latestRequestSentAt" TIMESTAMP WITH TIME ZONE, "latestStatus" integer, "latestRequestReceivedAt" TIMESTAMP WITH TIME ZONE, "lastCommunicatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "isNotResponding" boolean NOT NULL DEFAULT false, "isMarkedAsClosed" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_eaf60e4a0c399c9935413e06474" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_2cd3b2a6b4cf0b910b260afe08" ON "instance" ("caughtAt") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_8d5afc98982185799b160e10eb" ON "instance" ("host") `, + ); + await queryRunner.query( + `CREATE TABLE "muting" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "muteeId" character varying(32) NOT NULL, "muterId" character varying(32) NOT NULL, CONSTRAINT "PK_2e92d06c8b5c602eeb27ca9ba48" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f86d57fbca33c7a4e6897490cc" ON "muting" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_ec96b4fed9dae517e0dbbe0675" ON "muting" ("muteeId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_93060675b4a79a577f31d260c6" ON "muting" ("muterId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_1eb9d9824a630321a29fd3b290" ON "muting" ("muterId", "muteeId") `, + ); + await queryRunner.query( + `CREATE TABLE "sw_subscription" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "endpoint" character varying(512) NOT NULL, "auth" character varying(256) NOT NULL, "publickey" character varying(128) NOT NULL, CONSTRAINT "PK_e8f763631530051b95eb6279b91" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_97754ca6f2baff9b4abb7f853d" ON "sw_subscription" ("userId") `, + ); + await queryRunner.query( + `CREATE TABLE "blocking" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "blockeeId" character varying(32) NOT NULL, "blockerId" character varying(32) NOT NULL, CONSTRAINT "PK_e5d9a541cc1965ee7e048ea09dd" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b9a354f7941c1e779f3b33aea6" ON "blocking" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_2cd4a2743a99671308f5417759" ON "blocking" ("blockeeId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0627125f1a8a42c9a1929edb55" ON "blocking" ("blockerId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_98a1bc5cb30dfd159de056549f" ON "blocking" ("blockerId", "blockeeId") `, + ); + await queryRunner.query( + `CREATE TABLE "user_list" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, CONSTRAINT "PK_87bab75775fd9b1ff822b656402" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b7fcefbdd1c18dce86687531f9" ON "user_list" ("userId") `, + ); + await queryRunner.query( + `CREATE TABLE "user_list_joining" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "userListId" character varying(32) NOT NULL, CONSTRAINT "PK_11abb3768da1c5f8de101c9df45" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d844bfc6f3f523a05189076efa" ON "user_list_joining" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_605472305f26818cc93d1baaa7" ON "user_list_joining" ("userListId") `, + ); + await queryRunner.query( + `CREATE TABLE "hashtag" ("id" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "mentionedUserIds" character varying(32) array NOT NULL, "mentionedUsersCount" integer NOT NULL DEFAULT 0, "mentionedLocalUserIds" character varying(32) array NOT NULL, "mentionedLocalUsersCount" integer NOT NULL DEFAULT 0, "mentionedRemoteUserIds" character varying(32) array NOT NULL, "mentionedRemoteUsersCount" integer NOT NULL DEFAULT 0, "attachedUserIds" character varying(32) array NOT NULL, "attachedUsersCount" integer NOT NULL DEFAULT 0, "attachedLocalUserIds" character varying(32) array NOT NULL, "attachedLocalUsersCount" integer NOT NULL DEFAULT 0, "attachedRemoteUserIds" character varying(32) array NOT NULL, "attachedRemoteUsersCount" integer NOT NULL DEFAULT 0, CONSTRAINT "PK_cb36eb8af8412bfa978f1165d78" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_347fec870eafea7b26c8a73bac" ON "hashtag" ("name") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_2710a55f826ee236ea1a62698f" ON "hashtag" ("mentionedUsersCount") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0e206cec573f1edff4a3062923" ON "hashtag" ("mentionedLocalUsersCount") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_4c02d38a976c3ae132228c6fce" ON "hashtag" ("mentionedRemoteUsersCount") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d57f9030cd3af7f63ffb1c267c" ON "hashtag" ("attachedUsersCount") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0c44bf4f680964145f2a68a341" ON "hashtag" ("attachedLocalUsersCount") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0b03cbcd7e6a7ce068efa8ecc2" ON "hashtag" ("attachedRemoteUsersCount") `, + ); + await queryRunner.query( + `CREATE TABLE "note_favorite" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, CONSTRAINT "PK_af0da35a60b9fa4463a62082b36" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_47f4b1892f5d6ba8efb3057d81" ON "note_favorite" ("userId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_0f4fb9ad355f3effff221ef245" ON "note_favorite" ("userId", "noteId") `, + ); + await queryRunner.query( + `CREATE TABLE "abuse_user_report" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "reporterId" character varying(32) NOT NULL, "comment" character varying(512) NOT NULL, CONSTRAINT "PK_87873f5f5cc5c321a1306b2d18c" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_db2098070b2b5a523c58181f74" ON "abuse_user_report" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d049123c413e68ca52abe73420" ON "abuse_user_report" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_04cc96756f89d0b7f9473e8cdf" ON "abuse_user_report" ("reporterId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_5cd442c3b2e74fdd99dae20243" ON "abuse_user_report" ("userId", "reporterId") `, + ); + await queryRunner.query( + `CREATE TABLE "registration_ticket" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "code" character varying(64) NOT NULL, CONSTRAINT "PK_f11696b6fafcf3662d4292734f8" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_0ff69e8dfa9fe31bb4a4660f59" ON "registration_ticket" ("code") `, + ); + await queryRunner.query( + `CREATE TABLE "messaging_message" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "recipientId" character varying(32) NOT NULL, "text" character varying(4096), "isRead" boolean NOT NULL DEFAULT false, "fileId" character varying(32), CONSTRAINT "PK_db398fd79dc95d0eb8c30456eaa" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e21cd3646e52ef9c94aaf17c2e" ON "messaging_message" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_5377c307783fce2b6d352e1203" ON "messaging_message" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_cac14a4e3944454a5ce7daa514" ON "messaging_message" ("recipientId") `, + ); + await queryRunner.query( + `CREATE TABLE "signin" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "ip" character varying(128) NOT NULL, "headers" jsonb NOT NULL, "success" boolean NOT NULL, CONSTRAINT "PK_9e96ddc025712616fc492b3b588" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_2c308dbdc50d94dc625670055f" ON "signin" ("userId") `, + ); + await queryRunner.query( + `CREATE TABLE "auth_session" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "token" character varying(128) NOT NULL, "userId" character varying(32), "appId" character varying(32) NOT NULL, CONSTRAINT "PK_19354ed146424a728c1112a8cbf" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_62cb09e1129f6ec024ef66e183" ON "auth_session" ("token") `, + ); + await queryRunner.query( + `CREATE TABLE "follow_request" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "followeeId" character varying(32) NOT NULL, "followerId" character varying(32) NOT NULL, "requestId" character varying(128), "followerHost" character varying(128), "followerInbox" character varying(512), "followerSharedInbox" character varying(512), "followeeHost" character varying(128), "followeeInbox" character varying(512), "followeeSharedInbox" character varying(512), CONSTRAINT "PK_53a9aa3725f7a3deb150b39dbfc" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_12c01c0d1a79f77d9f6c15fadd" ON "follow_request" ("followeeId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a7fd92dd6dc519e6fb435dd108" ON "follow_request" ("followerId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_d54a512b822fac7ed52800f6b4" ON "follow_request" ("followerId", "followeeId") `, + ); + await queryRunner.query( + `CREATE TABLE "emoji" ("id" character varying(32) NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE, "name" character varying(128) NOT NULL, "host" character varying(128), "url" character varying(512) NOT NULL, "uri" character varying(512), "type" character varying(64), "aliases" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], CONSTRAINT "PK_df74ce05e24999ee01ea0bc50a3" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b37dafc86e9af007e3295c2781" ON "emoji" ("name") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_5900e907bb46516ddf2871327c" ON "emoji" ("host") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_4f4d35e1256c84ae3d1f0eab10" ON "emoji" ("name", "host") `, + ); + await queryRunner.query( + `CREATE TABLE "reversi_game" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "startedAt" TIMESTAMP WITH TIME ZONE, "user1Id" character varying(32) NOT NULL, "user2Id" character varying(32) NOT NULL, "user1Accepted" boolean NOT NULL DEFAULT false, "user2Accepted" boolean NOT NULL DEFAULT false, "black" integer, "isStarted" boolean NOT NULL DEFAULT false, "isEnded" boolean NOT NULL DEFAULT false, "winnerId" character varying(32), "surrendered" character varying(32), "logs" jsonb NOT NULL DEFAULT '[]', "map" character varying(64) array NOT NULL, "bw" character varying(32) NOT NULL, "isLlotheo" boolean NOT NULL DEFAULT false, "canPutEverywhere" boolean NOT NULL DEFAULT false, "loopedBoard" boolean NOT NULL DEFAULT false, "form1" jsonb DEFAULT null, "form2" jsonb DEFAULT null, "crc32" character varying(32), CONSTRAINT "PK_76b30eeba71b1193ad7c5311c3f" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b46ec40746efceac604142be1c" ON "reversi_game" ("createdAt") `, + ); + await queryRunner.query( + `CREATE TABLE "reversi_matching" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "parentId" character varying(32) NOT NULL, "childId" character varying(32) NOT NULL, CONSTRAINT "PK_880bd0afbab232f21c8b9d146cf" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b604d92d6c7aec38627f6eaf16" ON "reversi_matching" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_3b25402709dd9882048c2bbade" ON "reversi_matching" ("parentId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e247b23a3c9b45f89ec1299d06" ON "reversi_matching" ("childId") `, + ); + await queryRunner.query( + `CREATE TABLE "user_note_pining" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, CONSTRAINT "PK_a6a2dad4ae000abce2ea9d9b103" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_bfbc6f79ba4007b4ce5097f08d" ON "user_note_pining" ("userId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_410cd649884b501c02d6e72738" ON "user_note_pining" ("userId", "noteId") `, + ); + await queryRunner.query( + `CREATE TYPE "poll_notevisibility_enum" AS ENUM('public', 'home', 'followers', 'specified')`, + ); + await queryRunner.query( + `CREATE TABLE "poll" ("noteId" character varying(32) NOT NULL, "expiresAt" TIMESTAMP WITH TIME ZONE, "multiple" boolean NOT NULL, "choices" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], "votes" integer array NOT NULL, "noteVisibility" "poll_notevisibility_enum" NOT NULL, "userId" character varying(32) NOT NULL, "userHost" character varying(128), CONSTRAINT "REL_da851e06d0dfe2ef397d8b1bf1" UNIQUE ("noteId"), CONSTRAINT "PK_da851e06d0dfe2ef397d8b1bf1b" PRIMARY KEY ("noteId"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0610ebcfcfb4a18441a9bcdab2" ON "poll" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7fa20a12319c7f6dc3aed98c0a" ON "poll" ("userHost") `, + ); + await queryRunner.query( + `CREATE TABLE "user_keypair" ("userId" character varying(32) NOT NULL, "publicKey" character varying(4096) NOT NULL, "privateKey" character varying(4096) NOT NULL, CONSTRAINT "REL_f4853eb41ab722fe05f81cedeb" UNIQUE ("userId"), CONSTRAINT "PK_f4853eb41ab722fe05f81cedeb6" PRIMARY KEY ("userId"))`, + ); + await queryRunner.query( + `CREATE TABLE "user_publickey" ("userId" character varying(32) NOT NULL, "keyId" character varying(256) NOT NULL, "keyPem" character varying(4096) NOT NULL, CONSTRAINT "REL_10c146e4b39b443ede016f6736" UNIQUE ("userId"), CONSTRAINT "PK_10c146e4b39b443ede016f6736d" PRIMARY KEY ("userId"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_171e64971c780ebd23fae140bb" ON "user_publickey" ("keyId") `, + ); + await queryRunner.query( + `CREATE TABLE "user_profile" ("userId" character varying(32) NOT NULL, "location" character varying(128), "birthday" character(10), "description" character varying(1024), "fields" jsonb NOT NULL DEFAULT '[]', "url" character varying(512), "email" character varying(128), "emailVerifyCode" character varying(128), "emailVerified" boolean NOT NULL DEFAULT false, "twoFactorTempSecret" character varying(128), "twoFactorSecret" character varying(128), "twoFactorEnabled" boolean NOT NULL DEFAULT false, "password" character varying(128), "clientData" jsonb NOT NULL DEFAULT '{}', "autoWatch" boolean NOT NULL DEFAULT false, "autoAcceptFollowed" boolean NOT NULL DEFAULT false, "alwaysMarkNsfw" boolean NOT NULL DEFAULT false, "carefulBot" boolean NOT NULL DEFAULT false, "twitter" boolean NOT NULL DEFAULT false, "twitterAccessToken" character varying(64) DEFAULT null, "twitterAccessTokenSecret" character varying(64) DEFAULT null, "twitterUserId" character varying(64) DEFAULT null, "twitterScreenName" character varying(64) DEFAULT null, "github" boolean NOT NULL DEFAULT false, "githubAccessToken" character varying(64) DEFAULT null, "githubId" integer DEFAULT null, "githubLogin" character varying(64) DEFAULT null, "discord" boolean NOT NULL DEFAULT false, "discordAccessToken" character varying(64) DEFAULT null, "discordRefreshToken" character varying(64) DEFAULT null, "discordExpiresDate" integer DEFAULT null, "discordId" character varying(64) DEFAULT null, "discordUsername" character varying(64) DEFAULT null, "discordDiscriminator" character varying(64) DEFAULT null, "userHost" character varying(128), CONSTRAINT "REL_51cb79b5555effaf7d69ba1cff" UNIQUE ("userId"), CONSTRAINT "PK_51cb79b5555effaf7d69ba1cff9" PRIMARY KEY ("userId"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_dce530b98e454793dac5ec2f5a" ON "user_profile" ("userHost") `, + ); + await queryRunner.query( + `CREATE TYPE "__chart__active_users_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__active_users" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__active_users_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_count" bigint NOT NULL, "___remote_count" bigint NOT NULL, CONSTRAINT "PK_317237a9f733b970604a11e314f" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__drive_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__drive" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__drive_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_totalCount" bigint NOT NULL, "___local_totalSize" bigint NOT NULL, "___local_incCount" bigint NOT NULL, "___local_incSize" bigint NOT NULL, "___local_decCount" bigint NOT NULL, "___local_decSize" bigint NOT NULL, "___remote_totalCount" bigint NOT NULL, "___remote_totalSize" bigint NOT NULL, "___remote_incCount" bigint NOT NULL, "___remote_incSize" bigint NOT NULL, "___remote_decCount" bigint NOT NULL, "___remote_decSize" bigint NOT NULL, CONSTRAINT "PK_f96bc548a765cd4b3b354221ce7" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__federation_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__federation" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__federation_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___instance_total" bigint NOT NULL, "___instance_inc" bigint NOT NULL, "___instance_dec" bigint NOT NULL, CONSTRAINT "PK_b39dcd31a0fe1a7757e348e85fd" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__hashtag_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__hashtag" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__hashtag_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_count" bigint NOT NULL, "___remote_count" bigint NOT NULL, CONSTRAINT "PK_c32f1ea2b44a5d2f7881e37f8f9" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__instance_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__instance" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__instance_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___requests_failed" bigint NOT NULL, "___requests_succeeded" bigint NOT NULL, "___requests_received" bigint NOT NULL, "___notes_total" bigint NOT NULL, "___notes_inc" bigint NOT NULL, "___notes_dec" bigint NOT NULL, "___notes_diffs_normal" bigint NOT NULL, "___notes_diffs_reply" bigint NOT NULL, "___notes_diffs_renote" bigint NOT NULL, "___users_total" bigint NOT NULL, "___users_inc" bigint NOT NULL, "___users_dec" bigint NOT NULL, "___following_total" bigint NOT NULL, "___following_inc" bigint NOT NULL, "___following_dec" bigint NOT NULL, "___followers_total" bigint NOT NULL, "___followers_inc" bigint NOT NULL, "___followers_dec" bigint NOT NULL, "___drive_totalFiles" bigint NOT NULL, "___drive_totalUsage" bigint NOT NULL, "___drive_incFiles" bigint NOT NULL, "___drive_incUsage" bigint NOT NULL, "___drive_decFiles" bigint NOT NULL, "___drive_decUsage" bigint NOT NULL, CONSTRAINT "PK_1267c67c7c2d47b4903975f2c00" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__network_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__network" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__network_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___incomingRequests" bigint NOT NULL, "___outgoingRequests" bigint NOT NULL, "___totalTime" bigint NOT NULL, "___incomingBytes" bigint NOT NULL, "___outgoingBytes" bigint NOT NULL, CONSTRAINT "PK_bc4290c2e27fad14ef0c1ca93f3" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__notes_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__notes" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__notes_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_total" bigint NOT NULL, "___local_inc" bigint NOT NULL, "___local_dec" bigint NOT NULL, "___local_diffs_normal" bigint NOT NULL, "___local_diffs_reply" bigint NOT NULL, "___local_diffs_renote" bigint NOT NULL, "___remote_total" bigint NOT NULL, "___remote_inc" bigint NOT NULL, "___remote_dec" bigint NOT NULL, "___remote_diffs_normal" bigint NOT NULL, "___remote_diffs_reply" bigint NOT NULL, "___remote_diffs_renote" bigint NOT NULL, CONSTRAINT "PK_0aec823fa85c7f901bdb3863b14" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__per_user_drive_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__per_user_drive" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__per_user_drive_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___totalCount" bigint NOT NULL, "___totalSize" bigint NOT NULL, "___incCount" bigint NOT NULL, "___incSize" bigint NOT NULL, "___decCount" bigint NOT NULL, "___decSize" bigint NOT NULL, CONSTRAINT "PK_d0ef23d24d666e1a44a0cd3d208" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__per_user_following_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__per_user_following" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__per_user_following_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_followings_total" bigint NOT NULL, "___local_followings_inc" bigint NOT NULL, "___local_followings_dec" bigint NOT NULL, "___local_followers_total" bigint NOT NULL, "___local_followers_inc" bigint NOT NULL, "___local_followers_dec" bigint NOT NULL, "___remote_followings_total" bigint NOT NULL, "___remote_followings_inc" bigint NOT NULL, "___remote_followings_dec" bigint NOT NULL, "___remote_followers_total" bigint NOT NULL, "___remote_followers_inc" bigint NOT NULL, "___remote_followers_dec" bigint NOT NULL, CONSTRAINT "PK_85bb1b540363a29c2fec83bd907" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__per_user_notes_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__per_user_notes" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__per_user_notes_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___total" bigint NOT NULL, "___inc" bigint NOT NULL, "___dec" bigint NOT NULL, "___diffs_normal" bigint NOT NULL, "___diffs_reply" bigint NOT NULL, "___diffs_renote" bigint NOT NULL, CONSTRAINT "PK_334acf6e915af2f29edc11b8e50" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__per_user_reaction_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__per_user_reaction" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__per_user_reaction_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_count" bigint NOT NULL, "___remote_count" bigint NOT NULL, CONSTRAINT "PK_984f54dae441e65b633e8d27a7f" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__test_grouped_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__test_grouped" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__test_grouped_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___foo_total" bigint NOT NULL, "___foo_inc" bigint NOT NULL, "___foo_dec" bigint NOT NULL, CONSTRAINT "PK_f4a2b175d308695af30d4293272" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__test_unique_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__test_unique" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__test_unique_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___foo" bigint NOT NULL, CONSTRAINT "PK_409bac9c97cc612d8500012319d" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__test_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__test" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__test_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___foo_total" bigint NOT NULL, "___foo_inc" bigint NOT NULL, "___foo_dec" bigint NOT NULL, CONSTRAINT "PK_b4bc31dffbd1b785276a3ecfc1e" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE TYPE "__chart__users_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `CREATE TABLE "__chart__users" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128), "span" "__chart__users_span_enum" NOT NULL, "unique" jsonb NOT NULL DEFAULT '{}', "___local_total" bigint NOT NULL, "___local_inc" bigint NOT NULL, "___local_dec" bigint NOT NULL, "___remote_total" bigint NOT NULL, "___remote_inc" bigint NOT NULL, "___remote_dec" bigint NOT NULL, CONSTRAINT "PK_4dfcf2c78d03524b9eb2c99d328" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `ALTER TABLE "drive_folder" ADD CONSTRAINT "FK_f4fc06e49c0171c85f1c48060d2" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "drive_folder" ADD CONSTRAINT "FK_00ceffb0cdc238b3233294f08f2" FOREIGN KEY ("parentId") REFERENCES "drive_folder"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" ADD CONSTRAINT "FK_860fa6f6c7df5bb887249fba22e" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" ADD CONSTRAINT "FK_bb90d1956dafc4068c28aa7560a" FOREIGN KEY ("folderId") REFERENCES "drive_folder"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user" ADD CONSTRAINT "FK_58f5c71eaab331645112cf8cfa5" FOREIGN KEY ("avatarId") REFERENCES "drive_file"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user" ADD CONSTRAINT "FK_afc64b53f8db3707ceb34eb28e2" FOREIGN KEY ("bannerId") REFERENCES "drive_file"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "app" ADD CONSTRAINT "FK_3f5b0899ef90527a3462d7c2cb3" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ADD CONSTRAINT "FK_9949557d0e1b2c19e5344c171e9" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ADD CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "note" ADD CONSTRAINT "FK_17cb3553c700a4985dff5a30ff5" FOREIGN KEY ("replyId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "note" ADD CONSTRAINT "FK_52ccc804d7c69037d558bac4c96" FOREIGN KEY ("renoteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "note" ADD CONSTRAINT "FK_ec5c201576192ba8904c345c5cc" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "note" ADD CONSTRAINT "FK_5b87d9d19127bd5d92026017a7b" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "poll_vote" ADD CONSTRAINT "FK_66d2bd2ee31d14bcc23069a89f8" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "poll_vote" ADD CONSTRAINT "FK_aecfbd5ef60374918e63ee95fa7" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "note_reaction" ADD CONSTRAINT "FK_13761f64257f40c5636d0ff95ee" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "note_reaction" ADD CONSTRAINT "FK_45145e4953780f3cd5656f0ea6a" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "note_watching" ADD CONSTRAINT "FK_b0134ec406e8d09a540f8182888" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "note_watching" ADD CONSTRAINT "FK_03e7028ab8388a3f5e3ce2a8619" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "note_unread" ADD CONSTRAINT "FK_56b0166d34ddae49d8ef7610bb9" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "note_unread" ADD CONSTRAINT "FK_e637cba4dc4410218c4251260e4" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "notification" ADD CONSTRAINT "FK_3c601b70a1066d2c8b517094cb9" FOREIGN KEY ("notifieeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "notification" ADD CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710" FOREIGN KEY ("notifierId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "notification" ADD CONSTRAINT "FK_769cb6b73a1efe22ddf733ac453" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "following" ADD CONSTRAINT "FK_24e0042143a18157b234df186c3" FOREIGN KEY ("followeeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "following" ADD CONSTRAINT "FK_6516c5a6f3c015b4eed39978be5" FOREIGN KEY ("followerId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "muting" ADD CONSTRAINT "FK_ec96b4fed9dae517e0dbbe0675c" FOREIGN KEY ("muteeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "muting" ADD CONSTRAINT "FK_93060675b4a79a577f31d260c67" FOREIGN KEY ("muterId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "sw_subscription" ADD CONSTRAINT "FK_97754ca6f2baff9b4abb7f853dd" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "blocking" ADD CONSTRAINT "FK_2cd4a2743a99671308f5417759e" FOREIGN KEY ("blockeeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "blocking" ADD CONSTRAINT "FK_0627125f1a8a42c9a1929edb552" FOREIGN KEY ("blockerId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user_list" ADD CONSTRAINT "FK_b7fcefbdd1c18dce86687531f99" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user_list_joining" ADD CONSTRAINT "FK_d844bfc6f3f523a05189076efaa" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user_list_joining" ADD CONSTRAINT "FK_605472305f26818cc93d1baaa74" FOREIGN KEY ("userListId") REFERENCES "user_list"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "note_favorite" ADD CONSTRAINT "FK_47f4b1892f5d6ba8efb3057d81a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "note_favorite" ADD CONSTRAINT "FK_0e00498f180193423c992bc4370" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_d049123c413e68ca52abe734203" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_04cc96756f89d0b7f9473e8cdf3" FOREIGN KEY ("reporterId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" ADD CONSTRAINT "FK_5377c307783fce2b6d352e1203b" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" ADD CONSTRAINT "FK_cac14a4e3944454a5ce7daa5142" FOREIGN KEY ("recipientId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" ADD CONSTRAINT "FK_535def119223ac05ad3fa9ef64b" FOREIGN KEY ("fileId") REFERENCES "drive_file"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "signin" ADD CONSTRAINT "FK_2c308dbdc50d94dc625670055f7" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "auth_session" ADD CONSTRAINT "FK_c072b729d71697f959bde66ade0" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "auth_session" ADD CONSTRAINT "FK_dbe037d4bddd17b03a1dc778dee" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "follow_request" ADD CONSTRAINT "FK_12c01c0d1a79f77d9f6c15fadd2" FOREIGN KEY ("followeeId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "follow_request" ADD CONSTRAINT "FK_a7fd92dd6dc519e6fb435dd108f" FOREIGN KEY ("followerId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "reversi_game" ADD CONSTRAINT "FK_f7467510c60a45ce5aca6292743" FOREIGN KEY ("user1Id") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "reversi_game" ADD CONSTRAINT "FK_6649a4e8c5d5cf32fb03b5da9f6" FOREIGN KEY ("user2Id") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "reversi_matching" ADD CONSTRAINT "FK_3b25402709dd9882048c2bbade0" FOREIGN KEY ("parentId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "reversi_matching" ADD CONSTRAINT "FK_e247b23a3c9b45f89ec1299d066" FOREIGN KEY ("childId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user_note_pining" ADD CONSTRAINT "FK_bfbc6f79ba4007b4ce5097f08d6" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user_note_pining" ADD CONSTRAINT "FK_68881008f7c3588ad7ecae471cf" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "poll" ADD CONSTRAINT "FK_da851e06d0dfe2ef397d8b1bf1b" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user_keypair" ADD CONSTRAINT "FK_f4853eb41ab722fe05f81cedeb6" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user_publickey" ADD CONSTRAINT "FK_10c146e4b39b443ede016f6736d" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD CONSTRAINT "FK_51cb79b5555effaf7d69ba1cff9" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP CONSTRAINT "FK_51cb79b5555effaf7d69ba1cff9"`, + ); + await queryRunner.query( + `ALTER TABLE "user_publickey" DROP CONSTRAINT "FK_10c146e4b39b443ede016f6736d"`, + ); + await queryRunner.query( + `ALTER TABLE "user_keypair" DROP CONSTRAINT "FK_f4853eb41ab722fe05f81cedeb6"`, + ); + await queryRunner.query( + `ALTER TABLE "poll" DROP CONSTRAINT "FK_da851e06d0dfe2ef397d8b1bf1b"`, + ); + await queryRunner.query( + `ALTER TABLE "user_note_pining" DROP CONSTRAINT "FK_68881008f7c3588ad7ecae471cf"`, + ); + await queryRunner.query( + `ALTER TABLE "user_note_pining" DROP CONSTRAINT "FK_bfbc6f79ba4007b4ce5097f08d6"`, + ); + await queryRunner.query( + `ALTER TABLE "reversi_matching" DROP CONSTRAINT "FK_e247b23a3c9b45f89ec1299d066"`, + ); + await queryRunner.query( + `ALTER TABLE "reversi_matching" DROP CONSTRAINT "FK_3b25402709dd9882048c2bbade0"`, + ); + await queryRunner.query( + `ALTER TABLE "reversi_game" DROP CONSTRAINT "FK_6649a4e8c5d5cf32fb03b5da9f6"`, + ); + await queryRunner.query( + `ALTER TABLE "reversi_game" DROP CONSTRAINT "FK_f7467510c60a45ce5aca6292743"`, + ); + await queryRunner.query( + `ALTER TABLE "follow_request" DROP CONSTRAINT "FK_a7fd92dd6dc519e6fb435dd108f"`, + ); + await queryRunner.query( + `ALTER TABLE "follow_request" DROP CONSTRAINT "FK_12c01c0d1a79f77d9f6c15fadd2"`, + ); + await queryRunner.query( + `ALTER TABLE "auth_session" DROP CONSTRAINT "FK_dbe037d4bddd17b03a1dc778dee"`, + ); + await queryRunner.query( + `ALTER TABLE "auth_session" DROP CONSTRAINT "FK_c072b729d71697f959bde66ade0"`, + ); + await queryRunner.query( + `ALTER TABLE "signin" DROP CONSTRAINT "FK_2c308dbdc50d94dc625670055f7"`, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" DROP CONSTRAINT "FK_535def119223ac05ad3fa9ef64b"`, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" DROP CONSTRAINT "FK_cac14a4e3944454a5ce7daa5142"`, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" DROP CONSTRAINT "FK_5377c307783fce2b6d352e1203b"`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_04cc96756f89d0b7f9473e8cdf3"`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_d049123c413e68ca52abe734203"`, + ); + await queryRunner.query( + `ALTER TABLE "note_favorite" DROP CONSTRAINT "FK_0e00498f180193423c992bc4370"`, + ); + await queryRunner.query( + `ALTER TABLE "note_favorite" DROP CONSTRAINT "FK_47f4b1892f5d6ba8efb3057d81a"`, + ); + await queryRunner.query( + `ALTER TABLE "user_list_joining" DROP CONSTRAINT "FK_605472305f26818cc93d1baaa74"`, + ); + await queryRunner.query( + `ALTER TABLE "user_list_joining" DROP CONSTRAINT "FK_d844bfc6f3f523a05189076efaa"`, + ); + await queryRunner.query( + `ALTER TABLE "user_list" DROP CONSTRAINT "FK_b7fcefbdd1c18dce86687531f99"`, + ); + await queryRunner.query( + `ALTER TABLE "blocking" DROP CONSTRAINT "FK_0627125f1a8a42c9a1929edb552"`, + ); + await queryRunner.query( + `ALTER TABLE "blocking" DROP CONSTRAINT "FK_2cd4a2743a99671308f5417759e"`, + ); + await queryRunner.query( + `ALTER TABLE "sw_subscription" DROP CONSTRAINT "FK_97754ca6f2baff9b4abb7f853dd"`, + ); + await queryRunner.query( + `ALTER TABLE "muting" DROP CONSTRAINT "FK_93060675b4a79a577f31d260c67"`, + ); + await queryRunner.query( + `ALTER TABLE "muting" DROP CONSTRAINT "FK_ec96b4fed9dae517e0dbbe0675c"`, + ); + await queryRunner.query( + `ALTER TABLE "following" DROP CONSTRAINT "FK_6516c5a6f3c015b4eed39978be5"`, + ); + await queryRunner.query( + `ALTER TABLE "following" DROP CONSTRAINT "FK_24e0042143a18157b234df186c3"`, + ); + await queryRunner.query( + `ALTER TABLE "notification" DROP CONSTRAINT "FK_769cb6b73a1efe22ddf733ac453"`, + ); + await queryRunner.query( + `ALTER TABLE "notification" DROP CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710"`, + ); + await queryRunner.query( + `ALTER TABLE "notification" DROP CONSTRAINT "FK_3c601b70a1066d2c8b517094cb9"`, + ); + await queryRunner.query( + `ALTER TABLE "note_unread" DROP CONSTRAINT "FK_e637cba4dc4410218c4251260e4"`, + ); + await queryRunner.query( + `ALTER TABLE "note_unread" DROP CONSTRAINT "FK_56b0166d34ddae49d8ef7610bb9"`, + ); + await queryRunner.query( + `ALTER TABLE "note_watching" DROP CONSTRAINT "FK_03e7028ab8388a3f5e3ce2a8619"`, + ); + await queryRunner.query( + `ALTER TABLE "note_watching" DROP CONSTRAINT "FK_b0134ec406e8d09a540f8182888"`, + ); + await queryRunner.query( + `ALTER TABLE "note_reaction" DROP CONSTRAINT "FK_45145e4953780f3cd5656f0ea6a"`, + ); + await queryRunner.query( + `ALTER TABLE "note_reaction" DROP CONSTRAINT "FK_13761f64257f40c5636d0ff95ee"`, + ); + await queryRunner.query( + `ALTER TABLE "poll_vote" DROP CONSTRAINT "FK_aecfbd5ef60374918e63ee95fa7"`, + ); + await queryRunner.query( + `ALTER TABLE "poll_vote" DROP CONSTRAINT "FK_66d2bd2ee31d14bcc23069a89f8"`, + ); + await queryRunner.query( + `ALTER TABLE "note" DROP CONSTRAINT "FK_5b87d9d19127bd5d92026017a7b"`, + ); + await queryRunner.query( + `ALTER TABLE "note" DROP CONSTRAINT "FK_ec5c201576192ba8904c345c5cc"`, + ); + await queryRunner.query( + `ALTER TABLE "note" DROP CONSTRAINT "FK_52ccc804d7c69037d558bac4c96"`, + ); + await queryRunner.query( + `ALTER TABLE "note" DROP CONSTRAINT "FK_17cb3553c700a4985dff5a30ff5"`, + ); + await queryRunner.query( + `ALTER TABLE "access_token" DROP CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560"`, + ); + await queryRunner.query( + `ALTER TABLE "access_token" DROP CONSTRAINT "FK_9949557d0e1b2c19e5344c171e9"`, + ); + await queryRunner.query( + `ALTER TABLE "app" DROP CONSTRAINT "FK_3f5b0899ef90527a3462d7c2cb3"`, + ); + await queryRunner.query( + `ALTER TABLE "user" DROP CONSTRAINT "FK_afc64b53f8db3707ceb34eb28e2"`, + ); + await queryRunner.query( + `ALTER TABLE "user" DROP CONSTRAINT "FK_58f5c71eaab331645112cf8cfa5"`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" DROP CONSTRAINT "FK_bb90d1956dafc4068c28aa7560a"`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" DROP CONSTRAINT "FK_860fa6f6c7df5bb887249fba22e"`, + ); + await queryRunner.query( + `ALTER TABLE "drive_folder" DROP CONSTRAINT "FK_00ceffb0cdc238b3233294f08f2"`, + ); + await queryRunner.query( + `ALTER TABLE "drive_folder" DROP CONSTRAINT "FK_f4fc06e49c0171c85f1c48060d2"`, + ); + await queryRunner.query(`DROP TABLE "__chart__users"`); + await queryRunner.query(`DROP TYPE "__chart__users_span_enum"`); + await queryRunner.query(`DROP TABLE "__chart__test"`); + await queryRunner.query(`DROP TYPE "__chart__test_span_enum"`); + await queryRunner.query(`DROP TABLE "__chart__test_unique"`); + await queryRunner.query(`DROP TYPE "__chart__test_unique_span_enum"`); + await queryRunner.query(`DROP TABLE "__chart__test_grouped"`); + await queryRunner.query(`DROP TYPE "__chart__test_grouped_span_enum"`); + await queryRunner.query(`DROP TABLE "__chart__per_user_reaction"`); + await queryRunner.query(`DROP TYPE "__chart__per_user_reaction_span_enum"`); + await queryRunner.query(`DROP TABLE "__chart__per_user_notes"`); + await queryRunner.query(`DROP TYPE "__chart__per_user_notes_span_enum"`); + await queryRunner.query(`DROP TABLE "__chart__per_user_following"`); + await queryRunner.query( + `DROP TYPE "__chart__per_user_following_span_enum"`, + ); + await queryRunner.query(`DROP TABLE "__chart__per_user_drive"`); + await queryRunner.query(`DROP TYPE "__chart__per_user_drive_span_enum"`); + await queryRunner.query(`DROP TABLE "__chart__notes"`); + await queryRunner.query(`DROP TYPE "__chart__notes_span_enum"`); + await queryRunner.query(`DROP TABLE "__chart__network"`); + await queryRunner.query(`DROP TYPE "__chart__network_span_enum"`); + await queryRunner.query(`DROP TABLE "__chart__instance"`); + await queryRunner.query(`DROP TYPE "__chart__instance_span_enum"`); + await queryRunner.query(`DROP TABLE "__chart__hashtag"`); + await queryRunner.query(`DROP TYPE "__chart__hashtag_span_enum"`); + await queryRunner.query(`DROP TABLE "__chart__federation"`); + await queryRunner.query(`DROP TYPE "__chart__federation_span_enum"`); + await queryRunner.query(`DROP TABLE "__chart__drive"`); + await queryRunner.query(`DROP TYPE "__chart__drive_span_enum"`); + await queryRunner.query(`DROP TABLE "__chart__active_users"`); + await queryRunner.query(`DROP TYPE "__chart__active_users_span_enum"`); + await queryRunner.query(`DROP INDEX "IDX_dce530b98e454793dac5ec2f5a"`); + await queryRunner.query(`DROP TABLE "user_profile"`); + await queryRunner.query(`DROP INDEX "IDX_171e64971c780ebd23fae140bb"`); + await queryRunner.query(`DROP TABLE "user_publickey"`); + await queryRunner.query(`DROP TABLE "user_keypair"`); + await queryRunner.query(`DROP INDEX "IDX_7fa20a12319c7f6dc3aed98c0a"`); + await queryRunner.query(`DROP INDEX "IDX_0610ebcfcfb4a18441a9bcdab2"`); + await queryRunner.query(`DROP TABLE "poll"`); + await queryRunner.query(`DROP TYPE "poll_notevisibility_enum"`); + await queryRunner.query(`DROP INDEX "IDX_410cd649884b501c02d6e72738"`); + await queryRunner.query(`DROP INDEX "IDX_bfbc6f79ba4007b4ce5097f08d"`); + await queryRunner.query(`DROP TABLE "user_note_pining"`); + await queryRunner.query(`DROP INDEX "IDX_e247b23a3c9b45f89ec1299d06"`); + await queryRunner.query(`DROP INDEX "IDX_3b25402709dd9882048c2bbade"`); + await queryRunner.query(`DROP INDEX "IDX_b604d92d6c7aec38627f6eaf16"`); + await queryRunner.query(`DROP TABLE "reversi_matching"`); + await queryRunner.query(`DROP INDEX "IDX_b46ec40746efceac604142be1c"`); + await queryRunner.query(`DROP TABLE "reversi_game"`); + await queryRunner.query(`DROP INDEX "IDX_4f4d35e1256c84ae3d1f0eab10"`); + await queryRunner.query(`DROP INDEX "IDX_5900e907bb46516ddf2871327c"`); + await queryRunner.query(`DROP INDEX "IDX_b37dafc86e9af007e3295c2781"`); + await queryRunner.query(`DROP TABLE "emoji"`); + await queryRunner.query(`DROP INDEX "IDX_d54a512b822fac7ed52800f6b4"`); + await queryRunner.query(`DROP INDEX "IDX_a7fd92dd6dc519e6fb435dd108"`); + await queryRunner.query(`DROP INDEX "IDX_12c01c0d1a79f77d9f6c15fadd"`); + await queryRunner.query(`DROP TABLE "follow_request"`); + await queryRunner.query(`DROP INDEX "IDX_62cb09e1129f6ec024ef66e183"`); + await queryRunner.query(`DROP TABLE "auth_session"`); + await queryRunner.query(`DROP INDEX "IDX_2c308dbdc50d94dc625670055f"`); + await queryRunner.query(`DROP TABLE "signin"`); + await queryRunner.query(`DROP INDEX "IDX_cac14a4e3944454a5ce7daa514"`); + await queryRunner.query(`DROP INDEX "IDX_5377c307783fce2b6d352e1203"`); + await queryRunner.query(`DROP INDEX "IDX_e21cd3646e52ef9c94aaf17c2e"`); + await queryRunner.query(`DROP TABLE "messaging_message"`); + await queryRunner.query(`DROP INDEX "IDX_0ff69e8dfa9fe31bb4a4660f59"`); + await queryRunner.query(`DROP TABLE "registration_ticket"`); + await queryRunner.query(`DROP INDEX "IDX_5cd442c3b2e74fdd99dae20243"`); + await queryRunner.query(`DROP INDEX "IDX_04cc96756f89d0b7f9473e8cdf"`); + await queryRunner.query(`DROP INDEX "IDX_d049123c413e68ca52abe73420"`); + await queryRunner.query(`DROP INDEX "IDX_db2098070b2b5a523c58181f74"`); + await queryRunner.query(`DROP TABLE "abuse_user_report"`); + await queryRunner.query(`DROP INDEX "IDX_0f4fb9ad355f3effff221ef245"`); + await queryRunner.query(`DROP INDEX "IDX_47f4b1892f5d6ba8efb3057d81"`); + await queryRunner.query(`DROP TABLE "note_favorite"`); + await queryRunner.query(`DROP INDEX "IDX_0b03cbcd7e6a7ce068efa8ecc2"`); + await queryRunner.query(`DROP INDEX "IDX_0c44bf4f680964145f2a68a341"`); + await queryRunner.query(`DROP INDEX "IDX_d57f9030cd3af7f63ffb1c267c"`); + await queryRunner.query(`DROP INDEX "IDX_4c02d38a976c3ae132228c6fce"`); + await queryRunner.query(`DROP INDEX "IDX_0e206cec573f1edff4a3062923"`); + await queryRunner.query(`DROP INDEX "IDX_2710a55f826ee236ea1a62698f"`); + await queryRunner.query(`DROP INDEX "IDX_347fec870eafea7b26c8a73bac"`); + await queryRunner.query(`DROP TABLE "hashtag"`); + await queryRunner.query(`DROP INDEX "IDX_605472305f26818cc93d1baaa7"`); + await queryRunner.query(`DROP INDEX "IDX_d844bfc6f3f523a05189076efa"`); + await queryRunner.query(`DROP TABLE "user_list_joining"`); + await queryRunner.query(`DROP INDEX "IDX_b7fcefbdd1c18dce86687531f9"`); + await queryRunner.query(`DROP TABLE "user_list"`); + await queryRunner.query(`DROP INDEX "IDX_98a1bc5cb30dfd159de056549f"`); + await queryRunner.query(`DROP INDEX "IDX_0627125f1a8a42c9a1929edb55"`); + await queryRunner.query(`DROP INDEX "IDX_2cd4a2743a99671308f5417759"`); + await queryRunner.query(`DROP INDEX "IDX_b9a354f7941c1e779f3b33aea6"`); + await queryRunner.query(`DROP TABLE "blocking"`); + await queryRunner.query(`DROP INDEX "IDX_97754ca6f2baff9b4abb7f853d"`); + await queryRunner.query(`DROP TABLE "sw_subscription"`); + await queryRunner.query(`DROP INDEX "IDX_1eb9d9824a630321a29fd3b290"`); + await queryRunner.query(`DROP INDEX "IDX_93060675b4a79a577f31d260c6"`); + await queryRunner.query(`DROP INDEX "IDX_ec96b4fed9dae517e0dbbe0675"`); + await queryRunner.query(`DROP INDEX "IDX_f86d57fbca33c7a4e6897490cc"`); + await queryRunner.query(`DROP TABLE "muting"`); + await queryRunner.query(`DROP INDEX "IDX_8d5afc98982185799b160e10eb"`); + await queryRunner.query(`DROP INDEX "IDX_2cd3b2a6b4cf0b910b260afe08"`); + await queryRunner.query(`DROP TABLE "instance"`); + await queryRunner.query(`DROP INDEX "IDX_307be5f1d1252e0388662acb96"`); + await queryRunner.query(`DROP INDEX "IDX_6516c5a6f3c015b4eed39978be"`); + await queryRunner.query(`DROP INDEX "IDX_24e0042143a18157b234df186c"`); + await queryRunner.query(`DROP INDEX "IDX_582f8fab771a9040a12961f3e7"`); + await queryRunner.query(`DROP TABLE "following"`); + await queryRunner.query(`DROP TABLE "meta"`); + await queryRunner.query(`DROP INDEX "IDX_3c601b70a1066d2c8b517094cb"`); + await queryRunner.query(`DROP INDEX "IDX_b11a5e627c41d4dc3170f1d370"`); + await queryRunner.query(`DROP TABLE "notification"`); + await queryRunner.query(`DROP INDEX "IDX_d908433a4953cc13216cd9c274"`); + await queryRunner.query(`DROP INDEX "IDX_e637cba4dc4410218c4251260e"`); + await queryRunner.query(`DROP INDEX "IDX_56b0166d34ddae49d8ef7610bb"`); + await queryRunner.query(`DROP TABLE "note_unread"`); + await queryRunner.query(`DROP INDEX "IDX_a42c93c69989ce1d09959df4cf"`); + await queryRunner.query(`DROP INDEX "IDX_44499765eec6b5489d72c4253b"`); + await queryRunner.query(`DROP INDEX "IDX_03e7028ab8388a3f5e3ce2a861"`); + await queryRunner.query(`DROP INDEX "IDX_b0134ec406e8d09a540f818288"`); + await queryRunner.query(`DROP INDEX "IDX_318cdf42a9cfc11f479bd802bb"`); + await queryRunner.query(`DROP TABLE "note_watching"`); + await queryRunner.query(`DROP INDEX "IDX_ad0c221b25672daf2df320a817"`); + await queryRunner.query(`DROP INDEX "IDX_45145e4953780f3cd5656f0ea6"`); + await queryRunner.query(`DROP INDEX "IDX_13761f64257f40c5636d0ff95e"`); + await queryRunner.query(`DROP INDEX "IDX_01f4581f114e0ebd2bbb876f0b"`); + await queryRunner.query(`DROP TABLE "note_reaction"`); + await queryRunner.query(`DROP INDEX "IDX_50bd7164c5b78f1f4a42c4d21f"`); + await queryRunner.query(`DROP INDEX "IDX_aecfbd5ef60374918e63ee95fa"`); + await queryRunner.query(`DROP INDEX "IDX_66d2bd2ee31d14bcc23069a89f"`); + await queryRunner.query(`DROP INDEX "IDX_0fb627e1c2f753262a74f0562d"`); + await queryRunner.query(`DROP TABLE "poll_vote"`); + await queryRunner.query(`DROP INDEX "IDX_7125a826ab192eb27e11d358a5"`); + await queryRunner.query(`DROP INDEX "IDX_88937d94d7443d9a99a76fa5c0"`); + await queryRunner.query(`DROP INDEX "IDX_54ebcb6d27222913b908d56fd8"`); + await queryRunner.query(`DROP INDEX "IDX_796a8c03959361f97dc2be1d5c"`); + await queryRunner.query(`DROP INDEX "IDX_25dfc71b0369b003a4cd434d0b"`); + await queryRunner.query(`DROP INDEX "IDX_51c063b6a133a9cb87145450f5"`); + await queryRunner.query(`DROP INDEX "IDX_153536c67d05e9adb24e99fc2b"`); + await queryRunner.query(`DROP INDEX "IDX_5b87d9d19127bd5d92026017a7"`); + await queryRunner.query(`DROP INDEX "IDX_52ccc804d7c69037d558bac4c9"`); + await queryRunner.query(`DROP INDEX "IDX_17cb3553c700a4985dff5a30ff"`); + await queryRunner.query(`DROP INDEX "IDX_e7c0567f5261063592f022e9b5"`); + await queryRunner.query(`DROP TABLE "note"`); + await queryRunner.query(`DROP TYPE "note_visibility_enum"`); + await queryRunner.query(`DROP INDEX "IDX_9949557d0e1b2c19e5344c171e"`); + await queryRunner.query(`DROP INDEX "IDX_64c327441248bae40f7d92f34f"`); + await queryRunner.query(`DROP INDEX "IDX_70ba8f6af34bc924fc9e12adb8"`); + await queryRunner.query(`DROP TABLE "access_token"`); + await queryRunner.query(`DROP INDEX "IDX_f49922d511d666848f250663c4"`); + await queryRunner.query(`DROP INDEX "IDX_3f5b0899ef90527a3462d7c2cb"`); + await queryRunner.query(`DROP INDEX "IDX_048a757923ed8b157e9895da53"`); + await queryRunner.query(`DROP TABLE "app"`); + await queryRunner.query(`DROP INDEX "IDX_5deb01ae162d1d70b80d064c27"`); + await queryRunner.query(`DROP INDEX "IDX_a854e557b1b14814750c7c7b0c"`); + await queryRunner.query(`DROP INDEX "IDX_be623adaa4c566baf5d29ce0c8"`); + await queryRunner.query(`DROP INDEX "IDX_3252a5df8d5bbd16b281f7799e"`); + await queryRunner.query(`DROP INDEX "IDX_fa99d777623947a5b05f394cae"`); + await queryRunner.query(`DROP INDEX "IDX_a27b942a0d6dcff90e3ee9b5e8"`); + await queryRunner.query(`DROP INDEX "IDX_80ca6e6ef65fb9ef34ea8c90f4"`); + await queryRunner.query(`DROP INDEX "IDX_e11e649824a45d8ed01d597fd9"`); + await queryRunner.query(`DROP TABLE "user"`); + await queryRunner.query(`DROP INDEX "IDX_bb90d1956dafc4068c28aa7560"`); + await queryRunner.query(`DROP INDEX "IDX_e5848eac4940934e23dbc17581"`); + await queryRunner.query(`DROP INDEX "IDX_c55b2b7c284d9fef98026fc88e"`); + await queryRunner.query(`DROP INDEX "IDX_e74022ce9a074b3866f70e0d27"`); + await queryRunner.query(`DROP INDEX "IDX_d85a184c2540d2deba33daf642"`); + await queryRunner.query(`DROP INDEX "IDX_a40b8df8c989d7db937ea27cf6"`); + await queryRunner.query(`DROP INDEX "IDX_37bb9a1b4585f8a3beb24c62d6"`); + await queryRunner.query(`DROP INDEX "IDX_92779627994ac79277f070c91e"`); + await queryRunner.query(`DROP INDEX "IDX_860fa6f6c7df5bb887249fba22"`); + await queryRunner.query(`DROP INDEX "IDX_c8dfad3b72196dd1d6b5db168a"`); + await queryRunner.query(`DROP TABLE "drive_file"`); + await queryRunner.query(`DROP INDEX "IDX_00ceffb0cdc238b3233294f08f"`); + await queryRunner.query(`DROP INDEX "IDX_f4fc06e49c0171c85f1c48060d"`); + await queryRunner.query(`DROP INDEX "IDX_02878d441ceae15ce060b73daf"`); + await queryRunner.query(`DROP TABLE "drive_folder"`); + await queryRunner.query(`DROP INDEX "IDX_584b536b49e53ac81beb39a177"`); + await queryRunner.query(`DROP INDEX "IDX_8cb40cfc8f3c28261e6f887b03"`); + await queryRunner.query(`DROP INDEX "IDX_8e4eb51a35d81b64dda28eed0a"`); + await queryRunner.query(`DROP TABLE "log"`); + await queryRunner.query(`DROP TYPE "log_level_enum"`); + } } diff --git a/packages/backend/migration/1556348509290-Pages.js b/packages/backend/migration/1556348509290-Pages.js index 50caa2ce91..696b2acbec 100644 --- a/packages/backend/migration/1556348509290-Pages.js +++ b/packages/backend/migration/1556348509290-Pages.js @@ -1,28 +1,50 @@ - - export class Pages1556348509290 { - async up(queryRunner) { - await queryRunner.query(`CREATE TYPE "page_visibility_enum" AS ENUM('public', 'followers', 'specified')`); - await queryRunner.query(`CREATE TABLE "page" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "title" character varying(256) NOT NULL, "name" character varying(256) NOT NULL, "summary" character varying(256), "alignCenter" boolean NOT NULL, "font" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "eyeCatchingImageId" character varying(32), "content" jsonb NOT NULL DEFAULT '[]', "variables" jsonb NOT NULL DEFAULT '[]', "visibility" "page_visibility_enum" NOT NULL, "visibleUserIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], CONSTRAINT "PK_742f4117e065c5b6ad21b37ba1f" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_fbb4297c927a9b85e9cefa2eb1" ON "page" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_af639b066dfbca78b01a920f8a" ON "page" ("updatedAt") `); - await queryRunner.query(`CREATE INDEX "IDX_b82c19c08afb292de4600d99e4" ON "page" ("name") `); - await queryRunner.query(`CREATE INDEX "IDX_ae1d917992dd0c9d9bbdad06c4" ON "page" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_90148bbc2bf0854428786bfc15" ON "page" ("visibleUserIds") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_2133ef8317e4bdb839c0dcbf13" ON "page" ("userId", "name") `); - await queryRunner.query(`ALTER TABLE "page" ADD CONSTRAINT "FK_ae1d917992dd0c9d9bbdad06c4a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "page" ADD CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10" FOREIGN KEY ("eyeCatchingImageId") REFERENCES "drive_file"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "page" DROP CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10"`); - await queryRunner.query(`ALTER TABLE "page" DROP CONSTRAINT "FK_ae1d917992dd0c9d9bbdad06c4a"`); - await queryRunner.query(`DROP INDEX "IDX_2133ef8317e4bdb839c0dcbf13"`); - await queryRunner.query(`DROP INDEX "IDX_90148bbc2bf0854428786bfc15"`); - await queryRunner.query(`DROP INDEX "IDX_ae1d917992dd0c9d9bbdad06c4"`); - await queryRunner.query(`DROP INDEX "IDX_b82c19c08afb292de4600d99e4"`); - await queryRunner.query(`DROP INDEX "IDX_af639b066dfbca78b01a920f8a"`); - await queryRunner.query(`DROP INDEX "IDX_fbb4297c927a9b85e9cefa2eb1"`); - await queryRunner.query(`DROP TABLE "page"`); - await queryRunner.query(`DROP TYPE "page_visibility_enum"`); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE TYPE "page_visibility_enum" AS ENUM('public', 'followers', 'specified')`, + ); + await queryRunner.query( + `CREATE TABLE "page" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "title" character varying(256) NOT NULL, "name" character varying(256) NOT NULL, "summary" character varying(256), "alignCenter" boolean NOT NULL, "font" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "eyeCatchingImageId" character varying(32), "content" jsonb NOT NULL DEFAULT '[]', "variables" jsonb NOT NULL DEFAULT '[]', "visibility" "page_visibility_enum" NOT NULL, "visibleUserIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], CONSTRAINT "PK_742f4117e065c5b6ad21b37ba1f" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_fbb4297c927a9b85e9cefa2eb1" ON "page" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_af639b066dfbca78b01a920f8a" ON "page" ("updatedAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b82c19c08afb292de4600d99e4" ON "page" ("name") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_ae1d917992dd0c9d9bbdad06c4" ON "page" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_90148bbc2bf0854428786bfc15" ON "page" ("visibleUserIds") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_2133ef8317e4bdb839c0dcbf13" ON "page" ("userId", "name") `, + ); + await queryRunner.query( + `ALTER TABLE "page" ADD CONSTRAINT "FK_ae1d917992dd0c9d9bbdad06c4a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "page" ADD CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10" FOREIGN KEY ("eyeCatchingImageId") REFERENCES "drive_file"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "page" DROP CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10"`, + ); + await queryRunner.query( + `ALTER TABLE "page" DROP CONSTRAINT "FK_ae1d917992dd0c9d9bbdad06c4a"`, + ); + await queryRunner.query(`DROP INDEX "IDX_2133ef8317e4bdb839c0dcbf13"`); + await queryRunner.query(`DROP INDEX "IDX_90148bbc2bf0854428786bfc15"`); + await queryRunner.query(`DROP INDEX "IDX_ae1d917992dd0c9d9bbdad06c4"`); + await queryRunner.query(`DROP INDEX "IDX_b82c19c08afb292de4600d99e4"`); + await queryRunner.query(`DROP INDEX "IDX_af639b066dfbca78b01a920f8a"`); + await queryRunner.query(`DROP INDEX "IDX_fbb4297c927a9b85e9cefa2eb1"`); + await queryRunner.query(`DROP TABLE "page"`); + await queryRunner.query(`DROP TYPE "page_visibility_enum"`); + } } diff --git a/packages/backend/migration/1556746559567-UserProfile.js b/packages/backend/migration/1556746559567-UserProfile.js index 50a9d1a8be..d229ec519f 100644 --- a/packages/backend/migration/1556746559567-UserProfile.js +++ b/packages/backend/migration/1556746559567-UserProfile.js @@ -1,13 +1,21 @@ - - export class UserProfile1556746559567 { - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "githubId" TYPE VARCHAR(64) USING "githubId"::VARCHAR(64)`); - await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "discordExpiresDate" TYPE VARCHAR(64) USING "discordExpiresDate"::VARCHAR(64)`); - } - async down(queryRunner) { - await queryRunner.query(`UPDATE "user_profile" SET github = FALSE, discord = FALSE`); - await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "githubId" TYPE INTEGER USING NULL`); - await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "discordExpiresDate" TYPE INTEGER USING NULL`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ALTER COLUMN "githubId" TYPE VARCHAR(64) USING "githubId"::VARCHAR(64)`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ALTER COLUMN "discordExpiresDate" TYPE VARCHAR(64) USING "discordExpiresDate"::VARCHAR(64)`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `UPDATE "user_profile" SET github = FALSE, discord = FALSE`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ALTER COLUMN "githubId" TYPE INTEGER USING NULL`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ALTER COLUMN "discordExpiresDate" TYPE INTEGER USING NULL`, + ); + } } diff --git a/packages/backend/migration/1557476068003-PinnedUsers.js b/packages/backend/migration/1557476068003-PinnedUsers.js index d9cce25435..6f348836ad 100644 --- a/packages/backend/migration/1557476068003-PinnedUsers.js +++ b/packages/backend/migration/1557476068003-PinnedUsers.js @@ -1,10 +1,10 @@ - - export class PinnedUsers1557476068003 { - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "pinnedUsers" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedUsers"`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "pinnedUsers" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedUsers"`); + } } diff --git a/packages/backend/migration/1557761316509-AddSomeUrls.js b/packages/backend/migration/1557761316509-AddSomeUrls.js index ab8736f7cc..0734e14e90 100644 --- a/packages/backend/migration/1557761316509-AddSomeUrls.js +++ b/packages/backend/migration/1557761316509-AddSomeUrls.js @@ -1,14 +1,18 @@ - - export class AddSomeUrls1557761316509 { - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "ToSUrl" character varying(512)`); - await queryRunner.query(`ALTER TABLE "meta" ADD "repositoryUrl" character varying(512) NOT NULL DEFAULT 'https://github.com/misskey-dev/misskey'`); - await queryRunner.query(`ALTER TABLE "meta" ADD "feedbackUrl" character varying(512) DEFAULT 'https://github.com/misskey-dev/misskey/issues/new'`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "feedbackUrl"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "repositoryUrl"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "ToSUrl"`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "ToSUrl" character varying(512)`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "repositoryUrl" character varying(512) NOT NULL DEFAULT 'https://github.com/misskey-dev/misskey'`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "feedbackUrl" character varying(512) DEFAULT 'https://github.com/misskey-dev/misskey/issues/new'`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "feedbackUrl"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "repositoryUrl"`); + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "ToSUrl"`); + } } diff --git a/packages/backend/migration/1557932705754-ObjectStorageSetting.js b/packages/backend/migration/1557932705754-ObjectStorageSetting.js index 19a0b9d5cd..5fcc98fe15 100644 --- a/packages/backend/migration/1557932705754-ObjectStorageSetting.js +++ b/packages/backend/migration/1557932705754-ObjectStorageSetting.js @@ -1,28 +1,66 @@ - - export class ObjectStorageSetting1557932705754 { - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "useObjectStorage" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`ALTER TABLE "meta" ADD "objectStorageBucket" character varying(512)`); - await queryRunner.query(`ALTER TABLE "meta" ADD "objectStoragePrefix" character varying(512)`); - await queryRunner.query(`ALTER TABLE "meta" ADD "objectStorageBaseUrl" character varying(512)`); - await queryRunner.query(`ALTER TABLE "meta" ADD "objectStorageEndpoint" character varying(512)`); - await queryRunner.query(`ALTER TABLE "meta" ADD "objectStorageRegion" character varying(512)`); - await queryRunner.query(`ALTER TABLE "meta" ADD "objectStorageAccessKey" character varying(512)`); - await queryRunner.query(`ALTER TABLE "meta" ADD "objectStorageSecretKey" character varying(512)`); - await queryRunner.query(`ALTER TABLE "meta" ADD "objectStoragePort" integer`); - await queryRunner.query(`ALTER TABLE "meta" ADD "objectStorageUseSSL" boolean NOT NULL DEFAULT true`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStorageUseSSL"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStoragePort"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStorageSecretKey"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStorageAccessKey"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStorageRegion"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStorageEndpoint"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStorageBaseUrl"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStoragePrefix"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStorageBucket"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "useObjectStorage"`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "useObjectStorage" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "objectStorageBucket" character varying(512)`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "objectStoragePrefix" character varying(512)`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "objectStorageBaseUrl" character varying(512)`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "objectStorageEndpoint" character varying(512)`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "objectStorageRegion" character varying(512)`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "objectStorageAccessKey" character varying(512)`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "objectStorageSecretKey" character varying(512)`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "objectStoragePort" integer`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "objectStorageUseSSL" boolean NOT NULL DEFAULT true`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "objectStorageUseSSL"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "objectStoragePort"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "objectStorageSecretKey"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "objectStorageAccessKey"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "objectStorageRegion"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "objectStorageEndpoint"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "objectStorageBaseUrl"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "objectStoragePrefix"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "objectStorageBucket"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "useObjectStorage"`, + ); + } } diff --git a/packages/backend/migration/1558072954435-PageLike.js b/packages/backend/migration/1558072954435-PageLike.js index 31b08418a9..e919e02ddb 100644 --- a/packages/backend/migration/1558072954435-PageLike.js +++ b/packages/backend/migration/1558072954435-PageLike.js @@ -1,20 +1,34 @@ - - export class PageLike1558072954435 { - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "page_like" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "pageId" character varying(32) NOT NULL, CONSTRAINT "PK_813f034843af992d3ae0f43c64c" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_0e61efab7f88dbb79c9166dbb4" ON "page_like" ("userId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_4ce6fb9c70529b4c8ac46c9bfa" ON "page_like" ("userId", "pageId") `); - await queryRunner.query(`ALTER TABLE "page" ADD "likedCount" integer NOT NULL DEFAULT 0`); - await queryRunner.query(`ALTER TABLE "page_like" ADD CONSTRAINT "FK_0e61efab7f88dbb79c9166dbb48" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "page_like" ADD CONSTRAINT "FK_cf8782626dced3176038176a847" FOREIGN KEY ("pageId") REFERENCES "page"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "page_like" DROP CONSTRAINT "FK_cf8782626dced3176038176a847"`); - await queryRunner.query(`ALTER TABLE "page_like" DROP CONSTRAINT "FK_0e61efab7f88dbb79c9166dbb48"`); - await queryRunner.query(`ALTER TABLE "page" DROP COLUMN "likedCount"`); - await queryRunner.query(`DROP INDEX "IDX_4ce6fb9c70529b4c8ac46c9bfa"`); - await queryRunner.query(`DROP INDEX "IDX_0e61efab7f88dbb79c9166dbb4"`); - await queryRunner.query(`DROP TABLE "page_like"`); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "page_like" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "pageId" character varying(32) NOT NULL, CONSTRAINT "PK_813f034843af992d3ae0f43c64c" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0e61efab7f88dbb79c9166dbb4" ON "page_like" ("userId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_4ce6fb9c70529b4c8ac46c9bfa" ON "page_like" ("userId", "pageId") `, + ); + await queryRunner.query( + `ALTER TABLE "page" ADD "likedCount" integer NOT NULL DEFAULT 0`, + ); + await queryRunner.query( + `ALTER TABLE "page_like" ADD CONSTRAINT "FK_0e61efab7f88dbb79c9166dbb48" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "page_like" ADD CONSTRAINT "FK_cf8782626dced3176038176a847" FOREIGN KEY ("pageId") REFERENCES "page"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "page_like" DROP CONSTRAINT "FK_cf8782626dced3176038176a847"`, + ); + await queryRunner.query( + `ALTER TABLE "page_like" DROP CONSTRAINT "FK_0e61efab7f88dbb79c9166dbb48"`, + ); + await queryRunner.query(`ALTER TABLE "page" DROP COLUMN "likedCount"`); + await queryRunner.query(`DROP INDEX "IDX_4ce6fb9c70529b4c8ac46c9bfa"`); + await queryRunner.query(`DROP INDEX "IDX_0e61efab7f88dbb79c9166dbb4"`); + await queryRunner.query(`DROP TABLE "page_like"`); + } } diff --git a/packages/backend/migration/1558103093633-UserGroup.js b/packages/backend/migration/1558103093633-UserGroup.js index b670b31c3d..dc581a24ef 100644 --- a/packages/backend/migration/1558103093633-UserGroup.js +++ b/packages/backend/migration/1558103093633-UserGroup.js @@ -1,38 +1,82 @@ - - export class UserGroup1558103093633 { - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "user_group" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "name" character varying(256) NOT NULL, "userId" character varying(32) NOT NULL, "isPrivate" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_3c29fba6fe013ec8724378ce7c9" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_20e30aa35180e317e133d75316" ON "user_group" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_3d6b372788ab01be58853003c9" ON "user_group" ("userId") `); - await queryRunner.query(`CREATE TABLE "user_group_joining" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "userGroupId" character varying(32) NOT NULL, CONSTRAINT "PK_15f2425885253c5507e1599cfe7" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_f3a1b4bd0c7cabba958a0c0b23" ON "user_group_joining" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_67dc758bc0566985d1b3d39986" ON "user_group_joining" ("userGroupId") `); - await queryRunner.query(`ALTER TABLE "messaging_message" ADD "groupId" character varying(32)`); - await queryRunner.query(`ALTER TABLE "messaging_message" ADD "reads" character varying(32) array NOT NULL DEFAULT '{}'::varchar[]`); - await queryRunner.query(`ALTER TABLE "messaging_message" ALTER COLUMN "recipientId" DROP NOT NULL`); - await queryRunner.query(`COMMENT ON COLUMN "messaging_message"."recipientId" IS 'The recipient user ID.'`); - await queryRunner.query(`CREATE INDEX "IDX_2c4be03b446884f9e9c502135b" ON "messaging_message" ("groupId") `); - await queryRunner.query(`ALTER TABLE "messaging_message" ADD CONSTRAINT "FK_2c4be03b446884f9e9c502135be" FOREIGN KEY ("groupId") REFERENCES "user_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user_group" ADD CONSTRAINT "FK_3d6b372788ab01be58853003c93" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user_group_joining" ADD CONSTRAINT "FK_f3a1b4bd0c7cabba958a0c0b231" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user_group_joining" ADD CONSTRAINT "FK_67dc758bc0566985d1b3d399865" FOREIGN KEY ("userGroupId") REFERENCES "user_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_group_joining" DROP CONSTRAINT "FK_67dc758bc0566985d1b3d399865"`); - await queryRunner.query(`ALTER TABLE "user_group_joining" DROP CONSTRAINT "FK_f3a1b4bd0c7cabba958a0c0b231"`); - await queryRunner.query(`ALTER TABLE "user_group" DROP CONSTRAINT "FK_3d6b372788ab01be58853003c93"`); - await queryRunner.query(`ALTER TABLE "messaging_message" DROP CONSTRAINT "FK_2c4be03b446884f9e9c502135be"`); - await queryRunner.query(`DROP INDEX "IDX_2c4be03b446884f9e9c502135b"`); - await queryRunner.query(`COMMENT ON COLUMN "messaging_message"."recipientId" IS ''`); - await queryRunner.query(`ALTER TABLE "messaging_message" ALTER COLUMN "recipientId" SET NOT NULL`); - await queryRunner.query(`ALTER TABLE "messaging_message" DROP COLUMN "reads"`); - await queryRunner.query(`ALTER TABLE "messaging_message" DROP COLUMN "groupId"`); - await queryRunner.query(`DROP INDEX "IDX_67dc758bc0566985d1b3d39986"`); - await queryRunner.query(`DROP INDEX "IDX_f3a1b4bd0c7cabba958a0c0b23"`); - await queryRunner.query(`DROP TABLE "user_group_joining"`); - await queryRunner.query(`DROP INDEX "IDX_3d6b372788ab01be58853003c9"`); - await queryRunner.query(`DROP INDEX "IDX_20e30aa35180e317e133d75316"`); - await queryRunner.query(`DROP TABLE "user_group"`); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "user_group" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "name" character varying(256) NOT NULL, "userId" character varying(32) NOT NULL, "isPrivate" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_3c29fba6fe013ec8724378ce7c9" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_20e30aa35180e317e133d75316" ON "user_group" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_3d6b372788ab01be58853003c9" ON "user_group" ("userId") `, + ); + await queryRunner.query( + `CREATE TABLE "user_group_joining" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "userGroupId" character varying(32) NOT NULL, CONSTRAINT "PK_15f2425885253c5507e1599cfe7" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f3a1b4bd0c7cabba958a0c0b23" ON "user_group_joining" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_67dc758bc0566985d1b3d39986" ON "user_group_joining" ("userGroupId") `, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" ADD "groupId" character varying(32)`, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" ADD "reads" character varying(32) array NOT NULL DEFAULT '{}'::varchar[]`, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" ALTER COLUMN "recipientId" DROP NOT NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "messaging_message"."recipientId" IS 'The recipient user ID.'`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_2c4be03b446884f9e9c502135b" ON "messaging_message" ("groupId") `, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" ADD CONSTRAINT "FK_2c4be03b446884f9e9c502135be" FOREIGN KEY ("groupId") REFERENCES "user_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user_group" ADD CONSTRAINT "FK_3d6b372788ab01be58853003c93" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user_group_joining" ADD CONSTRAINT "FK_f3a1b4bd0c7cabba958a0c0b231" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user_group_joining" ADD CONSTRAINT "FK_67dc758bc0566985d1b3d399865" FOREIGN KEY ("userGroupId") REFERENCES "user_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_group_joining" DROP CONSTRAINT "FK_67dc758bc0566985d1b3d399865"`, + ); + await queryRunner.query( + `ALTER TABLE "user_group_joining" DROP CONSTRAINT "FK_f3a1b4bd0c7cabba958a0c0b231"`, + ); + await queryRunner.query( + `ALTER TABLE "user_group" DROP CONSTRAINT "FK_3d6b372788ab01be58853003c93"`, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" DROP CONSTRAINT "FK_2c4be03b446884f9e9c502135be"`, + ); + await queryRunner.query(`DROP INDEX "IDX_2c4be03b446884f9e9c502135b"`); + await queryRunner.query( + `COMMENT ON COLUMN "messaging_message"."recipientId" IS ''`, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" ALTER COLUMN "recipientId" SET NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" DROP COLUMN "reads"`, + ); + await queryRunner.query( + `ALTER TABLE "messaging_message" DROP COLUMN "groupId"`, + ); + await queryRunner.query(`DROP INDEX "IDX_67dc758bc0566985d1b3d39986"`); + await queryRunner.query(`DROP INDEX "IDX_f3a1b4bd0c7cabba958a0c0b23"`); + await queryRunner.query(`DROP TABLE "user_group_joining"`); + await queryRunner.query(`DROP INDEX "IDX_3d6b372788ab01be58853003c9"`); + await queryRunner.query(`DROP INDEX "IDX_20e30aa35180e317e133d75316"`); + await queryRunner.query(`DROP TABLE "user_group"`); + } } diff --git a/packages/backend/migration/1558257926829-UserGroupInvite.js b/packages/backend/migration/1558257926829-UserGroupInvite.js index e48bd3a7ff..ed137fdb2e 100644 --- a/packages/backend/migration/1558257926829-UserGroupInvite.js +++ b/packages/backend/migration/1558257926829-UserGroupInvite.js @@ -1,22 +1,38 @@ - - export class UserGroupInvite1558257926829 { - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "user_group_invite" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "userGroupId" character varying(32) NOT NULL, CONSTRAINT "PK_3893884af0d3a5f4d01e7921a97" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_1039988afa3bf991185b277fe0" ON "user_group_invite" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_e10924607d058004304611a436" ON "user_group_invite" ("userGroupId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_78787741f9010886796f2320a4" ON "user_group_invite" ("userId", "userGroupId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_d9ecaed8c6dc43f3592c229282" ON "user_group_joining" ("userId", "userGroupId") `); - await queryRunner.query(`ALTER TABLE "user_group_invite" ADD CONSTRAINT "FK_1039988afa3bf991185b277fe03" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user_group_invite" ADD CONSTRAINT "FK_e10924607d058004304611a436a" FOREIGN KEY ("userGroupId") REFERENCES "user_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_group_invite" DROP CONSTRAINT "FK_e10924607d058004304611a436a"`); - await queryRunner.query(`ALTER TABLE "user_group_invite" DROP CONSTRAINT "FK_1039988afa3bf991185b277fe03"`); - await queryRunner.query(`DROP INDEX "IDX_d9ecaed8c6dc43f3592c229282"`); - await queryRunner.query(`DROP INDEX "IDX_78787741f9010886796f2320a4"`); - await queryRunner.query(`DROP INDEX "IDX_e10924607d058004304611a436"`); - await queryRunner.query(`DROP INDEX "IDX_1039988afa3bf991185b277fe0"`); - await queryRunner.query(`DROP TABLE "user_group_invite"`); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "user_group_invite" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "userGroupId" character varying(32) NOT NULL, CONSTRAINT "PK_3893884af0d3a5f4d01e7921a97" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_1039988afa3bf991185b277fe0" ON "user_group_invite" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e10924607d058004304611a436" ON "user_group_invite" ("userGroupId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_78787741f9010886796f2320a4" ON "user_group_invite" ("userId", "userGroupId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_d9ecaed8c6dc43f3592c229282" ON "user_group_joining" ("userId", "userGroupId") `, + ); + await queryRunner.query( + `ALTER TABLE "user_group_invite" ADD CONSTRAINT "FK_1039988afa3bf991185b277fe03" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user_group_invite" ADD CONSTRAINT "FK_e10924607d058004304611a436a" FOREIGN KEY ("userGroupId") REFERENCES "user_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_group_invite" DROP CONSTRAINT "FK_e10924607d058004304611a436a"`, + ); + await queryRunner.query( + `ALTER TABLE "user_group_invite" DROP CONSTRAINT "FK_1039988afa3bf991185b277fe03"`, + ); + await queryRunner.query(`DROP INDEX "IDX_d9ecaed8c6dc43f3592c229282"`); + await queryRunner.query(`DROP INDEX "IDX_78787741f9010886796f2320a4"`); + await queryRunner.query(`DROP INDEX "IDX_e10924607d058004304611a436"`); + await queryRunner.query(`DROP INDEX "IDX_1039988afa3bf991185b277fe0"`); + await queryRunner.query(`DROP TABLE "user_group_invite"`); + } } diff --git a/packages/backend/migration/1558266512381-UserListJoining.js b/packages/backend/migration/1558266512381-UserListJoining.js index 3398aed139..3597e51f76 100644 --- a/packages/backend/migration/1558266512381-UserListJoining.js +++ b/packages/backend/migration/1558266512381-UserListJoining.js @@ -1,10 +1,10 @@ - - export class UserListJoining1558266512381 { - async up(queryRunner) { - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_90f7da835e4c10aca6853621e1" ON "user_list_joining" ("userId", "userListId") `); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_90f7da835e4c10aca6853621e1"`); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_90f7da835e4c10aca6853621e1" ON "user_list_joining" ("userId", "userListId") `, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_90f7da835e4c10aca6853621e1"`); + } } diff --git a/packages/backend/migration/1561706992953-webauthn.js b/packages/backend/migration/1561706992953-webauthn.js index b007ffef14..f860d2c11b 100644 --- a/packages/backend/migration/1561706992953-webauthn.js +++ b/packages/backend/migration/1561706992953-webauthn.js @@ -1,26 +1,48 @@ - - export class webauthn1561706992953 { - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "attestation_challenge" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "challenge" character varying(64) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "registrationChallenge" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_d0ba6786e093f1bcb497572a6b5" PRIMARY KEY ("id", "userId"))`); - await queryRunner.query(`CREATE INDEX "IDX_f1a461a618fa1755692d0e0d59" ON "attestation_challenge" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_47efb914aed1f72dd39a306c7b" ON "attestation_challenge" ("challenge") `); - await queryRunner.query(`CREATE TABLE "user_security_key" ("id" character varying NOT NULL, "userId" character varying(32) NOT NULL, "publicKey" character varying NOT NULL, "lastUsed" TIMESTAMP WITH TIME ZONE NOT NULL, "name" character varying(30) NOT NULL, CONSTRAINT "PK_3e508571121ab39c5f85d10c166" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_ff9ca3b5f3ee3d0681367a9b44" ON "user_security_key" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_0d7718e562dcedd0aa5cf2c9f7" ON "user_security_key" ("publicKey") `); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "securityKeysAvailable" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`ALTER TABLE "attestation_challenge" ADD CONSTRAINT "FK_f1a461a618fa1755692d0e0d592" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "user_security_key" ADD CONSTRAINT "FK_ff9ca3b5f3ee3d0681367a9b447" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_security_key" DROP CONSTRAINT "FK_ff9ca3b5f3ee3d0681367a9b447"`); - await queryRunner.query(`ALTER TABLE "attestation_challenge" DROP CONSTRAINT "FK_f1a461a618fa1755692d0e0d592"`); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "securityKeysAvailable"`); - await queryRunner.query(`DROP INDEX "IDX_0d7718e562dcedd0aa5cf2c9f7"`); - await queryRunner.query(`DROP INDEX "IDX_ff9ca3b5f3ee3d0681367a9b44"`); - await queryRunner.query(`DROP TABLE "user_security_key"`); - await queryRunner.query(`DROP INDEX "IDX_47efb914aed1f72dd39a306c7b"`); - await queryRunner.query(`DROP INDEX "IDX_f1a461a618fa1755692d0e0d59"`); - await queryRunner.query(`DROP TABLE "attestation_challenge"`); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "attestation_challenge" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "challenge" character varying(64) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "registrationChallenge" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_d0ba6786e093f1bcb497572a6b5" PRIMARY KEY ("id", "userId"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f1a461a618fa1755692d0e0d59" ON "attestation_challenge" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_47efb914aed1f72dd39a306c7b" ON "attestation_challenge" ("challenge") `, + ); + await queryRunner.query( + `CREATE TABLE "user_security_key" ("id" character varying NOT NULL, "userId" character varying(32) NOT NULL, "publicKey" character varying NOT NULL, "lastUsed" TIMESTAMP WITH TIME ZONE NOT NULL, "name" character varying(30) NOT NULL, CONSTRAINT "PK_3e508571121ab39c5f85d10c166" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_ff9ca3b5f3ee3d0681367a9b44" ON "user_security_key" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0d7718e562dcedd0aa5cf2c9f7" ON "user_security_key" ("publicKey") `, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "securityKeysAvailable" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `ALTER TABLE "attestation_challenge" ADD CONSTRAINT "FK_f1a461a618fa1755692d0e0d592" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "user_security_key" ADD CONSTRAINT "FK_ff9ca3b5f3ee3d0681367a9b447" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_security_key" DROP CONSTRAINT "FK_ff9ca3b5f3ee3d0681367a9b447"`, + ); + await queryRunner.query( + `ALTER TABLE "attestation_challenge" DROP CONSTRAINT "FK_f1a461a618fa1755692d0e0d592"`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "securityKeysAvailable"`, + ); + await queryRunner.query(`DROP INDEX "IDX_0d7718e562dcedd0aa5cf2c9f7"`); + await queryRunner.query(`DROP INDEX "IDX_ff9ca3b5f3ee3d0681367a9b44"`); + await queryRunner.query(`DROP TABLE "user_security_key"`); + await queryRunner.query(`DROP INDEX "IDX_47efb914aed1f72dd39a306c7b"`); + await queryRunner.query(`DROP INDEX "IDX_f1a461a618fa1755692d0e0d59"`); + await queryRunner.query(`DROP TABLE "attestation_challenge"`); + } } diff --git a/packages/backend/migration/1561873850023-ChartIndexes.js b/packages/backend/migration/1561873850023-ChartIndexes.js index 3ce53567fc..ba46da1e41 100644 --- a/packages/backend/migration/1561873850023-ChartIndexes.js +++ b/packages/backend/migration/1561873850023-ChartIndexes.js @@ -1,198 +1,376 @@ - - export class ChartIndexes1561873850023 { - async up(queryRunner) { - await queryRunner.query(`CREATE INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc" ON "__chart__active_users" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_15e91a03aeeac9dbccdf43fc06" ON "__chart__active_users" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_00ed5f86db1f7efafb1978bf21" ON "__chart__active_users" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_20f57cc8f142c131340ee16742" ON "__chart__active_users" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_9a3ed15a30ab7e3a37702e6e08" ON "__chart__active_users" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_c26e2c1cbb6e911e0554b27416" ON "__chart__active_users" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_13565815f618a1ff53886c5b28" ON "__chart__drive" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_3fa0d0f17ca72e3dc80999a032" ON "__chart__drive" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_7a170f67425e62a8fabb76c872" ON "__chart__drive" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_6e1df243476e20cbf86572ecc0" ON "__chart__drive" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_3313d7288855ec105b5bbf6c21" ON "__chart__drive" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_06690fc959f1c9fdaf21928222" ON "__chart__drive" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_36cb699c49580d4e6c2e6159f9" ON "__chart__federation" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_e447064455928cf627590ef527" ON "__chart__federation" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_76e87c7bfc5d925fcbba405d84" ON "__chart__federation" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_2d416e6af791a82e338c79d480" ON "__chart__federation" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_dd907becf76104e4b656659e6b" ON "__chart__federation" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_e9cd07672b37d8966cf3709283" ON "__chart__federation" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_07747a1038c05f532a718fe1de" ON "__chart__hashtag" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_fcc181fb8283009c61cc4083ef" ON "__chart__hashtag" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_99a7d2faaef84a6f728d714ad6" ON "__chart__hashtag" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_49975586f50ed7b800fdd88fbd" ON "__chart__hashtag" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_6d6f156ceefc6bc5f273a0e370" ON "__chart__hashtag" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_6b8f34a1a64b06014b6fb66824" ON "__chart__instance" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_c12f0af4a66cdd30c2287ce8aa" ON "__chart__instance" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_da8a46ba84ca1d8bb5a29bfb63" ON "__chart__instance" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_d0a4f79af5a97b08f37b547197" ON "__chart__instance" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_f5448d9633cff74208d850aabe" ON "__chart__instance" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_a1efd3e0048a5f2793a47360dc" ON "__chart__network" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_f8dd01baeded2ffa833e0a610a" ON "__chart__network" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_7b5da130992ec9df96712d4290" ON "__chart__network" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_08fac0eb3b11f04c200c0b40dd" ON "__chart__network" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_0a905b992fecd2b5c3fb98759e" ON "__chart__network" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_9ff6944f01acb756fdc92d7563" ON "__chart__network" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_42eb716a37d381cdf566192b2b" ON "__chart__notes" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_e69096589f11e3baa98ddd64d0" ON "__chart__notes" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_7036f2957151588b813185c794" ON "__chart__notes" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_0c9a159c5082cbeef3ca6706b5" ON "__chart__notes" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_f09d543e3acb16c5976bdb31fa" ON "__chart__notes" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_924fc196c80ca24bae01dd37e4" ON "__chart__notes" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_5f86db6492274e07c1a3cdf286" ON "__chart__per_user_drive" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_328f259961e60c4fa0bfcf55ca" ON "__chart__per_user_drive" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_e496ca8096d28f6b9b509264dc" ON "__chart__per_user_drive" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_42ea9381f0fda8dfe0fa1c8b53" ON "__chart__per_user_drive" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_f2aeafde2ae6fbad38e857631b" ON "__chart__per_user_drive" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_7af07790712aa3438ff6773f3b" ON "__chart__per_user_following" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_f92dd6d03f8d994f29987f6214" ON "__chart__per_user_following" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_4b3593098b6edc9c5afe36b18b" ON "__chart__per_user_following" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_57b5458d0d3d6d1e7f13d4e57f" ON "__chart__per_user_following" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_4db3b84c7be0d3464714f3e0b1" ON "__chart__per_user_following" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_84234bd1abb873f07329681c83" ON "__chart__per_user_notes" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_8d2cbbc8114d90d19b44d626b6" ON "__chart__per_user_notes" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_55bf20f366979f2436de99206b" ON "__chart__per_user_notes" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_046feeb12e9ef5f783f409866a" ON "__chart__per_user_notes" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_f68a5ab958f9f5fa17a32ac23b" ON "__chart__per_user_notes" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_f7bf4c62059764c2c2bb40fdab" ON "__chart__per_user_reaction" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_65633a106bce43fc7c5c30a5c7" ON "__chart__per_user_reaction" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_8cf3156fd7a6b15c43459c6e3b" ON "__chart__per_user_reaction" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_edeb73c09c3143a81bcb34d569" ON "__chart__per_user_reaction" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_e316f01a6d24eb31db27f88262" ON "__chart__per_user_reaction" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_0c641990ecf47d2545df4edb75" ON "__chart__test_grouped" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_2be7ec6cebddc14dc11e206686" ON "__chart__test_grouped" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_234dff3c0b56a6150b95431ab9" ON "__chart__test_grouped" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_a5133470f4825902e170328ca5" ON "__chart__test_grouped" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_b14489029e4b3aaf4bba5fb524" ON "__chart__test_grouped" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_84e661abb7bd1e51b690d4b017" ON "__chart__test_grouped" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_437bab3c6061d90f6bb65fd2cc" ON "__chart__test_unique" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_5c73bf61da4f6e6f15bae88ed1" ON "__chart__test_unique" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_bbfa573a8181018851ed0b6357" ON "__chart__test_unique" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_d70c86baedc68326be11f9c0ce" ON "__chart__test_unique" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_a0cd75442dd10d0643a17c4a49" ON "__chart__test_unique" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_66e1e1ecd2f29e57778af35b59" ON "__chart__test_unique" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_b070a906db04b44c67c6c2144d" ON "__chart__test" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_92255988735563f0fe4aba1f05" ON "__chart__test" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_d41cce6aee1a50bfc062038f9b" ON "__chart__test" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_c5870993e25c3d5771f91f5003" ON "__chart__test" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_a319e5dbf47e8a17497623beae" ON "__chart__test" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_f170de677ea75ad4533de2723e" ON "__chart__test" ("span", "date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_845254b3eaf708ae8a6cac3026" ON "__chart__users" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_7c184198ecf66a8d3ecb253ab3" ON "__chart__users" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_ed9b95919c672a13008e9487ee" ON "__chart__users" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_f091abb24193d50c653c6b77fc" ON "__chart__users" ("span", "date") `); - await queryRunner.query(`CREATE INDEX "IDX_337e9599f278bd7537fe30876f" ON "__chart__users" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_a770a57c70e668cc61590c9161" ON "__chart__users" ("span", "date", "group") `); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_a770a57c70e668cc61590c9161"`); - await queryRunner.query(`DROP INDEX "IDX_337e9599f278bd7537fe30876f"`); - await queryRunner.query(`DROP INDEX "IDX_f091abb24193d50c653c6b77fc"`); - await queryRunner.query(`DROP INDEX "IDX_ed9b95919c672a13008e9487ee"`); - await queryRunner.query(`DROP INDEX "IDX_7c184198ecf66a8d3ecb253ab3"`); - await queryRunner.query(`DROP INDEX "IDX_845254b3eaf708ae8a6cac3026"`); - await queryRunner.query(`DROP INDEX "IDX_f170de677ea75ad4533de2723e"`); - await queryRunner.query(`DROP INDEX "IDX_a319e5dbf47e8a17497623beae"`); - await queryRunner.query(`DROP INDEX "IDX_c5870993e25c3d5771f91f5003"`); - await queryRunner.query(`DROP INDEX "IDX_d41cce6aee1a50bfc062038f9b"`); - await queryRunner.query(`DROP INDEX "IDX_92255988735563f0fe4aba1f05"`); - await queryRunner.query(`DROP INDEX "IDX_b070a906db04b44c67c6c2144d"`); - await queryRunner.query(`DROP INDEX "IDX_66e1e1ecd2f29e57778af35b59"`); - await queryRunner.query(`DROP INDEX "IDX_a0cd75442dd10d0643a17c4a49"`); - await queryRunner.query(`DROP INDEX "IDX_d70c86baedc68326be11f9c0ce"`); - await queryRunner.query(`DROP INDEX "IDX_bbfa573a8181018851ed0b6357"`); - await queryRunner.query(`DROP INDEX "IDX_5c73bf61da4f6e6f15bae88ed1"`); - await queryRunner.query(`DROP INDEX "IDX_437bab3c6061d90f6bb65fd2cc"`); - await queryRunner.query(`DROP INDEX "IDX_84e661abb7bd1e51b690d4b017"`); - await queryRunner.query(`DROP INDEX "IDX_b14489029e4b3aaf4bba5fb524"`); - await queryRunner.query(`DROP INDEX "IDX_a5133470f4825902e170328ca5"`); - await queryRunner.query(`DROP INDEX "IDX_234dff3c0b56a6150b95431ab9"`); - await queryRunner.query(`DROP INDEX "IDX_2be7ec6cebddc14dc11e206686"`); - await queryRunner.query(`DROP INDEX "IDX_0c641990ecf47d2545df4edb75"`); - await queryRunner.query(`DROP INDEX "IDX_e316f01a6d24eb31db27f88262"`); - await queryRunner.query(`DROP INDEX "IDX_229a41ad465f9205f1f5703291"`); - await queryRunner.query(`DROP INDEX "IDX_edeb73c09c3143a81bcb34d569"`); - await queryRunner.query(`DROP INDEX "IDX_8cf3156fd7a6b15c43459c6e3b"`); - await queryRunner.query(`DROP INDEX "IDX_65633a106bce43fc7c5c30a5c7"`); - await queryRunner.query(`DROP INDEX "IDX_f7bf4c62059764c2c2bb40fdab"`); - await queryRunner.query(`DROP INDEX "IDX_f68a5ab958f9f5fa17a32ac23b"`); - await queryRunner.query(`DROP INDEX "IDX_5048e9daccbbbc6d567bb142d3"`); - await queryRunner.query(`DROP INDEX "IDX_046feeb12e9ef5f783f409866a"`); - await queryRunner.query(`DROP INDEX "IDX_55bf20f366979f2436de99206b"`); - await queryRunner.query(`DROP INDEX "IDX_8d2cbbc8114d90d19b44d626b6"`); - await queryRunner.query(`DROP INDEX "IDX_84234bd1abb873f07329681c83"`); - await queryRunner.query(`DROP INDEX "IDX_4db3b84c7be0d3464714f3e0b1"`); - await queryRunner.query(`DROP INDEX "IDX_b77d4dd9562c3a899d9a286fcd"`); - await queryRunner.query(`DROP INDEX "IDX_57b5458d0d3d6d1e7f13d4e57f"`); - await queryRunner.query(`DROP INDEX "IDX_4b3593098b6edc9c5afe36b18b"`); - await queryRunner.query(`DROP INDEX "IDX_f92dd6d03f8d994f29987f6214"`); - await queryRunner.query(`DROP INDEX "IDX_7af07790712aa3438ff6773f3b"`); - await queryRunner.query(`DROP INDEX "IDX_f2aeafde2ae6fbad38e857631b"`); - await queryRunner.query(`DROP INDEX "IDX_30bf67687f483ace115c5ca642"`); - await queryRunner.query(`DROP INDEX "IDX_42ea9381f0fda8dfe0fa1c8b53"`); - await queryRunner.query(`DROP INDEX "IDX_e496ca8096d28f6b9b509264dc"`); - await queryRunner.query(`DROP INDEX "IDX_328f259961e60c4fa0bfcf55ca"`); - await queryRunner.query(`DROP INDEX "IDX_5f86db6492274e07c1a3cdf286"`); - await queryRunner.query(`DROP INDEX "IDX_924fc196c80ca24bae01dd37e4"`); - await queryRunner.query(`DROP INDEX "IDX_f09d543e3acb16c5976bdb31fa"`); - await queryRunner.query(`DROP INDEX "IDX_0c9a159c5082cbeef3ca6706b5"`); - await queryRunner.query(`DROP INDEX "IDX_7036f2957151588b813185c794"`); - await queryRunner.query(`DROP INDEX "IDX_e69096589f11e3baa98ddd64d0"`); - await queryRunner.query(`DROP INDEX "IDX_42eb716a37d381cdf566192b2b"`); - await queryRunner.query(`DROP INDEX "IDX_9ff6944f01acb756fdc92d7563"`); - await queryRunner.query(`DROP INDEX "IDX_0a905b992fecd2b5c3fb98759e"`); - await queryRunner.query(`DROP INDEX "IDX_08fac0eb3b11f04c200c0b40dd"`); - await queryRunner.query(`DROP INDEX "IDX_7b5da130992ec9df96712d4290"`); - await queryRunner.query(`DROP INDEX "IDX_f8dd01baeded2ffa833e0a610a"`); - await queryRunner.query(`DROP INDEX "IDX_a1efd3e0048a5f2793a47360dc"`); - await queryRunner.query(`DROP INDEX "IDX_f5448d9633cff74208d850aabe"`); - await queryRunner.query(`DROP INDEX "IDX_39ee857ab2f23493037c6b6631"`); - await queryRunner.query(`DROP INDEX "IDX_d0a4f79af5a97b08f37b547197"`); - await queryRunner.query(`DROP INDEX "IDX_da8a46ba84ca1d8bb5a29bfb63"`); - await queryRunner.query(`DROP INDEX "IDX_c12f0af4a66cdd30c2287ce8aa"`); - await queryRunner.query(`DROP INDEX "IDX_6b8f34a1a64b06014b6fb66824"`); - await queryRunner.query(`DROP INDEX "IDX_6d6f156ceefc6bc5f273a0e370"`); - await queryRunner.query(`DROP INDEX "IDX_25a97c02003338124b2b75fdbc"`); - await queryRunner.query(`DROP INDEX "IDX_49975586f50ed7b800fdd88fbd"`); - await queryRunner.query(`DROP INDEX "IDX_99a7d2faaef84a6f728d714ad6"`); - await queryRunner.query(`DROP INDEX "IDX_fcc181fb8283009c61cc4083ef"`); - await queryRunner.query(`DROP INDEX "IDX_07747a1038c05f532a718fe1de"`); - await queryRunner.query(`DROP INDEX "IDX_e9cd07672b37d8966cf3709283"`); - await queryRunner.query(`DROP INDEX "IDX_dd907becf76104e4b656659e6b"`); - await queryRunner.query(`DROP INDEX "IDX_2d416e6af791a82e338c79d480"`); - await queryRunner.query(`DROP INDEX "IDX_76e87c7bfc5d925fcbba405d84"`); - await queryRunner.query(`DROP INDEX "IDX_e447064455928cf627590ef527"`); - await queryRunner.query(`DROP INDEX "IDX_36cb699c49580d4e6c2e6159f9"`); - await queryRunner.query(`DROP INDEX "IDX_06690fc959f1c9fdaf21928222"`); - await queryRunner.query(`DROP INDEX "IDX_3313d7288855ec105b5bbf6c21"`); - await queryRunner.query(`DROP INDEX "IDX_6e1df243476e20cbf86572ecc0"`); - await queryRunner.query(`DROP INDEX "IDX_7a170f67425e62a8fabb76c872"`); - await queryRunner.query(`DROP INDEX "IDX_3fa0d0f17ca72e3dc80999a032"`); - await queryRunner.query(`DROP INDEX "IDX_13565815f618a1ff53886c5b28"`); - await queryRunner.query(`DROP INDEX "IDX_c26e2c1cbb6e911e0554b27416"`); - await queryRunner.query(`DROP INDEX "IDX_9a3ed15a30ab7e3a37702e6e08"`); - await queryRunner.query(`DROP INDEX "IDX_20f57cc8f142c131340ee16742"`); - await queryRunner.query(`DROP INDEX "IDX_00ed5f86db1f7efafb1978bf21"`); - await queryRunner.query(`DROP INDEX "IDX_15e91a03aeeac9dbccdf43fc06"`); - await queryRunner.query(`DROP INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc"`); - await queryRunner.query(`DROP INDEX "IDX_90148bbc2bf0854428786bfc15"`); - await queryRunner.query(`DROP INDEX "IDX_88937d94d7443d9a99a76fa5c0"`); - await queryRunner.query(`DROP INDEX "IDX_54ebcb6d27222913b908d56fd8"`); - await queryRunner.query(`DROP INDEX "IDX_796a8c03959361f97dc2be1d5c"`); - await queryRunner.query(`DROP INDEX "IDX_25dfc71b0369b003a4cd434d0b"`); - await queryRunner.query(`DROP INDEX "IDX_51c063b6a133a9cb87145450f5"`); - await queryRunner.query(`DROP INDEX "IDX_fa99d777623947a5b05f394cae"`); - await queryRunner.query(`DROP INDEX "IDX_315c779174fe8247ab324f036e"`); - await queryRunner.query(`DROP INDEX "IDX_c5d46cbfda48b1c33ed852e21b"`); - await queryRunner.query(`DROP INDEX "IDX_8cb40cfc8f3c28261e6f887b03"`); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc" ON "__chart__active_users" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_15e91a03aeeac9dbccdf43fc06" ON "__chart__active_users" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_00ed5f86db1f7efafb1978bf21" ON "__chart__active_users" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_20f57cc8f142c131340ee16742" ON "__chart__active_users" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_9a3ed15a30ab7e3a37702e6e08" ON "__chart__active_users" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_c26e2c1cbb6e911e0554b27416" ON "__chart__active_users" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_13565815f618a1ff53886c5b28" ON "__chart__drive" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_3fa0d0f17ca72e3dc80999a032" ON "__chart__drive" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7a170f67425e62a8fabb76c872" ON "__chart__drive" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_6e1df243476e20cbf86572ecc0" ON "__chart__drive" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_3313d7288855ec105b5bbf6c21" ON "__chart__drive" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_06690fc959f1c9fdaf21928222" ON "__chart__drive" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_36cb699c49580d4e6c2e6159f9" ON "__chart__federation" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e447064455928cf627590ef527" ON "__chart__federation" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_76e87c7bfc5d925fcbba405d84" ON "__chart__federation" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_2d416e6af791a82e338c79d480" ON "__chart__federation" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_dd907becf76104e4b656659e6b" ON "__chart__federation" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e9cd07672b37d8966cf3709283" ON "__chart__federation" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_07747a1038c05f532a718fe1de" ON "__chart__hashtag" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_fcc181fb8283009c61cc4083ef" ON "__chart__hashtag" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_99a7d2faaef84a6f728d714ad6" ON "__chart__hashtag" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_49975586f50ed7b800fdd88fbd" ON "__chart__hashtag" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_6d6f156ceefc6bc5f273a0e370" ON "__chart__hashtag" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_6b8f34a1a64b06014b6fb66824" ON "__chart__instance" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_c12f0af4a66cdd30c2287ce8aa" ON "__chart__instance" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_da8a46ba84ca1d8bb5a29bfb63" ON "__chart__instance" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d0a4f79af5a97b08f37b547197" ON "__chart__instance" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f5448d9633cff74208d850aabe" ON "__chart__instance" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a1efd3e0048a5f2793a47360dc" ON "__chart__network" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f8dd01baeded2ffa833e0a610a" ON "__chart__network" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7b5da130992ec9df96712d4290" ON "__chart__network" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_08fac0eb3b11f04c200c0b40dd" ON "__chart__network" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0a905b992fecd2b5c3fb98759e" ON "__chart__network" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_9ff6944f01acb756fdc92d7563" ON "__chart__network" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_42eb716a37d381cdf566192b2b" ON "__chart__notes" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e69096589f11e3baa98ddd64d0" ON "__chart__notes" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7036f2957151588b813185c794" ON "__chart__notes" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0c9a159c5082cbeef3ca6706b5" ON "__chart__notes" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f09d543e3acb16c5976bdb31fa" ON "__chart__notes" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_924fc196c80ca24bae01dd37e4" ON "__chart__notes" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_5f86db6492274e07c1a3cdf286" ON "__chart__per_user_drive" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_328f259961e60c4fa0bfcf55ca" ON "__chart__per_user_drive" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e496ca8096d28f6b9b509264dc" ON "__chart__per_user_drive" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_42ea9381f0fda8dfe0fa1c8b53" ON "__chart__per_user_drive" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f2aeafde2ae6fbad38e857631b" ON "__chart__per_user_drive" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7af07790712aa3438ff6773f3b" ON "__chart__per_user_following" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f92dd6d03f8d994f29987f6214" ON "__chart__per_user_following" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_4b3593098b6edc9c5afe36b18b" ON "__chart__per_user_following" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_57b5458d0d3d6d1e7f13d4e57f" ON "__chart__per_user_following" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_4db3b84c7be0d3464714f3e0b1" ON "__chart__per_user_following" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_84234bd1abb873f07329681c83" ON "__chart__per_user_notes" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_8d2cbbc8114d90d19b44d626b6" ON "__chart__per_user_notes" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_55bf20f366979f2436de99206b" ON "__chart__per_user_notes" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_046feeb12e9ef5f783f409866a" ON "__chart__per_user_notes" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f68a5ab958f9f5fa17a32ac23b" ON "__chart__per_user_notes" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f7bf4c62059764c2c2bb40fdab" ON "__chart__per_user_reaction" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_65633a106bce43fc7c5c30a5c7" ON "__chart__per_user_reaction" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_8cf3156fd7a6b15c43459c6e3b" ON "__chart__per_user_reaction" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_edeb73c09c3143a81bcb34d569" ON "__chart__per_user_reaction" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e316f01a6d24eb31db27f88262" ON "__chart__per_user_reaction" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0c641990ecf47d2545df4edb75" ON "__chart__test_grouped" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_2be7ec6cebddc14dc11e206686" ON "__chart__test_grouped" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_234dff3c0b56a6150b95431ab9" ON "__chart__test_grouped" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a5133470f4825902e170328ca5" ON "__chart__test_grouped" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b14489029e4b3aaf4bba5fb524" ON "__chart__test_grouped" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_84e661abb7bd1e51b690d4b017" ON "__chart__test_grouped" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_437bab3c6061d90f6bb65fd2cc" ON "__chart__test_unique" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_5c73bf61da4f6e6f15bae88ed1" ON "__chart__test_unique" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_bbfa573a8181018851ed0b6357" ON "__chart__test_unique" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d70c86baedc68326be11f9c0ce" ON "__chart__test_unique" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a0cd75442dd10d0643a17c4a49" ON "__chart__test_unique" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_66e1e1ecd2f29e57778af35b59" ON "__chart__test_unique" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b070a906db04b44c67c6c2144d" ON "__chart__test" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_92255988735563f0fe4aba1f05" ON "__chart__test" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d41cce6aee1a50bfc062038f9b" ON "__chart__test" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_c5870993e25c3d5771f91f5003" ON "__chart__test" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a319e5dbf47e8a17497623beae" ON "__chart__test" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f170de677ea75ad4533de2723e" ON "__chart__test" ("span", "date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_845254b3eaf708ae8a6cac3026" ON "__chart__users" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7c184198ecf66a8d3ecb253ab3" ON "__chart__users" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_ed9b95919c672a13008e9487ee" ON "__chart__users" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f091abb24193d50c653c6b77fc" ON "__chart__users" ("span", "date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_337e9599f278bd7537fe30876f" ON "__chart__users" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a770a57c70e668cc61590c9161" ON "__chart__users" ("span", "date", "group") `, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_a770a57c70e668cc61590c9161"`); + await queryRunner.query(`DROP INDEX "IDX_337e9599f278bd7537fe30876f"`); + await queryRunner.query(`DROP INDEX "IDX_f091abb24193d50c653c6b77fc"`); + await queryRunner.query(`DROP INDEX "IDX_ed9b95919c672a13008e9487ee"`); + await queryRunner.query(`DROP INDEX "IDX_7c184198ecf66a8d3ecb253ab3"`); + await queryRunner.query(`DROP INDEX "IDX_845254b3eaf708ae8a6cac3026"`); + await queryRunner.query(`DROP INDEX "IDX_f170de677ea75ad4533de2723e"`); + await queryRunner.query(`DROP INDEX "IDX_a319e5dbf47e8a17497623beae"`); + await queryRunner.query(`DROP INDEX "IDX_c5870993e25c3d5771f91f5003"`); + await queryRunner.query(`DROP INDEX "IDX_d41cce6aee1a50bfc062038f9b"`); + await queryRunner.query(`DROP INDEX "IDX_92255988735563f0fe4aba1f05"`); + await queryRunner.query(`DROP INDEX "IDX_b070a906db04b44c67c6c2144d"`); + await queryRunner.query(`DROP INDEX "IDX_66e1e1ecd2f29e57778af35b59"`); + await queryRunner.query(`DROP INDEX "IDX_a0cd75442dd10d0643a17c4a49"`); + await queryRunner.query(`DROP INDEX "IDX_d70c86baedc68326be11f9c0ce"`); + await queryRunner.query(`DROP INDEX "IDX_bbfa573a8181018851ed0b6357"`); + await queryRunner.query(`DROP INDEX "IDX_5c73bf61da4f6e6f15bae88ed1"`); + await queryRunner.query(`DROP INDEX "IDX_437bab3c6061d90f6bb65fd2cc"`); + await queryRunner.query(`DROP INDEX "IDX_84e661abb7bd1e51b690d4b017"`); + await queryRunner.query(`DROP INDEX "IDX_b14489029e4b3aaf4bba5fb524"`); + await queryRunner.query(`DROP INDEX "IDX_a5133470f4825902e170328ca5"`); + await queryRunner.query(`DROP INDEX "IDX_234dff3c0b56a6150b95431ab9"`); + await queryRunner.query(`DROP INDEX "IDX_2be7ec6cebddc14dc11e206686"`); + await queryRunner.query(`DROP INDEX "IDX_0c641990ecf47d2545df4edb75"`); + await queryRunner.query(`DROP INDEX "IDX_e316f01a6d24eb31db27f88262"`); + await queryRunner.query(`DROP INDEX "IDX_229a41ad465f9205f1f5703291"`); + await queryRunner.query(`DROP INDEX "IDX_edeb73c09c3143a81bcb34d569"`); + await queryRunner.query(`DROP INDEX "IDX_8cf3156fd7a6b15c43459c6e3b"`); + await queryRunner.query(`DROP INDEX "IDX_65633a106bce43fc7c5c30a5c7"`); + await queryRunner.query(`DROP INDEX "IDX_f7bf4c62059764c2c2bb40fdab"`); + await queryRunner.query(`DROP INDEX "IDX_f68a5ab958f9f5fa17a32ac23b"`); + await queryRunner.query(`DROP INDEX "IDX_5048e9daccbbbc6d567bb142d3"`); + await queryRunner.query(`DROP INDEX "IDX_046feeb12e9ef5f783f409866a"`); + await queryRunner.query(`DROP INDEX "IDX_55bf20f366979f2436de99206b"`); + await queryRunner.query(`DROP INDEX "IDX_8d2cbbc8114d90d19b44d626b6"`); + await queryRunner.query(`DROP INDEX "IDX_84234bd1abb873f07329681c83"`); + await queryRunner.query(`DROP INDEX "IDX_4db3b84c7be0d3464714f3e0b1"`); + await queryRunner.query(`DROP INDEX "IDX_b77d4dd9562c3a899d9a286fcd"`); + await queryRunner.query(`DROP INDEX "IDX_57b5458d0d3d6d1e7f13d4e57f"`); + await queryRunner.query(`DROP INDEX "IDX_4b3593098b6edc9c5afe36b18b"`); + await queryRunner.query(`DROP INDEX "IDX_f92dd6d03f8d994f29987f6214"`); + await queryRunner.query(`DROP INDEX "IDX_7af07790712aa3438ff6773f3b"`); + await queryRunner.query(`DROP INDEX "IDX_f2aeafde2ae6fbad38e857631b"`); + await queryRunner.query(`DROP INDEX "IDX_30bf67687f483ace115c5ca642"`); + await queryRunner.query(`DROP INDEX "IDX_42ea9381f0fda8dfe0fa1c8b53"`); + await queryRunner.query(`DROP INDEX "IDX_e496ca8096d28f6b9b509264dc"`); + await queryRunner.query(`DROP INDEX "IDX_328f259961e60c4fa0bfcf55ca"`); + await queryRunner.query(`DROP INDEX "IDX_5f86db6492274e07c1a3cdf286"`); + await queryRunner.query(`DROP INDEX "IDX_924fc196c80ca24bae01dd37e4"`); + await queryRunner.query(`DROP INDEX "IDX_f09d543e3acb16c5976bdb31fa"`); + await queryRunner.query(`DROP INDEX "IDX_0c9a159c5082cbeef3ca6706b5"`); + await queryRunner.query(`DROP INDEX "IDX_7036f2957151588b813185c794"`); + await queryRunner.query(`DROP INDEX "IDX_e69096589f11e3baa98ddd64d0"`); + await queryRunner.query(`DROP INDEX "IDX_42eb716a37d381cdf566192b2b"`); + await queryRunner.query(`DROP INDEX "IDX_9ff6944f01acb756fdc92d7563"`); + await queryRunner.query(`DROP INDEX "IDX_0a905b992fecd2b5c3fb98759e"`); + await queryRunner.query(`DROP INDEX "IDX_08fac0eb3b11f04c200c0b40dd"`); + await queryRunner.query(`DROP INDEX "IDX_7b5da130992ec9df96712d4290"`); + await queryRunner.query(`DROP INDEX "IDX_f8dd01baeded2ffa833e0a610a"`); + await queryRunner.query(`DROP INDEX "IDX_a1efd3e0048a5f2793a47360dc"`); + await queryRunner.query(`DROP INDEX "IDX_f5448d9633cff74208d850aabe"`); + await queryRunner.query(`DROP INDEX "IDX_39ee857ab2f23493037c6b6631"`); + await queryRunner.query(`DROP INDEX "IDX_d0a4f79af5a97b08f37b547197"`); + await queryRunner.query(`DROP INDEX "IDX_da8a46ba84ca1d8bb5a29bfb63"`); + await queryRunner.query(`DROP INDEX "IDX_c12f0af4a66cdd30c2287ce8aa"`); + await queryRunner.query(`DROP INDEX "IDX_6b8f34a1a64b06014b6fb66824"`); + await queryRunner.query(`DROP INDEX "IDX_6d6f156ceefc6bc5f273a0e370"`); + await queryRunner.query(`DROP INDEX "IDX_25a97c02003338124b2b75fdbc"`); + await queryRunner.query(`DROP INDEX "IDX_49975586f50ed7b800fdd88fbd"`); + await queryRunner.query(`DROP INDEX "IDX_99a7d2faaef84a6f728d714ad6"`); + await queryRunner.query(`DROP INDEX "IDX_fcc181fb8283009c61cc4083ef"`); + await queryRunner.query(`DROP INDEX "IDX_07747a1038c05f532a718fe1de"`); + await queryRunner.query(`DROP INDEX "IDX_e9cd07672b37d8966cf3709283"`); + await queryRunner.query(`DROP INDEX "IDX_dd907becf76104e4b656659e6b"`); + await queryRunner.query(`DROP INDEX "IDX_2d416e6af791a82e338c79d480"`); + await queryRunner.query(`DROP INDEX "IDX_76e87c7bfc5d925fcbba405d84"`); + await queryRunner.query(`DROP INDEX "IDX_e447064455928cf627590ef527"`); + await queryRunner.query(`DROP INDEX "IDX_36cb699c49580d4e6c2e6159f9"`); + await queryRunner.query(`DROP INDEX "IDX_06690fc959f1c9fdaf21928222"`); + await queryRunner.query(`DROP INDEX "IDX_3313d7288855ec105b5bbf6c21"`); + await queryRunner.query(`DROP INDEX "IDX_6e1df243476e20cbf86572ecc0"`); + await queryRunner.query(`DROP INDEX "IDX_7a170f67425e62a8fabb76c872"`); + await queryRunner.query(`DROP INDEX "IDX_3fa0d0f17ca72e3dc80999a032"`); + await queryRunner.query(`DROP INDEX "IDX_13565815f618a1ff53886c5b28"`); + await queryRunner.query(`DROP INDEX "IDX_c26e2c1cbb6e911e0554b27416"`); + await queryRunner.query(`DROP INDEX "IDX_9a3ed15a30ab7e3a37702e6e08"`); + await queryRunner.query(`DROP INDEX "IDX_20f57cc8f142c131340ee16742"`); + await queryRunner.query(`DROP INDEX "IDX_00ed5f86db1f7efafb1978bf21"`); + await queryRunner.query(`DROP INDEX "IDX_15e91a03aeeac9dbccdf43fc06"`); + await queryRunner.query(`DROP INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc"`); + await queryRunner.query(`DROP INDEX "IDX_90148bbc2bf0854428786bfc15"`); + await queryRunner.query(`DROP INDEX "IDX_88937d94d7443d9a99a76fa5c0"`); + await queryRunner.query(`DROP INDEX "IDX_54ebcb6d27222913b908d56fd8"`); + await queryRunner.query(`DROP INDEX "IDX_796a8c03959361f97dc2be1d5c"`); + await queryRunner.query(`DROP INDEX "IDX_25dfc71b0369b003a4cd434d0b"`); + await queryRunner.query(`DROP INDEX "IDX_51c063b6a133a9cb87145450f5"`); + await queryRunner.query(`DROP INDEX "IDX_fa99d777623947a5b05f394cae"`); + await queryRunner.query(`DROP INDEX "IDX_315c779174fe8247ab324f036e"`); + await queryRunner.query(`DROP INDEX "IDX_c5d46cbfda48b1c33ed852e21b"`); + await queryRunner.query(`DROP INDEX "IDX_8cb40cfc8f3c28261e6f887b03"`); + } } diff --git a/packages/backend/migration/1562422242907-PasswordLessLogin.js b/packages/backend/migration/1562422242907-PasswordLessLogin.js index b73c7db4d3..8e1280830b 100644 --- a/packages/backend/migration/1562422242907-PasswordLessLogin.js +++ b/packages/backend/migration/1562422242907-PasswordLessLogin.js @@ -1,10 +1,12 @@ - - export class PasswordLessLogin1562422242907 { - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ADD COLUMN "usePasswordLessLogin" boolean DEFAULT false NOT NULL`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "usePasswordLessLogin"`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ADD COLUMN "usePasswordLessLogin" boolean DEFAULT false NOT NULL`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "usePasswordLessLogin"`, + ); + } } diff --git a/packages/backend/migration/1562444565093-PinnedPage.js b/packages/backend/migration/1562444565093-PinnedPage.js index 9a999a9150..dcb342d3fc 100644 --- a/packages/backend/migration/1562444565093-PinnedPage.js +++ b/packages/backend/migration/1562444565093-PinnedPage.js @@ -1,14 +1,24 @@ - - export class PinnedPage1562444565093 { - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ADD "pinnedPageId" character varying(32)`); - await queryRunner.query(`ALTER TABLE "user_profile" ADD CONSTRAINT "UQ_6dc44f1ceb65b1e72bacef2ca27" UNIQUE ("pinnedPageId")`); - await queryRunner.query(`ALTER TABLE "user_profile" ADD CONSTRAINT "FK_6dc44f1ceb65b1e72bacef2ca27" FOREIGN KEY ("pinnedPageId") REFERENCES "page"("id") ON DELETE SET NULL ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP CONSTRAINT "FK_6dc44f1ceb65b1e72bacef2ca27"`); - await queryRunner.query(`ALTER TABLE "user_profile" DROP CONSTRAINT "UQ_6dc44f1ceb65b1e72bacef2ca27"`); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "pinnedPageId"`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "pinnedPageId" character varying(32)`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD CONSTRAINT "UQ_6dc44f1ceb65b1e72bacef2ca27" UNIQUE ("pinnedPageId")`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD CONSTRAINT "FK_6dc44f1ceb65b1e72bacef2ca27" FOREIGN KEY ("pinnedPageId") REFERENCES "page"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP CONSTRAINT "FK_6dc44f1ceb65b1e72bacef2ca27"`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP CONSTRAINT "UQ_6dc44f1ceb65b1e72bacef2ca27"`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "pinnedPageId"`, + ); + } } diff --git a/packages/backend/migration/1562448332510-PageTitleHideOption.js b/packages/backend/migration/1562448332510-PageTitleHideOption.js index 8fc78d202f..9a1b42f4bb 100644 --- a/packages/backend/migration/1562448332510-PageTitleHideOption.js +++ b/packages/backend/migration/1562448332510-PageTitleHideOption.js @@ -1,10 +1,12 @@ - - export class PageTitleHideOption1562448332510 { - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "page" ADD "hideTitleWhenPinned" boolean NOT NULL DEFAULT false`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "page" DROP COLUMN "hideTitleWhenPinned"`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "page" ADD "hideTitleWhenPinned" boolean NOT NULL DEFAULT false`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "page" DROP COLUMN "hideTitleWhenPinned"`, + ); + } } diff --git a/packages/backend/migration/1562869971568-ModerationLog.js b/packages/backend/migration/1562869971568-ModerationLog.js index dd66d16eec..f652b067b4 100644 --- a/packages/backend/migration/1562869971568-ModerationLog.js +++ b/packages/backend/migration/1562869971568-ModerationLog.js @@ -1,14 +1,20 @@ - - export class ModerationLog1562869971568 { - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "moderation_log" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "type" character varying(128) NOT NULL, "info" jsonb NOT NULL, CONSTRAINT "PK_d0adca6ecfd068db83e4526cc26" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_a08ad074601d204e0f69da9a95" ON "moderation_log" ("userId") `); - await queryRunner.query(`ALTER TABLE "moderation_log" ADD CONSTRAINT "FK_a08ad074601d204e0f69da9a954" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "moderation_log" DROP CONSTRAINT "FK_a08ad074601d204e0f69da9a954"`); - await queryRunner.query(`DROP INDEX "IDX_a08ad074601d204e0f69da9a95"`); - await queryRunner.query(`DROP TABLE "moderation_log"`); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "moderation_log" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "type" character varying(128) NOT NULL, "info" jsonb NOT NULL, CONSTRAINT "PK_d0adca6ecfd068db83e4526cc26" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a08ad074601d204e0f69da9a95" ON "moderation_log" ("userId") `, + ); + await queryRunner.query( + `ALTER TABLE "moderation_log" ADD CONSTRAINT "FK_a08ad074601d204e0f69da9a954" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "moderation_log" DROP CONSTRAINT "FK_a08ad074601d204e0f69da9a954"`, + ); + await queryRunner.query(`DROP INDEX "IDX_a08ad074601d204e0f69da9a95"`); + await queryRunner.query(`DROP TABLE "moderation_log"`); + } } diff --git a/packages/backend/migration/1563757595828-UsedUsername.js b/packages/backend/migration/1563757595828-UsedUsername.js index 8972df297d..2cf5d8c740 100644 --- a/packages/backend/migration/1563757595828-UsedUsername.js +++ b/packages/backend/migration/1563757595828-UsedUsername.js @@ -1,10 +1,10 @@ - - export class UsedUsername1563757595828 { - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "used_username" ("username" character varying(128) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, CONSTRAINT "PK_78fd79d2d24c6ac2f4cc9a31a5d" PRIMARY KEY ("username"))`); - } - async down(queryRunner) { - await queryRunner.query(`DROP TABLE "used_username"`); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "used_username" ("username" character varying(128) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, CONSTRAINT "PK_78fd79d2d24c6ac2f4cc9a31a5d" PRIMARY KEY ("username"))`, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP TABLE "used_username"`); + } } diff --git a/packages/backend/migration/1565634203341-room.js b/packages/backend/migration/1565634203341-room.js index 679940f244..1023c0a31a 100644 --- a/packages/backend/migration/1565634203341-room.js +++ b/packages/backend/migration/1565634203341-room.js @@ -1,10 +1,10 @@ - - export class room1565634203341 { - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ADD "room" jsonb NOT NULL DEFAULT '{}'`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "room"`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "room" jsonb NOT NULL DEFAULT '{}'`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "room"`); + } } diff --git a/packages/backend/migration/1571220798684-CustomEmojiCategory.js b/packages/backend/migration/1571220798684-CustomEmojiCategory.js index 37c07366e1..4d75313328 100644 --- a/packages/backend/migration/1571220798684-CustomEmojiCategory.js +++ b/packages/backend/migration/1571220798684-CustomEmojiCategory.js @@ -1,10 +1,14 @@ - - export class CustomEmojiCategory1571220798684 { - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "emoji" ADD "category" character varying(128)`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "category"`, undefined); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "emoji" ADD "category" character varying(128)`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "emoji" DROP COLUMN "category"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1572760203493-nodeinfo.js b/packages/backend/migration/1572760203493-nodeinfo.js index 54d5f914a4..eea87c82c8 100644 --- a/packages/backend/migration/1572760203493-nodeinfo.js +++ b/packages/backend/migration/1572760203493-nodeinfo.js @@ -1,26 +1,78 @@ - - export class nodeinfo1572760203493 { - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "system"`, undefined); - await queryRunner.query(`ALTER TABLE "instance" ADD "softwareName" character varying(64) DEFAULT null`, undefined); - await queryRunner.query(`ALTER TABLE "instance" ADD "softwareVersion" character varying(64) DEFAULT null`, undefined); - await queryRunner.query(`ALTER TABLE "instance" ADD "openRegistrations" boolean DEFAULT null`, undefined); - await queryRunner.query(`ALTER TABLE "instance" ADD "name" character varying(256) DEFAULT null`, undefined); - await queryRunner.query(`ALTER TABLE "instance" ADD "description" character varying(4096) DEFAULT null`, undefined); - await queryRunner.query(`ALTER TABLE "instance" ADD "maintainerName" character varying(128) DEFAULT null`, undefined); - await queryRunner.query(`ALTER TABLE "instance" ADD "maintainerEmail" character varying(256) DEFAULT null`, undefined); - await queryRunner.query(`ALTER TABLE "instance" ADD "infoUpdatedAt" TIMESTAMP WITH TIME ZONE`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "infoUpdatedAt"`, undefined); - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "maintainerEmail"`, undefined); - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "maintainerName"`, undefined); - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "description"`, undefined); - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "name"`, undefined); - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "openRegistrations"`, undefined); - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "softwareVersion"`, undefined); - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "softwareName"`, undefined); - await queryRunner.query(`ALTER TABLE "instance" ADD "system" character varying(64)`, undefined); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "instance" DROP COLUMN "system"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" ADD "softwareName" character varying(64) DEFAULT null`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" ADD "softwareVersion" character varying(64) DEFAULT null`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" ADD "openRegistrations" boolean DEFAULT null`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" ADD "name" character varying(256) DEFAULT null`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" ADD "description" character varying(4096) DEFAULT null`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" ADD "maintainerName" character varying(128) DEFAULT null`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" ADD "maintainerEmail" character varying(256) DEFAULT null`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" ADD "infoUpdatedAt" TIMESTAMP WITH TIME ZONE`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "instance" DROP COLUMN "infoUpdatedAt"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" DROP COLUMN "maintainerEmail"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" DROP COLUMN "maintainerName"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" DROP COLUMN "description"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" DROP COLUMN "name"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" DROP COLUMN "openRegistrations"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" DROP COLUMN "softwareVersion"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" DROP COLUMN "softwareName"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" ADD "system" character varying(64)`, + undefined, + ); + } } diff --git a/packages/backend/migration/1576269851876-TalkFederationId.js b/packages/backend/migration/1576269851876-TalkFederationId.js index 35861d571f..f0aed7dd83 100644 --- a/packages/backend/migration/1576269851876-TalkFederationId.js +++ b/packages/backend/migration/1576269851876-TalkFederationId.js @@ -1,13 +1,17 @@ - - export class TalkFederationId1576269851876 { - constructor() { - this.name = 'TalkFederationId1576269851876'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "messaging_message" ADD "uri" character varying(512)`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "messaging_message" DROP COLUMN "uri"`, undefined); - } + constructor() { + this.name = "TalkFederationId1576269851876"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "messaging_message" ADD "uri" character varying(512)`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "messaging_message" DROP COLUMN "uri"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1576869585998-ProxyRemoteFiles.js b/packages/backend/migration/1576869585998-ProxyRemoteFiles.js index d6d134be40..5565f64b6d 100644 --- a/packages/backend/migration/1576869585998-ProxyRemoteFiles.js +++ b/packages/backend/migration/1576869585998-ProxyRemoteFiles.js @@ -1,13 +1,17 @@ - - export class ProxyRemoteFiles1576869585998 { - constructor() { - this.name = 'ProxyRemoteFiles1576869585998'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "proxyRemoteFiles" boolean NOT NULL DEFAULT false`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "proxyRemoteFiles"`, undefined); - } + constructor() { + this.name = "ProxyRemoteFiles1576869585998"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "proxyRemoteFiles" boolean NOT NULL DEFAULT false`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "proxyRemoteFiles"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1579267006611-v12.js b/packages/backend/migration/1579267006611-v12.js index 7f6318a192..f1d906465e 100644 --- a/packages/backend/migration/1579267006611-v12.js +++ b/packages/backend/migration/1579267006611-v12.js @@ -1,33 +1,91 @@ - - export class v121579267006611 { - constructor() { - this.name = 'v121579267006611'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "announcement" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "text" character varying(8192) NOT NULL, "title" character varying(256) NOT NULL, "imageUrl" character varying(1024), CONSTRAINT "PK_e0ef0550174fd1099a308fd18a0" PRIMARY KEY ("id"))`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_118ec703e596086fc4515acb39" ON "announcement" ("createdAt") `, undefined); - await queryRunner.query(`CREATE TABLE "announcement_read" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "announcementId" character varying(32) NOT NULL, CONSTRAINT "PK_4b90ad1f42681d97b2683890c5e" PRIMARY KEY ("id"))`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_8288151386172b8109f7239ab2" ON "announcement_read" ("userId") `, undefined); - await queryRunner.query(`CREATE INDEX "IDX_603a7b1e7aa0533c6c88e9bfaf" ON "announcement_read" ("announcementId") `, undefined); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_924fa71815cfa3941d003702a0" ON "announcement_read" ("userId", "announcementId") `, undefined); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "isVerified"`, undefined); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "announcements"`, undefined); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableEmojiReaction"`, undefined); - await queryRunner.query(`ALTER TABLE "announcement_read" ADD CONSTRAINT "FK_8288151386172b8109f7239ab28" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "announcement_read" ADD CONSTRAINT "FK_603a7b1e7aa0533c6c88e9bfafe" FOREIGN KEY ("announcementId") REFERENCES "announcement"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "announcement_read" DROP CONSTRAINT "FK_603a7b1e7aa0533c6c88e9bfafe"`, undefined); - await queryRunner.query(`ALTER TABLE "announcement_read" DROP CONSTRAINT "FK_8288151386172b8109f7239ab28"`, undefined); - await queryRunner.query(`ALTER TABLE "meta" ADD "enableEmojiReaction" boolean NOT NULL DEFAULT true`, undefined); - await queryRunner.query(`ALTER TABLE "meta" ADD "announcements" jsonb NOT NULL DEFAULT '[]'`, undefined); - await queryRunner.query(`ALTER TABLE "user" ADD "isVerified" boolean NOT NULL DEFAULT false`, undefined); - await queryRunner.query(`DROP INDEX "IDX_924fa71815cfa3941d003702a0"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_603a7b1e7aa0533c6c88e9bfaf"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_8288151386172b8109f7239ab2"`, undefined); - await queryRunner.query(`DROP TABLE "announcement_read"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_118ec703e596086fc4515acb39"`, undefined); - await queryRunner.query(`DROP TABLE "announcement"`, undefined); - } + constructor() { + this.name = "v121579267006611"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "announcement" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "text" character varying(8192) NOT NULL, "title" character varying(256) NOT NULL, "imageUrl" character varying(1024), CONSTRAINT "PK_e0ef0550174fd1099a308fd18a0" PRIMARY KEY ("id"))`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_118ec703e596086fc4515acb39" ON "announcement" ("createdAt") `, + undefined, + ); + await queryRunner.query( + `CREATE TABLE "announcement_read" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "announcementId" character varying(32) NOT NULL, CONSTRAINT "PK_4b90ad1f42681d97b2683890c5e" PRIMARY KEY ("id"))`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_8288151386172b8109f7239ab2" ON "announcement_read" ("userId") `, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_603a7b1e7aa0533c6c88e9bfaf" ON "announcement_read" ("announcementId") `, + undefined, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_924fa71815cfa3941d003702a0" ON "announcement_read" ("userId", "announcementId") `, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user" DROP COLUMN "isVerified"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "announcements"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "enableEmojiReaction"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "announcement_read" ADD CONSTRAINT "FK_8288151386172b8109f7239ab28" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "announcement_read" ADD CONSTRAINT "FK_603a7b1e7aa0533c6c88e9bfafe" FOREIGN KEY ("announcementId") REFERENCES "announcement"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "announcement_read" DROP CONSTRAINT "FK_603a7b1e7aa0533c6c88e9bfafe"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "announcement_read" DROP CONSTRAINT "FK_8288151386172b8109f7239ab28"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "enableEmojiReaction" boolean NOT NULL DEFAULT true`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "announcements" jsonb NOT NULL DEFAULT '[]'`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user" ADD "isVerified" boolean NOT NULL DEFAULT false`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_924fa71815cfa3941d003702a0"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_603a7b1e7aa0533c6c88e9bfaf"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_8288151386172b8109f7239ab2"`, + undefined, + ); + await queryRunner.query(`DROP TABLE "announcement_read"`, undefined); + await queryRunner.query( + `DROP INDEX "IDX_118ec703e596086fc4515acb39"`, + undefined, + ); + await queryRunner.query(`DROP TABLE "announcement"`, undefined); + } } diff --git a/packages/backend/migration/1579270193251-v12-2.js b/packages/backend/migration/1579270193251-v12-2.js index c51ce63066..6bbcdcc152 100644 --- a/packages/backend/migration/1579270193251-v12-2.js +++ b/packages/backend/migration/1579270193251-v12-2.js @@ -1,13 +1,17 @@ - - export class v1221579270193251 { - constructor() { - this.name = 'v1221579270193251'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "announcement_read" ADD "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "announcement_read" DROP COLUMN "createdAt"`, undefined); - } + constructor() { + this.name = "v1221579270193251"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "announcement_read" ADD "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "announcement_read" DROP COLUMN "createdAt"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1579282808087-v12-3.js b/packages/backend/migration/1579282808087-v12-3.js index aeb4f5a873..d5a9a86b52 100644 --- a/packages/backend/migration/1579282808087-v12-3.js +++ b/packages/backend/migration/1579282808087-v12-3.js @@ -1,13 +1,17 @@ - - export class v1231579282808087 { - constructor() { - this.name = 'v1231579282808087'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "announcement" ADD "updatedAt" TIMESTAMP WITH TIME ZONE`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "announcement" DROP COLUMN "updatedAt"`, undefined); - } + constructor() { + this.name = "v1231579282808087"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "announcement" ADD "updatedAt" TIMESTAMP WITH TIME ZONE`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "announcement" DROP COLUMN "updatedAt"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1579544426412-v12-4.js b/packages/backend/migration/1579544426412-v12-4.js index f1e093413e..efd6ee61bb 100644 --- a/packages/backend/migration/1579544426412-v12-4.js +++ b/packages/backend/migration/1579544426412-v12-4.js @@ -1,15 +1,25 @@ - - export class v1241579544426412 { - constructor() { - this.name = 'v1241579544426412'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "notification" ADD "followRequestId" character varying(32)`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ADD CONSTRAINT "FK_bd7fab507621e635b32cd31892c" FOREIGN KEY ("followRequestId") REFERENCES "follow_request"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "notification" DROP CONSTRAINT "FK_bd7fab507621e635b32cd31892c"`, undefined); - await queryRunner.query(`ALTER TABLE "notification" DROP COLUMN "followRequestId"`, undefined); - } + constructor() { + this.name = "v1241579544426412"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "notification" ADD "followRequestId" character varying(32)`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ADD CONSTRAINT "FK_bd7fab507621e635b32cd31892c" FOREIGN KEY ("followRequestId") REFERENCES "follow_request"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "notification" DROP CONSTRAINT "FK_bd7fab507621e635b32cd31892c"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" DROP COLUMN "followRequestId"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1579977526288-v12-5.js b/packages/backend/migration/1579977526288-v12-5.js index 6d2b5c584a..f71c287551 100644 --- a/packages/backend/migration/1579977526288-v12-5.js +++ b/packages/backend/migration/1579977526288-v12-5.js @@ -1,53 +1,156 @@ - - export class v1251579977526288 { - constructor() { - this.name = 'v1251579977526288'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "clip" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "isPublic" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_f0685dac8d4dd056d7255670b75" PRIMARY KEY ("id"))`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_2b5ec6c574d6802c94c80313fb" ON "clip" ("userId") `, undefined); - await queryRunner.query(`CREATE TABLE "clip_note" ("id" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "clipId" character varying(32) NOT NULL, CONSTRAINT "PK_e94cda2f40a99b57e032a1a738b" PRIMARY KEY ("id"))`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_a012eaf5c87c65da1deb5fdbfa" ON "clip_note" ("noteId") `, undefined); - await queryRunner.query(`CREATE INDEX "IDX_ebe99317bbbe9968a0c6f579ad" ON "clip_note" ("clipId") `, undefined); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_6fc0ec357d55a18646262fdfff" ON "clip_note" ("noteId", "clipId") `, undefined); - await queryRunner.query(`CREATE TYPE "antenna_src_enum" AS ENUM('home', 'all', 'list')`, undefined); - await queryRunner.query(`CREATE TABLE "antenna" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "src" "antenna_src_enum" NOT NULL, "userListId" character varying(32), "keywords" jsonb NOT NULL DEFAULT '[]', "withFile" boolean NOT NULL, "expression" character varying(2048), "notify" boolean NOT NULL, "hasNewNote" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_c170b99775e1dccca947c9f2d5f" PRIMARY KEY ("id"))`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_6446c571a0e8d0f05f01c78909" ON "antenna" ("userId") `, undefined); - await queryRunner.query(`CREATE TABLE "antenna_note" ("id" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "antennaId" character varying(32) NOT NULL, CONSTRAINT "PK_fb28d94d0989a3872df19fd6ef8" PRIMARY KEY ("id"))`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_bd0397be22147e17210940e125" ON "antenna_note" ("noteId") `, undefined); - await queryRunner.query(`CREATE INDEX "IDX_0d775946662d2575dfd2068a5f" ON "antenna_note" ("antennaId") `, undefined); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_335a0bf3f904406f9ef3dd51c2" ON "antenna_note" ("noteId", "antennaId") `, undefined); - await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "geo"`, undefined); - await queryRunner.query(`ALTER TABLE "clip" ADD CONSTRAINT "FK_2b5ec6c574d6802c94c80313fb2" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "clip_note" ADD CONSTRAINT "FK_a012eaf5c87c65da1deb5fdbfa3" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "clip_note" ADD CONSTRAINT "FK_ebe99317bbbe9968a0c6f579adf" FOREIGN KEY ("clipId") REFERENCES "clip"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" ADD CONSTRAINT "FK_6446c571a0e8d0f05f01c789096" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" ADD CONSTRAINT "FK_709d7d32053d0dd7620f678eeb9" FOREIGN KEY ("userListId") REFERENCES "user_list"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "antenna_note" ADD CONSTRAINT "FK_bd0397be22147e17210940e125b" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "antenna_note" ADD CONSTRAINT "FK_0d775946662d2575dfd2068a5f5" FOREIGN KEY ("antennaId") REFERENCES "antenna"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "antenna_note" DROP CONSTRAINT "FK_0d775946662d2575dfd2068a5f5"`, undefined); - await queryRunner.query(`ALTER TABLE "antenna_note" DROP CONSTRAINT "FK_bd0397be22147e17210940e125b"`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" DROP CONSTRAINT "FK_709d7d32053d0dd7620f678eeb9"`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" DROP CONSTRAINT "FK_6446c571a0e8d0f05f01c789096"`, undefined); - await queryRunner.query(`ALTER TABLE "clip_note" DROP CONSTRAINT "FK_ebe99317bbbe9968a0c6f579adf"`, undefined); - await queryRunner.query(`ALTER TABLE "clip_note" DROP CONSTRAINT "FK_a012eaf5c87c65da1deb5fdbfa3"`, undefined); - await queryRunner.query(`ALTER TABLE "clip" DROP CONSTRAINT "FK_2b5ec6c574d6802c94c80313fb2"`, undefined); - await queryRunner.query(`ALTER TABLE "note" ADD "geo" jsonb`, undefined); - await queryRunner.query(`DROP INDEX "IDX_335a0bf3f904406f9ef3dd51c2"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_0d775946662d2575dfd2068a5f"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_bd0397be22147e17210940e125"`, undefined); - await queryRunner.query(`DROP TABLE "antenna_note"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_6446c571a0e8d0f05f01c78909"`, undefined); - await queryRunner.query(`DROP TABLE "antenna"`, undefined); - await queryRunner.query(`DROP TYPE "antenna_src_enum"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_6fc0ec357d55a18646262fdfff"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_ebe99317bbbe9968a0c6f579ad"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_a012eaf5c87c65da1deb5fdbfa"`, undefined); - await queryRunner.query(`DROP TABLE "clip_note"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_2b5ec6c574d6802c94c80313fb"`, undefined); - await queryRunner.query(`DROP TABLE "clip"`, undefined); - } + constructor() { + this.name = "v1251579977526288"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "clip" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "isPublic" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_f0685dac8d4dd056d7255670b75" PRIMARY KEY ("id"))`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_2b5ec6c574d6802c94c80313fb" ON "clip" ("userId") `, + undefined, + ); + await queryRunner.query( + `CREATE TABLE "clip_note" ("id" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "clipId" character varying(32) NOT NULL, CONSTRAINT "PK_e94cda2f40a99b57e032a1a738b" PRIMARY KEY ("id"))`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a012eaf5c87c65da1deb5fdbfa" ON "clip_note" ("noteId") `, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_ebe99317bbbe9968a0c6f579ad" ON "clip_note" ("clipId") `, + undefined, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_6fc0ec357d55a18646262fdfff" ON "clip_note" ("noteId", "clipId") `, + undefined, + ); + await queryRunner.query( + `CREATE TYPE "antenna_src_enum" AS ENUM('home', 'all', 'list')`, + undefined, + ); + await queryRunner.query( + `CREATE TABLE "antenna" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "src" "antenna_src_enum" NOT NULL, "userListId" character varying(32), "keywords" jsonb NOT NULL DEFAULT '[]', "withFile" boolean NOT NULL, "expression" character varying(2048), "notify" boolean NOT NULL, "hasNewNote" boolean NOT NULL DEFAULT false, CONSTRAINT "PK_c170b99775e1dccca947c9f2d5f" PRIMARY KEY ("id"))`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_6446c571a0e8d0f05f01c78909" ON "antenna" ("userId") `, + undefined, + ); + await queryRunner.query( + `CREATE TABLE "antenna_note" ("id" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "antennaId" character varying(32) NOT NULL, CONSTRAINT "PK_fb28d94d0989a3872df19fd6ef8" PRIMARY KEY ("id"))`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_bd0397be22147e17210940e125" ON "antenna_note" ("noteId") `, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0d775946662d2575dfd2068a5f" ON "antenna_note" ("antennaId") `, + undefined, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_335a0bf3f904406f9ef3dd51c2" ON "antenna_note" ("noteId", "antennaId") `, + undefined, + ); + await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "geo"`, undefined); + await queryRunner.query( + `ALTER TABLE "clip" ADD CONSTRAINT "FK_2b5ec6c574d6802c94c80313fb2" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "clip_note" ADD CONSTRAINT "FK_a012eaf5c87c65da1deb5fdbfa3" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "clip_note" ADD CONSTRAINT "FK_ebe99317bbbe9968a0c6f579adf" FOREIGN KEY ("clipId") REFERENCES "clip"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" ADD CONSTRAINT "FK_6446c571a0e8d0f05f01c789096" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" ADD CONSTRAINT "FK_709d7d32053d0dd7620f678eeb9" FOREIGN KEY ("userListId") REFERENCES "user_list"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna_note" ADD CONSTRAINT "FK_bd0397be22147e17210940e125b" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna_note" ADD CONSTRAINT "FK_0d775946662d2575dfd2068a5f5" FOREIGN KEY ("antennaId") REFERENCES "antenna"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "antenna_note" DROP CONSTRAINT "FK_0d775946662d2575dfd2068a5f5"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna_note" DROP CONSTRAINT "FK_bd0397be22147e17210940e125b"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" DROP CONSTRAINT "FK_709d7d32053d0dd7620f678eeb9"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" DROP CONSTRAINT "FK_6446c571a0e8d0f05f01c789096"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "clip_note" DROP CONSTRAINT "FK_ebe99317bbbe9968a0c6f579adf"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "clip_note" DROP CONSTRAINT "FK_a012eaf5c87c65da1deb5fdbfa3"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "clip" DROP CONSTRAINT "FK_2b5ec6c574d6802c94c80313fb2"`, + undefined, + ); + await queryRunner.query(`ALTER TABLE "note" ADD "geo" jsonb`, undefined); + await queryRunner.query( + `DROP INDEX "IDX_335a0bf3f904406f9ef3dd51c2"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_0d775946662d2575dfd2068a5f"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_bd0397be22147e17210940e125"`, + undefined, + ); + await queryRunner.query(`DROP TABLE "antenna_note"`, undefined); + await queryRunner.query( + `DROP INDEX "IDX_6446c571a0e8d0f05f01c78909"`, + undefined, + ); + await queryRunner.query(`DROP TABLE "antenna"`, undefined); + await queryRunner.query(`DROP TYPE "antenna_src_enum"`, undefined); + await queryRunner.query( + `DROP INDEX "IDX_6fc0ec357d55a18646262fdfff"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_ebe99317bbbe9968a0c6f579ad"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_a012eaf5c87c65da1deb5fdbfa"`, + undefined, + ); + await queryRunner.query(`DROP TABLE "clip_note"`, undefined); + await queryRunner.query( + `DROP INDEX "IDX_2b5ec6c574d6802c94c80313fb"`, + undefined, + ); + await queryRunner.query(`DROP TABLE "clip"`, undefined); + } } diff --git a/packages/backend/migration/1579993013959-v12-6.js b/packages/backend/migration/1579993013959-v12-6.js index 3941c1391d..fc954c3612 100644 --- a/packages/backend/migration/1579993013959-v12-6.js +++ b/packages/backend/migration/1579993013959-v12-6.js @@ -1,17 +1,33 @@ - - export class v1261579993013959 { - constructor() { - this.name = 'v1261579993013959'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "hasNewNote"`, undefined); - await queryRunner.query(`ALTER TABLE "antenna_note" ADD "read" boolean NOT NULL DEFAULT false`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_9937ea48d7ae97ffb4f3f063a4" ON "antenna_note" ("read") `, undefined); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_9937ea48d7ae97ffb4f3f063a4"`, undefined); - await queryRunner.query(`ALTER TABLE "antenna_note" DROP COLUMN "read"`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" ADD "hasNewNote" boolean NOT NULL DEFAULT false`, undefined); - } + constructor() { + this.name = "v1261579993013959"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "antenna" DROP COLUMN "hasNewNote"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna_note" ADD "read" boolean NOT NULL DEFAULT false`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_9937ea48d7ae97ffb4f3f063a4" ON "antenna_note" ("read") `, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `DROP INDEX "IDX_9937ea48d7ae97ffb4f3f063a4"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna_note" DROP COLUMN "read"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" ADD "hasNewNote" boolean NOT NULL DEFAULT false`, + undefined, + ); + } } diff --git a/packages/backend/migration/1580069531114-v12-7.js b/packages/backend/migration/1580069531114-v12-7.js index 4b4790cb7d..c4214ddf13 100644 --- a/packages/backend/migration/1580069531114-v12-7.js +++ b/packages/backend/migration/1580069531114-v12-7.js @@ -1,23 +1,51 @@ - - export class v1271580069531114 { - constructor() { - this.name = 'v1271580069531114'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "antenna" ADD "users" character varying(1024) array NOT NULL DEFAULT '{}'::varchar[]`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" ADD "caseSensitive" boolean NOT NULL DEFAULT false`, undefined); - await queryRunner.query(`ALTER TYPE "public"."antenna_src_enum" RENAME TO "antenna_src_enum_old"`, undefined); - await queryRunner.query(`CREATE TYPE "antenna_src_enum" AS ENUM('home', 'all', 'users', 'list')`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "antenna_src_enum" USING "src"::"text"::"antenna_src_enum"`, undefined); - await queryRunner.query(`DROP TYPE "antenna_src_enum_old"`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`CREATE TYPE "antenna_src_enum_old" AS ENUM('home', 'all', 'list')`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "antenna_src_enum_old" USING "src"::"text"::"antenna_src_enum_old"`, undefined); - await queryRunner.query(`DROP TYPE "antenna_src_enum"`, undefined); - await queryRunner.query(`ALTER TYPE "antenna_src_enum_old" RENAME TO "antenna_src_enum"`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "caseSensitive"`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "users"`, undefined); - } + constructor() { + this.name = "v1271580069531114"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "antenna" ADD "users" character varying(1024) array NOT NULL DEFAULT '{}'::varchar[]`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" ADD "caseSensitive" boolean NOT NULL DEFAULT false`, + undefined, + ); + await queryRunner.query( + `ALTER TYPE "public"."antenna_src_enum" RENAME TO "antenna_src_enum_old"`, + undefined, + ); + await queryRunner.query( + `CREATE TYPE "antenna_src_enum" AS ENUM('home', 'all', 'users', 'list')`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "antenna_src_enum" USING "src"::"text"::"antenna_src_enum"`, + undefined, + ); + await queryRunner.query(`DROP TYPE "antenna_src_enum_old"`, undefined); + } + async down(queryRunner) { + await queryRunner.query( + `CREATE TYPE "antenna_src_enum_old" AS ENUM('home', 'all', 'list')`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "antenna_src_enum_old" USING "src"::"text"::"antenna_src_enum_old"`, + undefined, + ); + await queryRunner.query(`DROP TYPE "antenna_src_enum"`, undefined); + await queryRunner.query( + `ALTER TYPE "antenna_src_enum_old" RENAME TO "antenna_src_enum"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" DROP COLUMN "caseSensitive"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" DROP COLUMN "users"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1580148575182-v12-8.js b/packages/backend/migration/1580148575182-v12-8.js index cc30200c14..11b792b7ea 100644 --- a/packages/backend/migration/1580148575182-v12-8.js +++ b/packages/backend/migration/1580148575182-v12-8.js @@ -1,15 +1,25 @@ - - export class v1281580148575182 { - constructor() { - this.name = 'v1281580148575182'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "note" DROP CONSTRAINT "FK_ec5c201576192ba8904c345c5cc"`, undefined); - await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "appId"`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "note" ADD "appId" character varying(32)`, undefined); - await queryRunner.query(`ALTER TABLE "note" ADD CONSTRAINT "FK_ec5c201576192ba8904c345c5cc" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, undefined); - } + constructor() { + this.name = "v1281580148575182"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "note" DROP CONSTRAINT "FK_ec5c201576192ba8904c345c5cc"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "note" DROP COLUMN "appId"`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "note" ADD "appId" character varying(32)`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "note" ADD CONSTRAINT "FK_ec5c201576192ba8904c345c5cc" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, + undefined, + ); + } } diff --git a/packages/backend/migration/1580154400017-v12-9.js b/packages/backend/migration/1580154400017-v12-9.js index 3715798f19..19f8be0958 100644 --- a/packages/backend/migration/1580154400017-v12-9.js +++ b/packages/backend/migration/1580154400017-v12-9.js @@ -1,13 +1,17 @@ - - export class v1291580154400017 { - constructor() { - this.name = 'v1291580154400017'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "antenna" ADD "withReplies" boolean NOT NULL DEFAULT false`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "withReplies"`, undefined); - } + constructor() { + this.name = "v1291580154400017"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "antenna" ADD "withReplies" boolean NOT NULL DEFAULT false`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "antenna" DROP COLUMN "withReplies"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1580276619901-v12-10.js b/packages/backend/migration/1580276619901-v12-10.js index d5decb882e..e5dd1db5e5 100644 --- a/packages/backend/migration/1580276619901-v12-10.js +++ b/packages/backend/migration/1580276619901-v12-10.js @@ -1,18 +1,31 @@ - - export class v12101580276619901 { - constructor() { - this.name = 'v12101580276619901'; - } - async up(queryRunner) { - await queryRunner.query(`TRUNCATE TABLE "notification"`, undefined); - await queryRunner.query(`ALTER TABLE "notification" DROP COLUMN "type"`, undefined); - await queryRunner.query(`CREATE TYPE "notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted')`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ADD "type" "notification_type_enum" NOT NULL`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "notification" DROP COLUMN "type"`, undefined); - await queryRunner.query(`DROP TYPE "notification_type_enum"`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ADD "type" character varying(32) NOT NULL`, undefined); - } + constructor() { + this.name = "v12101580276619901"; + } + async up(queryRunner) { + await queryRunner.query(`TRUNCATE TABLE "notification"`, undefined); + await queryRunner.query( + `ALTER TABLE "notification" DROP COLUMN "type"`, + undefined, + ); + await queryRunner.query( + `CREATE TYPE "notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted')`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ADD "type" "notification_type_enum" NOT NULL`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "notification" DROP COLUMN "type"`, + undefined, + ); + await queryRunner.query(`DROP TYPE "notification_type_enum"`, undefined); + await queryRunner.query( + `ALTER TABLE "notification" ADD "type" character varying(32) NOT NULL`, + undefined, + ); + } } diff --git a/packages/backend/migration/1580331224276-v12-11.js b/packages/backend/migration/1580331224276-v12-11.js index 129720adbf..c31dca1758 100644 --- a/packages/backend/migration/1580331224276-v12-11.js +++ b/packages/backend/migration/1580331224276-v12-11.js @@ -1,17 +1,33 @@ - - export class v12111580331224276 { - constructor() { - this.name = 'v12111580331224276'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "isMarkedAsClosed"`, undefined); - await queryRunner.query(`ALTER TABLE "instance" ADD "isSuspended" boolean NOT NULL DEFAULT false`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_34500da2e38ac393f7bb6b299c" ON "instance" ("isSuspended") `, undefined); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_34500da2e38ac393f7bb6b299c"`, undefined); - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "isSuspended"`, undefined); - await queryRunner.query(`ALTER TABLE "instance" ADD "isMarkedAsClosed" boolean NOT NULL DEFAULT false`, undefined); - } + constructor() { + this.name = "v12111580331224276"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "instance" DROP COLUMN "isMarkedAsClosed"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" ADD "isSuspended" boolean NOT NULL DEFAULT false`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_34500da2e38ac393f7bb6b299c" ON "instance" ("isSuspended") `, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `DROP INDEX "IDX_34500da2e38ac393f7bb6b299c"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" DROP COLUMN "isSuspended"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "instance" ADD "isMarkedAsClosed" boolean NOT NULL DEFAULT false`, + undefined, + ); + } } diff --git a/packages/backend/migration/1580508795118-v12-12.js b/packages/backend/migration/1580508795118-v12-12.js index c5cec23a36..6df1b8f8a9 100644 --- a/packages/backend/migration/1580508795118-v12-12.js +++ b/packages/backend/migration/1580508795118-v12-12.js @@ -1,45 +1,145 @@ - - export class v12121580508795118 { - constructor() { - this.name = 'v12121580508795118'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "twitter"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "twitterAccessToken"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "twitterAccessTokenSecret"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "twitterUserId"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "twitterScreenName"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "github"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "githubAccessToken"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "githubId"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "githubLogin"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "discord"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "discordAccessToken"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "discordRefreshToken"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "discordExpiresDate"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "discordId"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "discordUsername"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "discordDiscriminator"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "integrations" jsonb NOT NULL DEFAULT '{}'`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "integrations"`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "discordDiscriminator" character varying(64) DEFAULT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "discordUsername" character varying(64) DEFAULT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "discordId" character varying(64) DEFAULT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "discordExpiresDate" character varying(64)`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "discordRefreshToken" character varying(64) DEFAULT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "discordAccessToken" character varying(64) DEFAULT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "discord" boolean NOT NULL DEFAULT false`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "githubLogin" character varying(64) DEFAULT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "githubId" character varying(64)`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "githubAccessToken" character varying(64) DEFAULT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "github" boolean NOT NULL DEFAULT false`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "twitterScreenName" character varying(64) DEFAULT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "twitterUserId" character varying(64) DEFAULT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "twitterAccessTokenSecret" character varying(64) DEFAULT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "twitterAccessToken" character varying(64) DEFAULT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "twitter" boolean NOT NULL DEFAULT false`, undefined); - } + constructor() { + this.name = "v12121580508795118"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "twitter"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "twitterAccessToken"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "twitterAccessTokenSecret"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "twitterUserId"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "twitterScreenName"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "github"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "githubAccessToken"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "githubId"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "githubLogin"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "discord"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "discordAccessToken"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "discordRefreshToken"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "discordExpiresDate"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "discordId"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "discordUsername"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "discordDiscriminator"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "integrations" jsonb NOT NULL DEFAULT '{}'`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "integrations"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "discordDiscriminator" character varying(64) DEFAULT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "discordUsername" character varying(64) DEFAULT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "discordId" character varying(64) DEFAULT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "discordExpiresDate" character varying(64)`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "discordRefreshToken" character varying(64) DEFAULT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "discordAccessToken" character varying(64) DEFAULT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "discord" boolean NOT NULL DEFAULT false`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "githubLogin" character varying(64) DEFAULT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "githubId" character varying(64)`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "githubAccessToken" character varying(64) DEFAULT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "github" boolean NOT NULL DEFAULT false`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "twitterScreenName" character varying(64) DEFAULT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "twitterUserId" character varying(64) DEFAULT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "twitterAccessTokenSecret" character varying(64) DEFAULT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "twitterAccessToken" character varying(64) DEFAULT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "twitter" boolean NOT NULL DEFAULT false`, + undefined, + ); + } } diff --git a/packages/backend/migration/1580543501339-v12-13.js b/packages/backend/migration/1580543501339-v12-13.js index 2fa490392d..fd4d131518 100644 --- a/packages/backend/migration/1580543501339-v12-13.js +++ b/packages/backend/migration/1580543501339-v12-13.js @@ -1,13 +1,14 @@ - - export class v12131580543501339 { - constructor() { - this.name = 'v12131580543501339'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE INDEX "IDX_NOTE_TAGS" ON "note" USING gin ("tags")`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_NOTE_TAGS"`, undefined); - } + constructor() { + this.name = "v12131580543501339"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE INDEX "IDX_NOTE_TAGS" ON "note" USING gin ("tags")`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_NOTE_TAGS"`, undefined); + } } diff --git a/packages/backend/migration/1580864313253-v12-14.js b/packages/backend/migration/1580864313253-v12-14.js index a3756ad029..47f778e1d7 100644 --- a/packages/backend/migration/1580864313253-v12-14.js +++ b/packages/backend/migration/1580864313253-v12-14.js @@ -1,19 +1,41 @@ - - export class v12141580864313253 { - constructor() { - this.name = 'v12141580864313253'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" RENAME COLUMN "proxyAccount" TO "proxyAccountId"`, undefined); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "proxyAccountId"`, undefined); - await queryRunner.query(`ALTER TABLE "meta" ADD "proxyAccountId" character varying(32)`, undefined); - await queryRunner.query(`ALTER TABLE "meta" ADD CONSTRAINT "FK_ab1bc0c1e209daa77b8e8d212ad" FOREIGN KEY ("proxyAccountId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP CONSTRAINT "FK_ab1bc0c1e209daa77b8e8d212ad"`, undefined); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "proxyAccountId"`, undefined); - await queryRunner.query(`ALTER TABLE "meta" ADD "proxyAccountId" character varying(128)`, undefined); - await queryRunner.query(`ALTER TABLE "meta" RENAME COLUMN "proxyAccountId" TO "proxyAccount"`, undefined); - } + constructor() { + this.name = "v12141580864313253"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" RENAME COLUMN "proxyAccount" TO "proxyAccountId"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "proxyAccountId"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "proxyAccountId" character varying(32)`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD CONSTRAINT "FK_ab1bc0c1e209daa77b8e8d212ad" FOREIGN KEY ("proxyAccountId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP CONSTRAINT "FK_ab1bc0c1e209daa77b8e8d212ad"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "proxyAccountId"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "proxyAccountId" character varying(128)`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" RENAME COLUMN "proxyAccountId" TO "proxyAccount"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1581526429287-user-group-invitation.js b/packages/backend/migration/1581526429287-user-group-invitation.js index 181b0aba86..e327816ea7 100644 --- a/packages/backend/migration/1581526429287-user-group-invitation.js +++ b/packages/backend/migration/1581526429287-user-group-invitation.js @@ -1,37 +1,107 @@ - - export class userGroupInvitation1581526429287 { - constructor() { - this.name = 'userGroupInvitation1581526429287'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "user_group_invitation" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "userGroupId" character varying(32) NOT NULL, CONSTRAINT "PK_160c63ec02bf23f6a5c5e8140d6" PRIMARY KEY ("id"))`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_bfbc6305547539369fe73eb144" ON "user_group_invitation" ("userId") `, undefined); - await queryRunner.query(`CREATE INDEX "IDX_5cc8c468090e129857e9fecce5" ON "user_group_invitation" ("userGroupId") `, undefined); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_e9793f65f504e5a31fbaedbf2f" ON "user_group_invitation" ("userId", "userGroupId") `, undefined); - await queryRunner.query(`ALTER TABLE "notification" ADD "userGroupInvitationId" character varying(32)`, undefined); - await queryRunner.query(`ALTER TYPE "public"."notification_type_enum" RENAME TO "notification_type_enum_old"`, undefined); - await queryRunner.query(`CREATE TYPE "notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited')`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ALTER COLUMN "type" TYPE "notification_type_enum" USING "type"::"text"::"notification_type_enum"`, undefined); - await queryRunner.query(`DROP TYPE "notification_type_enum_old"`, undefined); - await queryRunner.query(`COMMENT ON COLUMN "notification"."type" IS 'The type of the Notification.'`, undefined); - await queryRunner.query(`ALTER TABLE "user_group_invitation" ADD CONSTRAINT "FK_bfbc6305547539369fe73eb144a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "user_group_invitation" ADD CONSTRAINT "FK_5cc8c468090e129857e9fecce5a" FOREIGN KEY ("userGroupId") REFERENCES "user_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ADD CONSTRAINT "FK_8fe87814e978053a53b1beb7e98" FOREIGN KEY ("userGroupInvitationId") REFERENCES "user_group_invitation"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "notification" DROP CONSTRAINT "FK_8fe87814e978053a53b1beb7e98"`, undefined); - await queryRunner.query(`ALTER TABLE "user_group_invitation" DROP CONSTRAINT "FK_5cc8c468090e129857e9fecce5a"`, undefined); - await queryRunner.query(`ALTER TABLE "user_group_invitation" DROP CONSTRAINT "FK_bfbc6305547539369fe73eb144a"`, undefined); - await queryRunner.query(`COMMENT ON COLUMN "notification"."type" IS ''`, undefined); - await queryRunner.query(`CREATE TYPE "notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted')`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ALTER COLUMN "type" TYPE "notification_type_enum_old" USING "type"::"text"::"notification_type_enum_old"`, undefined); - await queryRunner.query(`DROP TYPE "notification_type_enum"`, undefined); - await queryRunner.query(`ALTER TYPE "notification_type_enum_old" RENAME TO "notification_type_enum"`, undefined); - await queryRunner.query(`ALTER TABLE "notification" DROP COLUMN "userGroupInvitationId"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_e9793f65f504e5a31fbaedbf2f"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_5cc8c468090e129857e9fecce5"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_bfbc6305547539369fe73eb144"`, undefined); - await queryRunner.query(`DROP TABLE "user_group_invitation"`, undefined); - } + constructor() { + this.name = "userGroupInvitation1581526429287"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "user_group_invitation" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "userGroupId" character varying(32) NOT NULL, CONSTRAINT "PK_160c63ec02bf23f6a5c5e8140d6" PRIMARY KEY ("id"))`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_bfbc6305547539369fe73eb144" ON "user_group_invitation" ("userId") `, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_5cc8c468090e129857e9fecce5" ON "user_group_invitation" ("userGroupId") `, + undefined, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_e9793f65f504e5a31fbaedbf2f" ON "user_group_invitation" ("userId", "userGroupId") `, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ADD "userGroupInvitationId" character varying(32)`, + undefined, + ); + await queryRunner.query( + `ALTER TYPE "public"."notification_type_enum" RENAME TO "notification_type_enum_old"`, + undefined, + ); + await queryRunner.query( + `CREATE TYPE "notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited')`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ALTER COLUMN "type" TYPE "notification_type_enum" USING "type"::"text"::"notification_type_enum"`, + undefined, + ); + await queryRunner.query( + `DROP TYPE "notification_type_enum_old"`, + undefined, + ); + await queryRunner.query( + `COMMENT ON COLUMN "notification"."type" IS 'The type of the Notification.'`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_group_invitation" ADD CONSTRAINT "FK_bfbc6305547539369fe73eb144a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_group_invitation" ADD CONSTRAINT "FK_5cc8c468090e129857e9fecce5a" FOREIGN KEY ("userGroupId") REFERENCES "user_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ADD CONSTRAINT "FK_8fe87814e978053a53b1beb7e98" FOREIGN KEY ("userGroupInvitationId") REFERENCES "user_group_invitation"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "notification" DROP CONSTRAINT "FK_8fe87814e978053a53b1beb7e98"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_group_invitation" DROP CONSTRAINT "FK_5cc8c468090e129857e9fecce5a"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "user_group_invitation" DROP CONSTRAINT "FK_bfbc6305547539369fe73eb144a"`, + undefined, + ); + await queryRunner.query( + `COMMENT ON COLUMN "notification"."type" IS ''`, + undefined, + ); + await queryRunner.query( + `CREATE TYPE "notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted')`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ALTER COLUMN "type" TYPE "notification_type_enum_old" USING "type"::"text"::"notification_type_enum_old"`, + undefined, + ); + await queryRunner.query(`DROP TYPE "notification_type_enum"`, undefined); + await queryRunner.query( + `ALTER TYPE "notification_type_enum_old" RENAME TO "notification_type_enum"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" DROP COLUMN "userGroupInvitationId"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_e9793f65f504e5a31fbaedbf2f"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_5cc8c468090e129857e9fecce5"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_bfbc6305547539369fe73eb144"`, + undefined, + ); + await queryRunner.query(`DROP TABLE "user_group_invitation"`, undefined); + } } diff --git a/packages/backend/migration/1581695816408-user-group-antenna.js b/packages/backend/migration/1581695816408-user-group-antenna.js index 267b58cd9b..28112767e7 100644 --- a/packages/backend/migration/1581695816408-user-group-antenna.js +++ b/packages/backend/migration/1581695816408-user-group-antenna.js @@ -1,27 +1,67 @@ - - export class userGroupAntenna1581695816408 { - constructor() { - this.name = 'userGroupAntenna1581695816408'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "antenna" ADD "userGroupJoiningId" character varying(32)`, undefined); - await queryRunner.query(`ALTER TYPE "public"."antenna_src_enum" RENAME TO "antenna_src_enum_old"`, undefined); - await queryRunner.query(`CREATE TYPE "antenna_src_enum" AS ENUM('home', 'all', 'users', 'list', 'group')`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "antenna_src_enum" USING "src"::"text"::"antenna_src_enum"`, undefined); - await queryRunner.query(`DROP TYPE "antenna_src_enum_old"`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "users"`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" ADD "users" character varying(1024) array NOT NULL DEFAULT '{}'::varchar[]`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" ADD CONSTRAINT "FK_ccbf5a8c0be4511133dcc50ddeb" FOREIGN KEY ("userGroupJoiningId") REFERENCES "user_group_joining"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "antenna" DROP CONSTRAINT "FK_ccbf5a8c0be4511133dcc50ddeb"`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "users"`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" ADD "users" character varying array NOT NULL DEFAULT '{}'`, undefined); - await queryRunner.query(`CREATE TYPE "antenna_src_enum_old" AS ENUM('home', 'all', 'users', 'list')`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "antenna_src_enum_old" USING "src"::"text"::"antenna_src_enum_old"`, undefined); - await queryRunner.query(`DROP TYPE "antenna_src_enum"`, undefined); - await queryRunner.query(`ALTER TYPE "antenna_src_enum_old" RENAME TO "antenna_src_enum"`, undefined); - await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "userGroupJoiningId"`, undefined); - } + constructor() { + this.name = "userGroupAntenna1581695816408"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "antenna" ADD "userGroupJoiningId" character varying(32)`, + undefined, + ); + await queryRunner.query( + `ALTER TYPE "public"."antenna_src_enum" RENAME TO "antenna_src_enum_old"`, + undefined, + ); + await queryRunner.query( + `CREATE TYPE "antenna_src_enum" AS ENUM('home', 'all', 'users', 'list', 'group')`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "antenna_src_enum" USING "src"::"text"::"antenna_src_enum"`, + undefined, + ); + await queryRunner.query(`DROP TYPE "antenna_src_enum_old"`, undefined); + await queryRunner.query( + `ALTER TABLE "antenna" DROP COLUMN "users"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" ADD "users" character varying(1024) array NOT NULL DEFAULT '{}'::varchar[]`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" ADD CONSTRAINT "FK_ccbf5a8c0be4511133dcc50ddeb" FOREIGN KEY ("userGroupJoiningId") REFERENCES "user_group_joining"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "antenna" DROP CONSTRAINT "FK_ccbf5a8c0be4511133dcc50ddeb"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" DROP COLUMN "users"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" ADD "users" character varying array NOT NULL DEFAULT '{}'`, + undefined, + ); + await queryRunner.query( + `CREATE TYPE "antenna_src_enum_old" AS ENUM('home', 'all', 'users', 'list')`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "antenna_src_enum_old" USING "src"::"text"::"antenna_src_enum_old"`, + undefined, + ); + await queryRunner.query(`DROP TYPE "antenna_src_enum"`, undefined); + await queryRunner.query( + `ALTER TYPE "antenna_src_enum_old" RENAME TO "antenna_src_enum"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "antenna" DROP COLUMN "userGroupJoiningId"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1581708415836-drive-user-folder-id-index.js b/packages/backend/migration/1581708415836-drive-user-folder-id-index.js index 43c2ce6cee..41902dc53f 100644 --- a/packages/backend/migration/1581708415836-drive-user-folder-id-index.js +++ b/packages/backend/migration/1581708415836-drive-user-folder-id-index.js @@ -1,13 +1,17 @@ - - export class driveUserFolderIdIndex1581708415836 { - constructor() { - this.name = 'driveUserFolderIdIndex1581708415836'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE INDEX "IDX_55720b33a61a7c806a8215b825" ON "drive_file" ("userId", "folderId", "id") `, undefined); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_55720b33a61a7c806a8215b825"`, undefined); - } + constructor() { + this.name = "driveUserFolderIdIndex1581708415836"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE INDEX "IDX_55720b33a61a7c806a8215b825" ON "drive_file" ("userId", "folderId", "id") `, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `DROP INDEX "IDX_55720b33a61a7c806a8215b825"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1581979837262-promo.js b/packages/backend/migration/1581979837262-promo.js index 4813a5f480..39e79965b7 100644 --- a/packages/backend/migration/1581979837262-promo.js +++ b/packages/backend/migration/1581979837262-promo.js @@ -1,27 +1,67 @@ - - export class promo1581979837262 { - constructor() { - this.name = 'promo1581979837262'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "promo_note" ("noteId" character varying(32) NOT NULL, "expiresAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, CONSTRAINT "REL_e263909ca4fe5d57f8d4230dd5" UNIQUE ("noteId"), CONSTRAINT "PK_e263909ca4fe5d57f8d4230dd5c" PRIMARY KEY ("noteId"))`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_83f0862e9bae44af52ced7099e" ON "promo_note" ("userId") `, undefined); - await queryRunner.query(`CREATE TABLE "promo_read" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, CONSTRAINT "PK_61917c1541002422b703318b7c9" PRIMARY KEY ("id"))`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_9657d55550c3d37bfafaf7d4b0" ON "promo_read" ("userId") `, undefined); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_2882b8a1a07c7d281a98b6db16" ON "promo_read" ("userId", "noteId") `, undefined); - await queryRunner.query(`ALTER TABLE "promo_note" ADD CONSTRAINT "FK_e263909ca4fe5d57f8d4230dd5c" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "promo_read" ADD CONSTRAINT "FK_9657d55550c3d37bfafaf7d4b05" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "promo_read" ADD CONSTRAINT "FK_a46a1a603ecee695d7db26da5f4" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "promo_read" DROP CONSTRAINT "FK_a46a1a603ecee695d7db26da5f4"`, undefined); - await queryRunner.query(`ALTER TABLE "promo_read" DROP CONSTRAINT "FK_9657d55550c3d37bfafaf7d4b05"`, undefined); - await queryRunner.query(`ALTER TABLE "promo_note" DROP CONSTRAINT "FK_e263909ca4fe5d57f8d4230dd5c"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_2882b8a1a07c7d281a98b6db16"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_9657d55550c3d37bfafaf7d4b0"`, undefined); - await queryRunner.query(`DROP TABLE "promo_read"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_83f0862e9bae44af52ced7099e"`, undefined); - await queryRunner.query(`DROP TABLE "promo_note"`, undefined); - } + constructor() { + this.name = "promo1581979837262"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "promo_note" ("noteId" character varying(32) NOT NULL, "expiresAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, CONSTRAINT "REL_e263909ca4fe5d57f8d4230dd5" UNIQUE ("noteId"), CONSTRAINT "PK_e263909ca4fe5d57f8d4230dd5c" PRIMARY KEY ("noteId"))`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_83f0862e9bae44af52ced7099e" ON "promo_note" ("userId") `, + undefined, + ); + await queryRunner.query( + `CREATE TABLE "promo_read" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, CONSTRAINT "PK_61917c1541002422b703318b7c9" PRIMARY KEY ("id"))`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_9657d55550c3d37bfafaf7d4b0" ON "promo_read" ("userId") `, + undefined, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_2882b8a1a07c7d281a98b6db16" ON "promo_read" ("userId", "noteId") `, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "promo_note" ADD CONSTRAINT "FK_e263909ca4fe5d57f8d4230dd5c" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "promo_read" ADD CONSTRAINT "FK_9657d55550c3d37bfafaf7d4b05" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "promo_read" ADD CONSTRAINT "FK_a46a1a603ecee695d7db26da5f4" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "promo_read" DROP CONSTRAINT "FK_a46a1a603ecee695d7db26da5f4"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "promo_read" DROP CONSTRAINT "FK_9657d55550c3d37bfafaf7d4b05"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "promo_note" DROP CONSTRAINT "FK_e263909ca4fe5d57f8d4230dd5c"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_2882b8a1a07c7d281a98b6db16"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_9657d55550c3d37bfafaf7d4b0"`, + undefined, + ); + await queryRunner.query(`DROP TABLE "promo_read"`, undefined); + await queryRunner.query( + `DROP INDEX "IDX_83f0862e9bae44af52ced7099e"`, + undefined, + ); + await queryRunner.query(`DROP TABLE "promo_note"`, undefined); + } } diff --git a/packages/backend/migration/1582019042083-featured-injecttion.js b/packages/backend/migration/1582019042083-featured-injecttion.js index 7f8790b01b..61b7d0c272 100644 --- a/packages/backend/migration/1582019042083-featured-injecttion.js +++ b/packages/backend/migration/1582019042083-featured-injecttion.js @@ -1,13 +1,17 @@ - - export class featuredInjecttion1582019042083 { - constructor() { - this.name = 'featuredInjecttion1582019042083'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ADD "injectFeaturedNote" boolean NOT NULL DEFAULT true`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "injectFeaturedNote"`, undefined); - } + constructor() { + this.name = "featuredInjecttion1582019042083"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "injectFeaturedNote" boolean NOT NULL DEFAULT true`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "injectFeaturedNote"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1582210532752-antenna-exclude.js b/packages/backend/migration/1582210532752-antenna-exclude.js index ff8d7b80d8..5a394270ef 100644 --- a/packages/backend/migration/1582210532752-antenna-exclude.js +++ b/packages/backend/migration/1582210532752-antenna-exclude.js @@ -1,13 +1,17 @@ - - export class antennaExclude1582210532752 { - constructor() { - this.name = 'antennaExclude1582210532752'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "antenna" ADD "excludeKeywords" jsonb NOT NULL DEFAULT '[]'`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "excludeKeywords"`, undefined); - } + constructor() { + this.name = "antennaExclude1582210532752"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "antenna" ADD "excludeKeywords" jsonb NOT NULL DEFAULT '[]'`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "antenna" DROP COLUMN "excludeKeywords"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1582875306439-note-reaction-length.js b/packages/backend/migration/1582875306439-note-reaction-length.js index e99501f012..2c9b726732 100644 --- a/packages/backend/migration/1582875306439-note-reaction-length.js +++ b/packages/backend/migration/1582875306439-note-reaction-length.js @@ -1,13 +1,17 @@ - - export class noteReactionLength1582875306439 { - constructor() { - this.name = 'noteReactionLength1582875306439'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(130)`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(128)`, undefined); - } + constructor() { + this.name = "noteReactionLength1582875306439"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(130)`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(128)`, + undefined, + ); + } } diff --git a/packages/backend/migration/1585361548360-miauth.js b/packages/backend/migration/1585361548360-miauth.js index e59aa3b6ef..2e052cb89a 100644 --- a/packages/backend/migration/1585361548360-miauth.js +++ b/packages/backend/migration/1585361548360-miauth.js @@ -1,35 +1,105 @@ - - export class miauth1585361548360 { - constructor() { - this.name = 'miauth1585361548360'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "access_token" ADD "lastUsedAt" TIMESTAMP WITH TIME ZONE DEFAULT null`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" ADD "session" character varying(128) DEFAULT null`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" ADD "name" character varying(128) DEFAULT null`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" ADD "description" character varying(512) DEFAULT null`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" ADD "iconUrl" character varying(512) DEFAULT null`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" ADD "permission" character varying(64) array NOT NULL DEFAULT '{}'::varchar[]`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" ADD "fetched" boolean NOT NULL DEFAULT false`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" DROP CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560"`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "appId" DROP NOT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "appId" SET DEFAULT null`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_bf3a053c07d9fb5d87317c56ee" ON "access_token" ("session") `, undefined); - await queryRunner.query(`ALTER TABLE "access_token" ADD CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "access_token" DROP CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_bf3a053c07d9fb5d87317c56ee"`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "appId" DROP DEFAULT`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "appId" SET NOT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" ADD CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" DROP COLUMN "fetched"`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" DROP COLUMN "permission"`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" DROP COLUMN "iconUrl"`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" DROP COLUMN "description"`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" DROP COLUMN "name"`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" DROP COLUMN "session"`, undefined); - await queryRunner.query(`ALTER TABLE "access_token" DROP COLUMN "lastUsedAt"`, undefined); - } + constructor() { + this.name = "miauth1585361548360"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "access_token" ADD "lastUsedAt" TIMESTAMP WITH TIME ZONE DEFAULT null`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ADD "session" character varying(128) DEFAULT null`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ADD "name" character varying(128) DEFAULT null`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ADD "description" character varying(512) DEFAULT null`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ADD "iconUrl" character varying(512) DEFAULT null`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ADD "permission" character varying(64) array NOT NULL DEFAULT '{}'::varchar[]`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ADD "fetched" boolean NOT NULL DEFAULT false`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" DROP CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ALTER COLUMN "appId" DROP NOT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ALTER COLUMN "appId" SET DEFAULT null`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_bf3a053c07d9fb5d87317c56ee" ON "access_token" ("session") `, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ADD CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "access_token" DROP CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_bf3a053c07d9fb5d87317c56ee"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ALTER COLUMN "appId" DROP DEFAULT`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ALTER COLUMN "appId" SET NOT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" ADD CONSTRAINT "FK_a3ff16c90cc87a82a0b5959e560" FOREIGN KEY ("appId") REFERENCES "app"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" DROP COLUMN "fetched"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" DROP COLUMN "permission"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" DROP COLUMN "iconUrl"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" DROP COLUMN "description"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" DROP COLUMN "name"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" DROP COLUMN "session"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "access_token" DROP COLUMN "lastUsedAt"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1585385921215-custom-notification.js b/packages/backend/migration/1585385921215-custom-notification.js index c3ddb2be17..23142cd3a8 100644 --- a/packages/backend/migration/1585385921215-custom-notification.js +++ b/packages/backend/migration/1585385921215-custom-notification.js @@ -1,47 +1,150 @@ - - export class customNotification1585385921215 { - constructor() { - this.name = 'customNotification1585385921215'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "notification" ADD "customBody" character varying(2048)`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ADD "customHeader" character varying(256)`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ADD "customIcon" character varying(1024)`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ADD "appAccessTokenId" character varying(32)`, undefined); - await queryRunner.query(`ALTER TABLE "notification" DROP CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710"`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ALTER COLUMN "notifierId" DROP NOT NULL`, undefined); - await queryRunner.query(`COMMENT ON COLUMN "notification"."notifierId" IS 'The ID of sender user of the Notification.'`, undefined); - await queryRunner.query(`ALTER TYPE "public"."notification_type_enum" RENAME TO "notification_type_enum_old"`, undefined); - await queryRunner.query(`CREATE TYPE "notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ALTER COLUMN "type" TYPE "notification_type_enum" USING "type"::"text"::"notification_type_enum"`, undefined); - await queryRunner.query(`DROP TYPE "notification_type_enum_old"`, undefined); - await queryRunner.query(`COMMENT ON COLUMN "notification"."type" IS 'The type of the Notification.'`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_3b4e96eec8d36a8bbb9d02aa71" ON "notification" ("notifierId") `, undefined); - await queryRunner.query(`CREATE INDEX "IDX_33f33cc8ef29d805a97ff4628b" ON "notification" ("type") `, undefined); - await queryRunner.query(`CREATE INDEX "IDX_080ab397c379af09b9d2169e5b" ON "notification" ("isRead") `, undefined); - await queryRunner.query(`CREATE INDEX "IDX_e22bf6bda77b6adc1fd9e75c8c" ON "notification" ("appAccessTokenId") `, undefined); - await queryRunner.query(`ALTER TABLE "notification" ADD CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710" FOREIGN KEY ("notifierId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ADD CONSTRAINT "FK_e22bf6bda77b6adc1fd9e75c8c9" FOREIGN KEY ("appAccessTokenId") REFERENCES "access_token"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "notification" DROP CONSTRAINT "FK_e22bf6bda77b6adc1fd9e75c8c9"`, undefined); - await queryRunner.query(`ALTER TABLE "notification" DROP CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_e22bf6bda77b6adc1fd9e75c8c"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_080ab397c379af09b9d2169e5b"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_33f33cc8ef29d805a97ff4628b"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_3b4e96eec8d36a8bbb9d02aa71"`, undefined); - await queryRunner.query(`COMMENT ON COLUMN "notification"."type" IS ''`, undefined); - await queryRunner.query(`CREATE TYPE "notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited')`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ALTER COLUMN "type" TYPE "notification_type_enum_old" USING "type"::"text"::"notification_type_enum_old"`, undefined); - await queryRunner.query(`DROP TYPE "notification_type_enum"`, undefined); - await queryRunner.query(`ALTER TYPE "notification_type_enum_old" RENAME TO "notification_type_enum"`, undefined); - await queryRunner.query(`COMMENT ON COLUMN "notification"."notifierId" IS ''`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ALTER COLUMN "notifierId" SET NOT NULL`, undefined); - await queryRunner.query(`ALTER TABLE "notification" ADD CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710" FOREIGN KEY ("notifierId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, undefined); - await queryRunner.query(`ALTER TABLE "notification" DROP COLUMN "appAccessTokenId"`, undefined); - await queryRunner.query(`ALTER TABLE "notification" DROP COLUMN "customIcon"`, undefined); - await queryRunner.query(`ALTER TABLE "notification" DROP COLUMN "customHeader"`, undefined); - await queryRunner.query(`ALTER TABLE "notification" DROP COLUMN "customBody"`, undefined); - } + constructor() { + this.name = "customNotification1585385921215"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "notification" ADD "customBody" character varying(2048)`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ADD "customHeader" character varying(256)`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ADD "customIcon" character varying(1024)`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ADD "appAccessTokenId" character varying(32)`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" DROP CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ALTER COLUMN "notifierId" DROP NOT NULL`, + undefined, + ); + await queryRunner.query( + `COMMENT ON COLUMN "notification"."notifierId" IS 'The ID of sender user of the Notification.'`, + undefined, + ); + await queryRunner.query( + `ALTER TYPE "public"."notification_type_enum" RENAME TO "notification_type_enum_old"`, + undefined, + ); + await queryRunner.query( + `CREATE TYPE "notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ALTER COLUMN "type" TYPE "notification_type_enum" USING "type"::"text"::"notification_type_enum"`, + undefined, + ); + await queryRunner.query( + `DROP TYPE "notification_type_enum_old"`, + undefined, + ); + await queryRunner.query( + `COMMENT ON COLUMN "notification"."type" IS 'The type of the Notification.'`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_3b4e96eec8d36a8bbb9d02aa71" ON "notification" ("notifierId") `, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_33f33cc8ef29d805a97ff4628b" ON "notification" ("type") `, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_080ab397c379af09b9d2169e5b" ON "notification" ("isRead") `, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e22bf6bda77b6adc1fd9e75c8c" ON "notification" ("appAccessTokenId") `, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ADD CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710" FOREIGN KEY ("notifierId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ADD CONSTRAINT "FK_e22bf6bda77b6adc1fd9e75c8c9" FOREIGN KEY ("appAccessTokenId") REFERENCES "access_token"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "notification" DROP CONSTRAINT "FK_e22bf6bda77b6adc1fd9e75c8c9"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" DROP CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_e22bf6bda77b6adc1fd9e75c8c"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_080ab397c379af09b9d2169e5b"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_33f33cc8ef29d805a97ff4628b"`, + undefined, + ); + await queryRunner.query( + `DROP INDEX "IDX_3b4e96eec8d36a8bbb9d02aa71"`, + undefined, + ); + await queryRunner.query( + `COMMENT ON COLUMN "notification"."type" IS ''`, + undefined, + ); + await queryRunner.query( + `CREATE TYPE "notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited')`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ALTER COLUMN "type" TYPE "notification_type_enum_old" USING "type"::"text"::"notification_type_enum_old"`, + undefined, + ); + await queryRunner.query(`DROP TYPE "notification_type_enum"`, undefined); + await queryRunner.query( + `ALTER TYPE "notification_type_enum_old" RENAME TO "notification_type_enum"`, + undefined, + ); + await queryRunner.query( + `COMMENT ON COLUMN "notification"."notifierId" IS ''`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ALTER COLUMN "notifierId" SET NOT NULL`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" ADD CONSTRAINT "FK_3b4e96eec8d36a8bbb9d02aa710" FOREIGN KEY ("notifierId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" DROP COLUMN "appAccessTokenId"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" DROP COLUMN "customIcon"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" DROP COLUMN "customHeader"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "notification" DROP COLUMN "customBody"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1585772678853-ap-url.js b/packages/backend/migration/1585772678853-ap-url.js index 5fb809ff53..18cc4588e6 100644 --- a/packages/backend/migration/1585772678853-ap-url.js +++ b/packages/backend/migration/1585772678853-ap-url.js @@ -1,13 +1,14 @@ - - export class apUrl1585772678853 { - constructor() { - this.name = 'apUrl1585772678853'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "note" ADD "url" character varying(512)`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "url"`, undefined); - } + constructor() { + this.name = "apUrl1585772678853"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "note" ADD "url" character varying(512)`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "url"`, undefined); + } } diff --git a/packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js b/packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js index e13bb217e3..89694f84b2 100644 --- a/packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js +++ b/packages/backend/migration/1586624197029-AddObjectStorageUseProxy.js @@ -1,13 +1,17 @@ - - export class AddObjectStorageUseProxy1586624197029 { - constructor() { - this.name = 'AddObjectStorageUseProxy1586624197029'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "objectStorageUseProxy" boolean NOT NULL DEFAULT true`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStorageUseProxy"`, undefined); - } + constructor() { + this.name = "AddObjectStorageUseProxy1586624197029"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "objectStorageUseProxy" boolean NOT NULL DEFAULT true`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "objectStorageUseProxy"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1586641139527-remote-reaction.js b/packages/backend/migration/1586641139527-remote-reaction.js index 5b23103a17..d7390544c4 100644 --- a/packages/backend/migration/1586641139527-remote-reaction.js +++ b/packages/backend/migration/1586641139527-remote-reaction.js @@ -1,13 +1,17 @@ - - export class remoteReaction1586641139527 { - constructor() { - this.name = 'remoteReaction1586641139527'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(260)`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(130)`, undefined); - } + constructor() { + this.name = "remoteReaction1586641139527"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(260)`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "note_reaction" ALTER COLUMN "reaction" TYPE character varying(130)`, + undefined, + ); + } } diff --git a/packages/backend/migration/1586708940386-pageAiScript.js b/packages/backend/migration/1586708940386-pageAiScript.js index eed616c111..25eb710988 100644 --- a/packages/backend/migration/1586708940386-pageAiScript.js +++ b/packages/backend/migration/1586708940386-pageAiScript.js @@ -1,13 +1,17 @@ - - export class pageAiScript1586708940386 { - constructor() { - this.name = 'pageAiScript1586708940386'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "page" ADD "script" character varying(16384) NOT NULL DEFAULT ''`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "page" DROP COLUMN "script"`, undefined); - } + constructor() { + this.name = "pageAiScript1586708940386"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "page" ADD "script" character varying(16384) NOT NULL DEFAULT ''`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "page" DROP COLUMN "script"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1588044505511-hCaptcha.js b/packages/backend/migration/1588044505511-hCaptcha.js index a33dbd7133..29ba87370f 100644 --- a/packages/backend/migration/1588044505511-hCaptcha.js +++ b/packages/backend/migration/1588044505511-hCaptcha.js @@ -1,17 +1,33 @@ - - export class hCaptcha1588044505511 { - constructor() { - this.name = 'hCaptcha1588044505511'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "enableHcaptcha" boolean NOT NULL DEFAULT false`, undefined); - await queryRunner.query(`ALTER TABLE "meta" ADD "hcaptchaSiteKey" character varying(64)`, undefined); - await queryRunner.query(`ALTER TABLE "meta" ADD "hcaptchaSecretKey" character varying(64)`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "hcaptchaSecretKey"`, undefined); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "hcaptchaSiteKey"`, undefined); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableHcaptcha"`, undefined); - } + constructor() { + this.name = "hCaptcha1588044505511"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "enableHcaptcha" boolean NOT NULL DEFAULT false`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "hcaptchaSiteKey" character varying(64)`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "hcaptchaSecretKey" character varying(64)`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "hcaptchaSecretKey"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "hcaptchaSiteKey"`, + undefined, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "enableHcaptcha"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1589023282116-pubRelay.js b/packages/backend/migration/1589023282116-pubRelay.js index 48a1028d39..a1a2299192 100644 --- a/packages/backend/migration/1589023282116-pubRelay.js +++ b/packages/backend/migration/1589023282116-pubRelay.js @@ -1,17 +1,27 @@ - - export class pubRelay1589023282116 { - constructor() { - this.name = 'pubRelay1589023282116'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TYPE "relay_status_enum" AS ENUM('requesting', 'accepted', 'rejected')`, undefined); - await queryRunner.query(`CREATE TABLE "relay" ("id" character varying(32) NOT NULL, "inbox" character varying(512) NOT NULL, "status" "relay_status_enum" NOT NULL, CONSTRAINT "PK_78ebc9cfddf4292633b7ba57aee" PRIMARY KEY ("id"))`, undefined); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0d9a1738f2cf7f3b1c3334dfab" ON "relay" ("inbox") `, undefined); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_0d9a1738f2cf7f3b1c3334dfab"`, undefined); - await queryRunner.query(`DROP TABLE "relay"`, undefined); - await queryRunner.query(`DROP TYPE "relay_status_enum"`, undefined); - } + constructor() { + this.name = "pubRelay1589023282116"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TYPE "relay_status_enum" AS ENUM('requesting', 'accepted', 'rejected')`, + undefined, + ); + await queryRunner.query( + `CREATE TABLE "relay" ("id" character varying(32) NOT NULL, "inbox" character varying(512) NOT NULL, "status" "relay_status_enum" NOT NULL, CONSTRAINT "PK_78ebc9cfddf4292633b7ba57aee" PRIMARY KEY ("id"))`, + undefined, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_0d9a1738f2cf7f3b1c3334dfab" ON "relay" ("inbox") `, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `DROP INDEX "IDX_0d9a1738f2cf7f3b1c3334dfab"`, + undefined, + ); + await queryRunner.query(`DROP TABLE "relay"`, undefined); + await queryRunner.query(`DROP TYPE "relay_status_enum"`, undefined); + } } diff --git a/packages/backend/migration/1595075960584-blurhash.js b/packages/backend/migration/1595075960584-blurhash.js index f24d3722cf..50660cd055 100644 --- a/packages/backend/migration/1595075960584-blurhash.js +++ b/packages/backend/migration/1595075960584-blurhash.js @@ -1,13 +1,13 @@ - - export class blurhash1595075960584 { - constructor() { - this.name = 'blurhash1595075960584'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "drive_file" ADD "blurhash" character varying(128)`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "blurhash"`); - } + constructor() { + this.name = "blurhash1595075960584"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "drive_file" ADD "blurhash" character varying(128)`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "blurhash"`); + } } diff --git a/packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js b/packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js index f18f6f972a..612ab648cb 100644 --- a/packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js +++ b/packages/backend/migration/1595077605646-blurhash-for-avatar-banner.js @@ -1,19 +1,25 @@ - - export class blurhashForAvatarBanner1595077605646 { - constructor() { - this.name = 'blurhashForAvatarBanner1595077605646'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarColor"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerColor"`); - await queryRunner.query(`ALTER TABLE "user" ADD "avatarBlurhash" character varying(128)`); - await queryRunner.query(`ALTER TABLE "user" ADD "bannerBlurhash" character varying(128)`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerBlurhash"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarBlurhash"`); - await queryRunner.query(`ALTER TABLE "user" ADD "bannerColor" character varying(32)`); - await queryRunner.query(`ALTER TABLE "user" ADD "avatarColor" character varying(32)`); - } + constructor() { + this.name = "blurhashForAvatarBanner1595077605646"; + } + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarColor"`); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerColor"`); + await queryRunner.query( + `ALTER TABLE "user" ADD "avatarBlurhash" character varying(128)`, + ); + await queryRunner.query( + `ALTER TABLE "user" ADD "bannerBlurhash" character varying(128)`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerBlurhash"`); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarBlurhash"`); + await queryRunner.query( + `ALTER TABLE "user" ADD "bannerColor" character varying(32)`, + ); + await queryRunner.query( + `ALTER TABLE "user" ADD "avatarColor" character varying(32)`, + ); + } } diff --git a/packages/backend/migration/1595676934834-instance-icon-url.js b/packages/backend/migration/1595676934834-instance-icon-url.js index df9d8199bd..c228b14b6c 100644 --- a/packages/backend/migration/1595676934834-instance-icon-url.js +++ b/packages/backend/migration/1595676934834-instance-icon-url.js @@ -1,13 +1,13 @@ - - export class instanceIconUrl1595676934834 { - constructor() { - this.name = 'instanceIconUrl1595676934834'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" ADD "iconUrl" character varying(256) DEFAULT null`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "iconUrl"`); - } + constructor() { + this.name = "instanceIconUrl1595676934834"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "instance" ADD "iconUrl" character varying(256) DEFAULT null`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "iconUrl"`); + } } diff --git a/packages/backend/migration/1595771249699-word-mute.js b/packages/backend/migration/1595771249699-word-mute.js index e8e4ac838b..0a8a63294d 100644 --- a/packages/backend/migration/1595771249699-word-mute.js +++ b/packages/backend/migration/1595771249699-word-mute.js @@ -1,29 +1,53 @@ - - export class wordMute1595771249699 { - constructor() { - this.name = 'wordMute1595771249699'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "muted_note" ("id" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, CONSTRAINT "PK_897e2eff1c0b9b64e55ca1418a4" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_70ab9786313d78e4201d81cdb8" ON "muted_note" ("noteId") `); - await queryRunner.query(`CREATE INDEX "IDX_d8e07aa18c2d64e86201601aec" ON "muted_note" ("userId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a8c6bfd637d3f1d67a27c48e27" ON "muted_note" ("noteId", "userId") `); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "enableWordMute" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "mutedWords" jsonb NOT NULL DEFAULT '[]'`); - await queryRunner.query(`CREATE INDEX "IDX_3befe6f999c86aff06eb0257b4" ON "user_profile" ("enableWordMute") `); - await queryRunner.query(`ALTER TABLE "muted_note" ADD CONSTRAINT "FK_70ab9786313d78e4201d81cdb89" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "muted_note" ADD CONSTRAINT "FK_d8e07aa18c2d64e86201601aec1" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "muted_note" DROP CONSTRAINT "FK_d8e07aa18c2d64e86201601aec1"`); - await queryRunner.query(`ALTER TABLE "muted_note" DROP CONSTRAINT "FK_70ab9786313d78e4201d81cdb89"`); - await queryRunner.query(`DROP INDEX "IDX_3befe6f999c86aff06eb0257b4"`); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "mutedWords"`); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "enableWordMute"`); - await queryRunner.query(`DROP INDEX "IDX_a8c6bfd637d3f1d67a27c48e27"`); - await queryRunner.query(`DROP INDEX "IDX_d8e07aa18c2d64e86201601aec"`); - await queryRunner.query(`DROP INDEX "IDX_70ab9786313d78e4201d81cdb8"`); - await queryRunner.query(`DROP TABLE "muted_note"`); - } + constructor() { + this.name = "wordMute1595771249699"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "muted_note" ("id" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, CONSTRAINT "PK_897e2eff1c0b9b64e55ca1418a4" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_70ab9786313d78e4201d81cdb8" ON "muted_note" ("noteId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d8e07aa18c2d64e86201601aec" ON "muted_note" ("userId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_a8c6bfd637d3f1d67a27c48e27" ON "muted_note" ("noteId", "userId") `, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "enableWordMute" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "mutedWords" jsonb NOT NULL DEFAULT '[]'`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_3befe6f999c86aff06eb0257b4" ON "user_profile" ("enableWordMute") `, + ); + await queryRunner.query( + `ALTER TABLE "muted_note" ADD CONSTRAINT "FK_70ab9786313d78e4201d81cdb89" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "muted_note" ADD CONSTRAINT "FK_d8e07aa18c2d64e86201601aec1" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "muted_note" DROP CONSTRAINT "FK_d8e07aa18c2d64e86201601aec1"`, + ); + await queryRunner.query( + `ALTER TABLE "muted_note" DROP CONSTRAINT "FK_70ab9786313d78e4201d81cdb89"`, + ); + await queryRunner.query(`DROP INDEX "IDX_3befe6f999c86aff06eb0257b4"`); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "mutedWords"`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "enableWordMute"`, + ); + await queryRunner.query(`DROP INDEX "IDX_a8c6bfd637d3f1d67a27c48e27"`); + await queryRunner.query(`DROP INDEX "IDX_d8e07aa18c2d64e86201601aec"`); + await queryRunner.query(`DROP INDEX "IDX_70ab9786313d78e4201d81cdb8"`); + await queryRunner.query(`DROP TABLE "muted_note"`); + } } diff --git a/packages/backend/migration/1595782306083-word-mute2.js b/packages/backend/migration/1595782306083-word-mute2.js index ab1e40a041..61f06b3474 100644 --- a/packages/backend/migration/1595782306083-word-mute2.js +++ b/packages/backend/migration/1595782306083-word-mute2.js @@ -1,17 +1,21 @@ - - export class wordMute21595782306083 { - constructor() { - this.name = 'wordMute21595782306083'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TYPE "muted_note_reason_enum" AS ENUM('word', 'manual', 'spam', 'other')`); - await queryRunner.query(`ALTER TABLE "muted_note" ADD "reason" "muted_note_reason_enum" NOT NULL`); - await queryRunner.query(`CREATE INDEX "IDX_636e977ff90b23676fb5624b25" ON "muted_note" ("reason") `); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_636e977ff90b23676fb5624b25"`); - await queryRunner.query(`ALTER TABLE "muted_note" DROP COLUMN "reason"`); - await queryRunner.query(`DROP TYPE "muted_note_reason_enum"`); - } + constructor() { + this.name = "wordMute21595782306083"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TYPE "muted_note_reason_enum" AS ENUM('word', 'manual', 'spam', 'other')`, + ); + await queryRunner.query( + `ALTER TABLE "muted_note" ADD "reason" "muted_note_reason_enum" NOT NULL`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_636e977ff90b23676fb5624b25" ON "muted_note" ("reason") `, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_636e977ff90b23676fb5624b25"`); + await queryRunner.query(`ALTER TABLE "muted_note" DROP COLUMN "reason"`); + await queryRunner.query(`DROP TYPE "muted_note_reason_enum"`); + } } diff --git a/packages/backend/migration/1596548170836-channel.js b/packages/backend/migration/1596548170836-channel.js index 242db7d45a..2aaaf95503 100644 --- a/packages/backend/migration/1596548170836-channel.js +++ b/packages/backend/migration/1596548170836-channel.js @@ -1,57 +1,115 @@ - - export class channel1596548170836 { - constructor() { - this.name = 'channel1596548170836'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "channel" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "lastNotedAt" TIMESTAMP WITH TIME ZONE, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "description" character varying(2048), "bannerId" character varying(32), "notesCount" integer NOT NULL DEFAULT 0, "usersCount" integer NOT NULL DEFAULT 0, CONSTRAINT "PK_590f33ee6ee7d76437acf362e39" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_71cb7b435b7c0d4843317e7e16" ON "channel" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_29ef80c6f13bcea998447fce43" ON "channel" ("lastNotedAt") `); - await queryRunner.query(`CREATE INDEX "IDX_823bae55bd81b3be6e05cff438" ON "channel" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_0f58c11241e649d2a638a8de94" ON "channel" ("notesCount") `); - await queryRunner.query(`CREATE INDEX "IDX_094b86cd36bb805d1aa1e8cc9a" ON "channel" ("usersCount") `); - await queryRunner.query(`CREATE TABLE "channel_following" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "followeeId" character varying(32) NOT NULL, "followerId" character varying(32) NOT NULL, CONSTRAINT "PK_8b104be7f7415113f2a02cd5bdd" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_11e71f2511589dcc8a4d3214f9" ON "channel_following" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_0e43068c3f92cab197c3d3cd86" ON "channel_following" ("followeeId") `); - await queryRunner.query(`CREATE INDEX "IDX_6d8084ec9496e7334a4602707e" ON "channel_following" ("followerId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_2e230dd45a10e671d781d99f3e" ON "channel_following" ("followerId", "followeeId") `); - await queryRunner.query(`CREATE TABLE "channel_note_pining" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "channelId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, CONSTRAINT "PK_44f7474496bcf2e4b741681146d" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_8125f950afd3093acb10d2db8a" ON "channel_note_pining" ("channelId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_f36fed37d6d4cdcc68c803cd9c" ON "channel_note_pining" ("channelId", "noteId") `); - await queryRunner.query(`ALTER TABLE "note" ADD "channelId" character varying(32) DEFAULT null`); - await queryRunner.query(`CREATE INDEX "IDX_f22169eb10657bded6d875ac8f" ON "note" ("channelId") `); - await queryRunner.query(`ALTER TABLE "channel" ADD CONSTRAINT "FK_823bae55bd81b3be6e05cff4383" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "channel" ADD CONSTRAINT "FK_999da2bcc7efadbfe0e92d3bc19" FOREIGN KEY ("bannerId") REFERENCES "drive_file"("id") ON DELETE SET NULL ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "note" ADD CONSTRAINT "FK_f22169eb10657bded6d875ac8f9" FOREIGN KEY ("channelId") REFERENCES "channel"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "channel_following" ADD CONSTRAINT "FK_0e43068c3f92cab197c3d3cd86e" FOREIGN KEY ("followeeId") REFERENCES "channel"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "channel_following" ADD CONSTRAINT "FK_6d8084ec9496e7334a4602707e1" FOREIGN KEY ("followerId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "channel_note_pining" ADD CONSTRAINT "FK_8125f950afd3093acb10d2db8a8" FOREIGN KEY ("channelId") REFERENCES "channel"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "channel_note_pining" ADD CONSTRAINT "FK_10b19ef67d297ea9de325cd4502" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "channel_note_pining" DROP CONSTRAINT "FK_10b19ef67d297ea9de325cd4502"`); - await queryRunner.query(`ALTER TABLE "channel_note_pining" DROP CONSTRAINT "FK_8125f950afd3093acb10d2db8a8"`); - await queryRunner.query(`ALTER TABLE "channel_following" DROP CONSTRAINT "FK_6d8084ec9496e7334a4602707e1"`); - await queryRunner.query(`ALTER TABLE "channel_following" DROP CONSTRAINT "FK_0e43068c3f92cab197c3d3cd86e"`); - await queryRunner.query(`ALTER TABLE "note" DROP CONSTRAINT "FK_f22169eb10657bded6d875ac8f9"`); - await queryRunner.query(`ALTER TABLE "channel" DROP CONSTRAINT "FK_999da2bcc7efadbfe0e92d3bc19"`); - await queryRunner.query(`ALTER TABLE "channel" DROP CONSTRAINT "FK_823bae55bd81b3be6e05cff4383"`); - await queryRunner.query(`DROP INDEX "IDX_f22169eb10657bded6d875ac8f"`); - await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "channelId"`); - await queryRunner.query(`DROP INDEX "IDX_f36fed37d6d4cdcc68c803cd9c"`); - await queryRunner.query(`DROP INDEX "IDX_8125f950afd3093acb10d2db8a"`); - await queryRunner.query(`DROP TABLE "channel_note_pining"`); - await queryRunner.query(`DROP INDEX "IDX_2e230dd45a10e671d781d99f3e"`); - await queryRunner.query(`DROP INDEX "IDX_6d8084ec9496e7334a4602707e"`); - await queryRunner.query(`DROP INDEX "IDX_0e43068c3f92cab197c3d3cd86"`); - await queryRunner.query(`DROP INDEX "IDX_11e71f2511589dcc8a4d3214f9"`); - await queryRunner.query(`DROP TABLE "channel_following"`); - await queryRunner.query(`DROP INDEX "IDX_094b86cd36bb805d1aa1e8cc9a"`); - await queryRunner.query(`DROP INDEX "IDX_0f58c11241e649d2a638a8de94"`); - await queryRunner.query(`DROP INDEX "IDX_823bae55bd81b3be6e05cff438"`); - await queryRunner.query(`DROP INDEX "IDX_29ef80c6f13bcea998447fce43"`); - await queryRunner.query(`DROP INDEX "IDX_71cb7b435b7c0d4843317e7e16"`); - await queryRunner.query(`DROP TABLE "channel"`); - } + constructor() { + this.name = "channel1596548170836"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "channel" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "lastNotedAt" TIMESTAMP WITH TIME ZONE, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "description" character varying(2048), "bannerId" character varying(32), "notesCount" integer NOT NULL DEFAULT 0, "usersCount" integer NOT NULL DEFAULT 0, CONSTRAINT "PK_590f33ee6ee7d76437acf362e39" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_71cb7b435b7c0d4843317e7e16" ON "channel" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_29ef80c6f13bcea998447fce43" ON "channel" ("lastNotedAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_823bae55bd81b3be6e05cff438" ON "channel" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0f58c11241e649d2a638a8de94" ON "channel" ("notesCount") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_094b86cd36bb805d1aa1e8cc9a" ON "channel" ("usersCount") `, + ); + await queryRunner.query( + `CREATE TABLE "channel_following" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "followeeId" character varying(32) NOT NULL, "followerId" character varying(32) NOT NULL, CONSTRAINT "PK_8b104be7f7415113f2a02cd5bdd" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_11e71f2511589dcc8a4d3214f9" ON "channel_following" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0e43068c3f92cab197c3d3cd86" ON "channel_following" ("followeeId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_6d8084ec9496e7334a4602707e" ON "channel_following" ("followerId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_2e230dd45a10e671d781d99f3e" ON "channel_following" ("followerId", "followeeId") `, + ); + await queryRunner.query( + `CREATE TABLE "channel_note_pining" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "channelId" character varying(32) NOT NULL, "noteId" character varying(32) NOT NULL, CONSTRAINT "PK_44f7474496bcf2e4b741681146d" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_8125f950afd3093acb10d2db8a" ON "channel_note_pining" ("channelId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_f36fed37d6d4cdcc68c803cd9c" ON "channel_note_pining" ("channelId", "noteId") `, + ); + await queryRunner.query( + `ALTER TABLE "note" ADD "channelId" character varying(32) DEFAULT null`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f22169eb10657bded6d875ac8f" ON "note" ("channelId") `, + ); + await queryRunner.query( + `ALTER TABLE "channel" ADD CONSTRAINT "FK_823bae55bd81b3be6e05cff4383" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "channel" ADD CONSTRAINT "FK_999da2bcc7efadbfe0e92d3bc19" FOREIGN KEY ("bannerId") REFERENCES "drive_file"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "note" ADD CONSTRAINT "FK_f22169eb10657bded6d875ac8f9" FOREIGN KEY ("channelId") REFERENCES "channel"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "channel_following" ADD CONSTRAINT "FK_0e43068c3f92cab197c3d3cd86e" FOREIGN KEY ("followeeId") REFERENCES "channel"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "channel_following" ADD CONSTRAINT "FK_6d8084ec9496e7334a4602707e1" FOREIGN KEY ("followerId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "channel_note_pining" ADD CONSTRAINT "FK_8125f950afd3093acb10d2db8a8" FOREIGN KEY ("channelId") REFERENCES "channel"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "channel_note_pining" ADD CONSTRAINT "FK_10b19ef67d297ea9de325cd4502" FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "channel_note_pining" DROP CONSTRAINT "FK_10b19ef67d297ea9de325cd4502"`, + ); + await queryRunner.query( + `ALTER TABLE "channel_note_pining" DROP CONSTRAINT "FK_8125f950afd3093acb10d2db8a8"`, + ); + await queryRunner.query( + `ALTER TABLE "channel_following" DROP CONSTRAINT "FK_6d8084ec9496e7334a4602707e1"`, + ); + await queryRunner.query( + `ALTER TABLE "channel_following" DROP CONSTRAINT "FK_0e43068c3f92cab197c3d3cd86e"`, + ); + await queryRunner.query( + `ALTER TABLE "note" DROP CONSTRAINT "FK_f22169eb10657bded6d875ac8f9"`, + ); + await queryRunner.query( + `ALTER TABLE "channel" DROP CONSTRAINT "FK_999da2bcc7efadbfe0e92d3bc19"`, + ); + await queryRunner.query( + `ALTER TABLE "channel" DROP CONSTRAINT "FK_823bae55bd81b3be6e05cff4383"`, + ); + await queryRunner.query(`DROP INDEX "IDX_f22169eb10657bded6d875ac8f"`); + await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "channelId"`); + await queryRunner.query(`DROP INDEX "IDX_f36fed37d6d4cdcc68c803cd9c"`); + await queryRunner.query(`DROP INDEX "IDX_8125f950afd3093acb10d2db8a"`); + await queryRunner.query(`DROP TABLE "channel_note_pining"`); + await queryRunner.query(`DROP INDEX "IDX_2e230dd45a10e671d781d99f3e"`); + await queryRunner.query(`DROP INDEX "IDX_6d8084ec9496e7334a4602707e"`); + await queryRunner.query(`DROP INDEX "IDX_0e43068c3f92cab197c3d3cd86"`); + await queryRunner.query(`DROP INDEX "IDX_11e71f2511589dcc8a4d3214f9"`); + await queryRunner.query(`DROP TABLE "channel_following"`); + await queryRunner.query(`DROP INDEX "IDX_094b86cd36bb805d1aa1e8cc9a"`); + await queryRunner.query(`DROP INDEX "IDX_0f58c11241e649d2a638a8de94"`); + await queryRunner.query(`DROP INDEX "IDX_823bae55bd81b3be6e05cff438"`); + await queryRunner.query(`DROP INDEX "IDX_29ef80c6f13bcea998447fce43"`); + await queryRunner.query(`DROP INDEX "IDX_71cb7b435b7c0d4843317e7e16"`); + await queryRunner.query(`DROP TABLE "channel"`); + } } diff --git a/packages/backend/migration/1596786425167-channel2.js b/packages/backend/migration/1596786425167-channel2.js index 4b17048fef..ae871f5ff6 100644 --- a/packages/backend/migration/1596786425167-channel2.js +++ b/packages/backend/migration/1596786425167-channel2.js @@ -1,13 +1,15 @@ - - export class channel21596786425167 { - constructor() { - this.name = 'channel21596786425167'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "channel_following" ADD "readCursor" TIMESTAMP WITH TIME ZONE NOT NULL`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "channel_following" DROP COLUMN "readCursor"`); - } + constructor() { + this.name = "channel21596786425167"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "channel_following" ADD "readCursor" TIMESTAMP WITH TIME ZONE NOT NULL`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "channel_following" DROP COLUMN "readCursor"`, + ); + } } diff --git a/packages/backend/migration/1597230137744-objectStorageSetPublicRead.js b/packages/backend/migration/1597230137744-objectStorageSetPublicRead.js index 07283e31df..81540d5e8c 100644 --- a/packages/backend/migration/1597230137744-objectStorageSetPublicRead.js +++ b/packages/backend/migration/1597230137744-objectStorageSetPublicRead.js @@ -1,13 +1,15 @@ - - export class objectStorageSetPublicRead1597230137744 { - constructor() { - this.name = 'objectStorageSetPublicRead1597230137744'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "objectStorageSetPublicRead" boolean NOT NULL DEFAULT false`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStorageSetPublicRead"`); - } + constructor() { + this.name = "objectStorageSetPublicRead1597230137744"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "objectStorageSetPublicRead" boolean NOT NULL DEFAULT false`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "objectStorageSetPublicRead"`, + ); + } } diff --git a/packages/backend/migration/1597236229720-IncludingNotificationTypes.js b/packages/backend/migration/1597236229720-IncludingNotificationTypes.js index f498fa7d9a..ce02148d28 100644 --- a/packages/backend/migration/1597236229720-IncludingNotificationTypes.js +++ b/packages/backend/migration/1597236229720-IncludingNotificationTypes.js @@ -1,15 +1,21 @@ - - export class IncludingNotificationTypes1597236229720 { - constructor() { - this.name = 'IncludingNotificationTypes1597236229720'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TYPE "user_profile_includingnotificationtypes_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "includingNotificationTypes" "user_profile_includingnotificationtypes_enum" array`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "includingNotificationTypes"`); - await queryRunner.query(`DROP TYPE "user_profile_includingnotificationtypes_enum"`); - } + constructor() { + this.name = "IncludingNotificationTypes1597236229720"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TYPE "user_profile_includingnotificationtypes_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "includingNotificationTypes" "user_profile_includingnotificationtypes_enum" array`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "includingNotificationTypes"`, + ); + await queryRunner.query( + `DROP TYPE "user_profile_includingnotificationtypes_enum"`, + ); + } } diff --git a/packages/backend/migration/1597385880794-add-sensitive-index.js b/packages/backend/migration/1597385880794-add-sensitive-index.js index 8c5c040ba0..d7c818bbfe 100644 --- a/packages/backend/migration/1597385880794-add-sensitive-index.js +++ b/packages/backend/migration/1597385880794-add-sensitive-index.js @@ -1,13 +1,13 @@ - - export class addSensitiveIndex1597385880794 { - constructor() { - this.name = 'addSensitiveIndex1597385880794'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE INDEX "IDX_a7eba67f8b3fa27271e85d2e26" ON "drive_file" ("isSensitive") `); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_a7eba67f8b3fa27271e85d2e26"`); - } + constructor() { + this.name = "addSensitiveIndex1597385880794"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE INDEX "IDX_a7eba67f8b3fa27271e85d2e26" ON "drive_file" ("isSensitive") `, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_a7eba67f8b3fa27271e85d2e26"`); + } } diff --git a/packages/backend/migration/1597459042300-channel-unread.js b/packages/backend/migration/1597459042300-channel-unread.js index 3157ab7793..4975a84f92 100644 --- a/packages/backend/migration/1597459042300-channel-unread.js +++ b/packages/backend/migration/1597459042300-channel-unread.js @@ -1,26 +1,44 @@ - - export class channelUnread1597459042300 { - constructor() { - this.name = 'channelUnread1597459042300'; - } - async up(queryRunner) { - await queryRunner.query(`TRUNCATE TABLE "note_unread"`, undefined); - await queryRunner.query(`ALTER TABLE "channel_following" DROP COLUMN "readCursor"`); - await queryRunner.query(`ALTER TABLE "note_unread" ADD "isMentioned" boolean NOT NULL`); - await queryRunner.query(`ALTER TABLE "note_unread" ADD "noteChannelId" character varying(32)`); - await queryRunner.query(`CREATE INDEX "IDX_25b1dd384bec391b07b74b861c" ON "note_unread" ("isMentioned") `); - await queryRunner.query(`CREATE INDEX "IDX_89a29c9237b8c3b6b3cbb4cb30" ON "note_unread" ("isSpecified") `); - await queryRunner.query(`CREATE INDEX "IDX_29e8c1d579af54d4232939f994" ON "note_unread" ("noteUserId") `); - await queryRunner.query(`CREATE INDEX "IDX_6a57f051d82c6d4036c141e107" ON "note_unread" ("noteChannelId") `); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_6a57f051d82c6d4036c141e107"`); - await queryRunner.query(`DROP INDEX "IDX_29e8c1d579af54d4232939f994"`); - await queryRunner.query(`DROP INDEX "IDX_89a29c9237b8c3b6b3cbb4cb30"`); - await queryRunner.query(`DROP INDEX "IDX_25b1dd384bec391b07b74b861c"`); - await queryRunner.query(`ALTER TABLE "note_unread" DROP COLUMN "noteChannelId"`); - await queryRunner.query(`ALTER TABLE "note_unread" DROP COLUMN "isMentioned"`); - await queryRunner.query(`ALTER TABLE "channel_following" ADD "readCursor" TIMESTAMP WITH TIME ZONE NOT NULL`); - } + constructor() { + this.name = "channelUnread1597459042300"; + } + async up(queryRunner) { + await queryRunner.query(`TRUNCATE TABLE "note_unread"`, undefined); + await queryRunner.query( + `ALTER TABLE "channel_following" DROP COLUMN "readCursor"`, + ); + await queryRunner.query( + `ALTER TABLE "note_unread" ADD "isMentioned" boolean NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "note_unread" ADD "noteChannelId" character varying(32)`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_25b1dd384bec391b07b74b861c" ON "note_unread" ("isMentioned") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_89a29c9237b8c3b6b3cbb4cb30" ON "note_unread" ("isSpecified") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_29e8c1d579af54d4232939f994" ON "note_unread" ("noteUserId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_6a57f051d82c6d4036c141e107" ON "note_unread" ("noteChannelId") `, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_6a57f051d82c6d4036c141e107"`); + await queryRunner.query(`DROP INDEX "IDX_29e8c1d579af54d4232939f994"`); + await queryRunner.query(`DROP INDEX "IDX_89a29c9237b8c3b6b3cbb4cb30"`); + await queryRunner.query(`DROP INDEX "IDX_25b1dd384bec391b07b74b861c"`); + await queryRunner.query( + `ALTER TABLE "note_unread" DROP COLUMN "noteChannelId"`, + ); + await queryRunner.query( + `ALTER TABLE "note_unread" DROP COLUMN "isMentioned"`, + ); + await queryRunner.query( + `ALTER TABLE "channel_following" ADD "readCursor" TIMESTAMP WITH TIME ZONE NOT NULL`, + ); + } } diff --git a/packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js b/packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js index 2bd8aee358..5a31d51e8b 100644 --- a/packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js +++ b/packages/backend/migration/1597893996136-ChannelNoteIdDescIndex.js @@ -1,15 +1,17 @@ - - export class ChannelNoteIdDescIndex1597893996136 { - constructor() { - this.name = 'ChannelNoteIdDescIndex1597893996136'; - } - async up(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_f22169eb10657bded6d875ac8f"`); - await queryRunner.query(`CREATE INDEX "IDX_note_on_channelId_and_id_desc" ON "note" ("channelId", "id" desc)`); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_note_on_channelId_and_id_desc"`); - await queryRunner.query(`CREATE INDEX "IDX_f22169eb10657bded6d875ac8f" ON "note" ("channelId") `); - } + constructor() { + this.name = "ChannelNoteIdDescIndex1597893996136"; + } + async up(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_f22169eb10657bded6d875ac8f"`); + await queryRunner.query( + `CREATE INDEX "IDX_note_on_channelId_and_id_desc" ON "note" ("channelId", "id" desc)`, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_note_on_channelId_and_id_desc"`); + await queryRunner.query( + `CREATE INDEX "IDX_f22169eb10657bded6d875ac8f" ON "note" ("channelId") `, + ); + } } diff --git a/packages/backend/migration/1600353287890-mutingNotificationTypes.js b/packages/backend/migration/1600353287890-mutingNotificationTypes.js index ed3eb7d146..2a317b3f9f 100644 --- a/packages/backend/migration/1600353287890-mutingNotificationTypes.js +++ b/packages/backend/migration/1600353287890-mutingNotificationTypes.js @@ -1,19 +1,33 @@ - - export class mutingNotificationTypes1600353287890 { - constructor() { - this.name = 'mutingNotificationTypes1600353287890'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "includingNotificationTypes"`); - await queryRunner.query(`DROP TYPE "public"."user_profile_includingnotificationtypes_enum"`); - await queryRunner.query(`CREATE TYPE "user_profile_mutingnotificationtypes_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "mutingNotificationTypes" "user_profile_mutingnotificationtypes_enum" array NOT NULL DEFAULT '{}'`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "mutingNotificationTypes"`); - await queryRunner.query(`DROP TYPE "user_profile_mutingnotificationtypes_enum"`); - await queryRunner.query(`CREATE TYPE "public"."user_profile_includingnotificationtypes_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "includingNotificationTypes" "user_profile_includingnotificationtypes_enum" array`); - } + constructor() { + this.name = "mutingNotificationTypes1600353287890"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "includingNotificationTypes"`, + ); + await queryRunner.query( + `DROP TYPE "public"."user_profile_includingnotificationtypes_enum"`, + ); + await queryRunner.query( + `CREATE TYPE "user_profile_mutingnotificationtypes_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "mutingNotificationTypes" "user_profile_mutingnotificationtypes_enum" array NOT NULL DEFAULT '{}'`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "mutingNotificationTypes"`, + ); + await queryRunner.query( + `DROP TYPE "user_profile_mutingnotificationtypes_enum"`, + ); + await queryRunner.query( + `CREATE TYPE "public"."user_profile_includingnotificationtypes_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "includingNotificationTypes" "user_profile_includingnotificationtypes_enum" array`, + ); + } } diff --git a/packages/backend/migration/1603094348345-refine-abuse-user-report.js b/packages/backend/migration/1603094348345-refine-abuse-user-report.js index 4918032a2b..1aaf2685e5 100644 --- a/packages/backend/migration/1603094348345-refine-abuse-user-report.js +++ b/packages/backend/migration/1603094348345-refine-abuse-user-report.js @@ -1,31 +1,63 @@ - - export class refineAbuseUserReport1603094348345 { - constructor() { - this.name = 'refineAbuseUserReport1603094348345'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_d049123c413e68ca52abe734203"`); - await queryRunner.query(`DROP INDEX "IDX_d049123c413e68ca52abe73420"`); - await queryRunner.query(`DROP INDEX "IDX_5cd442c3b2e74fdd99dae20243"`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" RENAME COLUMN "userId" TO "targetUserId"`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" ADD "assigneeId" character varying(32)`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" ADD "resolved" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP COLUMN "comment"`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" ADD "comment" character varying(2048) NOT NULL DEFAULT '{}'::varchar[]`); - await queryRunner.query(`CREATE INDEX "IDX_2b15aaf4a0dc5be3499af7ab6a" ON "abuse_user_report" ("resolved") `); - await queryRunner.query(`ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_08b883dd5fdd6f9c4c1572b36de" FOREIGN KEY ("assigneeId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_08b883dd5fdd6f9c4c1572b36de"`); - await queryRunner.query(`DROP INDEX "IDX_2b15aaf4a0dc5be3499af7ab6a"`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP COLUMN "comment"`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" ADD "comment" character varying(512) NOT NULL DEFAULT '{}'::varchar[]`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP COLUMN "resolved"`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP COLUMN "assigneeId"`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" RENAME COLUMN "targetUserId" TO "userId"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_5cd442c3b2e74fdd99dae20243" ON "abuse_user_report" ("userId", "reporterId") `); - await queryRunner.query(`CREATE INDEX "IDX_d049123c413e68ca52abe73420" ON "abuse_user_report" ("userId") `); - await queryRunner.query(`ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_d049123c413e68ca52abe734203" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } + constructor() { + this.name = "refineAbuseUserReport1603094348345"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_d049123c413e68ca52abe734203"`, + ); + await queryRunner.query(`DROP INDEX "IDX_d049123c413e68ca52abe73420"`); + await queryRunner.query(`DROP INDEX "IDX_5cd442c3b2e74fdd99dae20243"`); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" RENAME COLUMN "userId" TO "targetUserId"`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" ADD "assigneeId" character varying(32)`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" ADD "resolved" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" DROP COLUMN "comment"`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" ADD "comment" character varying(2048) NOT NULL DEFAULT '{}'::varchar[]`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_2b15aaf4a0dc5be3499af7ab6a" ON "abuse_user_report" ("resolved") `, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_08b883dd5fdd6f9c4c1572b36de" FOREIGN KEY ("assigneeId") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_08b883dd5fdd6f9c4c1572b36de"`, + ); + await queryRunner.query(`DROP INDEX "IDX_2b15aaf4a0dc5be3499af7ab6a"`); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" DROP COLUMN "comment"`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" ADD "comment" character varying(512) NOT NULL DEFAULT '{}'::varchar[]`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" DROP COLUMN "resolved"`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" DROP COLUMN "assigneeId"`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" RENAME COLUMN "targetUserId" TO "userId"`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_5cd442c3b2e74fdd99dae20243" ON "abuse_user_report" ("userId", "reporterId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d049123c413e68ca52abe73420" ON "abuse_user_report" ("userId") `, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_d049123c413e68ca52abe734203" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } } diff --git a/packages/backend/migration/1603095701770-refine-abuse-user-report2.js b/packages/backend/migration/1603095701770-refine-abuse-user-report2.js index 64e92672f2..301a8e5382 100644 --- a/packages/backend/migration/1603095701770-refine-abuse-user-report2.js +++ b/packages/backend/migration/1603095701770-refine-abuse-user-report2.js @@ -1,19 +1,29 @@ - - export class refineAbuseUserReport21603095701770 { - constructor() { - this.name = 'refineAbuseUserReport21603095701770'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "abuse_user_report" ADD "targetUserHost" character varying(128)`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" ADD "reporterHost" character varying(128)`); - await queryRunner.query(`CREATE INDEX "IDX_4ebbf7f93cdc10e8d1ef2fc6cd" ON "abuse_user_report" ("targetUserHost") `); - await queryRunner.query(`CREATE INDEX "IDX_f8d8b93740ad12c4ce8213a199" ON "abuse_user_report" ("reporterHost") `); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_f8d8b93740ad12c4ce8213a199"`); - await queryRunner.query(`DROP INDEX "IDX_4ebbf7f93cdc10e8d1ef2fc6cd"`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP COLUMN "reporterHost"`); - await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP COLUMN "targetUserHost"`); - } + constructor() { + this.name = "refineAbuseUserReport21603095701770"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "abuse_user_report" ADD "targetUserHost" character varying(128)`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" ADD "reporterHost" character varying(128)`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_4ebbf7f93cdc10e8d1ef2fc6cd" ON "abuse_user_report" ("targetUserHost") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f8d8b93740ad12c4ce8213a199" ON "abuse_user_report" ("reporterHost") `, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_f8d8b93740ad12c4ce8213a199"`); + await queryRunner.query(`DROP INDEX "IDX_4ebbf7f93cdc10e8d1ef2fc6cd"`); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" DROP COLUMN "reporterHost"`, + ); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" DROP COLUMN "targetUserHost"`, + ); + } } diff --git a/packages/backend/migration/1603776877564-instance-theme-color.js b/packages/backend/migration/1603776877564-instance-theme-color.js index 92440d3f64..9bb3d65c0e 100644 --- a/packages/backend/migration/1603776877564-instance-theme-color.js +++ b/packages/backend/migration/1603776877564-instance-theme-color.js @@ -1,13 +1,13 @@ - - export class instanceThemeColor1603776877564 { - constructor() { - this.name = 'instanceThemeColor1603776877564'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" ADD "themeColor" character varying(64) DEFAULT null`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "themeColor"`); - } + constructor() { + this.name = "instanceThemeColor1603776877564"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "instance" ADD "themeColor" character varying(64) DEFAULT null`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "themeColor"`); + } } diff --git a/packages/backend/migration/1603781553011-instance-favicon.js b/packages/backend/migration/1603781553011-instance-favicon.js index f607c49ffb..4b2442692f 100644 --- a/packages/backend/migration/1603781553011-instance-favicon.js +++ b/packages/backend/migration/1603781553011-instance-favicon.js @@ -1,13 +1,13 @@ - - export class instanceFavicon1603781553011 { - constructor() { - this.name = 'instanceFavicon1603781553011'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" ADD "faviconUrl" character varying(256) DEFAULT null`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "faviconUrl"`); - } + constructor() { + this.name = "instanceFavicon1603781553011"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "instance" ADD "faviconUrl" character varying(256) DEFAULT null`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "faviconUrl"`); + } } diff --git a/packages/backend/migration/1604821689616-delete-auto-watch.js b/packages/backend/migration/1604821689616-delete-auto-watch.js index 4706e8bae9..6a8333ce16 100644 --- a/packages/backend/migration/1604821689616-delete-auto-watch.js +++ b/packages/backend/migration/1604821689616-delete-auto-watch.js @@ -1,13 +1,15 @@ - - export class deleteAutoWatch1604821689616 { - constructor() { - this.name = 'deleteAutoWatch1604821689616'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "autoWatch"`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ADD "autoWatch" boolean NOT NULL DEFAULT false`); - } + constructor() { + this.name = "deleteAutoWatch1604821689616"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "autoWatch"`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "autoWatch" boolean NOT NULL DEFAULT false`, + ); + } } diff --git a/packages/backend/migration/1605408848373-clip-description.js b/packages/backend/migration/1605408848373-clip-description.js index edd5505b30..99cda65346 100644 --- a/packages/backend/migration/1605408848373-clip-description.js +++ b/packages/backend/migration/1605408848373-clip-description.js @@ -1,13 +1,13 @@ - - export class clipDescription1605408848373 { - constructor() { - this.name = 'clipDescription1605408848373'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "clip" ADD "description" character varying(2048) DEFAULT null`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "clip" DROP COLUMN "description"`); - } + constructor() { + this.name = "clipDescription1605408848373"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "clip" ADD "description" character varying(2048) DEFAULT null`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "clip" DROP COLUMN "description"`); + } } diff --git a/packages/backend/migration/1605408971051-comments.js b/packages/backend/migration/1605408971051-comments.js index 400efd5e70..363fec5cdd 100644 --- a/packages/backend/migration/1605408971051-comments.js +++ b/packages/backend/migration/1605408971051-comments.js @@ -1,433 +1,1067 @@ - - export class comments1605408971051 { - constructor() { - this.name = 'comments1605408971051'; - } - async up(queryRunner) { - await queryRunner.query(`COMMENT ON COLUMN "log"."createdAt" IS 'The created date of the Log.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_folder"."createdAt" IS 'The created date of the DriveFolder.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_folder"."name" IS 'The name of the DriveFolder.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_folder"."userId" IS 'The owner ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_folder"."parentId" IS 'The parent folder ID. If null, it means the DriveFolder is located in root.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."createdAt" IS 'The created date of the DriveFile.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."userId" IS 'The owner ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."userHost" IS 'The host of owner. It will be null if the user in local.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."md5" IS 'The MD5 hash of the DriveFile.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."name" IS 'The file name of the DriveFile.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."type" IS 'The content type (MIME) of the DriveFile.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."size" IS 'The file size (bytes) of the DriveFile.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."comment" IS 'The comment of the DriveFile.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."blurhash" IS 'The BlurHash string.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."properties" IS 'The any properties of the DriveFile. For example, it includes image width/height.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."url" IS 'The URL of the DriveFile.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."thumbnailUrl" IS 'The URL of the thumbnail of the DriveFile.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."webpublicUrl" IS 'The URL of the webpublic of the DriveFile.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."uri" IS 'The URI of the DriveFile. it will be null when the DriveFile is local.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."folderId" IS 'The parent folder ID. If null, it means the DriveFile is located in root.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."isSensitive" IS 'Whether the DriveFile is NSFW.'`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."isLink" IS 'Whether the DriveFile is direct link to remote server.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."createdAt" IS 'The created date of the User.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."updatedAt" IS 'The updated date of the User.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."username" IS 'The username of the User.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."usernameLower" IS 'The username (lowercased) of the User.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."name" IS 'The name of the User.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."followersCount" IS 'The count of followers.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."followingCount" IS 'The count of following.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."notesCount" IS 'The count of notes.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."avatarId" IS 'The ID of avatar DriveFile.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."bannerId" IS 'The ID of banner DriveFile.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isSuspended" IS 'Whether the User is suspended.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isSilenced" IS 'Whether the User is silenced.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isLocked" IS 'Whether the User is locked.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isBot" IS 'Whether the User is a bot.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isCat" IS 'Whether the User is a cat.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isAdmin" IS 'Whether the User is the admin.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isModerator" IS 'Whether the User is a moderator.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."host" IS 'The host of the User. It will be null if the origin of the user is local.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."inbox" IS 'The inbox URL of the User. It will be null if the origin of the user is local.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."sharedInbox" IS 'The sharedInbox URL of the User. It will be null if the origin of the user is local.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."featured" IS 'The featured URL of the User. It will be null if the origin of the user is local.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."uri" IS 'The URI of the User. It will be null if the origin of the user is local.'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."token" IS 'The native access token of the User. It will be null if the origin of the user is local.'`); - await queryRunner.query(`COMMENT ON COLUMN "app"."createdAt" IS 'The created date of the App.'`); - await queryRunner.query(`COMMENT ON COLUMN "app"."userId" IS 'The owner ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "app"."secret" IS 'The secret key of the App.'`); - await queryRunner.query(`COMMENT ON COLUMN "app"."name" IS 'The name of the App.'`); - await queryRunner.query(`COMMENT ON COLUMN "app"."description" IS 'The description of the App.'`); - await queryRunner.query(`COMMENT ON COLUMN "app"."permission" IS 'The permission of the App.'`); - await queryRunner.query(`COMMENT ON COLUMN "app"."callbackUrl" IS 'The callbackUrl of the App.'`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."createdAt" IS 'The created date of the AccessToken.'`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."lastUsedAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."session" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."appId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."description" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."iconUrl" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."createdAt" IS 'The created date of the Channel.'`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."userId" IS 'The owner ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."name" IS 'The name of the Channel.'`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."description" IS 'The description of the Channel.'`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."bannerId" IS 'The ID of banner Channel.'`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."notesCount" IS 'The count of notes.'`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."usersCount" IS 'The count of users.'`); - await queryRunner.query(`COMMENT ON COLUMN "note"."createdAt" IS 'The created date of the Note.'`); - await queryRunner.query(`COMMENT ON COLUMN "note"."replyId" IS 'The ID of reply target.'`); - await queryRunner.query(`COMMENT ON COLUMN "note"."renoteId" IS 'The ID of renote target.'`); - await queryRunner.query(`COMMENT ON COLUMN "note"."userId" IS 'The ID of author.'`); - await queryRunner.query(`COMMENT ON COLUMN "note"."uri" IS 'The URI of a note. it will be null when the note is local.'`); - await queryRunner.query(`COMMENT ON COLUMN "note"."url" IS 'The human readable url of a note. it will be null when the note is local.'`); - await queryRunner.query(`COMMENT ON COLUMN "note"."channelId" IS 'The ID of source channel.'`); - await queryRunner.query(`COMMENT ON COLUMN "note"."userHost" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "note"."replyUserId" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "note"."replyUserHost" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "note"."renoteUserId" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "note"."renoteUserHost" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "poll_vote"."createdAt" IS 'The created date of the PollVote.'`); - await queryRunner.query(`COMMENT ON COLUMN "note_reaction"."createdAt" IS 'The created date of the NoteReaction.'`); - await queryRunner.query(`COMMENT ON COLUMN "note_watching"."createdAt" IS 'The created date of the NoteWatching.'`); - await queryRunner.query(`COMMENT ON COLUMN "note_watching"."userId" IS 'The watcher ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "note_watching"."noteId" IS 'The target Note ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "note_watching"."noteUserId" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "note_unread"."noteUserId" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "note_unread"."noteChannelId" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."createdAt" IS 'The created date of the FollowRequest.'`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followeeId" IS 'The followee user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followerId" IS 'The follower user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."requestId" IS 'id of Follow Activity.'`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followerHost" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followerInbox" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followerSharedInbox" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followeeHost" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followeeInbox" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followeeSharedInbox" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "user_group"."createdAt" IS 'The created date of the UserGroup.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_group"."userId" IS 'The ID of owner.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_group_invitation"."createdAt" IS 'The created date of the UserGroupInvitation.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_group_invitation"."userId" IS 'The user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_group_invitation"."userGroupId" IS 'The group ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "notification"."createdAt" IS 'The created date of the Notification.'`); - await queryRunner.query(`COMMENT ON COLUMN "notification"."notifieeId" IS 'The ID of recipient user of the Notification.'`); - await queryRunner.query(`COMMENT ON COLUMN "notification"."isRead" IS 'Whether the Notification is read.'`); - await queryRunner.query(`COMMENT ON COLUMN "meta"."localDriveCapacityMb" IS 'Drive capacity of a local user (MB)'`); - await queryRunner.query(`COMMENT ON COLUMN "meta"."remoteDriveCapacityMb" IS 'Drive capacity of a remote user (MB)'`); - await queryRunner.query(`COMMENT ON COLUMN "meta"."maxNoteTextLength" IS 'Max allowed note text length in characters'`); - await queryRunner.query(`COMMENT ON COLUMN "following"."createdAt" IS 'The created date of the Following.'`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followeeId" IS 'The followee user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followerId" IS 'The follower user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followerHost" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followerInbox" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followerSharedInbox" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followeeHost" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followeeInbox" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followeeSharedInbox" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."caughtAt" IS 'The caught date of the Instance.'`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."host" IS 'The host of the Instance.'`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."usersCount" IS 'The count of the users of the Instance.'`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."notesCount" IS 'The count of the notes of the Instance.'`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."softwareName" IS 'The software of the Instance.'`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."softwareVersion" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."openRegistrations" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."description" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."maintainerName" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."maintainerEmail" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."iconUrl" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."faviconUrl" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."themeColor" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "muting"."createdAt" IS 'The created date of the Muting.'`); - await queryRunner.query(`COMMENT ON COLUMN "muting"."muteeId" IS 'The mutee user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "muting"."muterId" IS 'The muter user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "blocking"."createdAt" IS 'The created date of the Blocking.'`); - await queryRunner.query(`COMMENT ON COLUMN "blocking"."blockeeId" IS 'The blockee user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "blocking"."blockerId" IS 'The blocker user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_list"."createdAt" IS 'The created date of the UserList.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_list"."userId" IS 'The owner ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_list"."name" IS 'The name of the UserList.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_list_joining"."createdAt" IS 'The created date of the UserListJoining.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_list_joining"."userId" IS 'The user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_list_joining"."userListId" IS 'The list ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_group_joining"."createdAt" IS 'The created date of the UserGroupJoining.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_group_joining"."userId" IS 'The user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_group_joining"."userGroupId" IS 'The group ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "note_favorite"."createdAt" IS 'The created date of the NoteFavorite.'`); - await queryRunner.query(`COMMENT ON COLUMN "abuse_user_report"."createdAt" IS 'The created date of the AbuseUserReport.'`); - await queryRunner.query(`COMMENT ON COLUMN "abuse_user_report"."targetUserHost" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "abuse_user_report"."reporterHost" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "messaging_message"."createdAt" IS 'The created date of the MessagingMessage.'`); - await queryRunner.query(`COMMENT ON COLUMN "messaging_message"."userId" IS 'The sender user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "messaging_message"."groupId" IS 'The recipient group ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "signin"."createdAt" IS 'The created date of the Signin.'`); - await queryRunner.query(`COMMENT ON COLUMN "auth_session"."createdAt" IS 'The created date of the AuthSession.'`); - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."createdAt" IS 'The created date of the ReversiGame.'`); - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."startedAt" IS 'The started date of the ReversiGame.'`); - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."form1" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."form2" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "reversi_matching"."createdAt" IS 'The created date of the ReversiMatching.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_note_pining"."createdAt" IS 'The created date of the UserNotePinings.'`); - await queryRunner.query(`COMMENT ON COLUMN "poll"."noteId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "poll"."noteVisibility" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "poll"."userId" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "poll"."userHost" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "user_keypair"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_publickey"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "page"."createdAt" IS 'The created date of the Page.'`); - await queryRunner.query(`COMMENT ON COLUMN "page"."updatedAt" IS 'The updated date of the Page.'`); - await queryRunner.query(`COMMENT ON COLUMN "page"."userId" IS 'The ID of author.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."location" IS 'The location of the User.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."birthday" IS 'The birthday (YYYY-MM-DD) of the User.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."description" IS 'The description (bio) of the User.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."url" IS 'Remote URL of the user.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."email" IS 'The email address of the User.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."password" IS 'The password hash of the User. It will be null if the origin of the user is local.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."clientData" IS 'The client-specific data of the User.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."room" IS 'The room data of the User.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."userHost" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."id" IS 'Variable-length id given to navigator.credentials.get()'`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."publicKey" IS 'Variable-length public key used to verify attestations (hex-encoded).'`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."lastUsed" IS 'The date of the last time the UserSecurityKey was successfully validated.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."name" IS 'User-defined name for this key'`); - await queryRunner.query(`COMMENT ON COLUMN "attestation_challenge"."challenge" IS 'Hex-encoded sha256 hash of the challenge.'`); - await queryRunner.query(`COMMENT ON COLUMN "attestation_challenge"."createdAt" IS 'The date challenge was created for expiry purposes.'`); - await queryRunner.query(`COMMENT ON COLUMN "attestation_challenge"."registrationChallenge" IS 'Indicates that the challenge is only for registration purposes if true to prevent the challenge for being used as authentication.'`); - await queryRunner.query(`COMMENT ON COLUMN "moderation_log"."createdAt" IS 'The created date of the ModerationLog.'`); - await queryRunner.query(`COMMENT ON COLUMN "announcement"."createdAt" IS 'The created date of the Announcement.'`); - await queryRunner.query(`COMMENT ON COLUMN "announcement"."updatedAt" IS 'The updated date of the Announcement.'`); - await queryRunner.query(`COMMENT ON COLUMN "announcement_read"."createdAt" IS 'The created date of the AnnouncementRead.'`); - await queryRunner.query(`COMMENT ON COLUMN "clip"."createdAt" IS 'The created date of the Clip.'`); - await queryRunner.query(`COMMENT ON COLUMN "clip"."userId" IS 'The owner ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "clip"."name" IS 'The name of the Clip.'`); - await queryRunner.query(`COMMENT ON COLUMN "clip"."description" IS 'The description of the Clip.'`); - await queryRunner.query(`COMMENT ON COLUMN "clip_note"."noteId" IS 'The note ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "clip_note"."clipId" IS 'The clip ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "antenna"."createdAt" IS 'The created date of the Antenna.'`); - await queryRunner.query(`COMMENT ON COLUMN "antenna"."userId" IS 'The owner ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "antenna"."name" IS 'The name of the Antenna.'`); - await queryRunner.query(`COMMENT ON COLUMN "antenna_note"."noteId" IS 'The note ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "antenna_note"."antennaId" IS 'The antenna ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "promo_note"."noteId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "promo_note"."userId" IS '[Denormalized]'`); - await queryRunner.query(`COMMENT ON COLUMN "promo_read"."createdAt" IS 'The created date of the PromoRead.'`); - await queryRunner.query(`COMMENT ON COLUMN "muted_note"."noteId" IS 'The note ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "muted_note"."userId" IS 'The user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "muted_note"."reason" IS 'The reason of the MutedNote.'`); - await queryRunner.query(`COMMENT ON COLUMN "channel_following"."createdAt" IS 'The created date of the ChannelFollowing.'`); - await queryRunner.query(`COMMENT ON COLUMN "channel_following"."followeeId" IS 'The followee channel ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "channel_following"."followerId" IS 'The follower user ID.'`); - await queryRunner.query(`COMMENT ON COLUMN "channel_note_pining"."createdAt" IS 'The created date of the ChannelNotePining.'`); - } - async down(queryRunner) { - await queryRunner.query(`COMMENT ON COLUMN "channel_note_pining"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel_following"."followerId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel_following"."followeeId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel_following"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "muted_note"."reason" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "muted_note"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "muted_note"."noteId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "promo_read"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "promo_note"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "promo_note"."noteId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "antenna_note"."antennaId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "antenna_note"."noteId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "antenna"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "antenna"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "antenna"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "clip_note"."clipId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "clip_note"."noteId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "clip"."description" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "clip"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "clip"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "clip"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "announcement_read"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "announcement"."updatedAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "announcement"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "moderation_log"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "attestation_challenge"."registrationChallenge" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "attestation_challenge"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "attestation_challenge"."challenge" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."lastUsed" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."publicKey" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_security_key"."id" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."userHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."room" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."clientData" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."password" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."email" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."url" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."description" IS 'The description (bio) of the User.'`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."birthday" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."location" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "page"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "page"."updatedAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "page"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_publickey"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_keypair"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "poll"."userHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "poll"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "poll"."noteVisibility" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "poll"."noteId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_note_pining"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "reversi_matching"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."form2" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."form1" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."startedAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "auth_session"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "signin"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "messaging_message"."groupId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "messaging_message"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "messaging_message"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "abuse_user_report"."reporterHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "abuse_user_report"."targetUserHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "abuse_user_report"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note_favorite"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_group_joining"."userGroupId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_group_joining"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_group_joining"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_list_joining"."userListId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_list_joining"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_list_joining"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_list"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_list"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_list"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "blocking"."blockerId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "blocking"."blockeeId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "blocking"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "muting"."muterId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "muting"."muteeId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "muting"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."themeColor" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."faviconUrl" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."iconUrl" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."maintainerEmail" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."maintainerName" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."description" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."openRegistrations" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."softwareVersion" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."softwareName" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."notesCount" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."usersCount" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."host" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "instance"."caughtAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followeeSharedInbox" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followeeInbox" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followeeHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followerSharedInbox" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followerInbox" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followerHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followerId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "following"."followeeId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "following"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "meta"."maxNoteTextLength" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "meta"."remoteDriveCapacityMb" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "meta"."localDriveCapacityMb" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "notification"."isRead" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "notification"."notifieeId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "notification"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_group_invitation"."userGroupId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_group_invitation"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_group_invitation"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_group"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user_group"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followeeSharedInbox" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followeeInbox" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followeeHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followerSharedInbox" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followerInbox" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followerHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."requestId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followerId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."followeeId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "follow_request"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note_unread"."noteChannelId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note_unread"."noteUserId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note_watching"."noteUserId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note_watching"."noteId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note_watching"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note_watching"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note_reaction"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "poll_vote"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."renoteUserHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."renoteUserId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."replyUserHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."replyUserId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."userHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."channelId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."url" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."uri" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."renoteId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."replyId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "note"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."usersCount" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."notesCount" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."bannerId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."description" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "channel"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."iconUrl" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."description" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."appId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."session" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."lastUsedAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "access_token"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "app"."callbackUrl" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "app"."permission" IS 'The permission of the App.'`); - await queryRunner.query(`COMMENT ON COLUMN "app"."description" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "app"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "app"."secret" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "app"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "app"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."token" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."uri" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."featured" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."sharedInbox" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."inbox" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."host" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isModerator" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isAdmin" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isCat" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isBot" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isLocked" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isSilenced" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isSuspended" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."bannerId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."avatarId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."notesCount" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."followingCount" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."followersCount" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."usernameLower" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."username" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."updatedAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."isLink" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."isSensitive" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."folderId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."uri" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."webpublicUrl" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."thumbnailUrl" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."url" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."properties" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."blurhash" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."comment" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."size" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."type" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."md5" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."userHost" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_folder"."parentId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_folder"."userId" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_folder"."name" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "drive_folder"."createdAt" IS NULL`); - await queryRunner.query(`COMMENT ON COLUMN "log"."createdAt" IS NULL`); - } + constructor() { + this.name = "comments1605408971051"; + } + async up(queryRunner) { + await queryRunner.query( + `COMMENT ON COLUMN "log"."createdAt" IS 'The created date of the Log.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_folder"."createdAt" IS 'The created date of the DriveFolder.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_folder"."name" IS 'The name of the DriveFolder.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_folder"."userId" IS 'The owner ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_folder"."parentId" IS 'The parent folder ID. If null, it means the DriveFolder is located in root.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."createdAt" IS 'The created date of the DriveFile.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."userId" IS 'The owner ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."userHost" IS 'The host of owner. It will be null if the user in local.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."md5" IS 'The MD5 hash of the DriveFile.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."name" IS 'The file name of the DriveFile.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."type" IS 'The content type (MIME) of the DriveFile.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."size" IS 'The file size (bytes) of the DriveFile.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."comment" IS 'The comment of the DriveFile.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."blurhash" IS 'The BlurHash string.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."properties" IS 'The any properties of the DriveFile. For example, it includes image width/height.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."url" IS 'The URL of the DriveFile.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."thumbnailUrl" IS 'The URL of the thumbnail of the DriveFile.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."webpublicUrl" IS 'The URL of the webpublic of the DriveFile.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."uri" IS 'The URI of the DriveFile. it will be null when the DriveFile is local.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."folderId" IS 'The parent folder ID. If null, it means the DriveFile is located in root.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."isSensitive" IS 'Whether the DriveFile is NSFW.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."isLink" IS 'Whether the DriveFile is direct link to remote server.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."createdAt" IS 'The created date of the User.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."updatedAt" IS 'The updated date of the User.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."username" IS 'The username of the User.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."usernameLower" IS 'The username (lowercased) of the User.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."name" IS 'The name of the User.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."followersCount" IS 'The count of followers.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."followingCount" IS 'The count of following.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."notesCount" IS 'The count of notes.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."avatarId" IS 'The ID of avatar DriveFile.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."bannerId" IS 'The ID of banner DriveFile.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."isSuspended" IS 'Whether the User is suspended.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."isSilenced" IS 'Whether the User is silenced.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."isLocked" IS 'Whether the User is locked.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."isBot" IS 'Whether the User is a bot.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."isCat" IS 'Whether the User is a cat.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."isAdmin" IS 'Whether the User is the admin.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."isModerator" IS 'Whether the User is a moderator.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."host" IS 'The host of the User. It will be null if the origin of the user is local.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."inbox" IS 'The inbox URL of the User. It will be null if the origin of the user is local.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."sharedInbox" IS 'The sharedInbox URL of the User. It will be null if the origin of the user is local.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."featured" IS 'The featured URL of the User. It will be null if the origin of the user is local.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."uri" IS 'The URI of the User. It will be null if the origin of the user is local.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."token" IS 'The native access token of the User. It will be null if the origin of the user is local.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "app"."createdAt" IS 'The created date of the App.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "app"."userId" IS 'The owner ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "app"."secret" IS 'The secret key of the App.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "app"."name" IS 'The name of the App.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "app"."description" IS 'The description of the App.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "app"."permission" IS 'The permission of the App.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "app"."callbackUrl" IS 'The callbackUrl of the App.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "access_token"."createdAt" IS 'The created date of the AccessToken.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "access_token"."lastUsedAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "access_token"."session" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "access_token"."appId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "access_token"."name" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "access_token"."description" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "access_token"."iconUrl" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel"."createdAt" IS 'The created date of the Channel.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel"."userId" IS 'The owner ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel"."name" IS 'The name of the Channel.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel"."description" IS 'The description of the Channel.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel"."bannerId" IS 'The ID of banner Channel.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel"."notesCount" IS 'The count of notes.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel"."usersCount" IS 'The count of users.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note"."createdAt" IS 'The created date of the Note.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note"."replyId" IS 'The ID of reply target.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note"."renoteId" IS 'The ID of renote target.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note"."userId" IS 'The ID of author.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note"."uri" IS 'The URI of a note. it will be null when the note is local.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note"."url" IS 'The human readable url of a note. it will be null when the note is local.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note"."channelId" IS 'The ID of source channel.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note"."userHost" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note"."replyUserId" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note"."replyUserHost" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note"."renoteUserId" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note"."renoteUserHost" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "poll_vote"."createdAt" IS 'The created date of the PollVote.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_reaction"."createdAt" IS 'The created date of the NoteReaction.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_watching"."createdAt" IS 'The created date of the NoteWatching.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_watching"."userId" IS 'The watcher ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_watching"."noteId" IS 'The target Note ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_watching"."noteUserId" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_unread"."noteUserId" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_unread"."noteChannelId" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."createdAt" IS 'The created date of the FollowRequest.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followeeId" IS 'The followee user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followerId" IS 'The follower user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."requestId" IS 'id of Follow Activity.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followerHost" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followerInbox" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followerSharedInbox" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followeeHost" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followeeInbox" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followeeSharedInbox" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group"."createdAt" IS 'The created date of the UserGroup.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group"."userId" IS 'The ID of owner.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group_invitation"."createdAt" IS 'The created date of the UserGroupInvitation.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group_invitation"."userId" IS 'The user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group_invitation"."userGroupId" IS 'The group ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "notification"."createdAt" IS 'The created date of the Notification.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "notification"."notifieeId" IS 'The ID of recipient user of the Notification.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "notification"."isRead" IS 'Whether the Notification is read.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "meta"."localDriveCapacityMb" IS 'Drive capacity of a local user (MB)'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "meta"."remoteDriveCapacityMb" IS 'Drive capacity of a remote user (MB)'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "meta"."maxNoteTextLength" IS 'Max allowed note text length in characters'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."createdAt" IS 'The created date of the Following.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followeeId" IS 'The followee user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followerId" IS 'The follower user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followerHost" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followerInbox" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followerSharedInbox" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followeeHost" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followeeInbox" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followeeSharedInbox" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."caughtAt" IS 'The caught date of the Instance.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."host" IS 'The host of the Instance.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."usersCount" IS 'The count of the users of the Instance.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."notesCount" IS 'The count of the notes of the Instance.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."softwareName" IS 'The software of the Instance.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."softwareVersion" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."openRegistrations" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "instance"."name" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."description" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."maintainerName" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."maintainerEmail" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "instance"."iconUrl" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."faviconUrl" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."themeColor" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "muting"."createdAt" IS 'The created date of the Muting.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "muting"."muteeId" IS 'The mutee user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "muting"."muterId" IS 'The muter user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "blocking"."createdAt" IS 'The created date of the Blocking.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "blocking"."blockeeId" IS 'The blockee user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "blocking"."blockerId" IS 'The blocker user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_list"."createdAt" IS 'The created date of the UserList.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_list"."userId" IS 'The owner ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_list"."name" IS 'The name of the UserList.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_list_joining"."createdAt" IS 'The created date of the UserListJoining.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_list_joining"."userId" IS 'The user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_list_joining"."userListId" IS 'The list ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group_joining"."createdAt" IS 'The created date of the UserGroupJoining.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group_joining"."userId" IS 'The user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group_joining"."userGroupId" IS 'The group ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_favorite"."createdAt" IS 'The created date of the NoteFavorite.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "abuse_user_report"."createdAt" IS 'The created date of the AbuseUserReport.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "abuse_user_report"."targetUserHost" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "abuse_user_report"."reporterHost" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "messaging_message"."createdAt" IS 'The created date of the MessagingMessage.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "messaging_message"."userId" IS 'The sender user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "messaging_message"."groupId" IS 'The recipient group ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "signin"."createdAt" IS 'The created date of the Signin.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "auth_session"."createdAt" IS 'The created date of the AuthSession.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "reversi_game"."createdAt" IS 'The created date of the ReversiGame.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "reversi_game"."startedAt" IS 'The started date of the ReversiGame.'`, + ); + await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."form1" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."form2" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "reversi_matching"."createdAt" IS 'The created date of the ReversiMatching.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_note_pining"."createdAt" IS 'The created date of the UserNotePinings.'`, + ); + await queryRunner.query(`COMMENT ON COLUMN "poll"."noteId" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "poll"."noteVisibility" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "poll"."userId" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "poll"."userHost" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_keypair"."userId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_publickey"."userId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "page"."createdAt" IS 'The created date of the Page.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "page"."updatedAt" IS 'The updated date of the Page.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "page"."userId" IS 'The ID of author.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."userId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."location" IS 'The location of the User.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."birthday" IS 'The birthday (YYYY-MM-DD) of the User.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."description" IS 'The description (bio) of the User.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."url" IS 'Remote URL of the user.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."email" IS 'The email address of the User.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."password" IS 'The password hash of the User. It will be null if the origin of the user is local.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."clientData" IS 'The client-specific data of the User.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."room" IS 'The room data of the User.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."userHost" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_security_key"."id" IS 'Variable-length id given to navigator.credentials.get()'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_security_key"."publicKey" IS 'Variable-length public key used to verify attestations (hex-encoded).'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_security_key"."lastUsed" IS 'The date of the last time the UserSecurityKey was successfully validated.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_security_key"."name" IS 'User-defined name for this key'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "attestation_challenge"."challenge" IS 'Hex-encoded sha256 hash of the challenge.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "attestation_challenge"."createdAt" IS 'The date challenge was created for expiry purposes.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "attestation_challenge"."registrationChallenge" IS 'Indicates that the challenge is only for registration purposes if true to prevent the challenge for being used as authentication.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "moderation_log"."createdAt" IS 'The created date of the ModerationLog.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "announcement"."createdAt" IS 'The created date of the Announcement.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "announcement"."updatedAt" IS 'The updated date of the Announcement.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "announcement_read"."createdAt" IS 'The created date of the AnnouncementRead.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "clip"."createdAt" IS 'The created date of the Clip.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "clip"."userId" IS 'The owner ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "clip"."name" IS 'The name of the Clip.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "clip"."description" IS 'The description of the Clip.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "clip_note"."noteId" IS 'The note ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "clip_note"."clipId" IS 'The clip ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "antenna"."createdAt" IS 'The created date of the Antenna.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "antenna"."userId" IS 'The owner ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "antenna"."name" IS 'The name of the Antenna.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "antenna_note"."noteId" IS 'The note ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "antenna_note"."antennaId" IS 'The antenna ID.'`, + ); + await queryRunner.query(`COMMENT ON COLUMN "promo_note"."noteId" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "promo_note"."userId" IS '[Denormalized]'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "promo_read"."createdAt" IS 'The created date of the PromoRead.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "muted_note"."noteId" IS 'The note ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "muted_note"."userId" IS 'The user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "muted_note"."reason" IS 'The reason of the MutedNote.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel_following"."createdAt" IS 'The created date of the ChannelFollowing.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel_following"."followeeId" IS 'The followee channel ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel_following"."followerId" IS 'The follower user ID.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel_note_pining"."createdAt" IS 'The created date of the ChannelNotePining.'`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `COMMENT ON COLUMN "channel_note_pining"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel_following"."followerId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel_following"."followeeId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "channel_following"."createdAt" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "muted_note"."reason" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "muted_note"."userId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "muted_note"."noteId" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "promo_read"."createdAt" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "promo_note"."userId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "promo_note"."noteId" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "antenna_note"."antennaId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "antenna_note"."noteId" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "antenna"."name" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "antenna"."userId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "antenna"."createdAt" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "clip_note"."clipId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "clip_note"."noteId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "clip"."description" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "clip"."name" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "clip"."userId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "clip"."createdAt" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "announcement_read"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "announcement"."updatedAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "announcement"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "moderation_log"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "attestation_challenge"."registrationChallenge" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "attestation_challenge"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "attestation_challenge"."challenge" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_security_key"."name" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_security_key"."lastUsed" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_security_key"."publicKey" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_security_key"."id" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."userHost" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "user_profile"."room" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."clientData" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."password" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "user_profile"."email" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user_profile"."url" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."description" IS 'The description (bio) of the User.'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."birthday" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."location" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."userId" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "page"."userId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "page"."updatedAt" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "page"."createdAt" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "user_publickey"."userId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_keypair"."userId" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "poll"."userHost" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "poll"."userId" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "poll"."noteVisibility" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "poll"."noteId" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "user_note_pining"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "reversi_matching"."createdAt" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."form2" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "reversi_game"."form1" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "reversi_game"."startedAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "reversi_game"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "auth_session"."createdAt" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "signin"."createdAt" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "messaging_message"."groupId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "messaging_message"."userId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "messaging_message"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "abuse_user_report"."reporterHost" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "abuse_user_report"."targetUserHost" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "abuse_user_report"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_favorite"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group_joining"."userGroupId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group_joining"."userId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group_joining"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_list_joining"."userListId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_list_joining"."userId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_list_joining"."createdAt" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "user_list"."name" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user_list"."userId" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "user_list"."createdAt" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "blocking"."blockerId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "blocking"."blockeeId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "blocking"."createdAt" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "muting"."muterId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "muting"."muteeId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "muting"."createdAt" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."themeColor" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."faviconUrl" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "instance"."iconUrl" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."maintainerEmail" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."maintainerName" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."description" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "instance"."name" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."openRegistrations" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."softwareVersion" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."softwareName" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."notesCount" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "instance"."usersCount" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "instance"."host" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "instance"."caughtAt" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followeeSharedInbox" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followeeInbox" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followeeHost" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followerSharedInbox" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followerInbox" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followerHost" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followerId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."followeeId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "following"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "meta"."maxNoteTextLength" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "meta"."remoteDriveCapacityMb" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "meta"."localDriveCapacityMb" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "notification"."isRead" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "notification"."notifieeId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "notification"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group_invitation"."userGroupId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group_invitation"."userId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_group_invitation"."createdAt" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "user_group"."userId" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "user_group"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followeeSharedInbox" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followeeInbox" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followeeHost" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followerSharedInbox" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followerInbox" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followerHost" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."requestId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followerId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."followeeId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "follow_request"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_unread"."noteChannelId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_unread"."noteUserId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_watching"."noteUserId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_watching"."noteId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_watching"."userId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_watching"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note_reaction"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "poll_vote"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "note"."renoteUserHost" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "note"."renoteUserId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "note"."replyUserHost" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "note"."replyUserId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "note"."userHost" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "note"."channelId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "note"."url" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "note"."uri" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "note"."userId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "note"."renoteId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "note"."replyId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "note"."createdAt" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "channel"."usersCount" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "channel"."notesCount" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "channel"."bannerId" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "channel"."description" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "channel"."name" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "channel"."userId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "channel"."createdAt" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "access_token"."iconUrl" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "access_token"."description" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "access_token"."name" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "access_token"."appId" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "access_token"."session" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "access_token"."lastUsedAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "access_token"."createdAt" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "app"."callbackUrl" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "app"."permission" IS 'The permission of the App.'`, + ); + await queryRunner.query(`COMMENT ON COLUMN "app"."description" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "app"."name" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "app"."secret" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "app"."userId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "app"."createdAt" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."token" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."uri" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."featured" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."sharedInbox" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."inbox" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."host" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."isModerator" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."isAdmin" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."isCat" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."isBot" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."isLocked" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."isSilenced" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."isSuspended" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."bannerId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."avatarId" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."notesCount" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "user"."followingCount" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."followersCount" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "user"."name" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."usernameLower" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."username" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."updatedAt" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "user"."createdAt" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "drive_file"."isLink" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."isSensitive" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."folderId" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "drive_file"."uri" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."webpublicUrl" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."thumbnailUrl" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "drive_file"."url" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."properties" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."blurhash" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "drive_file"."comment" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "drive_file"."size" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "drive_file"."type" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "drive_file"."name" IS NULL`); + await queryRunner.query(`COMMENT ON COLUMN "drive_file"."md5" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."userHost" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "drive_file"."userId" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."createdAt" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_folder"."parentId" IS NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_folder"."userId" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "drive_folder"."name" IS NULL`); + await queryRunner.query( + `COMMENT ON COLUMN "drive_folder"."createdAt" IS NULL`, + ); + await queryRunner.query(`COMMENT ON COLUMN "log"."createdAt" IS NULL`); + } } diff --git a/packages/backend/migration/1605585339718-instance-pinned-pages.js b/packages/backend/migration/1605585339718-instance-pinned-pages.js index 56ccd44c8e..09e1617641 100644 --- a/packages/backend/migration/1605585339718-instance-pinned-pages.js +++ b/packages/backend/migration/1605585339718-instance-pinned-pages.js @@ -1,13 +1,13 @@ - - export class instancePinnedPages1605585339718 { - constructor() { - this.name = 'instancePinnedPages1605585339718'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "pinnedPages" character varying(512) array NOT NULL DEFAULT '{"/featured", "/channels", "/explore", "/pages", "/about-misskey"}'::varchar[]`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedPages"`); - } + constructor() { + this.name = "instancePinnedPages1605585339718"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "pinnedPages" character varying(512) array NOT NULL DEFAULT '{"/featured", "/channels", "/explore", "/pages", "/about-misskey"}'::varchar[]`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedPages"`); + } } diff --git a/packages/backend/migration/1605965516823-instance-images.js b/packages/backend/migration/1605965516823-instance-images.js index 710c75981d..ed9a26a655 100644 --- a/packages/backend/migration/1605965516823-instance-images.js +++ b/packages/backend/migration/1605965516823-instance-images.js @@ -1,15 +1,19 @@ - - export class instanceImages1605965516823 { - constructor() { - this.name = 'instanceImages1605965516823'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "backgroundImageUrl" character varying(512)`); - await queryRunner.query(`ALTER TABLE "meta" ADD "logoImageUrl" character varying(512)`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "logoImageUrl"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "backgroundImageUrl"`); - } + constructor() { + this.name = "instanceImages1605965516823"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "backgroundImageUrl" character varying(512)`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "logoImageUrl" character varying(512)`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "logoImageUrl"`); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "backgroundImageUrl"`, + ); + } } diff --git a/packages/backend/migration/1606191203881-no-crawle.js b/packages/backend/migration/1606191203881-no-crawle.js index b9ada4354e..4e7e822771 100644 --- a/packages/backend/migration/1606191203881-no-crawle.js +++ b/packages/backend/migration/1606191203881-no-crawle.js @@ -1,15 +1,21 @@ - - export class noCrawle1606191203881 { - constructor() { - this.name = 'noCrawle1606191203881'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ADD "noCrawle" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."noCrawle" IS 'Whether reject index by crawler.'`); - } - async down(queryRunner) { - await queryRunner.query(`COMMENT ON COLUMN "user_profile"."noCrawle" IS 'Whether reject index by crawler.'`); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "noCrawle"`); - } + constructor() { + this.name = "noCrawle1606191203881"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "noCrawle" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."noCrawle" IS 'Whether reject index by crawler.'`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `COMMENT ON COLUMN "user_profile"."noCrawle" IS 'Whether reject index by crawler.'`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "noCrawle"`, + ); + } } diff --git a/packages/backend/migration/1607151207216-instance-pinned-clip.js b/packages/backend/migration/1607151207216-instance-pinned-clip.js index 9a4195e74c..655b4c7fbd 100644 --- a/packages/backend/migration/1607151207216-instance-pinned-clip.js +++ b/packages/backend/migration/1607151207216-instance-pinned-clip.js @@ -1,13 +1,13 @@ - - export class instancePinnedClip1607151207216 { - constructor() { - this.name = 'instancePinnedClip1607151207216'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "pinnedClipId" character varying(32)`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedClipId"`); - } + constructor() { + this.name = "instancePinnedClip1607151207216"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "pinnedClipId" character varying(32)`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "pinnedClipId"`); + } } diff --git a/packages/backend/migration/1607353487793-isExplorable.js b/packages/backend/migration/1607353487793-isExplorable.js index d9f1ff4c69..d654ee121f 100644 --- a/packages/backend/migration/1607353487793-isExplorable.js +++ b/packages/backend/migration/1607353487793-isExplorable.js @@ -1,17 +1,23 @@ - - export class isExplorable1607353487793 { - constructor() { - this.name = 'isExplorable1607353487793'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" ADD "isExplorable" boolean NOT NULL DEFAULT true`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isExplorable" IS 'Whether the User is explorable.'`); - await queryRunner.query(`CREATE INDEX "IDX_d5a1b83c7cab66f167e6888188" ON "user" ("isExplorable") `); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_d5a1b83c7cab66f167e6888188"`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isExplorable" IS 'Whether the User is explorable.'`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "isExplorable"`); - } + constructor() { + this.name = "isExplorable1607353487793"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user" ADD "isExplorable" boolean NOT NULL DEFAULT true`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."isExplorable" IS 'Whether the User is explorable.'`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d5a1b83c7cab66f167e6888188" ON "user" ("isExplorable") `, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_d5a1b83c7cab66f167e6888188"`); + await queryRunner.query( + `COMMENT ON COLUMN "user"."isExplorable" IS 'Whether the User is explorable.'`, + ); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "isExplorable"`); + } } diff --git a/packages/backend/migration/1610277136869-registry.js b/packages/backend/migration/1610277136869-registry.js index 184c062ddb..023519302e 100644 --- a/packages/backend/migration/1610277136869-registry.js +++ b/packages/backend/migration/1610277136869-registry.js @@ -1,21 +1,31 @@ - - export class registry1610277136869 { - constructor() { - this.name = 'registry1610277136869'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "registry_item" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "key" character varying(1024) NOT NULL, "scope" character varying(1024) array NOT NULL DEFAULT '{}'::varchar[], "domain" character varying(512), CONSTRAINT "PK_64b3f7e6008b4d89b826cd3af95" PRIMARY KEY ("id")); COMMENT ON COLUMN "registry_item"."createdAt" IS 'The created date of the RegistryItem.'; COMMENT ON COLUMN "registry_item"."updatedAt" IS 'The updated date of the RegistryItem.'; COMMENT ON COLUMN "registry_item"."userId" IS 'The owner ID.'; COMMENT ON COLUMN "registry_item"."key" IS 'The key of the RegistryItem.'`); - await queryRunner.query(`CREATE INDEX "IDX_fb9d21ba0abb83223263df6bcb" ON "registry_item" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_22baca135bb8a3ea1a83d13df3" ON "registry_item" ("scope") `); - await queryRunner.query(`CREATE INDEX "IDX_0a72bdfcdb97c0eca11fe7ecad" ON "registry_item" ("domain") `); - await queryRunner.query(`ALTER TABLE "registry_item" ADD CONSTRAINT "FK_fb9d21ba0abb83223263df6bcb3" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "registry_item" DROP CONSTRAINT "FK_fb9d21ba0abb83223263df6bcb3"`); - await queryRunner.query(`DROP INDEX "IDX_0a72bdfcdb97c0eca11fe7ecad"`); - await queryRunner.query(`DROP INDEX "IDX_22baca135bb8a3ea1a83d13df3"`); - await queryRunner.query(`DROP INDEX "IDX_fb9d21ba0abb83223263df6bcb"`); - await queryRunner.query(`DROP TABLE "registry_item"`); - } + constructor() { + this.name = "registry1610277136869"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "registry_item" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "key" character varying(1024) NOT NULL, "scope" character varying(1024) array NOT NULL DEFAULT '{}'::varchar[], "domain" character varying(512), CONSTRAINT "PK_64b3f7e6008b4d89b826cd3af95" PRIMARY KEY ("id")); COMMENT ON COLUMN "registry_item"."createdAt" IS 'The created date of the RegistryItem.'; COMMENT ON COLUMN "registry_item"."updatedAt" IS 'The updated date of the RegistryItem.'; COMMENT ON COLUMN "registry_item"."userId" IS 'The owner ID.'; COMMENT ON COLUMN "registry_item"."key" IS 'The key of the RegistryItem.'`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_fb9d21ba0abb83223263df6bcb" ON "registry_item" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_22baca135bb8a3ea1a83d13df3" ON "registry_item" ("scope") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0a72bdfcdb97c0eca11fe7ecad" ON "registry_item" ("domain") `, + ); + await queryRunner.query( + `ALTER TABLE "registry_item" ADD CONSTRAINT "FK_fb9d21ba0abb83223263df6bcb3" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "registry_item" DROP CONSTRAINT "FK_fb9d21ba0abb83223263df6bcb3"`, + ); + await queryRunner.query(`DROP INDEX "IDX_0a72bdfcdb97c0eca11fe7ecad"`); + await queryRunner.query(`DROP INDEX "IDX_22baca135bb8a3ea1a83d13df3"`); + await queryRunner.query(`DROP INDEX "IDX_fb9d21ba0abb83223263df6bcb"`); + await queryRunner.query(`DROP TABLE "registry_item"`); + } } diff --git a/packages/backend/migration/1610277585759-registry2.js b/packages/backend/migration/1610277585759-registry2.js index 591bafae31..a2c1fb01bf 100644 --- a/packages/backend/migration/1610277585759-registry2.js +++ b/packages/backend/migration/1610277585759-registry2.js @@ -1,15 +1,19 @@ - - export class registry21610277585759 { - constructor() { - this.name = 'registry21610277585759'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "registry_item" ADD "value" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`COMMENT ON COLUMN "registry_item"."value" IS 'The value of the RegistryItem.'`); - } - async down(queryRunner) { - await queryRunner.query(`COMMENT ON COLUMN "registry_item"."value" IS 'The value of the RegistryItem.'`); - await queryRunner.query(`ALTER TABLE "registry_item" DROP COLUMN "value"`); - } + constructor() { + this.name = "registry21610277585759"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "registry_item" ADD "value" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "registry_item"."value" IS 'The value of the RegistryItem.'`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `COMMENT ON COLUMN "registry_item"."value" IS 'The value of the RegistryItem.'`, + ); + await queryRunner.query(`ALTER TABLE "registry_item" DROP COLUMN "value"`); + } } diff --git a/packages/backend/migration/1610283021566-registry3.js b/packages/backend/migration/1610283021566-registry3.js index e0289f17ee..a1d55b2dc1 100644 --- a/packages/backend/migration/1610283021566-registry3.js +++ b/packages/backend/migration/1610283021566-registry3.js @@ -1,13 +1,15 @@ - - export class registry31610283021566 { - constructor() { - this.name = 'registry31610283021566'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "registry_item" ALTER COLUMN "value" DROP NOT NULL`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "registry_item" ALTER COLUMN "value" SET NOT NULL`); - } + constructor() { + this.name = "registry31610283021566"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "registry_item" ALTER COLUMN "value" DROP NOT NULL`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "registry_item" ALTER COLUMN "value" SET NOT NULL`, + ); + } } diff --git a/packages/backend/migration/1611354329133-followersUri.js b/packages/backend/migration/1611354329133-followersUri.js index 669ddb480e..c7ca5c895b 100644 --- a/packages/backend/migration/1611354329133-followersUri.js +++ b/packages/backend/migration/1611354329133-followersUri.js @@ -1,15 +1,19 @@ - - export class followersUri1611354329133 { - constructor() { - this.name = 'followersUri1611354329133'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" ADD "followersUri" varchar(512) DEFAULT NULL`); - await queryRunner.query(`COMMENT ON COLUMN "user"."followersUri" IS 'The URI of the user Follower Collection. It will be null if the origin of the user is local.'`); - } - async down(queryRunner) { - await queryRunner.query(`COMMENT ON COLUMN "user"."followersUri" IS 'The URI of the user Follower Collection. It will be null if the origin of the user is local.'`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "followersUri"`); - } + constructor() { + this.name = "followersUri1611354329133"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user" ADD "followersUri" varchar(512) DEFAULT NULL`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."followersUri" IS 'The URI of the user Follower Collection. It will be null if the origin of the user is local.'`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `COMMENT ON COLUMN "user"."followersUri" IS 'The URI of the user Follower Collection. It will be null if the origin of the user is local.'`, + ); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "followersUri"`); + } } diff --git a/packages/backend/migration/1611397665007-gallery.js b/packages/backend/migration/1611397665007-gallery.js index f49b2df468..1f36acbc17 100644 --- a/packages/backend/migration/1611397665007-gallery.js +++ b/packages/backend/migration/1611397665007-gallery.js @@ -1,39 +1,71 @@ - - export class gallery1611397665007 { - constructor() { - this.name = 'gallery1611397665007'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "gallery_post" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "title" character varying(256) NOT NULL, "description" character varying(2048), "userId" character varying(32) NOT NULL, "fileIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], "isSensitive" boolean NOT NULL DEFAULT false, "likedCount" integer NOT NULL DEFAULT '0', "tags" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], CONSTRAINT "PK_8e90d7b6015f2c4518881b14753" PRIMARY KEY ("id")); COMMENT ON COLUMN "gallery_post"."createdAt" IS 'The created date of the GalleryPost.'; COMMENT ON COLUMN "gallery_post"."updatedAt" IS 'The updated date of the GalleryPost.'; COMMENT ON COLUMN "gallery_post"."userId" IS 'The ID of author.'; COMMENT ON COLUMN "gallery_post"."isSensitive" IS 'Whether the post is sensitive.'`); - await queryRunner.query(`CREATE INDEX "IDX_8f1a239bd077c8864a20c62c2c" ON "gallery_post" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_f631d37835adb04792e361807c" ON "gallery_post" ("updatedAt") `); - await queryRunner.query(`CREATE INDEX "IDX_985b836dddd8615e432d7043dd" ON "gallery_post" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_3ca50563facd913c425e7a89ee" ON "gallery_post" ("fileIds") `); - await queryRunner.query(`CREATE INDEX "IDX_f2d744d9a14d0dfb8b96cb7fc5" ON "gallery_post" ("isSensitive") `); - await queryRunner.query(`CREATE INDEX "IDX_1a165c68a49d08f11caffbd206" ON "gallery_post" ("likedCount") `); - await queryRunner.query(`CREATE INDEX "IDX_05cca34b985d1b8edc1d1e28df" ON "gallery_post" ("tags") `); - await queryRunner.query(`CREATE TABLE "gallery_like" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "postId" character varying(32) NOT NULL, CONSTRAINT "PK_853ab02be39b8de45cd720cc15f" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_8fd5215095473061855ceb948c" ON "gallery_like" ("userId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_df1b5f4099e99fb0bc5eae53b6" ON "gallery_like" ("userId", "postId") `); - await queryRunner.query(`ALTER TABLE "gallery_post" ADD CONSTRAINT "FK_985b836dddd8615e432d7043ddb" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "gallery_like" ADD CONSTRAINT "FK_8fd5215095473061855ceb948cf" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "gallery_like" ADD CONSTRAINT "FK_b1cb568bfe569e47b7051699fc8" FOREIGN KEY ("postId") REFERENCES "gallery_post"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "gallery_like" DROP CONSTRAINT "FK_b1cb568bfe569e47b7051699fc8"`); - await queryRunner.query(`ALTER TABLE "gallery_like" DROP CONSTRAINT "FK_8fd5215095473061855ceb948cf"`); - await queryRunner.query(`ALTER TABLE "gallery_post" DROP CONSTRAINT "FK_985b836dddd8615e432d7043ddb"`); - await queryRunner.query(`DROP INDEX "IDX_df1b5f4099e99fb0bc5eae53b6"`); - await queryRunner.query(`DROP INDEX "IDX_8fd5215095473061855ceb948c"`); - await queryRunner.query(`DROP TABLE "gallery_like"`); - await queryRunner.query(`DROP INDEX "IDX_05cca34b985d1b8edc1d1e28df"`); - await queryRunner.query(`DROP INDEX "IDX_1a165c68a49d08f11caffbd206"`); - await queryRunner.query(`DROP INDEX "IDX_f2d744d9a14d0dfb8b96cb7fc5"`); - await queryRunner.query(`DROP INDEX "IDX_3ca50563facd913c425e7a89ee"`); - await queryRunner.query(`DROP INDEX "IDX_985b836dddd8615e432d7043dd"`); - await queryRunner.query(`DROP INDEX "IDX_f631d37835adb04792e361807c"`); - await queryRunner.query(`DROP INDEX "IDX_8f1a239bd077c8864a20c62c2c"`); - await queryRunner.query(`DROP TABLE "gallery_post"`); - } + constructor() { + this.name = "gallery1611397665007"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "gallery_post" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, "title" character varying(256) NOT NULL, "description" character varying(2048), "userId" character varying(32) NOT NULL, "fileIds" character varying(32) array NOT NULL DEFAULT '{}'::varchar[], "isSensitive" boolean NOT NULL DEFAULT false, "likedCount" integer NOT NULL DEFAULT '0', "tags" character varying(128) array NOT NULL DEFAULT '{}'::varchar[], CONSTRAINT "PK_8e90d7b6015f2c4518881b14753" PRIMARY KEY ("id")); COMMENT ON COLUMN "gallery_post"."createdAt" IS 'The created date of the GalleryPost.'; COMMENT ON COLUMN "gallery_post"."updatedAt" IS 'The updated date of the GalleryPost.'; COMMENT ON COLUMN "gallery_post"."userId" IS 'The ID of author.'; COMMENT ON COLUMN "gallery_post"."isSensitive" IS 'Whether the post is sensitive.'`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_8f1a239bd077c8864a20c62c2c" ON "gallery_post" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f631d37835adb04792e361807c" ON "gallery_post" ("updatedAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_985b836dddd8615e432d7043dd" ON "gallery_post" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_3ca50563facd913c425e7a89ee" ON "gallery_post" ("fileIds") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f2d744d9a14d0dfb8b96cb7fc5" ON "gallery_post" ("isSensitive") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_1a165c68a49d08f11caffbd206" ON "gallery_post" ("likedCount") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_05cca34b985d1b8edc1d1e28df" ON "gallery_post" ("tags") `, + ); + await queryRunner.query( + `CREATE TABLE "gallery_like" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "postId" character varying(32) NOT NULL, CONSTRAINT "PK_853ab02be39b8de45cd720cc15f" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_8fd5215095473061855ceb948c" ON "gallery_like" ("userId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_df1b5f4099e99fb0bc5eae53b6" ON "gallery_like" ("userId", "postId") `, + ); + await queryRunner.query( + `ALTER TABLE "gallery_post" ADD CONSTRAINT "FK_985b836dddd8615e432d7043ddb" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "gallery_like" ADD CONSTRAINT "FK_8fd5215095473061855ceb948cf" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "gallery_like" ADD CONSTRAINT "FK_b1cb568bfe569e47b7051699fc8" FOREIGN KEY ("postId") REFERENCES "gallery_post"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "gallery_like" DROP CONSTRAINT "FK_b1cb568bfe569e47b7051699fc8"`, + ); + await queryRunner.query( + `ALTER TABLE "gallery_like" DROP CONSTRAINT "FK_8fd5215095473061855ceb948cf"`, + ); + await queryRunner.query( + `ALTER TABLE "gallery_post" DROP CONSTRAINT "FK_985b836dddd8615e432d7043ddb"`, + ); + await queryRunner.query(`DROP INDEX "IDX_df1b5f4099e99fb0bc5eae53b6"`); + await queryRunner.query(`DROP INDEX "IDX_8fd5215095473061855ceb948c"`); + await queryRunner.query(`DROP TABLE "gallery_like"`); + await queryRunner.query(`DROP INDEX "IDX_05cca34b985d1b8edc1d1e28df"`); + await queryRunner.query(`DROP INDEX "IDX_1a165c68a49d08f11caffbd206"`); + await queryRunner.query(`DROP INDEX "IDX_f2d744d9a14d0dfb8b96cb7fc5"`); + await queryRunner.query(`DROP INDEX "IDX_3ca50563facd913c425e7a89ee"`); + await queryRunner.query(`DROP INDEX "IDX_985b836dddd8615e432d7043dd"`); + await queryRunner.query(`DROP INDEX "IDX_f631d37835adb04792e361807c"`); + await queryRunner.query(`DROP INDEX "IDX_8f1a239bd077c8864a20c62c2c"`); + await queryRunner.query(`DROP TABLE "gallery_post"`); + } } diff --git a/packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js b/packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js index e4d3c0e8ec..b65ca2a577 100644 --- a/packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js +++ b/packages/backend/migration/1611547387175-objectStorageS3ForcePathStyle.js @@ -1,13 +1,15 @@ - - export class objectStorageS3ForcePathStyle1611547387175 { - constructor() { - this.name = 'objectStorageS3ForcePathStyle1611547387175'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "objectStorageS3ForcePathStyle" boolean NOT NULL DEFAULT true`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "objectStorageS3ForcePathStyle"`); - } + constructor() { + this.name = "objectStorageS3ForcePathStyle1611547387175"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "objectStorageS3ForcePathStyle" boolean NOT NULL DEFAULT true`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "objectStorageS3ForcePathStyle"`, + ); + } } diff --git a/packages/backend/migration/1612619156584-announcement-email.js b/packages/backend/migration/1612619156584-announcement-email.js index bcc718d1c2..a3b7292f8a 100644 --- a/packages/backend/migration/1612619156584-announcement-email.js +++ b/packages/backend/migration/1612619156584-announcement-email.js @@ -1,13 +1,15 @@ - - export class announcementEmail1612619156584 { - constructor() { - this.name = 'announcementEmail1612619156584'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ADD "receiveAnnouncementEmail" boolean NOT NULL DEFAULT true`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "receiveAnnouncementEmail"`); - } + constructor() { + this.name = "announcementEmail1612619156584"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "receiveAnnouncementEmail" boolean NOT NULL DEFAULT true`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "receiveAnnouncementEmail"`, + ); + } } diff --git a/packages/backend/migration/1613155914446-emailNotificationTypes.js b/packages/backend/migration/1613155914446-emailNotificationTypes.js index cd49924d2d..e64aada7b3 100644 --- a/packages/backend/migration/1613155914446-emailNotificationTypes.js +++ b/packages/backend/migration/1613155914446-emailNotificationTypes.js @@ -1,13 +1,15 @@ - - export class emailNotificationTypes1613155914446 { - constructor() { - this.name = 'emailNotificationTypes1613155914446'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ADD "emailNotificationTypes" jsonb NOT NULL DEFAULT '["follow","receiveFollowRequest","groupInvited"]'`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "emailNotificationTypes"`); - } + constructor() { + this.name = "emailNotificationTypes1613155914446"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "emailNotificationTypes" jsonb NOT NULL DEFAULT '["follow","receiveFollowRequest","groupInvited"]'`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "emailNotificationTypes"`, + ); + } } diff --git a/packages/backend/migration/1613181457597-user-lang.js b/packages/backend/migration/1613181457597-user-lang.js index d2cd06848e..aa5bf7de8d 100644 --- a/packages/backend/migration/1613181457597-user-lang.js +++ b/packages/backend/migration/1613181457597-user-lang.js @@ -1,13 +1,13 @@ - - export class userLang1613181457597 { - constructor() { - this.name = 'userLang1613181457597'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ADD "lang" character varying(32)`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "lang"`); - } + constructor() { + this.name = "userLang1613181457597"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "lang" character varying(32)`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "lang"`); + } } diff --git a/packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js b/packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js index f2e2c5d357..a8f1e33bfc 100644 --- a/packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js +++ b/packages/backend/migration/1613503367223-use-bigint-for-driveUsage.js @@ -1,14 +1,16 @@ - - export class useBigintForDriveUsage1613503367223 { - constructor() { - this.name = 'useBigintForDriveUsage1613503367223'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "driveUsage" TYPE bigint`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "driveUsage"`); - await queryRunner.query(`ALTER TABLE "instance" ADD "driveUsage" integer NOT NULL DEFAULT 0`); - } + constructor() { + this.name = "useBigintForDriveUsage1613503367223"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "instance" ALTER COLUMN "driveUsage" TYPE bigint`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "driveUsage"`); + await queryRunner.query( + `ALTER TABLE "instance" ADD "driveUsage" integer NOT NULL DEFAULT 0`, + ); + } } diff --git a/packages/backend/migration/1615965918224-chart-v2.js b/packages/backend/migration/1615965918224-chart-v2.js index 86fa5b0c00..0460a57f55 100644 --- a/packages/backend/migration/1615965918224-chart-v2.js +++ b/packages/backend/migration/1615965918224-chart-v2.js @@ -1,216 +1,508 @@ - - export class chartV21615965918224 { - constructor() { - this.name = 'chartV21615965918224'; - } - async up(queryRunner) { - await queryRunner.query(`DELETE FROM "__chart__active_users" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__drive" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__federation" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__hashtag" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__instance" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__network" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__notes" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__per_user_drive" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__per_user_following" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__per_user_notes" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__per_user_reaction" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__test" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__test_grouped" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__test_unique" WHERE "span" = 'day'`); - await queryRunner.query(`DELETE FROM "__chart__users" WHERE "span" = 'day'`); - await queryRunner.query(`DROP INDEX "IDX_15e91a03aeeac9dbccdf43fc06"`); - await queryRunner.query(`DROP INDEX "IDX_20f57cc8f142c131340ee16742"`); - await queryRunner.query(`DROP INDEX "IDX_c26e2c1cbb6e911e0554b27416"`); - await queryRunner.query(`DROP INDEX "IDX_3fa0d0f17ca72e3dc80999a032"`); - await queryRunner.query(`DROP INDEX "IDX_6e1df243476e20cbf86572ecc0"`); - await queryRunner.query(`DROP INDEX "IDX_06690fc959f1c9fdaf21928222"`); - await queryRunner.query(`DROP INDEX "IDX_e447064455928cf627590ef527"`); - await queryRunner.query(`DROP INDEX "IDX_2d416e6af791a82e338c79d480"`); - await queryRunner.query(`DROP INDEX "IDX_e9cd07672b37d8966cf3709283"`); - await queryRunner.query(`DROP INDEX "IDX_fcc181fb8283009c61cc4083ef"`); - await queryRunner.query(`DROP INDEX "IDX_49975586f50ed7b800fdd88fbd"`); - await queryRunner.query(`DROP INDEX "IDX_6d6f156ceefc6bc5f273a0e370"`); - await queryRunner.query(`DROP INDEX "IDX_c12f0af4a66cdd30c2287ce8aa"`); - await queryRunner.query(`DROP INDEX "IDX_d0a4f79af5a97b08f37b547197"`); - await queryRunner.query(`DROP INDEX "IDX_f5448d9633cff74208d850aabe"`); - await queryRunner.query(`DROP INDEX "IDX_f8dd01baeded2ffa833e0a610a"`); - await queryRunner.query(`DROP INDEX "IDX_08fac0eb3b11f04c200c0b40dd"`); - await queryRunner.query(`DROP INDEX "IDX_9ff6944f01acb756fdc92d7563"`); - await queryRunner.query(`DROP INDEX "IDX_e69096589f11e3baa98ddd64d0"`); - await queryRunner.query(`DROP INDEX "IDX_0c9a159c5082cbeef3ca6706b5"`); - await queryRunner.query(`DROP INDEX "IDX_924fc196c80ca24bae01dd37e4"`); - await queryRunner.query(`DROP INDEX "IDX_328f259961e60c4fa0bfcf55ca"`); - await queryRunner.query(`DROP INDEX "IDX_42ea9381f0fda8dfe0fa1c8b53"`); - await queryRunner.query(`DROP INDEX "IDX_f2aeafde2ae6fbad38e857631b"`); - await queryRunner.query(`DROP INDEX "IDX_f92dd6d03f8d994f29987f6214"`); - await queryRunner.query(`DROP INDEX "IDX_57b5458d0d3d6d1e7f13d4e57f"`); - await queryRunner.query(`DROP INDEX "IDX_4db3b84c7be0d3464714f3e0b1"`); - await queryRunner.query(`DROP INDEX "IDX_8d2cbbc8114d90d19b44d626b6"`); - await queryRunner.query(`DROP INDEX "IDX_046feeb12e9ef5f783f409866a"`); - await queryRunner.query(`DROP INDEX "IDX_f68a5ab958f9f5fa17a32ac23b"`); - await queryRunner.query(`DROP INDEX "IDX_65633a106bce43fc7c5c30a5c7"`); - await queryRunner.query(`DROP INDEX "IDX_edeb73c09c3143a81bcb34d569"`); - await queryRunner.query(`DROP INDEX "IDX_e316f01a6d24eb31db27f88262"`); - await queryRunner.query(`DROP INDEX "IDX_2be7ec6cebddc14dc11e206686"`); - await queryRunner.query(`DROP INDEX "IDX_a5133470f4825902e170328ca5"`); - await queryRunner.query(`DROP INDEX "IDX_84e661abb7bd1e51b690d4b017"`); - await queryRunner.query(`DROP INDEX "IDX_5c73bf61da4f6e6f15bae88ed1"`); - await queryRunner.query(`DROP INDEX "IDX_d70c86baedc68326be11f9c0ce"`); - await queryRunner.query(`DROP INDEX "IDX_66e1e1ecd2f29e57778af35b59"`); - await queryRunner.query(`DROP INDEX "IDX_92255988735563f0fe4aba1f05"`); - await queryRunner.query(`DROP INDEX "IDX_c5870993e25c3d5771f91f5003"`); - await queryRunner.query(`DROP INDEX "IDX_f170de677ea75ad4533de2723e"`); - await queryRunner.query(`DROP INDEX "IDX_7c184198ecf66a8d3ecb253ab3"`); - await queryRunner.query(`DROP INDEX "IDX_f091abb24193d50c653c6b77fc"`); - await queryRunner.query(`DROP INDEX "IDX_a770a57c70e668cc61590c9161"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__active_users_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___local_count"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_count"`); - await queryRunner.query(`ALTER TABLE "__chart__drive" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__drive_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__drive" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__federation_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__hashtag_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" DROP COLUMN "___local_count"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" DROP COLUMN "___remote_count"`); - await queryRunner.query(`ALTER TABLE "__chart__instance" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__instance_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__instance" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__network" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__network_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__network" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__notes" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__notes_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__notes" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__per_user_drive_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__per_user_following_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__per_user_notes_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__per_user_reaction_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__test_grouped" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__test_grouped_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__test_grouped" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__test_unique" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__test_unique_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__test_unique" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__test_unique" DROP COLUMN "___foo"`); - await queryRunner.query(`ALTER TABLE "__chart__test" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__test_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__test" DROP COLUMN "unique"`); - await queryRunner.query(`ALTER TABLE "__chart__users" DROP COLUMN "span"`); - await queryRunner.query(`DROP TYPE "public"."__chart__users_span_enum"`); - await queryRunner.query(`ALTER TABLE "__chart__users" DROP COLUMN "unique"`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__users" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__users_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__users" ADD "span" "__chart__users_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__test" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__test_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__test" ADD "span" "__chart__test_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__test_unique" ADD "___foo" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__test_unique" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__test_unique_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__test_unique" ADD "span" "__chart__test_unique_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__test_grouped" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__test_grouped_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__test_grouped" ADD "span" "__chart__test_grouped_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__per_user_reaction_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" ADD "span" "__chart__per_user_reaction_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__per_user_notes_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ADD "span" "__chart__per_user_notes_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__per_user_following_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ADD "span" "__chart__per_user_following_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__per_user_drive_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ADD "span" "__chart__per_user_drive_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__notes_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ADD "span" "__chart__notes_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__network" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__network_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__network" ADD "span" "__chart__network_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__instance_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ADD "span" "__chart__instance_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ADD "___remote_count" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ADD "___local_count" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__hashtag_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ADD "span" "__chart__hashtag_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__federation_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "span" "__chart__federation_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__drive_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ADD "span" "__chart__drive_span_enum" NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___remote_count" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___local_count" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique" jsonb NOT NULL DEFAULT '{}'`); - await queryRunner.query(`CREATE TYPE "public"."__chart__active_users_span_enum" AS ENUM('hour', 'day')`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "span" "__chart__active_users_span_enum" NOT NULL`); - await queryRunner.query(`CREATE INDEX "IDX_a770a57c70e668cc61590c9161" ON "__chart__users" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_f091abb24193d50c653c6b77fc" ON "__chart__users" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_7c184198ecf66a8d3ecb253ab3" ON "__chart__users" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_f170de677ea75ad4533de2723e" ON "__chart__test" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_c5870993e25c3d5771f91f5003" ON "__chart__test" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_92255988735563f0fe4aba1f05" ON "__chart__test" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_66e1e1ecd2f29e57778af35b59" ON "__chart__test_unique" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_d70c86baedc68326be11f9c0ce" ON "__chart__test_unique" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_5c73bf61da4f6e6f15bae88ed1" ON "__chart__test_unique" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_84e661abb7bd1e51b690d4b017" ON "__chart__test_grouped" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_a5133470f4825902e170328ca5" ON "__chart__test_grouped" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_2be7ec6cebddc14dc11e206686" ON "__chart__test_grouped" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_e316f01a6d24eb31db27f88262" ON "__chart__per_user_reaction" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_edeb73c09c3143a81bcb34d569" ON "__chart__per_user_reaction" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_65633a106bce43fc7c5c30a5c7" ON "__chart__per_user_reaction" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_f68a5ab958f9f5fa17a32ac23b" ON "__chart__per_user_notes" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_046feeb12e9ef5f783f409866a" ON "__chart__per_user_notes" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_8d2cbbc8114d90d19b44d626b6" ON "__chart__per_user_notes" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_4db3b84c7be0d3464714f3e0b1" ON "__chart__per_user_following" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_57b5458d0d3d6d1e7f13d4e57f" ON "__chart__per_user_following" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_f92dd6d03f8d994f29987f6214" ON "__chart__per_user_following" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_f2aeafde2ae6fbad38e857631b" ON "__chart__per_user_drive" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_42ea9381f0fda8dfe0fa1c8b53" ON "__chart__per_user_drive" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_328f259961e60c4fa0bfcf55ca" ON "__chart__per_user_drive" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_924fc196c80ca24bae01dd37e4" ON "__chart__notes" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_0c9a159c5082cbeef3ca6706b5" ON "__chart__notes" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_e69096589f11e3baa98ddd64d0" ON "__chart__notes" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_9ff6944f01acb756fdc92d7563" ON "__chart__network" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_08fac0eb3b11f04c200c0b40dd" ON "__chart__network" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_f8dd01baeded2ffa833e0a610a" ON "__chart__network" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_f5448d9633cff74208d850aabe" ON "__chart__instance" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_d0a4f79af5a97b08f37b547197" ON "__chart__instance" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_c12f0af4a66cdd30c2287ce8aa" ON "__chart__instance" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_6d6f156ceefc6bc5f273a0e370" ON "__chart__hashtag" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_49975586f50ed7b800fdd88fbd" ON "__chart__hashtag" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_fcc181fb8283009c61cc4083ef" ON "__chart__hashtag" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_e9cd07672b37d8966cf3709283" ON "__chart__federation" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_2d416e6af791a82e338c79d480" ON "__chart__federation" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_e447064455928cf627590ef527" ON "__chart__federation" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_06690fc959f1c9fdaf21928222" ON "__chart__drive" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_6e1df243476e20cbf86572ecc0" ON "__chart__drive" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_3fa0d0f17ca72e3dc80999a032" ON "__chart__drive" ("span") `); - await queryRunner.query(`CREATE INDEX "IDX_c26e2c1cbb6e911e0554b27416" ON "__chart__active_users" ("date", "group", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_20f57cc8f142c131340ee16742" ON "__chart__active_users" ("date", "span") `); - await queryRunner.query(`CREATE INDEX "IDX_15e91a03aeeac9dbccdf43fc06" ON "__chart__active_users" ("span") `); - } + constructor() { + this.name = "chartV21615965918224"; + } + async up(queryRunner) { + await queryRunner.query( + `DELETE FROM "__chart__active_users" WHERE "span" = 'day'`, + ); + await queryRunner.query( + `DELETE FROM "__chart__drive" WHERE "span" = 'day'`, + ); + await queryRunner.query( + `DELETE FROM "__chart__federation" WHERE "span" = 'day'`, + ); + await queryRunner.query( + `DELETE FROM "__chart__hashtag" WHERE "span" = 'day'`, + ); + await queryRunner.query( + `DELETE FROM "__chart__instance" WHERE "span" = 'day'`, + ); + await queryRunner.query( + `DELETE FROM "__chart__network" WHERE "span" = 'day'`, + ); + await queryRunner.query( + `DELETE FROM "__chart__notes" WHERE "span" = 'day'`, + ); + await queryRunner.query( + `DELETE FROM "__chart__per_user_drive" WHERE "span" = 'day'`, + ); + await queryRunner.query( + `DELETE FROM "__chart__per_user_following" WHERE "span" = 'day'`, + ); + await queryRunner.query( + `DELETE FROM "__chart__per_user_notes" WHERE "span" = 'day'`, + ); + await queryRunner.query( + `DELETE FROM "__chart__per_user_reaction" WHERE "span" = 'day'`, + ); + await queryRunner.query(`DELETE FROM "__chart__test" WHERE "span" = 'day'`); + await queryRunner.query( + `DELETE FROM "__chart__test_grouped" WHERE "span" = 'day'`, + ); + await queryRunner.query( + `DELETE FROM "__chart__test_unique" WHERE "span" = 'day'`, + ); + await queryRunner.query( + `DELETE FROM "__chart__users" WHERE "span" = 'day'`, + ); + await queryRunner.query(`DROP INDEX "IDX_15e91a03aeeac9dbccdf43fc06"`); + await queryRunner.query(`DROP INDEX "IDX_20f57cc8f142c131340ee16742"`); + await queryRunner.query(`DROP INDEX "IDX_c26e2c1cbb6e911e0554b27416"`); + await queryRunner.query(`DROP INDEX "IDX_3fa0d0f17ca72e3dc80999a032"`); + await queryRunner.query(`DROP INDEX "IDX_6e1df243476e20cbf86572ecc0"`); + await queryRunner.query(`DROP INDEX "IDX_06690fc959f1c9fdaf21928222"`); + await queryRunner.query(`DROP INDEX "IDX_e447064455928cf627590ef527"`); + await queryRunner.query(`DROP INDEX "IDX_2d416e6af791a82e338c79d480"`); + await queryRunner.query(`DROP INDEX "IDX_e9cd07672b37d8966cf3709283"`); + await queryRunner.query(`DROP INDEX "IDX_fcc181fb8283009c61cc4083ef"`); + await queryRunner.query(`DROP INDEX "IDX_49975586f50ed7b800fdd88fbd"`); + await queryRunner.query(`DROP INDEX "IDX_6d6f156ceefc6bc5f273a0e370"`); + await queryRunner.query(`DROP INDEX "IDX_c12f0af4a66cdd30c2287ce8aa"`); + await queryRunner.query(`DROP INDEX "IDX_d0a4f79af5a97b08f37b547197"`); + await queryRunner.query(`DROP INDEX "IDX_f5448d9633cff74208d850aabe"`); + await queryRunner.query(`DROP INDEX "IDX_f8dd01baeded2ffa833e0a610a"`); + await queryRunner.query(`DROP INDEX "IDX_08fac0eb3b11f04c200c0b40dd"`); + await queryRunner.query(`DROP INDEX "IDX_9ff6944f01acb756fdc92d7563"`); + await queryRunner.query(`DROP INDEX "IDX_e69096589f11e3baa98ddd64d0"`); + await queryRunner.query(`DROP INDEX "IDX_0c9a159c5082cbeef3ca6706b5"`); + await queryRunner.query(`DROP INDEX "IDX_924fc196c80ca24bae01dd37e4"`); + await queryRunner.query(`DROP INDEX "IDX_328f259961e60c4fa0bfcf55ca"`); + await queryRunner.query(`DROP INDEX "IDX_42ea9381f0fda8dfe0fa1c8b53"`); + await queryRunner.query(`DROP INDEX "IDX_f2aeafde2ae6fbad38e857631b"`); + await queryRunner.query(`DROP INDEX "IDX_f92dd6d03f8d994f29987f6214"`); + await queryRunner.query(`DROP INDEX "IDX_57b5458d0d3d6d1e7f13d4e57f"`); + await queryRunner.query(`DROP INDEX "IDX_4db3b84c7be0d3464714f3e0b1"`); + await queryRunner.query(`DROP INDEX "IDX_8d2cbbc8114d90d19b44d626b6"`); + await queryRunner.query(`DROP INDEX "IDX_046feeb12e9ef5f783f409866a"`); + await queryRunner.query(`DROP INDEX "IDX_f68a5ab958f9f5fa17a32ac23b"`); + await queryRunner.query(`DROP INDEX "IDX_65633a106bce43fc7c5c30a5c7"`); + await queryRunner.query(`DROP INDEX "IDX_edeb73c09c3143a81bcb34d569"`); + await queryRunner.query(`DROP INDEX "IDX_e316f01a6d24eb31db27f88262"`); + await queryRunner.query(`DROP INDEX "IDX_2be7ec6cebddc14dc11e206686"`); + await queryRunner.query(`DROP INDEX "IDX_a5133470f4825902e170328ca5"`); + await queryRunner.query(`DROP INDEX "IDX_84e661abb7bd1e51b690d4b017"`); + await queryRunner.query(`DROP INDEX "IDX_5c73bf61da4f6e6f15bae88ed1"`); + await queryRunner.query(`DROP INDEX "IDX_d70c86baedc68326be11f9c0ce"`); + await queryRunner.query(`DROP INDEX "IDX_66e1e1ecd2f29e57778af35b59"`); + await queryRunner.query(`DROP INDEX "IDX_92255988735563f0fe4aba1f05"`); + await queryRunner.query(`DROP INDEX "IDX_c5870993e25c3d5771f91f5003"`); + await queryRunner.query(`DROP INDEX "IDX_f170de677ea75ad4533de2723e"`); + await queryRunner.query(`DROP INDEX "IDX_7c184198ecf66a8d3ecb253ab3"`); + await queryRunner.query(`DROP INDEX "IDX_f091abb24193d50c653c6b77fc"`); + await queryRunner.query(`DROP INDEX "IDX_a770a57c70e668cc61590c9161"`); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "span"`, + ); + await queryRunner.query( + `DROP TYPE "public"."__chart__active_users_span_enum"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___local_count"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_count"`, + ); + await queryRunner.query(`ALTER TABLE "__chart__drive" DROP COLUMN "span"`); + await queryRunner.query(`DROP TYPE "public"."__chart__drive_span_enum"`); + await queryRunner.query( + `ALTER TABLE "__chart__drive" DROP COLUMN "unique"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "span"`, + ); + await queryRunner.query( + `DROP TYPE "public"."__chart__federation_span_enum"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "unique"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" DROP COLUMN "span"`, + ); + await queryRunner.query(`DROP TYPE "public"."__chart__hashtag_span_enum"`); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" DROP COLUMN "unique"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" DROP COLUMN "___local_count"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" DROP COLUMN "___remote_count"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" DROP COLUMN "span"`, + ); + await queryRunner.query(`DROP TYPE "public"."__chart__instance_span_enum"`); + await queryRunner.query( + `ALTER TABLE "__chart__instance" DROP COLUMN "unique"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" DROP COLUMN "span"`, + ); + await queryRunner.query(`DROP TYPE "public"."__chart__network_span_enum"`); + await queryRunner.query( + `ALTER TABLE "__chart__network" DROP COLUMN "unique"`, + ); + await queryRunner.query(`ALTER TABLE "__chart__notes" DROP COLUMN "span"`); + await queryRunner.query(`DROP TYPE "public"."__chart__notes_span_enum"`); + await queryRunner.query( + `ALTER TABLE "__chart__notes" DROP COLUMN "unique"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" DROP COLUMN "span"`, + ); + await queryRunner.query( + `DROP TYPE "public"."__chart__per_user_drive_span_enum"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" DROP COLUMN "unique"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" DROP COLUMN "span"`, + ); + await queryRunner.query( + `DROP TYPE "public"."__chart__per_user_following_span_enum"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" DROP COLUMN "unique"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" DROP COLUMN "span"`, + ); + await queryRunner.query( + `DROP TYPE "public"."__chart__per_user_notes_span_enum"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" DROP COLUMN "unique"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" DROP COLUMN "span"`, + ); + await queryRunner.query( + `DROP TYPE "public"."__chart__per_user_reaction_span_enum"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" DROP COLUMN "unique"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__test_grouped" DROP COLUMN "span"`, + ); + await queryRunner.query( + `DROP TYPE "public"."__chart__test_grouped_span_enum"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__test_grouped" DROP COLUMN "unique"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__test_unique" DROP COLUMN "span"`, + ); + await queryRunner.query( + `DROP TYPE "public"."__chart__test_unique_span_enum"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__test_unique" DROP COLUMN "unique"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__test_unique" DROP COLUMN "___foo"`, + ); + await queryRunner.query(`ALTER TABLE "__chart__test" DROP COLUMN "span"`); + await queryRunner.query(`DROP TYPE "public"."__chart__test_span_enum"`); + await queryRunner.query(`ALTER TABLE "__chart__test" DROP COLUMN "unique"`); + await queryRunner.query(`ALTER TABLE "__chart__users" DROP COLUMN "span"`); + await queryRunner.query(`DROP TYPE "public"."__chart__users_span_enum"`); + await queryRunner.query( + `ALTER TABLE "__chart__users" DROP COLUMN "unique"`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__users" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__users_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ADD "span" "__chart__users_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__test" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__test_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__test" ADD "span" "__chart__test_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__test_unique" ADD "___foo" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__test_unique" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__test_unique_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__test_unique" ADD "span" "__chart__test_unique_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__test_grouped" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__test_grouped_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__test_grouped" ADD "span" "__chart__test_grouped_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__per_user_reaction_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" ADD "span" "__chart__per_user_reaction_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__per_user_notes_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ADD "span" "__chart__per_user_notes_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__per_user_following_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ADD "span" "__chart__per_user_following_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__per_user_drive_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ADD "span" "__chart__per_user_drive_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__notes_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ADD "span" "__chart__notes_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__network_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ADD "span" "__chart__network_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__instance_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ADD "span" "__chart__instance_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ADD "___remote_count" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ADD "___local_count" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__hashtag_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ADD "span" "__chart__hashtag_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__federation_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "span" "__chart__federation_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__drive_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ADD "span" "__chart__drive_span_enum" NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___remote_count" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___local_count" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique" jsonb NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."__chart__active_users_span_enum" AS ENUM('hour', 'day')`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "span" "__chart__active_users_span_enum" NOT NULL`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a770a57c70e668cc61590c9161" ON "__chart__users" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f091abb24193d50c653c6b77fc" ON "__chart__users" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7c184198ecf66a8d3ecb253ab3" ON "__chart__users" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f170de677ea75ad4533de2723e" ON "__chart__test" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_c5870993e25c3d5771f91f5003" ON "__chart__test" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_92255988735563f0fe4aba1f05" ON "__chart__test" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_66e1e1ecd2f29e57778af35b59" ON "__chart__test_unique" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d70c86baedc68326be11f9c0ce" ON "__chart__test_unique" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_5c73bf61da4f6e6f15bae88ed1" ON "__chart__test_unique" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_84e661abb7bd1e51b690d4b017" ON "__chart__test_grouped" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a5133470f4825902e170328ca5" ON "__chart__test_grouped" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_2be7ec6cebddc14dc11e206686" ON "__chart__test_grouped" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e316f01a6d24eb31db27f88262" ON "__chart__per_user_reaction" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_edeb73c09c3143a81bcb34d569" ON "__chart__per_user_reaction" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_65633a106bce43fc7c5c30a5c7" ON "__chart__per_user_reaction" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f68a5ab958f9f5fa17a32ac23b" ON "__chart__per_user_notes" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_046feeb12e9ef5f783f409866a" ON "__chart__per_user_notes" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_8d2cbbc8114d90d19b44d626b6" ON "__chart__per_user_notes" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_4db3b84c7be0d3464714f3e0b1" ON "__chart__per_user_following" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_57b5458d0d3d6d1e7f13d4e57f" ON "__chart__per_user_following" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f92dd6d03f8d994f29987f6214" ON "__chart__per_user_following" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f2aeafde2ae6fbad38e857631b" ON "__chart__per_user_drive" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_42ea9381f0fda8dfe0fa1c8b53" ON "__chart__per_user_drive" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_328f259961e60c4fa0bfcf55ca" ON "__chart__per_user_drive" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_924fc196c80ca24bae01dd37e4" ON "__chart__notes" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0c9a159c5082cbeef3ca6706b5" ON "__chart__notes" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e69096589f11e3baa98ddd64d0" ON "__chart__notes" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_9ff6944f01acb756fdc92d7563" ON "__chart__network" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_08fac0eb3b11f04c200c0b40dd" ON "__chart__network" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f8dd01baeded2ffa833e0a610a" ON "__chart__network" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f5448d9633cff74208d850aabe" ON "__chart__instance" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d0a4f79af5a97b08f37b547197" ON "__chart__instance" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_c12f0af4a66cdd30c2287ce8aa" ON "__chart__instance" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_6d6f156ceefc6bc5f273a0e370" ON "__chart__hashtag" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_49975586f50ed7b800fdd88fbd" ON "__chart__hashtag" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_fcc181fb8283009c61cc4083ef" ON "__chart__hashtag" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e9cd07672b37d8966cf3709283" ON "__chart__federation" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_2d416e6af791a82e338c79d480" ON "__chart__federation" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e447064455928cf627590ef527" ON "__chart__federation" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_06690fc959f1c9fdaf21928222" ON "__chart__drive" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_6e1df243476e20cbf86572ecc0" ON "__chart__drive" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_3fa0d0f17ca72e3dc80999a032" ON "__chart__drive" ("span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_c26e2c1cbb6e911e0554b27416" ON "__chart__active_users" ("date", "group", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_20f57cc8f142c131340ee16742" ON "__chart__active_users" ("date", "span") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_15e91a03aeeac9dbccdf43fc06" ON "__chart__active_users" ("span") `, + ); + } } diff --git a/packages/backend/migration/1615966519402-chart-v2-2.js b/packages/backend/migration/1615966519402-chart-v2-2.js index c62f1b875c..ce75961035 100644 --- a/packages/backend/migration/1615966519402-chart-v2-2.js +++ b/packages/backend/migration/1615966519402-chart-v2-2.js @@ -1,21 +1,39 @@ - - export class chartV221615966519402 { - constructor() { - this.name = 'chartV221615966519402'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___local_users" character varying array NOT NULL DEFAULT '{}'::varchar[]`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___remote_users" character varying array NOT NULL DEFAULT '{}'::varchar[]`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ADD "___local_users" character varying array NOT NULL DEFAULT '{}'::varchar[]`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ADD "___remote_users" character varying array NOT NULL DEFAULT '{}'::varchar[]`); - await queryRunner.query(`ALTER TABLE "__chart__test_unique" ADD "___foo" character varying array NOT NULL DEFAULT '{}'::varchar[]`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__test_unique" DROP COLUMN "___foo"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" DROP COLUMN "___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" DROP COLUMN "___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`); - } + constructor() { + this.name = "chartV221615966519402"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___local_users" character varying array NOT NULL DEFAULT '{}'::varchar[]`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___remote_users" character varying array NOT NULL DEFAULT '{}'::varchar[]`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ADD "___local_users" character varying array NOT NULL DEFAULT '{}'::varchar[]`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ADD "___remote_users" character varying array NOT NULL DEFAULT '{}'::varchar[]`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__test_unique" ADD "___foo" character varying array NOT NULL DEFAULT '{}'::varchar[]`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__test_unique" DROP COLUMN "___foo"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" DROP COLUMN "___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" DROP COLUMN "___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`, + ); + } } diff --git a/packages/backend/migration/1618637372000-user-last-active-date.js b/packages/backend/migration/1618637372000-user-last-active-date.js index 6c77ace467..0211c256bc 100644 --- a/packages/backend/migration/1618637372000-user-last-active-date.js +++ b/packages/backend/migration/1618637372000-user-last-active-date.js @@ -1,15 +1,17 @@ - - export class userLastActiveDate1618637372000 { - constructor() { - this.name = 'userLastActiveDate1618637372000'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" ADD "lastActiveDate" TIMESTAMP WITH TIME ZONE DEFAULT NULL`); - await queryRunner.query(`CREATE INDEX "IDX_seoignmeoprigmkpodgrjmkpormg" ON "user" ("lastActiveDate") `); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_seoignmeoprigmkpodgrjmkpormg"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "lastActiveDate"`); - } + constructor() { + this.name = "userLastActiveDate1618637372000"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user" ADD "lastActiveDate" TIMESTAMP WITH TIME ZONE DEFAULT NULL`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_seoignmeoprigmkpodgrjmkpormg" ON "user" ("lastActiveDate") `, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_seoignmeoprigmkpodgrjmkpormg"`); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "lastActiveDate"`); + } } diff --git a/packages/backend/migration/1618639857000-user-hide-online-status.js b/packages/backend/migration/1618639857000-user-hide-online-status.js index e63c8ae11f..8d76326084 100644 --- a/packages/backend/migration/1618639857000-user-hide-online-status.js +++ b/packages/backend/migration/1618639857000-user-hide-online-status.js @@ -1,13 +1,15 @@ - - export class userHideOnlineStatus1618639857000 { - constructor() { - this.name = 'userHideOnlineStatus1618639857000'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" ADD "hideOnlineStatus" boolean NOT NULL DEFAULT false`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "hideOnlineStatus"`); - } + constructor() { + this.name = "userHideOnlineStatus1618639857000"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user" ADD "hideOnlineStatus" boolean NOT NULL DEFAULT false`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user" DROP COLUMN "hideOnlineStatus"`, + ); + } } diff --git a/packages/backend/migration/1619942102890-password-reset.js b/packages/backend/migration/1619942102890-password-reset.js index 922d225dc9..e3adeb95e7 100644 --- a/packages/backend/migration/1619942102890-password-reset.js +++ b/packages/backend/migration/1619942102890-password-reset.js @@ -1,19 +1,27 @@ - - export class passwordReset1619942102890 { - constructor() { - this.name = 'passwordReset1619942102890'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "password_reset_request" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "token" character varying(256) NOT NULL, "userId" character varying(32) NOT NULL, CONSTRAINT "PK_fcf4b02eae1403a2edaf87fd074" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0b575fa9a4cfe638a925949285" ON "password_reset_request" ("token") `); - await queryRunner.query(`CREATE INDEX "IDX_4bb7fd4a34492ae0e6cc8d30ac" ON "password_reset_request" ("userId") `); - await queryRunner.query(`ALTER TABLE "password_reset_request" ADD CONSTRAINT "FK_4bb7fd4a34492ae0e6cc8d30ac8" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "password_reset_request" DROP CONSTRAINT "FK_4bb7fd4a34492ae0e6cc8d30ac8"`); - await queryRunner.query(`DROP INDEX "IDX_4bb7fd4a34492ae0e6cc8d30ac"`); - await queryRunner.query(`DROP INDEX "IDX_0b575fa9a4cfe638a925949285"`); - await queryRunner.query(`DROP TABLE "password_reset_request"`); - } + constructor() { + this.name = "passwordReset1619942102890"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "password_reset_request" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "token" character varying(256) NOT NULL, "userId" character varying(32) NOT NULL, CONSTRAINT "PK_fcf4b02eae1403a2edaf87fd074" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_0b575fa9a4cfe638a925949285" ON "password_reset_request" ("token") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_4bb7fd4a34492ae0e6cc8d30ac" ON "password_reset_request" ("userId") `, + ); + await queryRunner.query( + `ALTER TABLE "password_reset_request" ADD CONSTRAINT "FK_4bb7fd4a34492ae0e6cc8d30ac8" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "password_reset_request" DROP CONSTRAINT "FK_4bb7fd4a34492ae0e6cc8d30ac8"`, + ); + await queryRunner.query(`DROP INDEX "IDX_4bb7fd4a34492ae0e6cc8d30ac"`); + await queryRunner.query(`DROP INDEX "IDX_0b575fa9a4cfe638a925949285"`); + await queryRunner.query(`DROP TABLE "password_reset_request"`); + } } diff --git a/packages/backend/migration/1620019354680-ad.js b/packages/backend/migration/1620019354680-ad.js index c96d2bfb33..e39b381013 100644 --- a/packages/backend/migration/1620019354680-ad.js +++ b/packages/backend/migration/1620019354680-ad.js @@ -1,17 +1,21 @@ - - export class ad1620019354680 { - constructor() { - this.name = 'ad1620019354680'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "ad" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "expiresAt" TIMESTAMP WITH TIME ZONE NOT NULL, "place" character varying(32) NOT NULL, "priority" character varying(32) NOT NULL, "url" character varying(1024) NOT NULL, "imageUrl" character varying(1024) NOT NULL, "memo" character varying(8192) NOT NULL, CONSTRAINT "PK_0193d5ef09746e88e9ea92c634d" PRIMARY KEY ("id")); COMMENT ON COLUMN "ad"."createdAt" IS 'The created date of the Ad.'; COMMENT ON COLUMN "ad"."expiresAt" IS 'The expired date of the Ad.'`); - await queryRunner.query(`CREATE INDEX "IDX_1129c2ef687fc272df040bafaa" ON "ad" ("createdAt") `); - await queryRunner.query(`CREATE INDEX "IDX_2da24ce20ad209f1d9dc032457" ON "ad" ("expiresAt") `); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_2da24ce20ad209f1d9dc032457"`); - await queryRunner.query(`DROP INDEX "IDX_1129c2ef687fc272df040bafaa"`); - await queryRunner.query(`DROP TABLE "ad"`); - } + constructor() { + this.name = "ad1620019354680"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "ad" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "expiresAt" TIMESTAMP WITH TIME ZONE NOT NULL, "place" character varying(32) NOT NULL, "priority" character varying(32) NOT NULL, "url" character varying(1024) NOT NULL, "imageUrl" character varying(1024) NOT NULL, "memo" character varying(8192) NOT NULL, CONSTRAINT "PK_0193d5ef09746e88e9ea92c634d" PRIMARY KEY ("id")); COMMENT ON COLUMN "ad"."createdAt" IS 'The created date of the Ad.'; COMMENT ON COLUMN "ad"."expiresAt" IS 'The expired date of the Ad.'`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_1129c2ef687fc272df040bafaa" ON "ad" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_2da24ce20ad209f1d9dc032457" ON "ad" ("expiresAt") `, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_2da24ce20ad209f1d9dc032457"`); + await queryRunner.query(`DROP INDEX "IDX_1129c2ef687fc272df040bafaa"`); + await queryRunner.query(`DROP TABLE "ad"`); + } } diff --git a/packages/backend/migration/1620364649428-ad2.js b/packages/backend/migration/1620364649428-ad2.js index db1c3e1de1..a61c3ef088 100644 --- a/packages/backend/migration/1620364649428-ad2.js +++ b/packages/backend/migration/1620364649428-ad2.js @@ -1,13 +1,13 @@ - - export class ad21620364649428 { - constructor() { - this.name = 'ad21620364649428'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "ad" ADD "ratio" integer NOT NULL DEFAULT '1'`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "ad" DROP COLUMN "ratio"`); - } + constructor() { + this.name = "ad21620364649428"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "ad" ADD "ratio" integer NOT NULL DEFAULT '1'`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "ad" DROP COLUMN "ratio"`); + } } diff --git a/packages/backend/migration/1621479946000-add-note-indexes.js b/packages/backend/migration/1621479946000-add-note-indexes.js index dcf97fa4dc..f9ffbbff17 100644 --- a/packages/backend/migration/1621479946000-add-note-indexes.js +++ b/packages/backend/migration/1621479946000-add-note-indexes.js @@ -1,15 +1,22 @@ - - export class addNoteIndexes1621479946000 { - constructor() { - this.name = 'addNoteIndexes1621479946000'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE INDEX "IDX_NOTE_MENTIONS" ON "note" USING gin ("mentions")`, undefined); - await queryRunner.query(`CREATE INDEX "IDX_NOTE_VISIBLE_USER_IDS" ON "note" USING gin ("visibleUserIds")`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_NOTE_MENTIONS"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_NOTE_VISIBLE_USER_IDS"`, undefined); - } + constructor() { + this.name = "addNoteIndexes1621479946000"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE INDEX "IDX_NOTE_MENTIONS" ON "note" USING gin ("mentions")`, + undefined, + ); + await queryRunner.query( + `CREATE INDEX "IDX_NOTE_VISIBLE_USER_IDS" ON "note" USING gin ("visibleUserIds")`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_NOTE_MENTIONS"`, undefined); + await queryRunner.query( + `DROP INDEX "IDX_NOTE_VISIBLE_USER_IDS"`, + undefined, + ); + } } diff --git a/packages/backend/migration/1622679304522-user-profile-description-length.js b/packages/backend/migration/1622679304522-user-profile-description-length.js index 22f6c1c5d9..7c761c92a1 100644 --- a/packages/backend/migration/1622679304522-user-profile-description-length.js +++ b/packages/backend/migration/1622679304522-user-profile-description-length.js @@ -1,13 +1,17 @@ - - export class userProfileDescriptionLength1622679304522 { - constructor() { - this.name = 'userProfileDescriptionLength1622679304522'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "description" TYPE character varying(2048)`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "description" TYPE character varying(1024)`, undefined); - } + constructor() { + this.name = "userProfileDescriptionLength1622679304522"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ALTER COLUMN "description" TYPE character varying(2048)`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ALTER COLUMN "description" TYPE character varying(1024)`, + undefined, + ); + } } diff --git a/packages/backend/migration/1622681548499-log-message-length.js b/packages/backend/migration/1622681548499-log-message-length.js index ac16c0e1ba..9dfb7ed3d2 100644 --- a/packages/backend/migration/1622681548499-log-message-length.js +++ b/packages/backend/migration/1622681548499-log-message-length.js @@ -1,13 +1,17 @@ - - export class logMessageLength1622681548499 { - constructor() { - this.name = 'logMessageLength1622681548499'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "log" ALTER COLUMN "message" TYPE character varying(2048)`, undefined); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "log" ALTER COLUMN "message" TYPE character varying(1024)`, undefined); - } + constructor() { + this.name = "logMessageLength1622681548499"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "log" ALTER COLUMN "message" TYPE character varying(2048)`, + undefined, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "log" ALTER COLUMN "message" TYPE character varying(1024)`, + undefined, + ); + } } diff --git a/packages/backend/migration/1626509500668-fix-remote-file-proxy.js b/packages/backend/migration/1626509500668-fix-remote-file-proxy.js index 30c562007b..f79cfb0066 100644 --- a/packages/backend/migration/1626509500668-fix-remote-file-proxy.js +++ b/packages/backend/migration/1626509500668-fix-remote-file-proxy.js @@ -1,22 +1,31 @@ - - export class fixRemoteFileProxy1626509500668 { - constructor() { - this.name = 'fixRemoteFileProxy1626509500668'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarUrl"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerUrl"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarBlurhash"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerBlurhash"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "proxyRemoteFiles"`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "proxyRemoteFiles" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`ALTER TABLE "user" ADD "bannerBlurhash" character varying(128)`); - await queryRunner.query(`ALTER TABLE "user" ADD "avatarBlurhash" character varying(128)`); - await queryRunner.query(`ALTER TABLE "user" ADD "bannerUrl" character varying(512)`); - await queryRunner.query(`ALTER TABLE "user" ADD "avatarUrl" character varying(512)`); - } + constructor() { + this.name = "fixRemoteFileProxy1626509500668"; + } + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarUrl"`); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerUrl"`); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "avatarBlurhash"`); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "bannerBlurhash"`); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "proxyRemoteFiles"`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "proxyRemoteFiles" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `ALTER TABLE "user" ADD "bannerBlurhash" character varying(128)`, + ); + await queryRunner.query( + `ALTER TABLE "user" ADD "avatarBlurhash" character varying(128)`, + ); + await queryRunner.query( + `ALTER TABLE "user" ADD "bannerUrl" character varying(512)`, + ); + await queryRunner.query( + `ALTER TABLE "user" ADD "avatarUrl" character varying(512)`, + ); + } } - diff --git a/packages/backend/migration/1626733991004-allowlist-secure-mode.js b/packages/backend/migration/1626733991004-allowlist-secure-mode.js index aa3fcf8752..6d2dd6842f 100644 --- a/packages/backend/migration/1626733991004-allowlist-secure-mode.js +++ b/packages/backend/migration/1626733991004-allowlist-secure-mode.js @@ -1,11 +1,15 @@ - - -export class allowlistSecureMode1626733991004 { - name = 'allowlistSecureMode1626733991004'; +export class allowlistSecureMode1626733991004 { + name = "allowlistSecureMode1626733991004"; async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "allowedHosts" character varying(256) [] default '{}'`); - await queryRunner.query(`ALTER TABLE "meta" ADD "secureMode" bool default false`); - await queryRunner.query(`ALTER TABLE "meta" ADD "privateMode" bool default false`); + await queryRunner.query( + `ALTER TABLE "meta" ADD "allowedHosts" character varying(256) [] default '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "secureMode" bool default false`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "privateMode" bool default false`, + ); } async down(queryRunner) { @@ -14,4 +18,3 @@ export class allowlistSecureMode1626733991004 { await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "privateMode"`); } } - diff --git a/packages/backend/migration/1629004542760-chart-reindex.js b/packages/backend/migration/1629004542760-chart-reindex.js index a7d459276d..8cc564b32e 100644 --- a/packages/backend/migration/1629004542760-chart-reindex.js +++ b/packages/backend/migration/1629004542760-chart-reindex.js @@ -1,181 +1,357 @@ - - export class chartReindex1629004542760 { - constructor() { - this.name = 'chartReindex1629004542760'; - } - async up(queryRunner) { - await queryRunner.query(`DELETE FROM "__chart__active_users" a USING "__chart__active_users" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DELETE FROM "__chart__drive" a USING "__chart__drive" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DELETE FROM "__chart__federation" a USING "__chart__federation" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DELETE FROM "__chart__hashtag" a USING "__chart__hashtag" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DELETE FROM "__chart__instance" a USING "__chart__instance" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DELETE FROM "__chart__network" a USING "__chart__network" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DELETE FROM "__chart__notes" a USING "__chart__notes" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DELETE FROM "__chart__per_user_drive" a USING "__chart__per_user_drive" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DELETE FROM "__chart__per_user_following" a USING "__chart__per_user_following" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DELETE FROM "__chart__per_user_notes" a USING "__chart__per_user_notes" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DELETE FROM "__chart__per_user_reaction" a USING "__chart__per_user_reaction" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DELETE FROM "__chart__test_grouped" a USING "__chart__test_grouped" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DELETE FROM "__chart__test_unique" a USING "__chart__test_unique" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DELETE FROM "__chart__users" a USING "__chart__users" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`); - await queryRunner.query(`DROP INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc"`); - await queryRunner.query(`DROP INDEX "IDX_00ed5f86db1f7efafb1978bf21"`); - await queryRunner.query(`DROP INDEX "IDX_9a3ed15a30ab7e3a37702e6e08"`); - await queryRunner.query(`DROP INDEX "IDX_13565815f618a1ff53886c5b28"`); - await queryRunner.query(`DROP INDEX "IDX_7a170f67425e62a8fabb76c872"`); - await queryRunner.query(`DROP INDEX "IDX_3313d7288855ec105b5bbf6c21"`); - await queryRunner.query(`DROP INDEX "IDX_36cb699c49580d4e6c2e6159f9"`); - await queryRunner.query(`DROP INDEX "IDX_76e87c7bfc5d925fcbba405d84"`); - await queryRunner.query(`DROP INDEX "IDX_dd907becf76104e4b656659e6b"`); - await queryRunner.query(`DROP INDEX "IDX_07747a1038c05f532a718fe1de"`); - await queryRunner.query(`DROP INDEX "IDX_99a7d2faaef84a6f728d714ad6"`); - await queryRunner.query(`DROP INDEX "IDX_25a97c02003338124b2b75fdbc"`); - await queryRunner.query(`DROP INDEX "IDX_6b8f34a1a64b06014b6fb66824"`); - await queryRunner.query(`DROP INDEX "IDX_da8a46ba84ca1d8bb5a29bfb63"`); - await queryRunner.query(`DROP INDEX "IDX_39ee857ab2f23493037c6b6631"`); - await queryRunner.query(`DROP INDEX "IDX_a1efd3e0048a5f2793a47360dc"`); - await queryRunner.query(`DROP INDEX "IDX_7b5da130992ec9df96712d4290"`); - await queryRunner.query(`DROP INDEX "IDX_0a905b992fecd2b5c3fb98759e"`); - await queryRunner.query(`DROP INDEX "IDX_42eb716a37d381cdf566192b2b"`); - await queryRunner.query(`DROP INDEX "IDX_7036f2957151588b813185c794"`); - await queryRunner.query(`DROP INDEX "IDX_f09d543e3acb16c5976bdb31fa"`); - await queryRunner.query(`DROP INDEX "IDX_5f86db6492274e07c1a3cdf286"`); - await queryRunner.query(`DROP INDEX "IDX_e496ca8096d28f6b9b509264dc"`); - await queryRunner.query(`DROP INDEX "IDX_30bf67687f483ace115c5ca642"`); - await queryRunner.query(`DROP INDEX "IDX_7af07790712aa3438ff6773f3b"`); - await queryRunner.query(`DROP INDEX "IDX_4b3593098b6edc9c5afe36b18b"`); - await queryRunner.query(`DROP INDEX "IDX_b77d4dd9562c3a899d9a286fcd"`); - await queryRunner.query(`DROP INDEX "IDX_84234bd1abb873f07329681c83"`); - await queryRunner.query(`DROP INDEX "IDX_55bf20f366979f2436de99206b"`); - await queryRunner.query(`DROP INDEX "IDX_5048e9daccbbbc6d567bb142d3"`); - await queryRunner.query(`DROP INDEX "IDX_f7bf4c62059764c2c2bb40fdab"`); - await queryRunner.query(`DROP INDEX "IDX_8cf3156fd7a6b15c43459c6e3b"`); - await queryRunner.query(`DROP INDEX "IDX_229a41ad465f9205f1f5703291"`); - await queryRunner.query(`DROP INDEX "IDX_0c641990ecf47d2545df4edb75"`); - await queryRunner.query(`DROP INDEX "IDX_234dff3c0b56a6150b95431ab9"`); - await queryRunner.query(`DROP INDEX "IDX_b14489029e4b3aaf4bba5fb524"`); - await queryRunner.query(`DROP INDEX "IDX_437bab3c6061d90f6bb65fd2cc"`); - await queryRunner.query(`DROP INDEX "IDX_bbfa573a8181018851ed0b6357"`); - await queryRunner.query(`DROP INDEX "IDX_a0cd75442dd10d0643a17c4a49"`); - await queryRunner.query(`DROP INDEX "IDX_b070a906db04b44c67c6c2144d"`); - await queryRunner.query(`DROP INDEX "IDX_d41cce6aee1a50bfc062038f9b"`); - await queryRunner.query(`DROP INDEX "IDX_a319e5dbf47e8a17497623beae"`); - await queryRunner.query(`DROP INDEX "IDX_845254b3eaf708ae8a6cac3026"`); - await queryRunner.query(`DROP INDEX "IDX_ed9b95919c672a13008e9487ee"`); - await queryRunner.query(`DROP INDEX "IDX_337e9599f278bd7537fe30876f"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_9a3ed15a30ab7e3a37702e6e08" ON "__chart__active_users" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_60c5c6e7e538c09aa274ecd1cf" ON "__chart__active_users" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_3313d7288855ec105b5bbf6c21" ON "__chart__drive" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_ceab80a6729f8e2e6f5b8a1a3d" ON "__chart__drive" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_dd907becf76104e4b656659e6b" ON "__chart__federation" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_eddfed8fb40305a04c6f941050" ON "__chart__federation" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_53a3604b939e2b479eb2cfaac8" ON "__chart__hashtag" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_8111b817b9818c04d7eb8475b1" ON "__chart__instance" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0a905b992fecd2b5c3fb98759e" ON "__chart__network" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_2082327b2699ce924fa654afc5" ON "__chart__network" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_f09d543e3acb16c5976bdb31fa" ON "__chart__notes" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_e60c358aaced5aab8900a4af31" ON "__chart__notes" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a9a806d466b314f253a1a611c4" ON "__chart__per_user_drive" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_dabbb38a51ab86ee3cab291326" ON "__chart__per_user_following" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_583a157ed0cf0ed1b5ec2a833f" ON "__chart__per_user_notes" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_3b7697a96f522d0478972e6d6f" ON "__chart__per_user_reaction" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_b14489029e4b3aaf4bba5fb524" ON "__chart__test_grouped" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_da522b4008a9f5d7743b87ad55" ON "__chart__test_grouped" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a0cd75442dd10d0643a17c4a49" ON "__chart__test_unique" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_16effb2e888f6763673b579f80" ON "__chart__test_unique" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a319e5dbf47e8a17497623beae" ON "__chart__test" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_dab383a36f3c9db4a0c9b02cf3" ON "__chart__test" ("date") WHERE "group" IS NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_337e9599f278bd7537fe30876f" ON "__chart__users" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_66feba81e1795d176d06c0b1e6" ON "__chart__users" ("date") WHERE "group" IS NULL`); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_66feba81e1795d176d06c0b1e6"`); - await queryRunner.query(`DROP INDEX "IDX_337e9599f278bd7537fe30876f"`); - await queryRunner.query(`DROP INDEX "IDX_dab383a36f3c9db4a0c9b02cf3"`); - await queryRunner.query(`DROP INDEX "IDX_a319e5dbf47e8a17497623beae"`); - await queryRunner.query(`DROP INDEX "IDX_16effb2e888f6763673b579f80"`); - await queryRunner.query(`DROP INDEX "IDX_a0cd75442dd10d0643a17c4a49"`); - await queryRunner.query(`DROP INDEX "IDX_da522b4008a9f5d7743b87ad55"`); - await queryRunner.query(`DROP INDEX "IDX_b14489029e4b3aaf4bba5fb524"`); - await queryRunner.query(`DROP INDEX "IDX_3b7697a96f522d0478972e6d6f"`); - await queryRunner.query(`DROP INDEX "IDX_229a41ad465f9205f1f5703291"`); - await queryRunner.query(`DROP INDEX "IDX_583a157ed0cf0ed1b5ec2a833f"`); - await queryRunner.query(`DROP INDEX "IDX_5048e9daccbbbc6d567bb142d3"`); - await queryRunner.query(`DROP INDEX "IDX_dabbb38a51ab86ee3cab291326"`); - await queryRunner.query(`DROP INDEX "IDX_b77d4dd9562c3a899d9a286fcd"`); - await queryRunner.query(`DROP INDEX "IDX_a9a806d466b314f253a1a611c4"`); - await queryRunner.query(`DROP INDEX "IDX_30bf67687f483ace115c5ca642"`); - await queryRunner.query(`DROP INDEX "IDX_e60c358aaced5aab8900a4af31"`); - await queryRunner.query(`DROP INDEX "IDX_f09d543e3acb16c5976bdb31fa"`); - await queryRunner.query(`DROP INDEX "IDX_2082327b2699ce924fa654afc5"`); - await queryRunner.query(`DROP INDEX "IDX_0a905b992fecd2b5c3fb98759e"`); - await queryRunner.query(`DROP INDEX "IDX_8111b817b9818c04d7eb8475b1"`); - await queryRunner.query(`DROP INDEX "IDX_39ee857ab2f23493037c6b6631"`); - await queryRunner.query(`DROP INDEX "IDX_53a3604b939e2b479eb2cfaac8"`); - await queryRunner.query(`DROP INDEX "IDX_25a97c02003338124b2b75fdbc"`); - await queryRunner.query(`DROP INDEX "IDX_eddfed8fb40305a04c6f941050"`); - await queryRunner.query(`DROP INDEX "IDX_dd907becf76104e4b656659e6b"`); - await queryRunner.query(`DROP INDEX "IDX_ceab80a6729f8e2e6f5b8a1a3d"`); - await queryRunner.query(`DROP INDEX "IDX_3313d7288855ec105b5bbf6c21"`); - await queryRunner.query(`DROP INDEX "IDX_60c5c6e7e538c09aa274ecd1cf"`); - await queryRunner.query(`DROP INDEX "IDX_9a3ed15a30ab7e3a37702e6e08"`); - await queryRunner.query(`DROP INDEX "IDX_a9021cc2e1feb5f72d3db6e9f5"`); - await queryRunner.query(`DROP INDEX "IDX_f22169eb10657bded6d875ac8f"`); - await queryRunner.query(`DROP INDEX "IDX_c8cc87bd0f2f4487d17c651fbf"`); - await queryRunner.query(`DROP INDEX "IDX_754499f9b2642336433769518d"`); - await queryRunner.query(`DROP INDEX "IDX_315c779174fe8247ab324f036e"`); - await queryRunner.query(`DROP INDEX "IDX_c5d46cbfda48b1c33ed852e21b"`); - await queryRunner.query(`CREATE INDEX "IDX_337e9599f278bd7537fe30876f" ON "__chart__users" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_ed9b95919c672a13008e9487ee" ON "__chart__users" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_845254b3eaf708ae8a6cac3026" ON "__chart__users" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_a319e5dbf47e8a17497623beae" ON "__chart__test" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_d41cce6aee1a50bfc062038f9b" ON "__chart__test" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_b070a906db04b44c67c6c2144d" ON "__chart__test" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_a0cd75442dd10d0643a17c4a49" ON "__chart__test_unique" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_bbfa573a8181018851ed0b6357" ON "__chart__test_unique" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_437bab3c6061d90f6bb65fd2cc" ON "__chart__test_unique" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_b14489029e4b3aaf4bba5fb524" ON "__chart__test_grouped" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_234dff3c0b56a6150b95431ab9" ON "__chart__test_grouped" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_0c641990ecf47d2545df4edb75" ON "__chart__test_grouped" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_8cf3156fd7a6b15c43459c6e3b" ON "__chart__per_user_reaction" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_f7bf4c62059764c2c2bb40fdab" ON "__chart__per_user_reaction" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_55bf20f366979f2436de99206b" ON "__chart__per_user_notes" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_84234bd1abb873f07329681c83" ON "__chart__per_user_notes" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_4b3593098b6edc9c5afe36b18b" ON "__chart__per_user_following" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_7af07790712aa3438ff6773f3b" ON "__chart__per_user_following" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_e496ca8096d28f6b9b509264dc" ON "__chart__per_user_drive" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_5f86db6492274e07c1a3cdf286" ON "__chart__per_user_drive" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_f09d543e3acb16c5976bdb31fa" ON "__chart__notes" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_7036f2957151588b813185c794" ON "__chart__notes" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_42eb716a37d381cdf566192b2b" ON "__chart__notes" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_0a905b992fecd2b5c3fb98759e" ON "__chart__network" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_7b5da130992ec9df96712d4290" ON "__chart__network" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_a1efd3e0048a5f2793a47360dc" ON "__chart__network" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_da8a46ba84ca1d8bb5a29bfb63" ON "__chart__instance" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_6b8f34a1a64b06014b6fb66824" ON "__chart__instance" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_99a7d2faaef84a6f728d714ad6" ON "__chart__hashtag" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_07747a1038c05f532a718fe1de" ON "__chart__hashtag" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_dd907becf76104e4b656659e6b" ON "__chart__federation" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_76e87c7bfc5d925fcbba405d84" ON "__chart__federation" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_36cb699c49580d4e6c2e6159f9" ON "__chart__federation" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_3313d7288855ec105b5bbf6c21" ON "__chart__drive" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_7a170f67425e62a8fabb76c872" ON "__chart__drive" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_13565815f618a1ff53886c5b28" ON "__chart__drive" ("date") `); - await queryRunner.query(`CREATE INDEX "IDX_9a3ed15a30ab7e3a37702e6e08" ON "__chart__active_users" ("date", "group") `); - await queryRunner.query(`CREATE INDEX "IDX_00ed5f86db1f7efafb1978bf21" ON "__chart__active_users" ("group") `); - await queryRunner.query(`CREATE INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc" ON "__chart__active_users" ("date") `); - } + constructor() { + this.name = "chartReindex1629004542760"; + } + async up(queryRunner) { + await queryRunner.query( + `DELETE FROM "__chart__active_users" a USING "__chart__active_users" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query( + `DELETE FROM "__chart__drive" a USING "__chart__drive" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query( + `DELETE FROM "__chart__federation" a USING "__chart__federation" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query( + `DELETE FROM "__chart__hashtag" a USING "__chart__hashtag" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query( + `DELETE FROM "__chart__instance" a USING "__chart__instance" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query( + `DELETE FROM "__chart__network" a USING "__chart__network" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query( + `DELETE FROM "__chart__notes" a USING "__chart__notes" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query( + `DELETE FROM "__chart__per_user_drive" a USING "__chart__per_user_drive" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query( + `DELETE FROM "__chart__per_user_following" a USING "__chart__per_user_following" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query( + `DELETE FROM "__chart__per_user_notes" a USING "__chart__per_user_notes" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query( + `DELETE FROM "__chart__per_user_reaction" a USING "__chart__per_user_reaction" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query( + `DELETE FROM "__chart__test_grouped" a USING "__chart__test_grouped" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query( + `DELETE FROM "__chart__test_unique" a USING "__chart__test_unique" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query( + `DELETE FROM "__chart__users" a USING "__chart__users" b WHERE a.id < b.id AND ((a.group IS NULL AND b.group IS NULL) OR a.group = b.group) AND a.date = b.date;`, + ); + await queryRunner.query(`DROP INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc"`); + await queryRunner.query(`DROP INDEX "IDX_00ed5f86db1f7efafb1978bf21"`); + await queryRunner.query(`DROP INDEX "IDX_9a3ed15a30ab7e3a37702e6e08"`); + await queryRunner.query(`DROP INDEX "IDX_13565815f618a1ff53886c5b28"`); + await queryRunner.query(`DROP INDEX "IDX_7a170f67425e62a8fabb76c872"`); + await queryRunner.query(`DROP INDEX "IDX_3313d7288855ec105b5bbf6c21"`); + await queryRunner.query(`DROP INDEX "IDX_36cb699c49580d4e6c2e6159f9"`); + await queryRunner.query(`DROP INDEX "IDX_76e87c7bfc5d925fcbba405d84"`); + await queryRunner.query(`DROP INDEX "IDX_dd907becf76104e4b656659e6b"`); + await queryRunner.query(`DROP INDEX "IDX_07747a1038c05f532a718fe1de"`); + await queryRunner.query(`DROP INDEX "IDX_99a7d2faaef84a6f728d714ad6"`); + await queryRunner.query(`DROP INDEX "IDX_25a97c02003338124b2b75fdbc"`); + await queryRunner.query(`DROP INDEX "IDX_6b8f34a1a64b06014b6fb66824"`); + await queryRunner.query(`DROP INDEX "IDX_da8a46ba84ca1d8bb5a29bfb63"`); + await queryRunner.query(`DROP INDEX "IDX_39ee857ab2f23493037c6b6631"`); + await queryRunner.query(`DROP INDEX "IDX_a1efd3e0048a5f2793a47360dc"`); + await queryRunner.query(`DROP INDEX "IDX_7b5da130992ec9df96712d4290"`); + await queryRunner.query(`DROP INDEX "IDX_0a905b992fecd2b5c3fb98759e"`); + await queryRunner.query(`DROP INDEX "IDX_42eb716a37d381cdf566192b2b"`); + await queryRunner.query(`DROP INDEX "IDX_7036f2957151588b813185c794"`); + await queryRunner.query(`DROP INDEX "IDX_f09d543e3acb16c5976bdb31fa"`); + await queryRunner.query(`DROP INDEX "IDX_5f86db6492274e07c1a3cdf286"`); + await queryRunner.query(`DROP INDEX "IDX_e496ca8096d28f6b9b509264dc"`); + await queryRunner.query(`DROP INDEX "IDX_30bf67687f483ace115c5ca642"`); + await queryRunner.query(`DROP INDEX "IDX_7af07790712aa3438ff6773f3b"`); + await queryRunner.query(`DROP INDEX "IDX_4b3593098b6edc9c5afe36b18b"`); + await queryRunner.query(`DROP INDEX "IDX_b77d4dd9562c3a899d9a286fcd"`); + await queryRunner.query(`DROP INDEX "IDX_84234bd1abb873f07329681c83"`); + await queryRunner.query(`DROP INDEX "IDX_55bf20f366979f2436de99206b"`); + await queryRunner.query(`DROP INDEX "IDX_5048e9daccbbbc6d567bb142d3"`); + await queryRunner.query(`DROP INDEX "IDX_f7bf4c62059764c2c2bb40fdab"`); + await queryRunner.query(`DROP INDEX "IDX_8cf3156fd7a6b15c43459c6e3b"`); + await queryRunner.query(`DROP INDEX "IDX_229a41ad465f9205f1f5703291"`); + await queryRunner.query(`DROP INDEX "IDX_0c641990ecf47d2545df4edb75"`); + await queryRunner.query(`DROP INDEX "IDX_234dff3c0b56a6150b95431ab9"`); + await queryRunner.query(`DROP INDEX "IDX_b14489029e4b3aaf4bba5fb524"`); + await queryRunner.query(`DROP INDEX "IDX_437bab3c6061d90f6bb65fd2cc"`); + await queryRunner.query(`DROP INDEX "IDX_bbfa573a8181018851ed0b6357"`); + await queryRunner.query(`DROP INDEX "IDX_a0cd75442dd10d0643a17c4a49"`); + await queryRunner.query(`DROP INDEX "IDX_b070a906db04b44c67c6c2144d"`); + await queryRunner.query(`DROP INDEX "IDX_d41cce6aee1a50bfc062038f9b"`); + await queryRunner.query(`DROP INDEX "IDX_a319e5dbf47e8a17497623beae"`); + await queryRunner.query(`DROP INDEX "IDX_845254b3eaf708ae8a6cac3026"`); + await queryRunner.query(`DROP INDEX "IDX_ed9b95919c672a13008e9487ee"`); + await queryRunner.query(`DROP INDEX "IDX_337e9599f278bd7537fe30876f"`); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_9a3ed15a30ab7e3a37702e6e08" ON "__chart__active_users" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_60c5c6e7e538c09aa274ecd1cf" ON "__chart__active_users" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_3313d7288855ec105b5bbf6c21" ON "__chart__drive" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_ceab80a6729f8e2e6f5b8a1a3d" ON "__chart__drive" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_dd907becf76104e4b656659e6b" ON "__chart__federation" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_eddfed8fb40305a04c6f941050" ON "__chart__federation" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_53a3604b939e2b479eb2cfaac8" ON "__chart__hashtag" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_8111b817b9818c04d7eb8475b1" ON "__chart__instance" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_0a905b992fecd2b5c3fb98759e" ON "__chart__network" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_2082327b2699ce924fa654afc5" ON "__chart__network" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_f09d543e3acb16c5976bdb31fa" ON "__chart__notes" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_e60c358aaced5aab8900a4af31" ON "__chart__notes" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_a9a806d466b314f253a1a611c4" ON "__chart__per_user_drive" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_dabbb38a51ab86ee3cab291326" ON "__chart__per_user_following" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_583a157ed0cf0ed1b5ec2a833f" ON "__chart__per_user_notes" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_3b7697a96f522d0478972e6d6f" ON "__chart__per_user_reaction" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_b14489029e4b3aaf4bba5fb524" ON "__chart__test_grouped" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_da522b4008a9f5d7743b87ad55" ON "__chart__test_grouped" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_a0cd75442dd10d0643a17c4a49" ON "__chart__test_unique" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_16effb2e888f6763673b579f80" ON "__chart__test_unique" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_a319e5dbf47e8a17497623beae" ON "__chart__test" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_dab383a36f3c9db4a0c9b02cf3" ON "__chart__test" ("date") WHERE "group" IS NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_337e9599f278bd7537fe30876f" ON "__chart__users" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_66feba81e1795d176d06c0b1e6" ON "__chart__users" ("date") WHERE "group" IS NULL`, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_66feba81e1795d176d06c0b1e6"`); + await queryRunner.query(`DROP INDEX "IDX_337e9599f278bd7537fe30876f"`); + await queryRunner.query(`DROP INDEX "IDX_dab383a36f3c9db4a0c9b02cf3"`); + await queryRunner.query(`DROP INDEX "IDX_a319e5dbf47e8a17497623beae"`); + await queryRunner.query(`DROP INDEX "IDX_16effb2e888f6763673b579f80"`); + await queryRunner.query(`DROP INDEX "IDX_a0cd75442dd10d0643a17c4a49"`); + await queryRunner.query(`DROP INDEX "IDX_da522b4008a9f5d7743b87ad55"`); + await queryRunner.query(`DROP INDEX "IDX_b14489029e4b3aaf4bba5fb524"`); + await queryRunner.query(`DROP INDEX "IDX_3b7697a96f522d0478972e6d6f"`); + await queryRunner.query(`DROP INDEX "IDX_229a41ad465f9205f1f5703291"`); + await queryRunner.query(`DROP INDEX "IDX_583a157ed0cf0ed1b5ec2a833f"`); + await queryRunner.query(`DROP INDEX "IDX_5048e9daccbbbc6d567bb142d3"`); + await queryRunner.query(`DROP INDEX "IDX_dabbb38a51ab86ee3cab291326"`); + await queryRunner.query(`DROP INDEX "IDX_b77d4dd9562c3a899d9a286fcd"`); + await queryRunner.query(`DROP INDEX "IDX_a9a806d466b314f253a1a611c4"`); + await queryRunner.query(`DROP INDEX "IDX_30bf67687f483ace115c5ca642"`); + await queryRunner.query(`DROP INDEX "IDX_e60c358aaced5aab8900a4af31"`); + await queryRunner.query(`DROP INDEX "IDX_f09d543e3acb16c5976bdb31fa"`); + await queryRunner.query(`DROP INDEX "IDX_2082327b2699ce924fa654afc5"`); + await queryRunner.query(`DROP INDEX "IDX_0a905b992fecd2b5c3fb98759e"`); + await queryRunner.query(`DROP INDEX "IDX_8111b817b9818c04d7eb8475b1"`); + await queryRunner.query(`DROP INDEX "IDX_39ee857ab2f23493037c6b6631"`); + await queryRunner.query(`DROP INDEX "IDX_53a3604b939e2b479eb2cfaac8"`); + await queryRunner.query(`DROP INDEX "IDX_25a97c02003338124b2b75fdbc"`); + await queryRunner.query(`DROP INDEX "IDX_eddfed8fb40305a04c6f941050"`); + await queryRunner.query(`DROP INDEX "IDX_dd907becf76104e4b656659e6b"`); + await queryRunner.query(`DROP INDEX "IDX_ceab80a6729f8e2e6f5b8a1a3d"`); + await queryRunner.query(`DROP INDEX "IDX_3313d7288855ec105b5bbf6c21"`); + await queryRunner.query(`DROP INDEX "IDX_60c5c6e7e538c09aa274ecd1cf"`); + await queryRunner.query(`DROP INDEX "IDX_9a3ed15a30ab7e3a37702e6e08"`); + await queryRunner.query(`DROP INDEX "IDX_a9021cc2e1feb5f72d3db6e9f5"`); + await queryRunner.query(`DROP INDEX "IDX_f22169eb10657bded6d875ac8f"`); + await queryRunner.query(`DROP INDEX "IDX_c8cc87bd0f2f4487d17c651fbf"`); + await queryRunner.query(`DROP INDEX "IDX_754499f9b2642336433769518d"`); + await queryRunner.query(`DROP INDEX "IDX_315c779174fe8247ab324f036e"`); + await queryRunner.query(`DROP INDEX "IDX_c5d46cbfda48b1c33ed852e21b"`); + await queryRunner.query( + `CREATE INDEX "IDX_337e9599f278bd7537fe30876f" ON "__chart__users" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_ed9b95919c672a13008e9487ee" ON "__chart__users" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_845254b3eaf708ae8a6cac3026" ON "__chart__users" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a319e5dbf47e8a17497623beae" ON "__chart__test" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d41cce6aee1a50bfc062038f9b" ON "__chart__test" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b070a906db04b44c67c6c2144d" ON "__chart__test" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a0cd75442dd10d0643a17c4a49" ON "__chart__test_unique" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_bbfa573a8181018851ed0b6357" ON "__chart__test_unique" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_437bab3c6061d90f6bb65fd2cc" ON "__chart__test_unique" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b14489029e4b3aaf4bba5fb524" ON "__chart__test_grouped" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_234dff3c0b56a6150b95431ab9" ON "__chart__test_grouped" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0c641990ecf47d2545df4edb75" ON "__chart__test_grouped" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_8cf3156fd7a6b15c43459c6e3b" ON "__chart__per_user_reaction" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f7bf4c62059764c2c2bb40fdab" ON "__chart__per_user_reaction" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_55bf20f366979f2436de99206b" ON "__chart__per_user_notes" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_84234bd1abb873f07329681c83" ON "__chart__per_user_notes" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_4b3593098b6edc9c5afe36b18b" ON "__chart__per_user_following" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7af07790712aa3438ff6773f3b" ON "__chart__per_user_following" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e496ca8096d28f6b9b509264dc" ON "__chart__per_user_drive" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_5f86db6492274e07c1a3cdf286" ON "__chart__per_user_drive" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f09d543e3acb16c5976bdb31fa" ON "__chart__notes" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7036f2957151588b813185c794" ON "__chart__notes" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_42eb716a37d381cdf566192b2b" ON "__chart__notes" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0a905b992fecd2b5c3fb98759e" ON "__chart__network" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7b5da130992ec9df96712d4290" ON "__chart__network" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_a1efd3e0048a5f2793a47360dc" ON "__chart__network" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_da8a46ba84ca1d8bb5a29bfb63" ON "__chart__instance" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_6b8f34a1a64b06014b6fb66824" ON "__chart__instance" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_99a7d2faaef84a6f728d714ad6" ON "__chart__hashtag" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_07747a1038c05f532a718fe1de" ON "__chart__hashtag" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_dd907becf76104e4b656659e6b" ON "__chart__federation" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_76e87c7bfc5d925fcbba405d84" ON "__chart__federation" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_36cb699c49580d4e6c2e6159f9" ON "__chart__federation" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_3313d7288855ec105b5bbf6c21" ON "__chart__drive" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7a170f67425e62a8fabb76c872" ON "__chart__drive" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_13565815f618a1ff53886c5b28" ON "__chart__drive" ("date") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_9a3ed15a30ab7e3a37702e6e08" ON "__chart__active_users" ("date", "group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_00ed5f86db1f7efafb1978bf21" ON "__chart__active_users" ("group") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc" ON "__chart__active_users" ("date") `, + ); + } } diff --git a/packages/backend/migration/1629024377804-deepl-integration.js b/packages/backend/migration/1629024377804-deepl-integration.js index 19c49ffcde..1dd5465fba 100644 --- a/packages/backend/migration/1629024377804-deepl-integration.js +++ b/packages/backend/migration/1629024377804-deepl-integration.js @@ -1,13 +1,13 @@ - - export class deeplIntegration1629024377804 { - constructor() { - this.name = 'deeplIntegration1629024377804'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "deeplAuthKey" character varying(128)`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "deeplAuthKey"`); - } + constructor() { + this.name = "deeplIntegration1629024377804"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "deeplAuthKey" character varying(128)`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "deeplAuthKey"`); + } } diff --git a/packages/backend/migration/1629288472000-fix-channel-userId.js b/packages/backend/migration/1629288472000-fix-channel-userId.js index 02a1199b09..e02549b11a 100644 --- a/packages/backend/migration/1629288472000-fix-channel-userId.js +++ b/packages/backend/migration/1629288472000-fix-channel-userId.js @@ -1,13 +1,15 @@ - - export class fixChannelUserId1629288472000 { - constructor() { - this.name = 'fixChannelUserId1629288472000'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "channel" ALTER COLUMN "userId" DROP NOT NULL;`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "channel" ALTER COLUMN "userId" SET NOT NULL;`); - } + constructor() { + this.name = "fixChannelUserId1629288472000"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "channel" ALTER COLUMN "userId" DROP NOT NULL;`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "channel" ALTER COLUMN "userId" SET NOT NULL;`, + ); + } } diff --git a/packages/backend/migration/1629512953000-user-is-deleted.js b/packages/backend/migration/1629512953000-user-is-deleted.js index a7848d5690..448535276f 100644 --- a/packages/backend/migration/1629512953000-user-is-deleted.js +++ b/packages/backend/migration/1629512953000-user-is-deleted.js @@ -1,14 +1,16 @@ - - export class isUserDeleted1629512953000 { - constructor() { - this.name = 'isUserDeleted1629512953000'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" ADD "isDeleted" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`COMMENT ON COLUMN "user"."isDeleted" IS 'Whether the User is deleted.'`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "isDeleted"`); - } + constructor() { + this.name = "isUserDeleted1629512953000"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user" ADD "isDeleted" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."isDeleted" IS 'Whether the User is deleted.'`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "isDeleted"`); + } } diff --git a/packages/backend/migration/1629778475000-deepl-integration2.js b/packages/backend/migration/1629778475000-deepl-integration2.js index 699f06c768..138e00d247 100644 --- a/packages/backend/migration/1629778475000-deepl-integration2.js +++ b/packages/backend/migration/1629778475000-deepl-integration2.js @@ -1,13 +1,13 @@ - - export class deeplIntegration21629778475000 { - constructor() { - this.name = 'deeplIntegration21629778475000'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "deeplIsPro" boolean NOT NULL DEFAULT false`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "deeplIsPro"`); - } + constructor() { + this.name = "deeplIntegration21629778475000"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "deeplIsPro" boolean NOT NULL DEFAULT false`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "deeplIsPro"`); + } } diff --git a/packages/backend/migration/1629833361000-AddShowTLReplies.js b/packages/backend/migration/1629833361000-AddShowTLReplies.js index 5d4c938a7b..78e9f417b7 100644 --- a/packages/backend/migration/1629833361000-AddShowTLReplies.js +++ b/packages/backend/migration/1629833361000-AddShowTLReplies.js @@ -1,14 +1,18 @@ - - export class addShowTLReplies1629833361000 { constructor() { - this.name = 'addShowTLReplies1629833361000'; + this.name = "addShowTLReplies1629833361000"; } async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" ADD "showTimelineReplies" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`COMMENT ON COLUMN "user"."showTimelineReplies" IS 'Whether to show users replying to other users in the timeline.'`); + await queryRunner.query( + `ALTER TABLE "user" ADD "showTimelineReplies" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."showTimelineReplies" IS 'Whether to show users replying to other users in the timeline.'`, + ); } async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "showTimelineReplies"`); + await queryRunner.query( + `ALTER TABLE "user" DROP COLUMN "showTimelineReplies"`, + ); } } diff --git a/packages/backend/migration/1629968054000_userInstanceBlocks.js b/packages/backend/migration/1629968054000_userInstanceBlocks.js index 1f202d9f66..666aaba284 100644 --- a/packages/backend/migration/1629968054000_userInstanceBlocks.js +++ b/packages/backend/migration/1629968054000_userInstanceBlocks.js @@ -1,14 +1,18 @@ - - export class userInstanceBlocks1629968054000 { constructor() { - this.name = 'userInstanceBlocks1629968054000'; + 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.'`); + 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"`); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "mutedInstances"`, + ); } } diff --git a/packages/backend/migration/1633068642000-email-required-for-signup.js b/packages/backend/migration/1633068642000-email-required-for-signup.js index d592f3ca21..45c0894a75 100644 --- a/packages/backend/migration/1633068642000-email-required-for-signup.js +++ b/packages/backend/migration/1633068642000-email-required-for-signup.js @@ -1,13 +1,15 @@ - - export class emailRequiredForSignup1633068642000 { - constructor() { - this.name = 'emailRequiredForSignup1633068642000'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "emailRequiredForSignup" boolean NOT NULL DEFAULT false`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "emailRequiredForSignup"`); - } + constructor() { + this.name = "emailRequiredForSignup1633068642000"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "emailRequiredForSignup" boolean NOT NULL DEFAULT false`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "emailRequiredForSignup"`, + ); + } } diff --git a/packages/backend/migration/1633071909016-user-pending.js b/packages/backend/migration/1633071909016-user-pending.js index 17cf5c11be..b37e51629d 100644 --- a/packages/backend/migration/1633071909016-user-pending.js +++ b/packages/backend/migration/1633071909016-user-pending.js @@ -1,15 +1,17 @@ - - export class userPending1633071909016 { - constructor() { - this.name = 'userPending1633071909016'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "user_pending" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "code" character varying(128) NOT NULL, "username" character varying(128) NOT NULL, "email" character varying(128) NOT NULL, "password" character varying(128) NOT NULL, CONSTRAINT "PK_d4c84e013c98ec02d19b8fbbafa" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_4e5c4c99175638ec0761714ab0" ON "user_pending" ("code") `); - } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "IDX_4e5c4c99175638ec0761714ab0"`); - await queryRunner.query(`DROP TABLE "user_pending"`); - } + constructor() { + this.name = "userPending1633071909016"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "user_pending" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "code" character varying(128) NOT NULL, "username" character varying(128) NOT NULL, "email" character varying(128) NOT NULL, "password" character varying(128) NOT NULL, CONSTRAINT "PK_d4c84e013c98ec02d19b8fbbafa" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_4e5c4c99175638ec0761714ab0" ON "user_pending" ("code") `, + ); + } + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_4e5c4c99175638ec0761714ab0"`); + await queryRunner.query(`DROP TABLE "user_pending"`); + } } diff --git a/packages/backend/migration/1634486652000-user-public-reactions.js b/packages/backend/migration/1634486652000-user-public-reactions.js index e741122491..95b957f11c 100644 --- a/packages/backend/migration/1634486652000-user-public-reactions.js +++ b/packages/backend/migration/1634486652000-user-public-reactions.js @@ -1,13 +1,15 @@ - - export class userPublicReactions1634486652000 { - constructor() { - this.name = 'userPublicReactions1634486652000'; - } - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ADD "publicReactions" boolean NOT NULL DEFAULT false`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "publicReactions"`); - } + constructor() { + this.name = "userPublicReactions1634486652000"; + } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "publicReactions" boolean NOT NULL DEFAULT false`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "publicReactions"`, + ); + } } diff --git a/packages/backend/migration/1634902659689-delete-log.js b/packages/backend/migration/1634902659689-delete-log.js index 555a0020c3..fc148f0988 100644 --- a/packages/backend/migration/1634902659689-delete-log.js +++ b/packages/backend/migration/1634902659689-delete-log.js @@ -1,12 +1,9 @@ - - export class deleteLog1634902659689 { - constructor() { - this.name = 'deleteLog1634902659689'; - } - async up(queryRunner) { - await queryRunner.query(`DROP TABLE "log"`); - } - async down(queryRunner) { - } + constructor() { + this.name = "deleteLog1634902659689"; + } + async up(queryRunner) { + await queryRunner.query(`DROP TABLE "log"`); + } + async down(queryRunner) {} } diff --git a/packages/backend/migration/1635500777168-note-thread-mute.js b/packages/backend/migration/1635500777168-note-thread-mute.js index a790cace33..5fcfa40c07 100644 --- a/packages/backend/migration/1635500777168-note-thread-mute.js +++ b/packages/backend/migration/1635500777168-note-thread-mute.js @@ -1,25 +1,47 @@ - - export class noteThreadMute1635500777168 { - constructor() { - this.name = 'noteThreadMute1635500777168'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "note_thread_muting" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "threadId" character varying(256) NOT NULL, CONSTRAINT "PK_ec5936d94d1a0369646d12a3a47" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_29c11c7deb06615076f8c95b80" ON "note_thread_muting" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_c426394644267453e76f036926" ON "note_thread_muting" ("threadId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_ae7aab18a2641d3e5f25e0c4ea" ON "note_thread_muting" ("userId", "threadId") `); - await queryRunner.query(`ALTER TABLE "note" ADD "threadId" character varying(256)`); - await queryRunner.query(`CREATE INDEX "IDX_d4ebdef929896d6dc4a3c5bb48" ON "note" ("threadId") `); - await queryRunner.query(`ALTER TABLE "note_thread_muting" ADD CONSTRAINT "FK_29c11c7deb06615076f8c95b80a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "note_thread_muting" DROP CONSTRAINT "FK_29c11c7deb06615076f8c95b80a"`); - await queryRunner.query(`DROP INDEX "public"."IDX_d4ebdef929896d6dc4a3c5bb48"`); - await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "threadId"`); - await queryRunner.query(`DROP INDEX "public"."IDX_ae7aab18a2641d3e5f25e0c4ea"`); - await queryRunner.query(`DROP INDEX "public"."IDX_c426394644267453e76f036926"`); - await queryRunner.query(`DROP INDEX "public"."IDX_29c11c7deb06615076f8c95b80"`); - await queryRunner.query(`DROP TABLE "note_thread_muting"`); - } + constructor() { + this.name = "noteThreadMute1635500777168"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "note_thread_muting" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "threadId" character varying(256) NOT NULL, CONSTRAINT "PK_ec5936d94d1a0369646d12a3a47" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_29c11c7deb06615076f8c95b80" ON "note_thread_muting" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_c426394644267453e76f036926" ON "note_thread_muting" ("threadId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_ae7aab18a2641d3e5f25e0c4ea" ON "note_thread_muting" ("userId", "threadId") `, + ); + await queryRunner.query( + `ALTER TABLE "note" ADD "threadId" character varying(256)`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_d4ebdef929896d6dc4a3c5bb48" ON "note" ("threadId") `, + ); + await queryRunner.query( + `ALTER TABLE "note_thread_muting" ADD CONSTRAINT "FK_29c11c7deb06615076f8c95b80a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "note_thread_muting" DROP CONSTRAINT "FK_29c11c7deb06615076f8c95b80a"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_d4ebdef929896d6dc4a3c5bb48"`, + ); + await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "threadId"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_ae7aab18a2641d3e5f25e0c4ea"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_c426394644267453e76f036926"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_29c11c7deb06615076f8c95b80"`, + ); + await queryRunner.query(`DROP TABLE "note_thread_muting"`); + } } diff --git a/packages/backend/migration/1636197624383-ff-visibility.js b/packages/backend/migration/1636197624383-ff-visibility.js index 89028f3c22..a3af8f7186 100644 --- a/packages/backend/migration/1636197624383-ff-visibility.js +++ b/packages/backend/migration/1636197624383-ff-visibility.js @@ -1,15 +1,21 @@ - - export class ffVisibility1636197624383 { - constructor() { - this.name = 'ffVisibility1636197624383'; - } - async up(queryRunner) { - await queryRunner.query(`CREATE TYPE "public"."user_profile_ffvisibility_enum" AS ENUM('public', 'followers', 'private')`); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "ffVisibility" "public"."user_profile_ffvisibility_enum" NOT NULL DEFAULT 'public'`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "ffVisibility"`); - await queryRunner.query(`DROP TYPE "public"."user_profile_ffvisibility_enum"`); - } + constructor() { + this.name = "ffVisibility1636197624383"; + } + async up(queryRunner) { + await queryRunner.query( + `CREATE TYPE "public"."user_profile_ffvisibility_enum" AS ENUM('public', 'followers', 'private')`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "ffVisibility" "public"."user_profile_ffvisibility_enum" NOT NULL DEFAULT 'public'`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "ffVisibility"`, + ); + await queryRunner.query( + `DROP TYPE "public"."user_profile_ffvisibility_enum"`, + ); + } } diff --git a/packages/backend/migration/1636697408073-remove-via-mobile.js b/packages/backend/migration/1636697408073-remove-via-mobile.js index 36e96fd21e..f862760249 100644 --- a/packages/backend/migration/1636697408073-remove-via-mobile.js +++ b/packages/backend/migration/1636697408073-remove-via-mobile.js @@ -1,13 +1,13 @@ - - export class removeViaMobile1636697408073 { - name = 'removeViaMobile1636697408073' + name = "removeViaMobile1636697408073"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "viaMobile"`); - } + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "note" DROP COLUMN "viaMobile"`); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "note" ADD "viaMobile" boolean NOT NULL DEFAULT false`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "note" ADD "viaMobile" boolean NOT NULL DEFAULT false`, + ); + } } diff --git a/packages/backend/migration/1637320813000-forwarded-report.js b/packages/backend/migration/1637320813000-forwarded-report.js index 1e39bd5c3f..18ec172063 100644 --- a/packages/backend/migration/1637320813000-forwarded-report.js +++ b/packages/backend/migration/1637320813000-forwarded-report.js @@ -1,13 +1,15 @@ - - export class forwardedReport1637320813000 { - name = 'forwardedReport1637320813000'; + name = "forwardedReport1637320813000"; async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "abuse_user_report" ADD "forwarded" boolean NOT NULL DEFAULT false`); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" ADD "forwarded" boolean NOT NULL DEFAULT false`, + ); } async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "abuse_user_report" DROP COLUMN "forwarded"`); + await queryRunner.query( + `ALTER TABLE "abuse_user_report" DROP COLUMN "forwarded"`, + ); } -}; +} diff --git a/packages/backend/migration/1639325650583-chart-v3.js b/packages/backend/migration/1639325650583-chart-v3.js index e2a4e920c9..011708c0fe 100644 --- a/packages/backend/migration/1639325650583-chart-v3.js +++ b/packages/backend/migration/1639325650583-chart-v3.js @@ -1,189 +1,511 @@ - - export class chartV31639325650583 { - name = 'chartV31639325650583' + name = "chartV31639325650583"; - async up(queryRunner) { - await queryRunner.query(`DELETE FROM "__chart__per_user_drive" WHERE "group" IS NULL`); + async up(queryRunner) { + await queryRunner.query( + `DELETE FROM "__chart__per_user_drive" WHERE "group" IS NULL`, + ); - await queryRunner.query(`DROP INDEX "public"."IDX_dd907becf76104e4b656659e6b"`); - await queryRunner.query(`DROP INDEX "public"."IDX_eddfed8fb40305a04c6f941050"`); - await queryRunner.query(`DROP INDEX "public"."IDX_f09d543e3acb16c5976bdb31fa"`); - await queryRunner.query(`DROP INDEX "public"."IDX_e60c358aaced5aab8900a4af31"`); - await queryRunner.query(`DROP INDEX "public"."IDX_337e9599f278bd7537fe30876f"`); - await queryRunner.query(`DROP INDEX "public"."IDX_66feba81e1795d176d06c0b1e6"`); - await queryRunner.query(`DROP INDEX "public"."IDX_0a905b992fecd2b5c3fb98759e"`); - await queryRunner.query(`DROP INDEX "public"."IDX_2082327b2699ce924fa654afc5"`); - await queryRunner.query(`DROP INDEX "public"."IDX_9a3ed15a30ab7e3a37702e6e08"`); - await queryRunner.query(`DROP INDEX "public"."IDX_60c5c6e7e538c09aa274ecd1cf"`); - await queryRunner.query(`DROP INDEX "public"."IDX_8111b817b9818c04d7eb8475b1"`); - await queryRunner.query(`DROP INDEX "public"."IDX_583a157ed0cf0ed1b5ec2a833f"`); - await queryRunner.query(`DROP INDEX "public"."IDX_3313d7288855ec105b5bbf6c21"`); - await queryRunner.query(`DROP INDEX "public"."IDX_ceab80a6729f8e2e6f5b8a1a3d"`); - await queryRunner.query(`DROP INDEX "public"."IDX_3b7697a96f522d0478972e6d6f"`); - await queryRunner.query(`DROP INDEX "public"."IDX_53a3604b939e2b479eb2cfaac8"`); - await queryRunner.query(`DROP INDEX "public"."IDX_dabbb38a51ab86ee3cab291326"`); - await queryRunner.query(`DROP INDEX "public"."IDX_a9a806d466b314f253a1a611c4"`); - await queryRunner.query(`CREATE TABLE "__chart_day__federation" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___instance_total" bigint NOT NULL, "___instance_inc" bigint NOT NULL, "___instance_dec" bigint NOT NULL, CONSTRAINT "UQ_617a8fe225a6e701d89e02d2c74" UNIQUE ("date"), CONSTRAINT "PK_7ca721c769f31698e0e1331e8e6" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_617a8fe225a6e701d89e02d2c7" ON "__chart_day__federation" ("date") `); - await queryRunner.query(`CREATE TABLE "__chart_day__notes" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___local_total" bigint NOT NULL, "___local_inc" bigint NOT NULL, "___local_dec" bigint NOT NULL, "___local_diffs_normal" bigint NOT NULL, "___local_diffs_reply" bigint NOT NULL, "___local_diffs_renote" bigint NOT NULL, "___remote_total" bigint NOT NULL, "___remote_inc" bigint NOT NULL, "___remote_dec" bigint NOT NULL, "___remote_diffs_normal" bigint NOT NULL, "___remote_diffs_reply" bigint NOT NULL, "___remote_diffs_renote" bigint NOT NULL, CONSTRAINT "UQ_1a527b423ad0858a1af5a056d43" UNIQUE ("date"), CONSTRAINT "PK_1fa4139e1f338272b758d05e090" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_1a527b423ad0858a1af5a056d4" ON "__chart_day__notes" ("date") `); - await queryRunner.query(`CREATE TABLE "__chart_day__users" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___local_total" bigint NOT NULL, "___local_inc" bigint NOT NULL, "___local_dec" bigint NOT NULL, "___remote_total" bigint NOT NULL, "___remote_inc" bigint NOT NULL, "___remote_dec" bigint NOT NULL, CONSTRAINT "UQ_cad6e07c20037f31cdba8a350c3" UNIQUE ("date"), CONSTRAINT "PK_d7f7185abb9851f70c4726c54bd" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_cad6e07c20037f31cdba8a350c" ON "__chart_day__users" ("date") `); - await queryRunner.query(`CREATE TABLE "__chart_day__network" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___incomingRequests" bigint NOT NULL, "___outgoingRequests" bigint NOT NULL, "___totalTime" bigint NOT NULL, "___incomingBytes" bigint NOT NULL, "___outgoingBytes" bigint NOT NULL, CONSTRAINT "UQ_8bfa548c2b31f9e07db113773ee" UNIQUE ("date"), CONSTRAINT "PK_cac499d6f471042dfed1e7e0132" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_8bfa548c2b31f9e07db113773e" ON "__chart_day__network" ("date") `); - await queryRunner.query(`CREATE TABLE "__chart_day__active_users" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___local_users" character varying array NOT NULL, "___remote_users" character varying array NOT NULL, CONSTRAINT "UQ_d5954f3df5e5e3bdfc3c03f3906" UNIQUE ("date"), CONSTRAINT "PK_b1790489b14f005ae8f404f5795" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_d5954f3df5e5e3bdfc3c03f390" ON "__chart_day__active_users" ("date") `); - await queryRunner.query(`CREATE TABLE "__chart_day__instance" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___requests_failed" bigint NOT NULL, "___requests_succeeded" bigint NOT NULL, "___requests_received" bigint NOT NULL, "___notes_total" bigint NOT NULL, "___notes_inc" bigint NOT NULL, "___notes_dec" bigint NOT NULL, "___notes_diffs_normal" bigint NOT NULL, "___notes_diffs_reply" bigint NOT NULL, "___notes_diffs_renote" bigint NOT NULL, "___users_total" bigint NOT NULL, "___users_inc" bigint NOT NULL, "___users_dec" bigint NOT NULL, "___following_total" bigint NOT NULL, "___following_inc" bigint NOT NULL, "___following_dec" bigint NOT NULL, "___followers_total" bigint NOT NULL, "___followers_inc" bigint NOT NULL, "___followers_dec" bigint NOT NULL, "___drive_totalFiles" bigint NOT NULL, "___drive_totalUsage" bigint NOT NULL, "___drive_incFiles" bigint NOT NULL, "___drive_incUsage" bigint NOT NULL, "___drive_decFiles" bigint NOT NULL, "___drive_decUsage" bigint NOT NULL, CONSTRAINT "UQ_fea7c0278325a1a2492f2d6acbf" UNIQUE ("date", "group"), CONSTRAINT "PK_479a8ff9d959274981087043023" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_fea7c0278325a1a2492f2d6acb" ON "__chart_day__instance" ("date", "group") `); - await queryRunner.query(`CREATE TABLE "__chart_day__per_user_notes" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___total" bigint NOT NULL, "___inc" bigint NOT NULL, "___dec" bigint NOT NULL, "___diffs_normal" bigint NOT NULL, "___diffs_reply" bigint NOT NULL, "___diffs_renote" bigint NOT NULL, CONSTRAINT "UQ_c5545d4b31cdc684034e33b81c3" UNIQUE ("date", "group"), CONSTRAINT "PK_58bab6b6d3ad9310cbc7460fd28" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_c5545d4b31cdc684034e33b81c" ON "__chart_day__per_user_notes" ("date", "group") `); - await queryRunner.query(`CREATE TABLE "__chart_day__drive" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___local_totalCount" bigint NOT NULL, "___local_totalSize" bigint NOT NULL, "___local_incCount" bigint NOT NULL, "___local_incSize" bigint NOT NULL, "___local_decCount" bigint NOT NULL, "___local_decSize" bigint NOT NULL, "___remote_totalCount" bigint NOT NULL, "___remote_totalSize" bigint NOT NULL, "___remote_incCount" bigint NOT NULL, "___remote_incSize" bigint NOT NULL, "___remote_decCount" bigint NOT NULL, "___remote_decSize" bigint NOT NULL, CONSTRAINT "UQ_0b60ebb3aa0065f10b0616c1171" UNIQUE ("date"), CONSTRAINT "PK_e7ec0de057c77c40fc8d8b62151" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0b60ebb3aa0065f10b0616c117" ON "__chart_day__drive" ("date") `); - await queryRunner.query(`CREATE TABLE "__chart_day__per_user_reaction" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___local_count" bigint NOT NULL, "___remote_count" bigint NOT NULL, CONSTRAINT "UQ_d54b653660d808b118e36c184c0" UNIQUE ("date", "group"), CONSTRAINT "PK_8af24e2d51ff781a354fe595eda" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_d54b653660d808b118e36c184c" ON "__chart_day__per_user_reaction" ("date", "group") `); - await queryRunner.query(`CREATE TABLE "__chart_day__hashtag" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___local_users" character varying array NOT NULL, "___remote_users" character varying array NOT NULL, CONSTRAINT "UQ_8f589cf056ff51f09d6096f6450" UNIQUE ("date", "group"), CONSTRAINT "PK_13d5a3b089344e5557f8e0980b4" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_8f589cf056ff51f09d6096f645" ON "__chart_day__hashtag" ("date", "group") `); - await queryRunner.query(`CREATE TABLE "__chart_day__per_user_following" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___local_followings_total" bigint NOT NULL, "___local_followings_inc" bigint NOT NULL, "___local_followings_dec" bigint NOT NULL, "___local_followers_total" bigint NOT NULL, "___local_followers_inc" bigint NOT NULL, "___local_followers_dec" bigint NOT NULL, "___remote_followings_total" bigint NOT NULL, "___remote_followings_inc" bigint NOT NULL, "___remote_followings_dec" bigint NOT NULL, "___remote_followers_total" bigint NOT NULL, "___remote_followers_inc" bigint NOT NULL, "___remote_followers_dec" bigint NOT NULL, CONSTRAINT "UQ_e4849a3231f38281280ea4c0eee" UNIQUE ("date", "group"), CONSTRAINT "PK_68ce6b67da57166da66fc8fb27e" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_e4849a3231f38281280ea4c0ee" ON "__chart_day__per_user_following" ("date", "group") `); - await queryRunner.query(`CREATE TABLE "__chart_day__per_user_drive" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___totalCount" bigint NOT NULL, "___totalSize" bigint NOT NULL, "___incCount" bigint NOT NULL, "___incSize" bigint NOT NULL, "___decCount" bigint NOT NULL, "___decSize" bigint NOT NULL, CONSTRAINT "UQ_62aa5047b5aec92524f24c701d7" UNIQUE ("date", "group"), CONSTRAINT "PK_1ae135254c137011645da7f4045" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_62aa5047b5aec92524f24c701d" ON "__chart_day__per_user_drive" ("date", "group") `); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "group"`); - await queryRunner.query(`ALTER TABLE "__chart__notes" DROP COLUMN "group"`); - await queryRunner.query(`ALTER TABLE "__chart__users" DROP COLUMN "group"`); - await queryRunner.query(`ALTER TABLE "__chart__network" DROP COLUMN "group"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "group"`); - await queryRunner.query(`ALTER TABLE "__chart__drive" DROP COLUMN "group"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD CONSTRAINT "UQ_36cb699c49580d4e6c2e6159f97" UNIQUE ("date")`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ADD CONSTRAINT "UQ_42eb716a37d381cdf566192b2be" UNIQUE ("date")`); - await queryRunner.query(`ALTER TABLE "__chart__users" ADD CONSTRAINT "UQ_845254b3eaf708ae8a6cac30265" UNIQUE ("date")`); - await queryRunner.query(`ALTER TABLE "__chart__network" ADD CONSTRAINT "UQ_a1efd3e0048a5f2793a47360dc6" UNIQUE ("date")`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD CONSTRAINT "UQ_0ad37b7ef50f4ddc84363d7ccca" UNIQUE ("date")`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ALTER COLUMN "___local_users" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ALTER COLUMN "___remote_users" DROP DEFAULT`); - await queryRunner.query(`DROP INDEX "public"."IDX_39ee857ab2f23493037c6b6631"`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "group" SET NOT NULL`); - await queryRunner.query(`DROP INDEX "public"."IDX_5048e9daccbbbc6d567bb142d3"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "group" SET NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ADD CONSTRAINT "UQ_13565815f618a1ff53886c5b28a" UNIQUE ("date")`); - await queryRunner.query(`DROP INDEX "public"."IDX_229a41ad465f9205f1f5703291"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "group" SET NOT NULL`); - await queryRunner.query(`DROP INDEX "public"."IDX_25a97c02003338124b2b75fdbc"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ALTER COLUMN "group" SET NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" DROP DEFAULT`); - await queryRunner.query(`DROP INDEX "public"."IDX_b77d4dd9562c3a899d9a286fcd"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "group" SET NOT NULL`); - await queryRunner.query(`DROP INDEX "public"."IDX_30bf67687f483ace115c5ca642"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "group" SET NOT NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_36cb699c49580d4e6c2e6159f9" ON "__chart__federation" ("date") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_42eb716a37d381cdf566192b2b" ON "__chart__notes" ("date") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_845254b3eaf708ae8a6cac3026" ON "__chart__users" ("date") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a1efd3e0048a5f2793a47360dc" ON "__chart__network" ("date") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc" ON "__chart__active_users" ("date") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_13565815f618a1ff53886c5b28" ON "__chart__drive" ("date") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `); - await queryRunner.query(`ALTER TABLE "__chart__instance" ADD CONSTRAINT "UQ_39ee857ab2f23493037c6b66311" UNIQUE ("date", "group")`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ADD CONSTRAINT "UQ_5048e9daccbbbc6d567bb142d34" UNIQUE ("date", "group")`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" ADD CONSTRAINT "UQ_229a41ad465f9205f1f57032910" UNIQUE ("date", "group")`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ADD CONSTRAINT "UQ_25a97c02003338124b2b75fdbc8" UNIQUE ("date", "group")`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ADD CONSTRAINT "UQ_b77d4dd9562c3a899d9a286fcd7" UNIQUE ("date", "group")`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ADD CONSTRAINT "UQ_30bf67687f483ace115c5ca6429" UNIQUE ("date", "group")`); - } + await queryRunner.query( + `DROP INDEX "public"."IDX_dd907becf76104e4b656659e6b"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_eddfed8fb40305a04c6f941050"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_f09d543e3acb16c5976bdb31fa"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_e60c358aaced5aab8900a4af31"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_337e9599f278bd7537fe30876f"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_66feba81e1795d176d06c0b1e6"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_0a905b992fecd2b5c3fb98759e"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_2082327b2699ce924fa654afc5"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_9a3ed15a30ab7e3a37702e6e08"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_60c5c6e7e538c09aa274ecd1cf"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_8111b817b9818c04d7eb8475b1"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_583a157ed0cf0ed1b5ec2a833f"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_3313d7288855ec105b5bbf6c21"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_ceab80a6729f8e2e6f5b8a1a3d"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_3b7697a96f522d0478972e6d6f"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_53a3604b939e2b479eb2cfaac8"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_dabbb38a51ab86ee3cab291326"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_a9a806d466b314f253a1a611c4"`, + ); + await queryRunner.query( + `CREATE TABLE "__chart_day__federation" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___instance_total" bigint NOT NULL, "___instance_inc" bigint NOT NULL, "___instance_dec" bigint NOT NULL, CONSTRAINT "UQ_617a8fe225a6e701d89e02d2c74" UNIQUE ("date"), CONSTRAINT "PK_7ca721c769f31698e0e1331e8e6" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_617a8fe225a6e701d89e02d2c7" ON "__chart_day__federation" ("date") `, + ); + await queryRunner.query( + `CREATE TABLE "__chart_day__notes" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___local_total" bigint NOT NULL, "___local_inc" bigint NOT NULL, "___local_dec" bigint NOT NULL, "___local_diffs_normal" bigint NOT NULL, "___local_diffs_reply" bigint NOT NULL, "___local_diffs_renote" bigint NOT NULL, "___remote_total" bigint NOT NULL, "___remote_inc" bigint NOT NULL, "___remote_dec" bigint NOT NULL, "___remote_diffs_normal" bigint NOT NULL, "___remote_diffs_reply" bigint NOT NULL, "___remote_diffs_renote" bigint NOT NULL, CONSTRAINT "UQ_1a527b423ad0858a1af5a056d43" UNIQUE ("date"), CONSTRAINT "PK_1fa4139e1f338272b758d05e090" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_1a527b423ad0858a1af5a056d4" ON "__chart_day__notes" ("date") `, + ); + await queryRunner.query( + `CREATE TABLE "__chart_day__users" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___local_total" bigint NOT NULL, "___local_inc" bigint NOT NULL, "___local_dec" bigint NOT NULL, "___remote_total" bigint NOT NULL, "___remote_inc" bigint NOT NULL, "___remote_dec" bigint NOT NULL, CONSTRAINT "UQ_cad6e07c20037f31cdba8a350c3" UNIQUE ("date"), CONSTRAINT "PK_d7f7185abb9851f70c4726c54bd" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_cad6e07c20037f31cdba8a350c" ON "__chart_day__users" ("date") `, + ); + await queryRunner.query( + `CREATE TABLE "__chart_day__network" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___incomingRequests" bigint NOT NULL, "___outgoingRequests" bigint NOT NULL, "___totalTime" bigint NOT NULL, "___incomingBytes" bigint NOT NULL, "___outgoingBytes" bigint NOT NULL, CONSTRAINT "UQ_8bfa548c2b31f9e07db113773ee" UNIQUE ("date"), CONSTRAINT "PK_cac499d6f471042dfed1e7e0132" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_8bfa548c2b31f9e07db113773e" ON "__chart_day__network" ("date") `, + ); + await queryRunner.query( + `CREATE TABLE "__chart_day__active_users" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___local_users" character varying array NOT NULL, "___remote_users" character varying array NOT NULL, CONSTRAINT "UQ_d5954f3df5e5e3bdfc3c03f3906" UNIQUE ("date"), CONSTRAINT "PK_b1790489b14f005ae8f404f5795" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_d5954f3df5e5e3bdfc3c03f390" ON "__chart_day__active_users" ("date") `, + ); + await queryRunner.query( + `CREATE TABLE "__chart_day__instance" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___requests_failed" bigint NOT NULL, "___requests_succeeded" bigint NOT NULL, "___requests_received" bigint NOT NULL, "___notes_total" bigint NOT NULL, "___notes_inc" bigint NOT NULL, "___notes_dec" bigint NOT NULL, "___notes_diffs_normal" bigint NOT NULL, "___notes_diffs_reply" bigint NOT NULL, "___notes_diffs_renote" bigint NOT NULL, "___users_total" bigint NOT NULL, "___users_inc" bigint NOT NULL, "___users_dec" bigint NOT NULL, "___following_total" bigint NOT NULL, "___following_inc" bigint NOT NULL, "___following_dec" bigint NOT NULL, "___followers_total" bigint NOT NULL, "___followers_inc" bigint NOT NULL, "___followers_dec" bigint NOT NULL, "___drive_totalFiles" bigint NOT NULL, "___drive_totalUsage" bigint NOT NULL, "___drive_incFiles" bigint NOT NULL, "___drive_incUsage" bigint NOT NULL, "___drive_decFiles" bigint NOT NULL, "___drive_decUsage" bigint NOT NULL, CONSTRAINT "UQ_fea7c0278325a1a2492f2d6acbf" UNIQUE ("date", "group"), CONSTRAINT "PK_479a8ff9d959274981087043023" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_fea7c0278325a1a2492f2d6acb" ON "__chart_day__instance" ("date", "group") `, + ); + await queryRunner.query( + `CREATE TABLE "__chart_day__per_user_notes" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___total" bigint NOT NULL, "___inc" bigint NOT NULL, "___dec" bigint NOT NULL, "___diffs_normal" bigint NOT NULL, "___diffs_reply" bigint NOT NULL, "___diffs_renote" bigint NOT NULL, CONSTRAINT "UQ_c5545d4b31cdc684034e33b81c3" UNIQUE ("date", "group"), CONSTRAINT "PK_58bab6b6d3ad9310cbc7460fd28" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_c5545d4b31cdc684034e33b81c" ON "__chart_day__per_user_notes" ("date", "group") `, + ); + await queryRunner.query( + `CREATE TABLE "__chart_day__drive" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___local_totalCount" bigint NOT NULL, "___local_totalSize" bigint NOT NULL, "___local_incCount" bigint NOT NULL, "___local_incSize" bigint NOT NULL, "___local_decCount" bigint NOT NULL, "___local_decSize" bigint NOT NULL, "___remote_totalCount" bigint NOT NULL, "___remote_totalSize" bigint NOT NULL, "___remote_incCount" bigint NOT NULL, "___remote_incSize" bigint NOT NULL, "___remote_decCount" bigint NOT NULL, "___remote_decSize" bigint NOT NULL, CONSTRAINT "UQ_0b60ebb3aa0065f10b0616c1171" UNIQUE ("date"), CONSTRAINT "PK_e7ec0de057c77c40fc8d8b62151" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_0b60ebb3aa0065f10b0616c117" ON "__chart_day__drive" ("date") `, + ); + await queryRunner.query( + `CREATE TABLE "__chart_day__per_user_reaction" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___local_count" bigint NOT NULL, "___remote_count" bigint NOT NULL, CONSTRAINT "UQ_d54b653660d808b118e36c184c0" UNIQUE ("date", "group"), CONSTRAINT "PK_8af24e2d51ff781a354fe595eda" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_d54b653660d808b118e36c184c" ON "__chart_day__per_user_reaction" ("date", "group") `, + ); + await queryRunner.query( + `CREATE TABLE "__chart_day__hashtag" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___local_users" character varying array NOT NULL, "___remote_users" character varying array NOT NULL, CONSTRAINT "UQ_8f589cf056ff51f09d6096f6450" UNIQUE ("date", "group"), CONSTRAINT "PK_13d5a3b089344e5557f8e0980b4" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_8f589cf056ff51f09d6096f645" ON "__chart_day__hashtag" ("date", "group") `, + ); + await queryRunner.query( + `CREATE TABLE "__chart_day__per_user_following" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___local_followings_total" bigint NOT NULL, "___local_followings_inc" bigint NOT NULL, "___local_followings_dec" bigint NOT NULL, "___local_followers_total" bigint NOT NULL, "___local_followers_inc" bigint NOT NULL, "___local_followers_dec" bigint NOT NULL, "___remote_followings_total" bigint NOT NULL, "___remote_followings_inc" bigint NOT NULL, "___remote_followings_dec" bigint NOT NULL, "___remote_followers_total" bigint NOT NULL, "___remote_followers_inc" bigint NOT NULL, "___remote_followers_dec" bigint NOT NULL, CONSTRAINT "UQ_e4849a3231f38281280ea4c0eee" UNIQUE ("date", "group"), CONSTRAINT "PK_68ce6b67da57166da66fc8fb27e" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_e4849a3231f38281280ea4c0ee" ON "__chart_day__per_user_following" ("date", "group") `, + ); + await queryRunner.query( + `CREATE TABLE "__chart_day__per_user_drive" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "group" character varying(128) NOT NULL, "___totalCount" bigint NOT NULL, "___totalSize" bigint NOT NULL, "___incCount" bigint NOT NULL, "___incSize" bigint NOT NULL, "___decCount" bigint NOT NULL, "___decSize" bigint NOT NULL, CONSTRAINT "UQ_62aa5047b5aec92524f24c701d7" UNIQUE ("date", "group"), CONSTRAINT "PK_1ae135254c137011645da7f4045" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_62aa5047b5aec92524f24c701d" ON "__chart_day__per_user_drive" ("date", "group") `, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "group"`, + ); + await queryRunner.query(`ALTER TABLE "__chart__notes" DROP COLUMN "group"`); + await queryRunner.query(`ALTER TABLE "__chart__users" DROP COLUMN "group"`); + await queryRunner.query( + `ALTER TABLE "__chart__network" DROP COLUMN "group"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "group"`, + ); + await queryRunner.query(`ALTER TABLE "__chart__drive" DROP COLUMN "group"`); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD CONSTRAINT "UQ_36cb699c49580d4e6c2e6159f97" UNIQUE ("date")`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ADD CONSTRAINT "UQ_42eb716a37d381cdf566192b2be" UNIQUE ("date")`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ADD CONSTRAINT "UQ_845254b3eaf708ae8a6cac30265" UNIQUE ("date")`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ADD CONSTRAINT "UQ_a1efd3e0048a5f2793a47360dc6" UNIQUE ("date")`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD CONSTRAINT "UQ_0ad37b7ef50f4ddc84363d7ccca" UNIQUE ("date")`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ALTER COLUMN "___local_users" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ALTER COLUMN "___remote_users" DROP DEFAULT`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_39ee857ab2f23493037c6b6631"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "group" SET NOT NULL`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_5048e9daccbbbc6d567bb142d3"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "group" SET NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ADD CONSTRAINT "UQ_13565815f618a1ff53886c5b28a" UNIQUE ("date")`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_229a41ad465f9205f1f5703291"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "group" SET NOT NULL`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_25a97c02003338124b2b75fdbc"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ALTER COLUMN "group" SET NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" DROP DEFAULT`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_b77d4dd9562c3a899d9a286fcd"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "group" SET NOT NULL`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_30bf67687f483ace115c5ca642"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "group" SET NOT NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_36cb699c49580d4e6c2e6159f9" ON "__chart__federation" ("date") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_42eb716a37d381cdf566192b2b" ON "__chart__notes" ("date") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_845254b3eaf708ae8a6cac3026" ON "__chart__users" ("date") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_a1efd3e0048a5f2793a47360dc" ON "__chart__network" ("date") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_0ad37b7ef50f4ddc84363d7ccc" ON "__chart__active_users" ("date") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_13565815f618a1ff53886c5b28" ON "__chart__drive" ("date") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ADD CONSTRAINT "UQ_39ee857ab2f23493037c6b66311" UNIQUE ("date", "group")`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ADD CONSTRAINT "UQ_5048e9daccbbbc6d567bb142d34" UNIQUE ("date", "group")`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" ADD CONSTRAINT "UQ_229a41ad465f9205f1f57032910" UNIQUE ("date", "group")`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ADD CONSTRAINT "UQ_25a97c02003338124b2b75fdbc8" UNIQUE ("date", "group")`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ADD CONSTRAINT "UQ_b77d4dd9562c3a899d9a286fcd7" UNIQUE ("date", "group")`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ADD CONSTRAINT "UQ_30bf67687f483ace115c5ca6429" UNIQUE ("date", "group")`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" DROP CONSTRAINT "UQ_30bf67687f483ace115c5ca6429"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" DROP CONSTRAINT "UQ_b77d4dd9562c3a899d9a286fcd7"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" DROP CONSTRAINT "UQ_25a97c02003338124b2b75fdbc8"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" DROP CONSTRAINT "UQ_229a41ad465f9205f1f57032910"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" DROP CONSTRAINT "UQ_5048e9daccbbbc6d567bb142d34"`); - await queryRunner.query(`ALTER TABLE "__chart__instance" DROP CONSTRAINT "UQ_39ee857ab2f23493037c6b66311"`); - await queryRunner.query(`DROP INDEX "public"."IDX_30bf67687f483ace115c5ca642"`); - await queryRunner.query(`DROP INDEX "public"."IDX_b77d4dd9562c3a899d9a286fcd"`); - await queryRunner.query(`DROP INDEX "public"."IDX_25a97c02003338124b2b75fdbc"`); - await queryRunner.query(`DROP INDEX "public"."IDX_229a41ad465f9205f1f5703291"`); - await queryRunner.query(`DROP INDEX "public"."IDX_13565815f618a1ff53886c5b28"`); - await queryRunner.query(`DROP INDEX "public"."IDX_5048e9daccbbbc6d567bb142d3"`); - await queryRunner.query(`DROP INDEX "public"."IDX_39ee857ab2f23493037c6b6631"`); - await queryRunner.query(`DROP INDEX "public"."IDX_0ad37b7ef50f4ddc84363d7ccc"`); - await queryRunner.query(`DROP INDEX "public"."IDX_a1efd3e0048a5f2793a47360dc"`); - await queryRunner.query(`DROP INDEX "public"."IDX_845254b3eaf708ae8a6cac3026"`); - await queryRunner.query(`DROP INDEX "public"."IDX_42eb716a37d381cdf566192b2b"`); - await queryRunner.query(`DROP INDEX "public"."IDX_36cb699c49580d4e6c2e6159f9"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "group" DROP NOT NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "group" DROP NOT NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" SET DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" SET DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ALTER COLUMN "group" DROP NOT NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "group" DROP NOT NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `); - await queryRunner.query(`ALTER TABLE "__chart__drive" DROP CONSTRAINT "UQ_13565815f618a1ff53886c5b28a"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "group" DROP NOT NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "group" DROP NOT NULL`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ALTER COLUMN "___remote_users" SET DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ALTER COLUMN "___local_users" SET DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP CONSTRAINT "UQ_0ad37b7ef50f4ddc84363d7ccca"`); - await queryRunner.query(`ALTER TABLE "__chart__network" DROP CONSTRAINT "UQ_a1efd3e0048a5f2793a47360dc6"`); - await queryRunner.query(`ALTER TABLE "__chart__users" DROP CONSTRAINT "UQ_845254b3eaf708ae8a6cac30265"`); - await queryRunner.query(`ALTER TABLE "__chart__notes" DROP CONSTRAINT "UQ_42eb716a37d381cdf566192b2be"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP CONSTRAINT "UQ_36cb699c49580d4e6c2e6159f97"`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ADD "group" character varying(128)`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "group" character varying(128)`); - await queryRunner.query(`ALTER TABLE "__chart__network" ADD "group" character varying(128)`); - await queryRunner.query(`ALTER TABLE "__chart__users" ADD "group" character varying(128)`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ADD "group" character varying(128)`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "group" character varying(128)`); - await queryRunner.query(`DROP INDEX "public"."IDX_62aa5047b5aec92524f24c701d"`); - await queryRunner.query(`DROP TABLE "__chart_day__per_user_drive"`); - await queryRunner.query(`DROP INDEX "public"."IDX_e4849a3231f38281280ea4c0ee"`); - await queryRunner.query(`DROP TABLE "__chart_day__per_user_following"`); - await queryRunner.query(`DROP INDEX "public"."IDX_8f589cf056ff51f09d6096f645"`); - await queryRunner.query(`DROP TABLE "__chart_day__hashtag"`); - await queryRunner.query(`DROP INDEX "public"."IDX_d54b653660d808b118e36c184c"`); - await queryRunner.query(`DROP TABLE "__chart_day__per_user_reaction"`); - await queryRunner.query(`DROP INDEX "public"."IDX_0b60ebb3aa0065f10b0616c117"`); - await queryRunner.query(`DROP TABLE "__chart_day__drive"`); - await queryRunner.query(`DROP INDEX "public"."IDX_c5545d4b31cdc684034e33b81c"`); - await queryRunner.query(`DROP TABLE "__chart_day__per_user_notes"`); - await queryRunner.query(`DROP INDEX "public"."IDX_fea7c0278325a1a2492f2d6acb"`); - await queryRunner.query(`DROP TABLE "__chart_day__instance"`); - await queryRunner.query(`DROP INDEX "public"."IDX_d5954f3df5e5e3bdfc3c03f390"`); - await queryRunner.query(`DROP TABLE "__chart_day__active_users"`); - await queryRunner.query(`DROP INDEX "public"."IDX_8bfa548c2b31f9e07db113773e"`); - await queryRunner.query(`DROP TABLE "__chart_day__network"`); - await queryRunner.query(`DROP INDEX "public"."IDX_cad6e07c20037f31cdba8a350c"`); - await queryRunner.query(`DROP TABLE "__chart_day__users"`); - await queryRunner.query(`DROP INDEX "public"."IDX_1a527b423ad0858a1af5a056d4"`); - await queryRunner.query(`DROP TABLE "__chart_day__notes"`); - await queryRunner.query(`DROP INDEX "public"."IDX_617a8fe225a6e701d89e02d2c7"`); - await queryRunner.query(`DROP TABLE "__chart_day__federation"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a9a806d466b314f253a1a611c4" ON "__chart__per_user_drive" ("date") WHERE ("group" IS NULL)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_dabbb38a51ab86ee3cab291326" ON "__chart__per_user_following" ("date") WHERE ("group" IS NULL)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_53a3604b939e2b479eb2cfaac8" ON "__chart__hashtag" ("date") WHERE ("group" IS NULL)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_3b7697a96f522d0478972e6d6f" ON "__chart__per_user_reaction" ("date") WHERE ("group" IS NULL)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_ceab80a6729f8e2e6f5b8a1a3d" ON "__chart__drive" ("date") WHERE ("group" IS NULL)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_3313d7288855ec105b5bbf6c21" ON "__chart__drive" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_583a157ed0cf0ed1b5ec2a833f" ON "__chart__per_user_notes" ("date") WHERE ("group" IS NULL)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_8111b817b9818c04d7eb8475b1" ON "__chart__instance" ("date") WHERE ("group" IS NULL)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_60c5c6e7e538c09aa274ecd1cf" ON "__chart__active_users" ("date") WHERE ("group" IS NULL)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_9a3ed15a30ab7e3a37702e6e08" ON "__chart__active_users" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_2082327b2699ce924fa654afc5" ON "__chart__network" ("date") WHERE ("group" IS NULL)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0a905b992fecd2b5c3fb98759e" ON "__chart__network" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_66feba81e1795d176d06c0b1e6" ON "__chart__users" ("date") WHERE ("group" IS NULL)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_337e9599f278bd7537fe30876f" ON "__chart__users" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_e60c358aaced5aab8900a4af31" ON "__chart__notes" ("date") WHERE ("group" IS NULL)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_f09d543e3acb16c5976bdb31fa" ON "__chart__notes" ("date", "group") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_eddfed8fb40305a04c6f941050" ON "__chart__federation" ("date") WHERE ("group" IS NULL)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_dd907becf76104e4b656659e6b" ON "__chart__federation" ("date", "group") `); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" DROP CONSTRAINT "UQ_30bf67687f483ace115c5ca6429"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" DROP CONSTRAINT "UQ_b77d4dd9562c3a899d9a286fcd7"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" DROP CONSTRAINT "UQ_25a97c02003338124b2b75fdbc8"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" DROP CONSTRAINT "UQ_229a41ad465f9205f1f57032910"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" DROP CONSTRAINT "UQ_5048e9daccbbbc6d567bb142d34"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" DROP CONSTRAINT "UQ_39ee857ab2f23493037c6b66311"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_30bf67687f483ace115c5ca642"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_b77d4dd9562c3a899d9a286fcd"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_25a97c02003338124b2b75fdbc"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_229a41ad465f9205f1f5703291"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_13565815f618a1ff53886c5b28"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_5048e9daccbbbc6d567bb142d3"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_39ee857ab2f23493037c6b6631"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_0ad37b7ef50f4ddc84363d7ccc"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_a1efd3e0048a5f2793a47360dc"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_845254b3eaf708ae8a6cac3026"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_42eb716a37d381cdf566192b2b"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_36cb699c49580d4e6c2e6159f9"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "group" DROP NOT NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_30bf67687f483ace115c5ca642" ON "__chart__per_user_drive" ("date", "group") `, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "group" DROP NOT NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_b77d4dd9562c3a899d9a286fcd" ON "__chart__per_user_following" ("date", "group") `, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" SET DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" SET DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ALTER COLUMN "group" DROP NOT NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_25a97c02003338124b2b75fdbc" ON "__chart__hashtag" ("date", "group") `, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "group" DROP NOT NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_229a41ad465f9205f1f5703291" ON "__chart__per_user_reaction" ("date", "group") `, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" DROP CONSTRAINT "UQ_13565815f618a1ff53886c5b28a"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "group" DROP NOT NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_5048e9daccbbbc6d567bb142d3" ON "__chart__per_user_notes" ("date", "group") `, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "group" DROP NOT NULL`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_39ee857ab2f23493037c6b6631" ON "__chart__instance" ("date", "group") `, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ALTER COLUMN "___remote_users" SET DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ALTER COLUMN "___local_users" SET DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP CONSTRAINT "UQ_0ad37b7ef50f4ddc84363d7ccca"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" DROP CONSTRAINT "UQ_a1efd3e0048a5f2793a47360dc6"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" DROP CONSTRAINT "UQ_845254b3eaf708ae8a6cac30265"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" DROP CONSTRAINT "UQ_42eb716a37d381cdf566192b2be"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP CONSTRAINT "UQ_36cb699c49580d4e6c2e6159f97"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ADD "group" character varying(128)`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "group" character varying(128)`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ADD "group" character varying(128)`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ADD "group" character varying(128)`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ADD "group" character varying(128)`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "group" character varying(128)`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_62aa5047b5aec92524f24c701d"`, + ); + await queryRunner.query(`DROP TABLE "__chart_day__per_user_drive"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_e4849a3231f38281280ea4c0ee"`, + ); + await queryRunner.query(`DROP TABLE "__chart_day__per_user_following"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_8f589cf056ff51f09d6096f645"`, + ); + await queryRunner.query(`DROP TABLE "__chart_day__hashtag"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_d54b653660d808b118e36c184c"`, + ); + await queryRunner.query(`DROP TABLE "__chart_day__per_user_reaction"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_0b60ebb3aa0065f10b0616c117"`, + ); + await queryRunner.query(`DROP TABLE "__chart_day__drive"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_c5545d4b31cdc684034e33b81c"`, + ); + await queryRunner.query(`DROP TABLE "__chart_day__per_user_notes"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_fea7c0278325a1a2492f2d6acb"`, + ); + await queryRunner.query(`DROP TABLE "__chart_day__instance"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_d5954f3df5e5e3bdfc3c03f390"`, + ); + await queryRunner.query(`DROP TABLE "__chart_day__active_users"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_8bfa548c2b31f9e07db113773e"`, + ); + await queryRunner.query(`DROP TABLE "__chart_day__network"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_cad6e07c20037f31cdba8a350c"`, + ); + await queryRunner.query(`DROP TABLE "__chart_day__users"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_1a527b423ad0858a1af5a056d4"`, + ); + await queryRunner.query(`DROP TABLE "__chart_day__notes"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_617a8fe225a6e701d89e02d2c7"`, + ); + await queryRunner.query(`DROP TABLE "__chart_day__federation"`); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_a9a806d466b314f253a1a611c4" ON "__chart__per_user_drive" ("date") WHERE ("group" IS NULL)`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_dabbb38a51ab86ee3cab291326" ON "__chart__per_user_following" ("date") WHERE ("group" IS NULL)`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_53a3604b939e2b479eb2cfaac8" ON "__chart__hashtag" ("date") WHERE ("group" IS NULL)`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_3b7697a96f522d0478972e6d6f" ON "__chart__per_user_reaction" ("date") WHERE ("group" IS NULL)`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_ceab80a6729f8e2e6f5b8a1a3d" ON "__chart__drive" ("date") WHERE ("group" IS NULL)`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_3313d7288855ec105b5bbf6c21" ON "__chart__drive" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_583a157ed0cf0ed1b5ec2a833f" ON "__chart__per_user_notes" ("date") WHERE ("group" IS NULL)`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_8111b817b9818c04d7eb8475b1" ON "__chart__instance" ("date") WHERE ("group" IS NULL)`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_60c5c6e7e538c09aa274ecd1cf" ON "__chart__active_users" ("date") WHERE ("group" IS NULL)`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_9a3ed15a30ab7e3a37702e6e08" ON "__chart__active_users" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_2082327b2699ce924fa654afc5" ON "__chart__network" ("date") WHERE ("group" IS NULL)`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_0a905b992fecd2b5c3fb98759e" ON "__chart__network" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_66feba81e1795d176d06c0b1e6" ON "__chart__users" ("date") WHERE ("group" IS NULL)`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_337e9599f278bd7537fe30876f" ON "__chart__users" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_e60c358aaced5aab8900a4af31" ON "__chart__notes" ("date") WHERE ("group" IS NULL)`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_f09d543e3acb16c5976bdb31fa" ON "__chart__notes" ("date", "group") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_eddfed8fb40305a04c6f941050" ON "__chart__federation" ("date") WHERE ("group" IS NULL)`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_dd907becf76104e4b656659e6b" ON "__chart__federation" ("date", "group") `, + ); + } } diff --git a/packages/backend/migration/1642611822809-emoji-url.js b/packages/backend/migration/1642611822809-emoji-url.js index d38f8cc08c..e1852c0025 100644 --- a/packages/backend/migration/1642611822809-emoji-url.js +++ b/packages/backend/migration/1642611822809-emoji-url.js @@ -1,15 +1,19 @@ - - export class emojiUrl1642611822809 { - name = 'emojiUrl1642611822809' + name = "emojiUrl1642611822809"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "emoji" RENAME COLUMN "url" TO "originalUrl"`); - await queryRunner.query(`ALTER TABLE "emoji" ADD "publicUrl" character varying(512) NOT NULL DEFAULT ''`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "emoji" RENAME COLUMN "url" TO "originalUrl"`, + ); + await queryRunner.query( + `ALTER TABLE "emoji" ADD "publicUrl" character varying(512) NOT NULL DEFAULT ''`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "publicUrl"`); - await queryRunner.query(`ALTER TABLE "emoji" RENAME COLUMN "originalUrl" TO "url"`); - } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "publicUrl"`); + await queryRunner.query( + `ALTER TABLE "emoji" RENAME COLUMN "originalUrl" TO "url"`, + ); + } } diff --git a/packages/backend/migration/1642613870898-drive-file-webpublic-type.js b/packages/backend/migration/1642613870898-drive-file-webpublic-type.js index 15434f7d0c..df5ab7899b 100644 --- a/packages/backend/migration/1642613870898-drive-file-webpublic-type.js +++ b/packages/backend/migration/1642613870898-drive-file-webpublic-type.js @@ -1,13 +1,15 @@ - - export class driveFileWebpublicType1642613870898 { - name = 'driveFileWebpublicType1642613870898' + name = "driveFileWebpublicType1642613870898"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "drive_file" ADD "webpublicType" character varying(128)`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "drive_file" ADD "webpublicType" character varying(128)`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "webpublicType"`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "drive_file" DROP COLUMN "webpublicType"`, + ); + } } diff --git a/packages/backend/migration/1643963705770-chart-v4.js b/packages/backend/migration/1643963705770-chart-v4.js index 8b320c2b41..1e7233cc72 100644 --- a/packages/backend/migration/1643963705770-chart-v4.js +++ b/packages/backend/migration/1643963705770-chart-v4.js @@ -1,63 +1,165 @@ - - export class chartV41643963705770 { - name = 'chartV41643963705770' + name = "chartV41643963705770"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__instance" DROP COLUMN "___drive_totalUsage"`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" DROP COLUMN "___drive_totalUsage"`); - await queryRunner.query(`ALTER TABLE "__chart__drive" DROP COLUMN "___local_totalCount"`); - await queryRunner.query(`ALTER TABLE "__chart__drive" DROP COLUMN "___local_totalSize"`); - await queryRunner.query(`ALTER TABLE "__chart__drive" DROP COLUMN "___remote_totalCount"`); - await queryRunner.query(`ALTER TABLE "__chart__drive" DROP COLUMN "___remote_totalSize"`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" DROP COLUMN "___local_totalCount"`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" DROP COLUMN "___local_totalSize"`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" DROP COLUMN "___remote_totalCount"`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" DROP COLUMN "___remote_totalSize"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___local_users" bigint NOT NULL DEFAULT 0`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___remote_users" bigint NOT NULL DEFAULT 0`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___local_users" bigint NOT NULL DEFAULT 0`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___remote_users" bigint NOT NULL DEFAULT 0`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" DROP COLUMN "___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ADD "___local_users" bigint NOT NULL DEFAULT 0`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" DROP COLUMN "___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ADD "___remote_users" bigint NOT NULL DEFAULT 0`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" DROP COLUMN "___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" ADD "___local_users" bigint NOT NULL DEFAULT 0`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" DROP COLUMN "___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" ADD "___remote_users" bigint NOT NULL DEFAULT 0`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__instance" DROP COLUMN "___drive_totalUsage"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" DROP COLUMN "___drive_totalUsage"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" DROP COLUMN "___local_totalCount"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" DROP COLUMN "___local_totalSize"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" DROP COLUMN "___remote_totalCount"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" DROP COLUMN "___remote_totalSize"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" DROP COLUMN "___local_totalCount"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" DROP COLUMN "___local_totalSize"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" DROP COLUMN "___remote_totalCount"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" DROP COLUMN "___remote_totalSize"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___local_users" bigint NOT NULL DEFAULT 0`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___remote_users" bigint NOT NULL DEFAULT 0`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___local_users" bigint NOT NULL DEFAULT 0`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___remote_users" bigint NOT NULL DEFAULT 0`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" DROP COLUMN "___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ADD "___local_users" bigint NOT NULL DEFAULT 0`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" DROP COLUMN "___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ADD "___remote_users" bigint NOT NULL DEFAULT 0`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" ADD "___local_users" bigint NOT NULL DEFAULT 0`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" ADD "___remote_users" bigint NOT NULL DEFAULT 0`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" DROP COLUMN "___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" ADD "___remote_users" character varying array NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" DROP COLUMN "___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" ADD "___local_users" character varying array NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" DROP COLUMN "___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ADD "___remote_users" character varying array NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" DROP COLUMN "___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ADD "___local_users" character varying array NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___remote_users" character varying array NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___local_users" character varying array NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___remote_users" character varying array NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___local_users" character varying array NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ADD "___remote_totalSize" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ADD "___remote_totalCount" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ADD "___local_totalSize" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ADD "___local_totalCount" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ADD "___remote_totalSize" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ADD "___remote_totalCount" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ADD "___local_totalSize" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ADD "___local_totalCount" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ADD "___drive_totalUsage" bigint NOT NULL`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ADD "___drive_totalUsage" bigint NOT NULL`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" ADD "___remote_users" character varying array NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" ADD "___local_users" character varying array NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" DROP COLUMN "___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ADD "___remote_users" character varying array NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" DROP COLUMN "___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ADD "___local_users" character varying array NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___remote_users" character varying array NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___local_users" character varying array NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___remote_users" character varying array NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___local_users" character varying array NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ADD "___remote_totalSize" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ADD "___remote_totalCount" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ADD "___local_totalSize" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ADD "___local_totalCount" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ADD "___remote_totalSize" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ADD "___remote_totalCount" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ADD "___local_totalSize" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ADD "___local_totalCount" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ADD "___drive_totalUsage" bigint NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ADD "___drive_totalUsage" bigint NOT NULL`, + ); + } } diff --git a/packages/backend/migration/1643966656277-chart-v5.js b/packages/backend/migration/1643966656277-chart-v5.js index df84002f78..826f28ee34 100644 --- a/packages/backend/migration/1643966656277-chart-v5.js +++ b/packages/backend/migration/1643966656277-chart-v5.js @@ -1,27 +1,57 @@ - - export class chartV51643966656277 { - name = 'chartV51643966656277' + name = "chartV51643966656277"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" DROP COLUMN "unique_temp___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" DROP COLUMN "unique_temp___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" DROP COLUMN "unique_temp___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" DROP COLUMN "unique_temp___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___local_users"`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "unique_temp___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" DROP COLUMN "unique_temp___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" DROP COLUMN "unique_temp___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" DROP COLUMN "unique_temp___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___local_users"`, + ); + } } diff --git a/packages/backend/migration/1643967331284-chart-v6.js b/packages/backend/migration/1643967331284-chart-v6.js index 119198f4a5..9dfbf24bec 100644 --- a/packages/backend/migration/1643967331284-chart-v6.js +++ b/packages/backend/migration/1643967331284-chart-v6.js @@ -1,343 +1,1005 @@ - - export class chartV61643967331284 { - name = 'chartV61643967331284' + name = "chartV61643967331284"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_normal" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_reply" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_renote" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_normal" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_reply" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_renote" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_normal" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_reply" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_renote" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_normal" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_reply" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_renote" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___local_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___local_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___local_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___remote_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___remote_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___remote_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___incomingRequests" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingRequests" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___totalTime" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___incomingBytes" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingBytes" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingRequests" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingRequests" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___totalTime" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingBytes" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingBytes" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_normal" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_reply" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_renote" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___users_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___users_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___users_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___following_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___following_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___following_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_totalFiles" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incFiles" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decFiles" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incUsage" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decUsage" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_normal" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_reply" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_renote" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_totalFiles" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incFiles" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decFiles" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incUsage" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decUsage" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_normal" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_reply" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_renote" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_normal" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_reply" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_renote" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incSize" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decSize" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incSize" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decSize" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incSize" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decSize" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incSize" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decSize" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___local_count" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___remote_count" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___local_count" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___remote_count" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_total" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_inc" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_dec" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalSize" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incSize" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decSize" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalSize" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incSize" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decCount" SET DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decSize" SET DEFAULT '0'`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_normal" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_reply" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_renote" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_normal" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_reply" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_renote" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_normal" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_reply" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_renote" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_normal" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_reply" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_renote" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___local_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___local_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___local_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingRequests" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingRequests" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___totalTime" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingBytes" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingBytes" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingRequests" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingRequests" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___totalTime" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingBytes" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingBytes" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_normal" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_reply" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_renote" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_totalFiles" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incFiles" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decFiles" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incUsage" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decUsage" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_normal" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_reply" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_renote" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_totalFiles" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incFiles" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decFiles" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incUsage" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decUsage" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_normal" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_reply" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_renote" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_normal" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_reply" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_renote" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incSize" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decSize" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incSize" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decSize" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incSize" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decSize" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incSize" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decSize" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___local_count" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___remote_count" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___local_count" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___remote_count" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_total" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_inc" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_dec" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalSize" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incSize" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decSize" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalSize" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incSize" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decCount" SET DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decSize" SET DEFAULT '0'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___remote_count" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___local_count" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___remote_count" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___local_count" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incSize" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incCount" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_renote" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_reply" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_normal" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_renote" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_reply" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_normal" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decUsage" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incUsage" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decFiles" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incFiles" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_totalFiles" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_renote" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_reply" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_normal" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decUsage" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incUsage" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decFiles" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incFiles" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_totalFiles" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___following_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___following_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___following_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___users_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___users_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___users_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_renote" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_reply" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_normal" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingBytes" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingBytes" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___totalTime" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingRequests" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingRequests" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingBytes" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___incomingBytes" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___totalTime" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingRequests" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___incomingRequests" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___remote_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___remote_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___remote_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___local_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___local_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___local_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_renote" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_reply" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_normal" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_renote" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_reply" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_normal" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_renote" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_reply" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_normal" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_renote" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_reply" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_normal" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_total" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_dec" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_inc" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" DROP DEFAULT`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___remote_count" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___local_count" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___remote_count" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___local_count" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incSize" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incCount" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_renote" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_reply" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_normal" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_renote" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_reply" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_normal" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decUsage" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incUsage" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decFiles" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incFiles" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_totalFiles" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_renote" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_reply" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_normal" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decUsage" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incUsage" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decFiles" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incFiles" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_totalFiles" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_renote" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_reply" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_normal" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingBytes" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingBytes" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___totalTime" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingRequests" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingRequests" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingBytes" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingBytes" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___totalTime" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingRequests" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingRequests" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___local_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___local_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___local_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_renote" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_reply" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_normal" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_renote" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_reply" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_normal" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_renote" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_reply" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_normal" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_renote" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_reply" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_normal" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_total" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_dec" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_inc" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" DROP DEFAULT`, + ); + } } diff --git a/packages/backend/migration/1644010796173-convert-hard-mutes.js b/packages/backend/migration/1644010796173-convert-hard-mutes.js index 207a759b8e..39c5b080fd 100644 --- a/packages/backend/migration/1644010796173-convert-hard-mutes.js +++ b/packages/backend/migration/1644010796173-convert-hard-mutes.js @@ -1,65 +1,70 @@ -import RE2 from 're2'; - +import RE2 from "re2"; export class convertHardMutes1644010796173 { - name = 'convertHardMutes1644010796173' + name = "convertHardMutes1644010796173"; - async up(queryRunner) { - let entries = await queryRunner.query(`SELECT "userId", "mutedWords" FROM "user_profile" WHERE "userHost" IS NULL`); - for(let i = 0; i < entries.length; i++) { - let words = entries[i].mutedWords - .map(line => { - if (typeof line === 'string') return []; - const regexp = line.join(" ").match(/^\/(.+)\/(.*)$/); - if (regexp) { - // convert regexp's - try { - new RE2(regexp[1], regexp[2]); - return `/${regexp[1]}/${regexp[2]}`; - } catch (err) { - // invalid regex, ignore it - return []; - } - } else { - // remove empty segments - return line.filter(x => x !== ''); - } - }) - // remove empty lines - .filter(x => !(Array.isArray(x) && x.length === 0)); + async up(queryRunner) { + let entries = await queryRunner.query( + `SELECT "userId", "mutedWords" FROM "user_profile" WHERE "userHost" IS NULL`, + ); + for (let i = 0; i < entries.length; i++) { + let words = entries[i].mutedWords + .map((line) => { + if (typeof line === "string") return []; + const regexp = line.join(" ").match(/^\/(.+)\/(.*)$/); + if (regexp) { + // convert regexp's + try { + new RE2(regexp[1], regexp[2]); + return `/${regexp[1]}/${regexp[2]}`; + } catch (err) { + // invalid regex, ignore it + return []; + } + } else { + // remove empty segments + return line.filter((x) => x !== ""); + } + }) + // remove empty lines + .filter((x) => !(Array.isArray(x) && x.length === 0)); - await queryRunner.connection.createQueryBuilder() - .update('user_profile') - .set({ - mutedWords: words - }) - .where('userId = :id', { id: entries[i].userId }) - .execute(); - } - } + await queryRunner.connection + .createQueryBuilder() + .update("user_profile") + .set({ + mutedWords: words, + }) + .where("userId = :id", { id: entries[i].userId }) + .execute(); + } + } - async down(queryRunner) { - let entries = await queryRunner.query(`SELECT "userId", "mutedWords" FROM "user_profile"`); - for(let i = 0; i < entries.length; i++) { - let words = entries[i].mutedWords - .map(line => { - if (Array.isArray(line)) { - return line; - } else { - // do not split regex at spaces again - return [line]; - } - }) - // remove empty lines - .filter(x => !(Array.isArray(x) && x.length === 0)); + async down(queryRunner) { + let entries = await queryRunner.query( + `SELECT "userId", "mutedWords" FROM "user_profile"`, + ); + for (let i = 0; i < entries.length; i++) { + let words = entries[i].mutedWords + .map((line) => { + if (Array.isArray(line)) { + return line; + } else { + // do not split regex at spaces again + return [line]; + } + }) + // remove empty lines + .filter((x) => !(Array.isArray(x) && x.length === 0)); - await queryRunner.connection.createQueryBuilder() - .update('user_profile') - .set({ - mutedWords: words - }) - .where('userId = :id', { id: entries[i].userId }) - .execute(); - } - } + await queryRunner.connection + .createQueryBuilder() + .update("user_profile") + .set({ + mutedWords: words, + }) + .where("userId = :id", { id: entries[i].userId }) + .execute(); + } + } } diff --git a/packages/backend/migration/1644058404077-chart-v7.js b/packages/backend/migration/1644058404077-chart-v7.js index f05ad003db..ab48c9ab38 100644 --- a/packages/backend/migration/1644058404077-chart-v7.js +++ b/packages/backend/migration/1644058404077-chart-v7.js @@ -1,501 +1,1470 @@ - - export class chartV71644058404077 { - name = 'chartV71644058404077' + name = "chartV71644058404077"; async up(queryRunner) { - await queryRunner.query(`UPDATE "__chart__federation" SET "___instance_total"=2147483647 WHERE "___instance_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__federation" SET "___instance_inc"=32767 WHERE "___instance_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart__federation" SET "___instance_dec"=32767 WHERE "___instance_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__federation" SET "___instance_total"=2147483647 WHERE "___instance_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__federation" SET "___instance_inc"=32767 WHERE "___instance_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__federation" SET "___instance_dec"=32767 WHERE "___instance_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart__notes" SET "___local_total"=2147483647 WHERE "___local_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__notes" SET "___local_inc"=2147483647 WHERE "___local_inc" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__notes" SET "___local_dec"=2147483647 WHERE "___local_dec" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__notes" SET "___local_diffs_normal"=2147483647 WHERE "___local_diffs_normal" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__notes" SET "___local_diffs_reply"=2147483647 WHERE "___local_diffs_reply" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__notes" SET "___local_diffs_renote"=2147483647 WHERE "___local_diffs_renote" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__notes" SET "___remote_total"=2147483647 WHERE "___remote_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__notes" SET "___remote_inc"=2147483647 WHERE "___remote_inc" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__notes" SET "___remote_dec"=2147483647 WHERE "___remote_dec" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__notes" SET "___remote_diffs_normal"=2147483647 WHERE "___remote_diffs_normal" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__notes" SET "___remote_diffs_reply"=2147483647 WHERE "___remote_diffs_reply" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__notes" SET "___remote_diffs_renote"=2147483647 WHERE "___remote_diffs_renote" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__notes" SET "___local_total"=2147483647 WHERE "___local_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__notes" SET "___local_inc"=2147483647 WHERE "___local_inc" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__notes" SET "___local_dec"=2147483647 WHERE "___local_dec" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__notes" SET "___local_diffs_normal"=2147483647 WHERE "___local_diffs_normal" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__notes" SET "___local_diffs_reply"=2147483647 WHERE "___local_diffs_reply" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__notes" SET "___local_diffs_renote"=2147483647 WHERE "___local_diffs_renote" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__notes" SET "___remote_total"=2147483647 WHERE "___remote_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__notes" SET "___remote_inc"=2147483647 WHERE "___remote_inc" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__notes" SET "___remote_dec"=2147483647 WHERE "___remote_dec" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__notes" SET "___remote_diffs_normal"=2147483647 WHERE "___remote_diffs_normal" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__notes" SET "___remote_diffs_reply"=2147483647 WHERE "___remote_diffs_reply" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__notes" SET "___remote_diffs_renote"=2147483647 WHERE "___remote_diffs_renote" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__users" SET "___local_total"=2147483647 WHERE "___local_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__users" SET "___local_inc"=32767 WHERE "___local_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart__users" SET "___local_dec"=32767 WHERE "___local_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart__users" SET "___remote_total"=2147483647 WHERE "___remote_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__users" SET "___remote_inc"=32767 WHERE "___remote_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart__users" SET "___remote_dec"=32767 WHERE "___remote_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__users" SET "___local_total"=2147483647 WHERE "___local_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__users" SET "___local_inc"=32767 WHERE "___local_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__users" SET "___local_dec"=32767 WHERE "___local_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__users" SET "___remote_total"=2147483647 WHERE "___remote_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__users" SET "___remote_inc"=32767 WHERE "___remote_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__users" SET "___remote_dec"=32767 WHERE "___remote_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart__network" SET "___incomingRequests"=2147483647 WHERE "___incomingRequests" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__network" SET "___outgoingRequests"=2147483647 WHERE "___outgoingRequests" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__network" SET "___totalTime"=2147483647 WHERE "___totalTime" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__network" SET "___incomingBytes"=2147483647 WHERE "___incomingBytes" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__network" SET "___outgoingBytes"=2147483647 WHERE "___outgoingBytes" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__network" SET "___incomingRequests"=2147483647 WHERE "___incomingRequests" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__network" SET "___outgoingRequests"=2147483647 WHERE "___outgoingRequests" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__network" SET "___totalTime"=2147483647 WHERE "___totalTime" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__network" SET "___incomingBytes"=2147483647 WHERE "___incomingBytes" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__network" SET "___outgoingBytes"=2147483647 WHERE "___outgoingBytes" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___requests_failed"=32767 WHERE "___requests_failed" > 32767`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___requests_succeeded"=32767 WHERE "___requests_succeeded" > 32767`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___requests_received"=32767 WHERE "___requests_received" > 32767`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___notes_total"=2147483647 WHERE "___notes_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___notes_inc"=2147483647 WHERE "___notes_inc" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___notes_dec"=2147483647 WHERE "___notes_dec" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___notes_diffs_normal"=2147483647 WHERE "___notes_diffs_normal" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___notes_diffs_reply"=2147483647 WHERE "___notes_diffs_reply" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___notes_diffs_renote"=2147483647 WHERE "___notes_diffs_renote" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___users_total"=2147483647 WHERE "___users_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___users_inc"=32767 WHERE "___users_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___users_dec"=32767 WHERE "___users_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___following_total"=2147483647 WHERE "___following_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___following_inc"=32767 WHERE "___following_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___following_dec"=32767 WHERE "___following_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___followers_total"=2147483647 WHERE "___followers_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___followers_inc"=32767 WHERE "___followers_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___followers_dec"=32767 WHERE "___followers_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___drive_totalFiles"=2147483647 WHERE "___drive_totalFiles" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___drive_incFiles"=2147483647 WHERE "___drive_incFiles" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___drive_decFiles"=2147483647 WHERE "___drive_decFiles" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___drive_incUsage"=2147483647 WHERE "___drive_incUsage" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__instance" SET "___drive_decUsage"=2147483647 WHERE "___drive_decUsage" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___requests_failed"=32767 WHERE "___requests_failed" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___requests_succeeded"=32767 WHERE "___requests_succeeded" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___requests_received"=32767 WHERE "___requests_received" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___notes_total"=2147483647 WHERE "___notes_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___notes_inc"=2147483647 WHERE "___notes_inc" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___notes_dec"=2147483647 WHERE "___notes_dec" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___notes_diffs_normal"=2147483647 WHERE "___notes_diffs_normal" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___notes_diffs_reply"=2147483647 WHERE "___notes_diffs_reply" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___notes_diffs_renote"=2147483647 WHERE "___notes_diffs_renote" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___users_total"=2147483647 WHERE "___users_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___users_inc"=32767 WHERE "___users_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___users_dec"=32767 WHERE "___users_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___following_total"=2147483647 WHERE "___following_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___following_inc"=32767 WHERE "___following_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___following_dec"=32767 WHERE "___following_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___followers_total"=2147483647 WHERE "___followers_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___followers_inc"=32767 WHERE "___followers_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___followers_dec"=32767 WHERE "___followers_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___drive_totalFiles"=2147483647 WHERE "___drive_totalFiles" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___drive_incFiles"=2147483647 WHERE "___drive_incFiles" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___drive_decFiles"=2147483647 WHERE "___drive_decFiles" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___drive_incUsage"=2147483647 WHERE "___drive_incUsage" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__instance" SET "___drive_decUsage"=2147483647 WHERE "___drive_decUsage" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__per_user_notes" SET "___total"=2147483647 WHERE "___total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__per_user_notes" SET "___inc"=32767 WHERE "___inc" > 32767`); - await queryRunner.query(`UPDATE "__chart__per_user_notes" SET "___dec"=32767 WHERE "___dec" > 32767`); - await queryRunner.query(`UPDATE "__chart__per_user_notes" SET "___diffs_normal"=32767 WHERE "___diffs_normal" > 32767`); - await queryRunner.query(`UPDATE "__chart__per_user_notes" SET "___diffs_reply"=32767 WHERE "___diffs_reply" > 32767`); - await queryRunner.query(`UPDATE "__chart__per_user_notes" SET "___diffs_renote"=32767 WHERE "___diffs_renote" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_notes" SET "___total"=2147483647 WHERE "___total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__per_user_notes" SET "___inc"=32767 WHERE "___inc" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_notes" SET "___dec"=32767 WHERE "___dec" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_notes" SET "___diffs_normal"=32767 WHERE "___diffs_normal" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_notes" SET "___diffs_reply"=32767 WHERE "___diffs_reply" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_notes" SET "___diffs_renote"=32767 WHERE "___diffs_renote" > 32767`); - await queryRunner.query(`UPDATE "__chart__drive" SET "___local_incCount"=2147483647 WHERE "___local_incCount" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__drive" SET "___local_incSize"=2147483647 WHERE "___local_incSize" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__drive" SET "___local_decCount"=2147483647 WHERE "___local_decCount" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__drive" SET "___local_decSize"=2147483647 WHERE "___local_decSize" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__drive" SET "___remote_incCount"=2147483647 WHERE "___remote_incCount" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__drive" SET "___remote_incSize"=2147483647 WHERE "___remote_incSize" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__drive" SET "___remote_decCount"=2147483647 WHERE "___remote_decCount" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__drive" SET "___remote_decSize"=2147483647 WHERE "___remote_decSize" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__drive" SET "___local_incCount"=2147483647 WHERE "___local_incCount" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__drive" SET "___local_incSize"=2147483647 WHERE "___local_incSize" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__drive" SET "___local_decCount"=2147483647 WHERE "___local_decCount" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__drive" SET "___local_decSize"=2147483647 WHERE "___local_decSize" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__drive" SET "___remote_incCount"=2147483647 WHERE "___remote_incCount" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__drive" SET "___remote_incSize"=2147483647 WHERE "___remote_incSize" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__drive" SET "___remote_decCount"=2147483647 WHERE "___remote_decCount" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__drive" SET "___remote_decSize"=2147483647 WHERE "___remote_decSize" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__per_user_reaction" SET "___local_count"=32767 WHERE "___local_count" > 32767`); - await queryRunner.query(`UPDATE "__chart__per_user_reaction" SET "___remote_count"=32767 WHERE "___remote_count" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_reaction" SET "___local_count"=32767 WHERE "___local_count" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_reaction" SET "___remote_count"=32767 WHERE "___remote_count" > 32767`); - await queryRunner.query(`UPDATE "__chart__per_user_following" SET "___local_followings_total"=2147483647 WHERE "___local_followings_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__per_user_following" SET "___local_followings_inc"=32767 WHERE "___local_followings_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart__per_user_following" SET "___local_followings_dec"=32767 WHERE "___local_followings_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart__per_user_following" SET "___local_followers_total"=2147483647 WHERE "___local_followers_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__per_user_following" SET "___local_followers_inc"=32767 WHERE "___local_followers_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart__per_user_following" SET "___local_followers_dec"=32767 WHERE "___local_followers_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart__per_user_following" SET "___remote_followings_total"=2147483647 WHERE "___remote_followings_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__per_user_following" SET "___remote_followings_inc"=32767 WHERE "___remote_followings_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart__per_user_following" SET "___remote_followings_dec"=32767 WHERE "___remote_followings_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart__per_user_following" SET "___remote_followers_total"=2147483647 WHERE "___remote_followers_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__per_user_following" SET "___remote_followers_inc"=32767 WHERE "___remote_followers_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart__per_user_following" SET "___remote_followers_dec"=32767 WHERE "___remote_followers_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_following" SET "___local_followings_total"=2147483647 WHERE "___local_followings_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__per_user_following" SET "___local_followings_inc"=32767 WHERE "___local_followings_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_following" SET "___local_followings_dec"=32767 WHERE "___local_followings_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_following" SET "___local_followers_total"=2147483647 WHERE "___local_followers_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__per_user_following" SET "___local_followers_inc"=32767 WHERE "___local_followers_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_following" SET "___local_followers_dec"=32767 WHERE "___local_followers_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_following" SET "___remote_followings_total"=2147483647 WHERE "___remote_followings_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__per_user_following" SET "___remote_followings_inc"=32767 WHERE "___remote_followings_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_following" SET "___remote_followings_dec"=32767 WHERE "___remote_followings_dec" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_following" SET "___remote_followers_total"=2147483647 WHERE "___remote_followers_total" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__per_user_following" SET "___remote_followers_inc"=32767 WHERE "___remote_followers_inc" > 32767`); - await queryRunner.query(`UPDATE "__chart_day__per_user_following" SET "___remote_followers_dec"=32767 WHERE "___remote_followers_dec" > 32767`); + await queryRunner.query( + `UPDATE "__chart__federation" SET "___instance_total"=2147483647 WHERE "___instance_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__federation" SET "___instance_inc"=32767 WHERE "___instance_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__federation" SET "___instance_dec"=32767 WHERE "___instance_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__federation" SET "___instance_total"=2147483647 WHERE "___instance_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__federation" SET "___instance_inc"=32767 WHERE "___instance_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__federation" SET "___instance_dec"=32767 WHERE "___instance_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__notes" SET "___local_total"=2147483647 WHERE "___local_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__notes" SET "___local_inc"=2147483647 WHERE "___local_inc" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__notes" SET "___local_dec"=2147483647 WHERE "___local_dec" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__notes" SET "___local_diffs_normal"=2147483647 WHERE "___local_diffs_normal" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__notes" SET "___local_diffs_reply"=2147483647 WHERE "___local_diffs_reply" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__notes" SET "___local_diffs_renote"=2147483647 WHERE "___local_diffs_renote" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__notes" SET "___remote_total"=2147483647 WHERE "___remote_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__notes" SET "___remote_inc"=2147483647 WHERE "___remote_inc" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__notes" SET "___remote_dec"=2147483647 WHERE "___remote_dec" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__notes" SET "___remote_diffs_normal"=2147483647 WHERE "___remote_diffs_normal" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__notes" SET "___remote_diffs_reply"=2147483647 WHERE "___remote_diffs_reply" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__notes" SET "___remote_diffs_renote"=2147483647 WHERE "___remote_diffs_renote" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__notes" SET "___local_total"=2147483647 WHERE "___local_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__notes" SET "___local_inc"=2147483647 WHERE "___local_inc" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__notes" SET "___local_dec"=2147483647 WHERE "___local_dec" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__notes" SET "___local_diffs_normal"=2147483647 WHERE "___local_diffs_normal" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__notes" SET "___local_diffs_reply"=2147483647 WHERE "___local_diffs_reply" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__notes" SET "___local_diffs_renote"=2147483647 WHERE "___local_diffs_renote" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__notes" SET "___remote_total"=2147483647 WHERE "___remote_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__notes" SET "___remote_inc"=2147483647 WHERE "___remote_inc" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__notes" SET "___remote_dec"=2147483647 WHERE "___remote_dec" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__notes" SET "___remote_diffs_normal"=2147483647 WHERE "___remote_diffs_normal" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__notes" SET "___remote_diffs_reply"=2147483647 WHERE "___remote_diffs_reply" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__notes" SET "___remote_diffs_renote"=2147483647 WHERE "___remote_diffs_renote" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__users" SET "___local_total"=2147483647 WHERE "___local_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__users" SET "___local_inc"=32767 WHERE "___local_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__users" SET "___local_dec"=32767 WHERE "___local_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__users" SET "___remote_total"=2147483647 WHERE "___remote_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__users" SET "___remote_inc"=32767 WHERE "___remote_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__users" SET "___remote_dec"=32767 WHERE "___remote_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__users" SET "___local_total"=2147483647 WHERE "___local_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__users" SET "___local_inc"=32767 WHERE "___local_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__users" SET "___local_dec"=32767 WHERE "___local_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__users" SET "___remote_total"=2147483647 WHERE "___remote_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__users" SET "___remote_inc"=32767 WHERE "___remote_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__users" SET "___remote_dec"=32767 WHERE "___remote_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__network" SET "___incomingRequests"=2147483647 WHERE "___incomingRequests" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__network" SET "___outgoingRequests"=2147483647 WHERE "___outgoingRequests" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__network" SET "___totalTime"=2147483647 WHERE "___totalTime" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__network" SET "___incomingBytes"=2147483647 WHERE "___incomingBytes" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__network" SET "___outgoingBytes"=2147483647 WHERE "___outgoingBytes" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__network" SET "___incomingRequests"=2147483647 WHERE "___incomingRequests" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__network" SET "___outgoingRequests"=2147483647 WHERE "___outgoingRequests" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__network" SET "___totalTime"=2147483647 WHERE "___totalTime" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__network" SET "___incomingBytes"=2147483647 WHERE "___incomingBytes" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__network" SET "___outgoingBytes"=2147483647 WHERE "___outgoingBytes" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___requests_failed"=32767 WHERE "___requests_failed" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___requests_succeeded"=32767 WHERE "___requests_succeeded" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___requests_received"=32767 WHERE "___requests_received" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___notes_total"=2147483647 WHERE "___notes_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___notes_inc"=2147483647 WHERE "___notes_inc" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___notes_dec"=2147483647 WHERE "___notes_dec" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___notes_diffs_normal"=2147483647 WHERE "___notes_diffs_normal" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___notes_diffs_reply"=2147483647 WHERE "___notes_diffs_reply" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___notes_diffs_renote"=2147483647 WHERE "___notes_diffs_renote" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___users_total"=2147483647 WHERE "___users_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___users_inc"=32767 WHERE "___users_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___users_dec"=32767 WHERE "___users_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___following_total"=2147483647 WHERE "___following_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___following_inc"=32767 WHERE "___following_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___following_dec"=32767 WHERE "___following_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___followers_total"=2147483647 WHERE "___followers_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___followers_inc"=32767 WHERE "___followers_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___followers_dec"=32767 WHERE "___followers_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___drive_totalFiles"=2147483647 WHERE "___drive_totalFiles" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___drive_incFiles"=2147483647 WHERE "___drive_incFiles" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___drive_decFiles"=2147483647 WHERE "___drive_decFiles" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___drive_incUsage"=2147483647 WHERE "___drive_incUsage" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__instance" SET "___drive_decUsage"=2147483647 WHERE "___drive_decUsage" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___requests_failed"=32767 WHERE "___requests_failed" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___requests_succeeded"=32767 WHERE "___requests_succeeded" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___requests_received"=32767 WHERE "___requests_received" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___notes_total"=2147483647 WHERE "___notes_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___notes_inc"=2147483647 WHERE "___notes_inc" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___notes_dec"=2147483647 WHERE "___notes_dec" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___notes_diffs_normal"=2147483647 WHERE "___notes_diffs_normal" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___notes_diffs_reply"=2147483647 WHERE "___notes_diffs_reply" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___notes_diffs_renote"=2147483647 WHERE "___notes_diffs_renote" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___users_total"=2147483647 WHERE "___users_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___users_inc"=32767 WHERE "___users_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___users_dec"=32767 WHERE "___users_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___following_total"=2147483647 WHERE "___following_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___following_inc"=32767 WHERE "___following_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___following_dec"=32767 WHERE "___following_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___followers_total"=2147483647 WHERE "___followers_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___followers_inc"=32767 WHERE "___followers_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___followers_dec"=32767 WHERE "___followers_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___drive_totalFiles"=2147483647 WHERE "___drive_totalFiles" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___drive_incFiles"=2147483647 WHERE "___drive_incFiles" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___drive_decFiles"=2147483647 WHERE "___drive_decFiles" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___drive_incUsage"=2147483647 WHERE "___drive_incUsage" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__instance" SET "___drive_decUsage"=2147483647 WHERE "___drive_decUsage" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_notes" SET "___total"=2147483647 WHERE "___total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_notes" SET "___inc"=32767 WHERE "___inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_notes" SET "___dec"=32767 WHERE "___dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_notes" SET "___diffs_normal"=32767 WHERE "___diffs_normal" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_notes" SET "___diffs_reply"=32767 WHERE "___diffs_reply" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_notes" SET "___diffs_renote"=32767 WHERE "___diffs_renote" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_notes" SET "___total"=2147483647 WHERE "___total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_notes" SET "___inc"=32767 WHERE "___inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_notes" SET "___dec"=32767 WHERE "___dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_notes" SET "___diffs_normal"=32767 WHERE "___diffs_normal" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_notes" SET "___diffs_reply"=32767 WHERE "___diffs_reply" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_notes" SET "___diffs_renote"=32767 WHERE "___diffs_renote" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__drive" SET "___local_incCount"=2147483647 WHERE "___local_incCount" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__drive" SET "___local_incSize"=2147483647 WHERE "___local_incSize" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__drive" SET "___local_decCount"=2147483647 WHERE "___local_decCount" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__drive" SET "___local_decSize"=2147483647 WHERE "___local_decSize" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__drive" SET "___remote_incCount"=2147483647 WHERE "___remote_incCount" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__drive" SET "___remote_incSize"=2147483647 WHERE "___remote_incSize" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__drive" SET "___remote_decCount"=2147483647 WHERE "___remote_decCount" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__drive" SET "___remote_decSize"=2147483647 WHERE "___remote_decSize" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__drive" SET "___local_incCount"=2147483647 WHERE "___local_incCount" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__drive" SET "___local_incSize"=2147483647 WHERE "___local_incSize" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__drive" SET "___local_decCount"=2147483647 WHERE "___local_decCount" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__drive" SET "___local_decSize"=2147483647 WHERE "___local_decSize" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__drive" SET "___remote_incCount"=2147483647 WHERE "___remote_incCount" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__drive" SET "___remote_incSize"=2147483647 WHERE "___remote_incSize" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__drive" SET "___remote_decCount"=2147483647 WHERE "___remote_decCount" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__drive" SET "___remote_decSize"=2147483647 WHERE "___remote_decSize" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_reaction" SET "___local_count"=32767 WHERE "___local_count" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_reaction" SET "___remote_count"=32767 WHERE "___remote_count" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_reaction" SET "___local_count"=32767 WHERE "___local_count" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_reaction" SET "___remote_count"=32767 WHERE "___remote_count" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_following" SET "___local_followings_total"=2147483647 WHERE "___local_followings_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_following" SET "___local_followings_inc"=32767 WHERE "___local_followings_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_following" SET "___local_followings_dec"=32767 WHERE "___local_followings_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_following" SET "___local_followers_total"=2147483647 WHERE "___local_followers_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_following" SET "___local_followers_inc"=32767 WHERE "___local_followers_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_following" SET "___local_followers_dec"=32767 WHERE "___local_followers_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_following" SET "___remote_followings_total"=2147483647 WHERE "___remote_followings_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_following" SET "___remote_followings_inc"=32767 WHERE "___remote_followings_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_following" SET "___remote_followings_dec"=32767 WHERE "___remote_followings_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_following" SET "___remote_followers_total"=2147483647 WHERE "___remote_followers_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_following" SET "___remote_followers_inc"=32767 WHERE "___remote_followers_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart__per_user_following" SET "___remote_followers_dec"=32767 WHERE "___remote_followers_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_following" SET "___local_followings_total"=2147483647 WHERE "___local_followings_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_following" SET "___local_followings_inc"=32767 WHERE "___local_followings_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_following" SET "___local_followings_dec"=32767 WHERE "___local_followings_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_following" SET "___local_followers_total"=2147483647 WHERE "___local_followers_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_following" SET "___local_followers_inc"=32767 WHERE "___local_followers_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_following" SET "___local_followers_dec"=32767 WHERE "___local_followers_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_following" SET "___remote_followings_total"=2147483647 WHERE "___remote_followings_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_following" SET "___remote_followings_inc"=32767 WHERE "___remote_followings_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_following" SET "___remote_followings_dec"=32767 WHERE "___remote_followings_dec" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_following" SET "___remote_followers_total"=2147483647 WHERE "___remote_followers_total" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_following" SET "___remote_followers_inc"=32767 WHERE "___remote_followers_inc" > 32767`, + ); + await queryRunner.query( + `UPDATE "__chart_day__per_user_following" SET "___remote_followers_dec"=32767 WHERE "___remote_followers_dec" > 32767`, + ); await queryRunner.query(`TRUNCATE TABLE "__chart__per_user_drive"`); await queryRunner.query(`TRUNCATE TABLE "__chart_day__per_user_drive"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" TYPE integer USING "___instance_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_inc" TYPE smallint USING "___instance_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_dec" TYPE smallint USING "___instance_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_total" TYPE integer USING "___instance_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_inc" TYPE smallint USING "___instance_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_dec" TYPE smallint USING "___instance_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_total" TYPE integer USING "___local_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_inc" TYPE integer USING "___local_inc"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_dec" TYPE integer USING "___local_dec"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_normal" TYPE integer USING "___local_diffs_normal"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_reply" TYPE integer USING "___local_diffs_reply"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_renote" TYPE integer USING "___local_diffs_renote"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_total" TYPE integer USING "___remote_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_inc" TYPE integer USING "___remote_inc"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_dec" TYPE integer USING "___remote_dec"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_normal" TYPE integer USING "___remote_diffs_normal"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_reply" TYPE integer USING "___remote_diffs_reply"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_renote" TYPE integer USING "___remote_diffs_renote"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_total" TYPE integer USING "___local_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_inc" TYPE integer USING "___local_inc"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_dec" TYPE integer USING "___local_dec"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_normal" TYPE integer USING "___local_diffs_normal"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_reply" TYPE integer USING "___local_diffs_reply"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_renote" TYPE integer USING "___local_diffs_renote"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_total" TYPE integer USING "___remote_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_inc" TYPE integer USING "___remote_inc"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_dec" TYPE integer USING "___remote_dec"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_normal" TYPE integer USING "___remote_diffs_normal"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_reply" TYPE integer USING "___remote_diffs_reply"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_renote" TYPE integer USING "___remote_diffs_renote"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___local_total" TYPE integer USING "___local_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___local_inc" TYPE smallint USING "___local_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___local_dec" TYPE smallint USING "___local_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___remote_total" TYPE integer USING "___remote_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___remote_inc" TYPE smallint USING "___remote_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___remote_dec" TYPE smallint USING "___remote_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_total" TYPE integer USING "___local_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_inc" TYPE smallint USING "___local_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_dec" TYPE smallint USING "___local_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_total" TYPE integer USING "___remote_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_inc" TYPE smallint USING "___remote_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_dec" TYPE smallint USING "___remote_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___incomingRequests" TYPE integer USING "___incomingRequests"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingRequests" TYPE integer USING "___outgoingRequests"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___totalTime" TYPE integer USING "___totalTime"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___incomingBytes" TYPE integer USING "___incomingBytes"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingBytes" TYPE integer USING "___outgoingBytes"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingRequests" TYPE integer USING "___incomingRequests"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingRequests" TYPE integer USING "___outgoingRequests"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___totalTime" TYPE integer USING "___totalTime"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingBytes" TYPE integer USING "___incomingBytes"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingBytes" TYPE integer USING "___outgoingBytes"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" TYPE smallint USING "___requests_failed"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" TYPE smallint USING "___requests_succeeded"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" TYPE smallint USING "___requests_received"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" TYPE integer USING "___notes_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_inc" TYPE integer USING "___notes_inc"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_dec" TYPE integer USING "___notes_dec"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_normal" TYPE integer USING "___notes_diffs_normal"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_reply" TYPE integer USING "___notes_diffs_reply"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_renote" TYPE integer USING "___notes_diffs_renote"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___users_total" TYPE integer USING "___users_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___users_inc" TYPE smallint USING "___users_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___users_dec" TYPE smallint USING "___users_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___following_total" TYPE integer USING "___following_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___following_inc" TYPE smallint USING "___following_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___following_dec" TYPE smallint USING "___following_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_total" TYPE integer USING "___followers_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_inc" TYPE smallint USING "___followers_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_dec" TYPE smallint USING "___followers_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_totalFiles" TYPE integer USING "___drive_totalFiles"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incFiles" TYPE integer USING "___drive_incFiles"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decFiles" TYPE integer USING "___drive_decFiles"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incUsage" TYPE integer USING "___drive_incUsage"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decUsage" TYPE integer USING "___drive_decUsage"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" TYPE smallint USING "___requests_failed"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" TYPE smallint USING "___requests_succeeded"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" TYPE smallint USING "___requests_received"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" TYPE integer USING "___notes_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_inc" TYPE integer USING "___notes_inc"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_dec" TYPE integer USING "___notes_dec"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_normal" TYPE integer USING "___notes_diffs_normal"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_reply" TYPE integer USING "___notes_diffs_reply"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_renote" TYPE integer USING "___notes_diffs_renote"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_total" TYPE integer USING "___users_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_inc" TYPE smallint USING "___users_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_dec" TYPE smallint USING "___users_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_total" TYPE integer USING "___following_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_inc" TYPE smallint USING "___following_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_dec" TYPE smallint USING "___following_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_total" TYPE integer USING "___followers_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_inc" TYPE smallint USING "___followers_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_dec" TYPE smallint USING "___followers_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_totalFiles" TYPE integer USING "___drive_totalFiles"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incFiles" TYPE integer USING "___drive_incFiles"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decFiles" TYPE integer USING "___drive_decFiles"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incUsage" TYPE integer USING "___drive_incUsage"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decUsage" TYPE integer USING "___drive_decUsage"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___total" TYPE integer USING "___total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___inc" TYPE smallint USING "___inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___dec" TYPE smallint USING "___dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_normal" TYPE smallint USING "___diffs_normal"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_reply" TYPE smallint USING "___diffs_reply"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_renote" TYPE smallint USING "___diffs_renote"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___total" TYPE integer USING "___total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___inc" TYPE smallint USING "___inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___dec" TYPE smallint USING "___dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_normal" TYPE smallint USING "___diffs_normal"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_reply" TYPE smallint USING "___diffs_reply"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_renote" TYPE smallint USING "___diffs_renote"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incCount" TYPE integer USING "___local_incCount"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incSize" TYPE integer USING "___local_incSize"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decCount" TYPE integer USING "___local_decCount"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decSize" TYPE integer USING "___local_decSize"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incCount" TYPE integer USING "___remote_incCount"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incSize" TYPE integer USING "___remote_incSize"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decCount" TYPE integer USING "___remote_decCount"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decSize" TYPE integer USING "___remote_decSize"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incCount" TYPE integer USING "___local_incCount"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incSize" TYPE integer USING "___local_incSize"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decCount" TYPE integer USING "___local_decCount"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decSize" TYPE integer USING "___local_decSize"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incCount" TYPE integer USING "___remote_incCount"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incSize" TYPE integer USING "___remote_incSize"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decCount" TYPE integer USING "___remote_decCount"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decSize" TYPE integer USING "___remote_decSize"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___local_count" TYPE smallint USING "___local_count"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___remote_count" TYPE smallint USING "___remote_count"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___local_count" TYPE smallint USING "___local_count"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___remote_count" TYPE smallint USING "___remote_count"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_total" TYPE integer USING "___local_followings_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_inc" TYPE smallint USING "___local_followings_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_dec" TYPE smallint USING "___local_followings_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_total" TYPE integer USING "___local_followers_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_inc" TYPE smallint USING "___local_followers_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_dec" TYPE smallint USING "___local_followers_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_total" TYPE integer USING "___remote_followings_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_inc" TYPE smallint USING "___remote_followings_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_dec" TYPE smallint USING "___remote_followings_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_total" TYPE integer USING "___remote_followers_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_inc" TYPE smallint USING "___remote_followers_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_dec" TYPE smallint USING "___remote_followers_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_total" TYPE integer USING "___local_followings_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_inc" TYPE smallint USING "___local_followings_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_dec" TYPE smallint USING "___local_followings_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_total" TYPE integer USING "___local_followers_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_inc" TYPE smallint USING "___local_followers_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_dec" TYPE smallint USING "___local_followers_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_total" TYPE integer USING "___remote_followings_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_inc" TYPE smallint USING "___remote_followings_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_dec" TYPE smallint USING "___remote_followings_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_total" TYPE integer USING "___remote_followers_total"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_inc" TYPE smallint USING "___remote_followers_inc"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_dec" TYPE smallint USING "___remote_followers_dec"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalCount" TYPE integer USING "___totalCount"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalSize" TYPE integer USING "___totalSize"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incCount" TYPE smallint USING "___incCount"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incSize" TYPE integer USING "___incSize"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decCount" TYPE smallint USING "___decCount"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decSize" TYPE integer USING "___decSize"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalCount" TYPE integer USING "___totalCount"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalSize" TYPE integer USING "___totalSize"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incCount" TYPE smallint USING "___incCount"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incSize" TYPE integer USING "___incSize"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decCount" TYPE smallint USING "___decCount"::smallint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decSize" TYPE integer USING "___decSize"::integer`); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" TYPE integer USING "___instance_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_inc" TYPE smallint USING "___instance_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_dec" TYPE smallint USING "___instance_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_total" TYPE integer USING "___instance_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_inc" TYPE smallint USING "___instance_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_dec" TYPE smallint USING "___instance_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_total" TYPE integer USING "___local_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_inc" TYPE integer USING "___local_inc"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_dec" TYPE integer USING "___local_dec"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_normal" TYPE integer USING "___local_diffs_normal"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_reply" TYPE integer USING "___local_diffs_reply"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_renote" TYPE integer USING "___local_diffs_renote"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_total" TYPE integer USING "___remote_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_inc" TYPE integer USING "___remote_inc"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_dec" TYPE integer USING "___remote_dec"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_normal" TYPE integer USING "___remote_diffs_normal"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_reply" TYPE integer USING "___remote_diffs_reply"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_renote" TYPE integer USING "___remote_diffs_renote"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_total" TYPE integer USING "___local_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_inc" TYPE integer USING "___local_inc"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_dec" TYPE integer USING "___local_dec"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_normal" TYPE integer USING "___local_diffs_normal"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_reply" TYPE integer USING "___local_diffs_reply"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_renote" TYPE integer USING "___local_diffs_renote"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_total" TYPE integer USING "___remote_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_inc" TYPE integer USING "___remote_inc"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_dec" TYPE integer USING "___remote_dec"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_normal" TYPE integer USING "___remote_diffs_normal"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_reply" TYPE integer USING "___remote_diffs_reply"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_renote" TYPE integer USING "___remote_diffs_renote"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___local_total" TYPE integer USING "___local_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___local_inc" TYPE smallint USING "___local_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___local_dec" TYPE smallint USING "___local_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_total" TYPE integer USING "___remote_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_inc" TYPE smallint USING "___remote_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_dec" TYPE smallint USING "___remote_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_total" TYPE integer USING "___local_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_inc" TYPE smallint USING "___local_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_dec" TYPE smallint USING "___local_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_total" TYPE integer USING "___remote_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_inc" TYPE smallint USING "___remote_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_dec" TYPE smallint USING "___remote_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingRequests" TYPE integer USING "___incomingRequests"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingRequests" TYPE integer USING "___outgoingRequests"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___totalTime" TYPE integer USING "___totalTime"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingBytes" TYPE integer USING "___incomingBytes"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingBytes" TYPE integer USING "___outgoingBytes"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingRequests" TYPE integer USING "___incomingRequests"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingRequests" TYPE integer USING "___outgoingRequests"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___totalTime" TYPE integer USING "___totalTime"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingBytes" TYPE integer USING "___incomingBytes"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingBytes" TYPE integer USING "___outgoingBytes"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" TYPE smallint USING "___requests_failed"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" TYPE smallint USING "___requests_succeeded"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" TYPE smallint USING "___requests_received"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" TYPE integer USING "___notes_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_inc" TYPE integer USING "___notes_inc"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_dec" TYPE integer USING "___notes_dec"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_normal" TYPE integer USING "___notes_diffs_normal"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_reply" TYPE integer USING "___notes_diffs_reply"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_renote" TYPE integer USING "___notes_diffs_renote"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_total" TYPE integer USING "___users_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_inc" TYPE smallint USING "___users_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_dec" TYPE smallint USING "___users_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_total" TYPE integer USING "___following_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_inc" TYPE smallint USING "___following_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_dec" TYPE smallint USING "___following_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_total" TYPE integer USING "___followers_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_inc" TYPE smallint USING "___followers_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_dec" TYPE smallint USING "___followers_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_totalFiles" TYPE integer USING "___drive_totalFiles"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incFiles" TYPE integer USING "___drive_incFiles"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decFiles" TYPE integer USING "___drive_decFiles"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incUsage" TYPE integer USING "___drive_incUsage"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decUsage" TYPE integer USING "___drive_decUsage"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" TYPE smallint USING "___requests_failed"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" TYPE smallint USING "___requests_succeeded"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" TYPE smallint USING "___requests_received"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" TYPE integer USING "___notes_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_inc" TYPE integer USING "___notes_inc"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_dec" TYPE integer USING "___notes_dec"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_normal" TYPE integer USING "___notes_diffs_normal"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_reply" TYPE integer USING "___notes_diffs_reply"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_renote" TYPE integer USING "___notes_diffs_renote"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_total" TYPE integer USING "___users_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_inc" TYPE smallint USING "___users_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_dec" TYPE smallint USING "___users_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_total" TYPE integer USING "___following_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_inc" TYPE smallint USING "___following_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_dec" TYPE smallint USING "___following_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_total" TYPE integer USING "___followers_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_inc" TYPE smallint USING "___followers_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_dec" TYPE smallint USING "___followers_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_totalFiles" TYPE integer USING "___drive_totalFiles"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incFiles" TYPE integer USING "___drive_incFiles"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decFiles" TYPE integer USING "___drive_decFiles"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incUsage" TYPE integer USING "___drive_incUsage"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decUsage" TYPE integer USING "___drive_decUsage"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___total" TYPE integer USING "___total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___inc" TYPE smallint USING "___inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___dec" TYPE smallint USING "___dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_normal" TYPE smallint USING "___diffs_normal"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_reply" TYPE smallint USING "___diffs_reply"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_renote" TYPE smallint USING "___diffs_renote"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___total" TYPE integer USING "___total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___inc" TYPE smallint USING "___inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___dec" TYPE smallint USING "___dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_normal" TYPE smallint USING "___diffs_normal"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_reply" TYPE smallint USING "___diffs_reply"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_renote" TYPE smallint USING "___diffs_renote"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incCount" TYPE integer USING "___local_incCount"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incSize" TYPE integer USING "___local_incSize"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decCount" TYPE integer USING "___local_decCount"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decSize" TYPE integer USING "___local_decSize"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incCount" TYPE integer USING "___remote_incCount"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incSize" TYPE integer USING "___remote_incSize"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decCount" TYPE integer USING "___remote_decCount"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decSize" TYPE integer USING "___remote_decSize"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incCount" TYPE integer USING "___local_incCount"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incSize" TYPE integer USING "___local_incSize"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decCount" TYPE integer USING "___local_decCount"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decSize" TYPE integer USING "___local_decSize"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incCount" TYPE integer USING "___remote_incCount"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incSize" TYPE integer USING "___remote_incSize"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decCount" TYPE integer USING "___remote_decCount"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decSize" TYPE integer USING "___remote_decSize"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___local_count" TYPE smallint USING "___local_count"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___remote_count" TYPE smallint USING "___remote_count"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___local_count" TYPE smallint USING "___local_count"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___remote_count" TYPE smallint USING "___remote_count"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_total" TYPE integer USING "___local_followings_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_inc" TYPE smallint USING "___local_followings_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_dec" TYPE smallint USING "___local_followings_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_total" TYPE integer USING "___local_followers_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_inc" TYPE smallint USING "___local_followers_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_dec" TYPE smallint USING "___local_followers_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_total" TYPE integer USING "___remote_followings_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_inc" TYPE smallint USING "___remote_followings_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_dec" TYPE smallint USING "___remote_followings_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_total" TYPE integer USING "___remote_followers_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_inc" TYPE smallint USING "___remote_followers_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_dec" TYPE smallint USING "___remote_followers_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_total" TYPE integer USING "___local_followings_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_inc" TYPE smallint USING "___local_followings_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_dec" TYPE smallint USING "___local_followings_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_total" TYPE integer USING "___local_followers_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_inc" TYPE smallint USING "___local_followers_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_dec" TYPE smallint USING "___local_followers_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_total" TYPE integer USING "___remote_followings_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_inc" TYPE smallint USING "___remote_followings_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_dec" TYPE smallint USING "___remote_followings_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_total" TYPE integer USING "___remote_followers_total"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_inc" TYPE smallint USING "___remote_followers_inc"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_dec" TYPE smallint USING "___remote_followers_dec"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalCount" TYPE integer USING "___totalCount"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalSize" TYPE integer USING "___totalSize"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incCount" TYPE smallint USING "___incCount"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incSize" TYPE integer USING "___incSize"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decCount" TYPE smallint USING "___decCount"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decSize" TYPE integer USING "___decSize"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalCount" TYPE integer USING "___totalCount"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalSize" TYPE integer USING "___totalSize"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incCount" TYPE smallint USING "___incCount"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incSize" TYPE integer USING "___incSize"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decCount" TYPE smallint USING "___decCount"::smallint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decSize" TYPE integer USING "___decSize"::integer`, + ); } async down(queryRunner) { - - await queryRunner.query(`ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" TYPE bigint USING "___instance_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_inc" TYPE bigint USING "___instance_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_dec" TYPE bigint USING "___instance_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_total" TYPE bigint USING "___instance_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_inc" TYPE bigint USING "___instance_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_dec" TYPE bigint USING "___instance_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_total" TYPE bigint USING "___local_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_inc" TYPE bigint USING "___local_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_dec" TYPE bigint USING "___local_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_normal" TYPE bigint USING "___local_diffs_normal"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_reply" TYPE bigint USING "___local_diffs_reply"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_renote" TYPE bigint USING "___local_diffs_renote"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_total" TYPE bigint USING "___remote_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_inc" TYPE bigint USING "___remote_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_dec" TYPE bigint USING "___remote_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_normal" TYPE bigint USING "___remote_diffs_normal"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_reply" TYPE bigint USING "___remote_diffs_reply"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_renote" TYPE bigint USING "___remote_diffs_renote"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_total" TYPE bigint USING "___local_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_inc" TYPE bigint USING "___local_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_dec" TYPE bigint USING "___local_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_normal" TYPE bigint USING "___local_diffs_normal"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_reply" TYPE bigint USING "___local_diffs_reply"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_renote" TYPE bigint USING "___local_diffs_renote"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_total" TYPE bigint USING "___remote_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_inc" TYPE bigint USING "___remote_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_dec" TYPE bigint USING "___remote_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_normal" TYPE bigint USING "___remote_diffs_normal"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_reply" TYPE bigint USING "___remote_diffs_reply"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_renote" TYPE bigint USING "___remote_diffs_renote"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___local_total" TYPE bigint USING "___local_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___local_inc" TYPE bigint USING "___local_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___local_dec" TYPE bigint USING "___local_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___remote_total" TYPE bigint USING "___remote_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___remote_inc" TYPE bigint USING "___remote_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__users" ALTER COLUMN "___remote_dec" TYPE bigint USING "___remote_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_total" TYPE bigint USING "___local_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_inc" TYPE bigint USING "___local_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_dec" TYPE bigint USING "___local_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_total" TYPE bigint USING "___remote_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_inc" TYPE bigint USING "___remote_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_dec" TYPE bigint USING "___remote_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___incomingRequests" TYPE bigint USING "___incomingRequests"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingRequests" TYPE bigint USING "___outgoingRequests"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___totalTime" TYPE bigint USING "___totalTime"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___incomingBytes" TYPE bigint USING "___incomingBytes"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingBytes" TYPE bigint USING "___outgoingBytes"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingRequests" TYPE bigint USING "___incomingRequests"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingRequests" TYPE bigint USING "___outgoingRequests"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___totalTime" TYPE bigint USING "___totalTime"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingBytes" TYPE bigint USING "___incomingBytes"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingBytes" TYPE bigint USING "___outgoingBytes"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" TYPE bigint USING "___requests_failed"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" TYPE bigint USING "___requests_succeeded"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" TYPE bigint USING "___requests_received"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" TYPE bigint USING "___notes_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_inc" TYPE bigint USING "___notes_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_dec" TYPE bigint USING "___notes_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_normal" TYPE bigint USING "___notes_diffs_normal"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_reply" TYPE bigint USING "___notes_diffs_reply"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_renote" TYPE bigint USING "___notes_diffs_renote"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___users_total" TYPE bigint USING "___users_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___users_inc" TYPE bigint USING "___users_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___users_dec" TYPE bigint USING "___users_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___following_total" TYPE bigint USING "___following_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___following_inc" TYPE bigint USING "___following_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___following_dec" TYPE bigint USING "___following_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_total" TYPE bigint USING "___followers_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_inc" TYPE bigint USING "___followers_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_dec" TYPE bigint USING "___followers_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_totalFiles" TYPE bigint USING "___drive_totalFiles"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incFiles" TYPE bigint USING "___drive_incFiles"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decFiles" TYPE bigint USING "___drive_decFiles"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incUsage" TYPE bigint USING "___drive_incUsage"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decUsage" TYPE bigint USING "___drive_decUsage"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" TYPE bigint USING "___requests_failed"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" TYPE bigint USING "___requests_succeeded"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" TYPE bigint USING "___requests_received"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" TYPE bigint USING "___notes_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_inc" TYPE bigint USING "___notes_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_dec" TYPE bigint USING "___notes_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_normal" TYPE bigint USING "___notes_diffs_normal"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_reply" TYPE bigint USING "___notes_diffs_reply"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_renote" TYPE bigint USING "___notes_diffs_renote"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_total" TYPE bigint USING "___users_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_inc" TYPE bigint USING "___users_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_dec" TYPE bigint USING "___users_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_total" TYPE bigint USING "___following_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_inc" TYPE bigint USING "___following_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_dec" TYPE bigint USING "___following_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_total" TYPE bigint USING "___followers_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_inc" TYPE bigint USING "___followers_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_dec" TYPE bigint USING "___followers_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_totalFiles" TYPE bigint USING "___drive_totalFiles"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incFiles" TYPE bigint USING "___drive_incFiles"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decFiles" TYPE bigint USING "___drive_decFiles"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incUsage" TYPE bigint USING "___drive_incUsage"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decUsage" TYPE bigint USING "___drive_decUsage"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___total" TYPE bigint USING "___total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___inc" TYPE bigint USING "___inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___dec" TYPE bigint USING "___dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_normal" TYPE bigint USING "___diffs_normal"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_reply" TYPE bigint USING "___diffs_reply"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_renote" TYPE bigint USING "___diffs_renote"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___total" TYPE bigint USING "___total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___inc" TYPE bigint USING "___inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___dec" TYPE bigint USING "___dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_normal" TYPE bigint USING "___diffs_normal"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_reply" TYPE bigint USING "___diffs_reply"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_renote" TYPE bigint USING "___diffs_renote"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incCount" TYPE bigint USING "___local_incCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incSize" TYPE bigint USING "___local_incSize"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decCount" TYPE bigint USING "___local_decCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decSize" TYPE bigint USING "___local_decSize"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incCount" TYPE bigint USING "___remote_incCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incSize" TYPE bigint USING "___remote_incSize"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decCount" TYPE bigint USING "___remote_decCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decSize" TYPE bigint USING "___remote_decSize"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incCount" TYPE bigint USING "___local_incCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incSize" TYPE bigint USING "___local_incSize"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decCount" TYPE bigint USING "___local_decCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decSize" TYPE bigint USING "___local_decSize"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incCount" TYPE bigint USING "___remote_incCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incSize" TYPE bigint USING "___remote_incSize"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decCount" TYPE bigint USING "___remote_decCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decSize" TYPE bigint USING "___remote_decSize"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___local_count" TYPE bigint USING "___local_count"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___remote_count" TYPE bigint USING "___remote_count"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___local_count" TYPE bigint USING "___local_count"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___remote_count" TYPE bigint USING "___remote_count"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_total" TYPE bigint USING "___local_followings_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_inc" TYPE bigint USING "___local_followings_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_dec" TYPE bigint USING "___local_followings_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_total" TYPE bigint USING "___local_followers_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_inc" TYPE bigint USING "___local_followers_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_dec" TYPE bigint USING "___local_followers_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_total" TYPE bigint USING "___remote_followings_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_inc" TYPE bigint USING "___remote_followings_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_dec" TYPE bigint USING "___remote_followings_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_total" TYPE bigint USING "___remote_followers_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_inc" TYPE bigint USING "___remote_followers_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_dec" TYPE bigint USING "___remote_followers_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_total" TYPE bigint USING "___local_followings_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_inc" TYPE bigint USING "___local_followings_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_dec" TYPE bigint USING "___local_followings_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_total" TYPE bigint USING "___local_followers_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_inc" TYPE bigint USING "___local_followers_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_dec" TYPE bigint USING "___local_followers_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_total" TYPE bigint USING "___remote_followings_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_inc" TYPE bigint USING "___remote_followings_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_dec" TYPE bigint USING "___remote_followings_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_total" TYPE bigint USING "___remote_followers_total"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_inc" TYPE bigint USING "___remote_followers_inc"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_dec" TYPE bigint USING "___remote_followers_dec"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalCount" TYPE bigint USING "___totalCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalSize" TYPE bigint USING "___totalSize"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incCount" TYPE bigint USING "___incCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incSize" TYPE bigint USING "___incSize"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decCount" TYPE bigint USING "___decCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decSize" TYPE bigint USING "___decSize"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalCount" TYPE bigint USING "___totalCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalSize" TYPE bigint USING "___totalSize"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incCount" TYPE bigint USING "___incCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incSize" TYPE bigint USING "___incSize"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decCount" TYPE bigint USING "___decCount"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decSize" TYPE bigint USING "___decSize"::bigint`); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_total" TYPE bigint USING "___instance_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_inc" TYPE bigint USING "___instance_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ALTER COLUMN "___instance_dec" TYPE bigint USING "___instance_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_total" TYPE bigint USING "___instance_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_inc" TYPE bigint USING "___instance_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ALTER COLUMN "___instance_dec" TYPE bigint USING "___instance_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_total" TYPE bigint USING "___local_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_inc" TYPE bigint USING "___local_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_dec" TYPE bigint USING "___local_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_normal" TYPE bigint USING "___local_diffs_normal"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_reply" TYPE bigint USING "___local_diffs_reply"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___local_diffs_renote" TYPE bigint USING "___local_diffs_renote"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_total" TYPE bigint USING "___remote_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_inc" TYPE bigint USING "___remote_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_dec" TYPE bigint USING "___remote_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_normal" TYPE bigint USING "___remote_diffs_normal"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_reply" TYPE bigint USING "___remote_diffs_reply"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ALTER COLUMN "___remote_diffs_renote" TYPE bigint USING "___remote_diffs_renote"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_total" TYPE bigint USING "___local_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_inc" TYPE bigint USING "___local_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_dec" TYPE bigint USING "___local_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_normal" TYPE bigint USING "___local_diffs_normal"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_reply" TYPE bigint USING "___local_diffs_reply"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___local_diffs_renote" TYPE bigint USING "___local_diffs_renote"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_total" TYPE bigint USING "___remote_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_inc" TYPE bigint USING "___remote_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_dec" TYPE bigint USING "___remote_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_normal" TYPE bigint USING "___remote_diffs_normal"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_reply" TYPE bigint USING "___remote_diffs_reply"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ALTER COLUMN "___remote_diffs_renote" TYPE bigint USING "___remote_diffs_renote"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___local_total" TYPE bigint USING "___local_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___local_inc" TYPE bigint USING "___local_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___local_dec" TYPE bigint USING "___local_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_total" TYPE bigint USING "___remote_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_inc" TYPE bigint USING "___remote_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__users" ALTER COLUMN "___remote_dec" TYPE bigint USING "___remote_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_total" TYPE bigint USING "___local_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_inc" TYPE bigint USING "___local_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___local_dec" TYPE bigint USING "___local_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_total" TYPE bigint USING "___remote_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_inc" TYPE bigint USING "___remote_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__users" ALTER COLUMN "___remote_dec" TYPE bigint USING "___remote_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingRequests" TYPE bigint USING "___incomingRequests"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingRequests" TYPE bigint USING "___outgoingRequests"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___totalTime" TYPE bigint USING "___totalTime"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___incomingBytes" TYPE bigint USING "___incomingBytes"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__network" ALTER COLUMN "___outgoingBytes" TYPE bigint USING "___outgoingBytes"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingRequests" TYPE bigint USING "___incomingRequests"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingRequests" TYPE bigint USING "___outgoingRequests"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___totalTime" TYPE bigint USING "___totalTime"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___incomingBytes" TYPE bigint USING "___incomingBytes"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__network" ALTER COLUMN "___outgoingBytes" TYPE bigint USING "___outgoingBytes"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_failed" TYPE bigint USING "___requests_failed"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_succeeded" TYPE bigint USING "___requests_succeeded"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___requests_received" TYPE bigint USING "___requests_received"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_total" TYPE bigint USING "___notes_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_inc" TYPE bigint USING "___notes_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_dec" TYPE bigint USING "___notes_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_normal" TYPE bigint USING "___notes_diffs_normal"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_reply" TYPE bigint USING "___notes_diffs_reply"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___notes_diffs_renote" TYPE bigint USING "___notes_diffs_renote"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_total" TYPE bigint USING "___users_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_inc" TYPE bigint USING "___users_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___users_dec" TYPE bigint USING "___users_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_total" TYPE bigint USING "___following_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_inc" TYPE bigint USING "___following_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___following_dec" TYPE bigint USING "___following_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_total" TYPE bigint USING "___followers_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_inc" TYPE bigint USING "___followers_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___followers_dec" TYPE bigint USING "___followers_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_totalFiles" TYPE bigint USING "___drive_totalFiles"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incFiles" TYPE bigint USING "___drive_incFiles"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decFiles" TYPE bigint USING "___drive_decFiles"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_incUsage" TYPE bigint USING "___drive_incUsage"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ALTER COLUMN "___drive_decUsage" TYPE bigint USING "___drive_decUsage"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_failed" TYPE bigint USING "___requests_failed"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_succeeded" TYPE bigint USING "___requests_succeeded"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___requests_received" TYPE bigint USING "___requests_received"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_total" TYPE bigint USING "___notes_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_inc" TYPE bigint USING "___notes_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_dec" TYPE bigint USING "___notes_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_normal" TYPE bigint USING "___notes_diffs_normal"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_reply" TYPE bigint USING "___notes_diffs_reply"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___notes_diffs_renote" TYPE bigint USING "___notes_diffs_renote"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_total" TYPE bigint USING "___users_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_inc" TYPE bigint USING "___users_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___users_dec" TYPE bigint USING "___users_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_total" TYPE bigint USING "___following_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_inc" TYPE bigint USING "___following_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___following_dec" TYPE bigint USING "___following_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_total" TYPE bigint USING "___followers_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_inc" TYPE bigint USING "___followers_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___followers_dec" TYPE bigint USING "___followers_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_totalFiles" TYPE bigint USING "___drive_totalFiles"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incFiles" TYPE bigint USING "___drive_incFiles"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decFiles" TYPE bigint USING "___drive_decFiles"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_incUsage" TYPE bigint USING "___drive_incUsage"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ALTER COLUMN "___drive_decUsage" TYPE bigint USING "___drive_decUsage"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___total" TYPE bigint USING "___total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___inc" TYPE bigint USING "___inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___dec" TYPE bigint USING "___dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_normal" TYPE bigint USING "___diffs_normal"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_reply" TYPE bigint USING "___diffs_reply"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ALTER COLUMN "___diffs_renote" TYPE bigint USING "___diffs_renote"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___total" TYPE bigint USING "___total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___inc" TYPE bigint USING "___inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___dec" TYPE bigint USING "___dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_normal" TYPE bigint USING "___diffs_normal"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_reply" TYPE bigint USING "___diffs_reply"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ALTER COLUMN "___diffs_renote" TYPE bigint USING "___diffs_renote"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incCount" TYPE bigint USING "___local_incCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_incSize" TYPE bigint USING "___local_incSize"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decCount" TYPE bigint USING "___local_decCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___local_decSize" TYPE bigint USING "___local_decSize"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incCount" TYPE bigint USING "___remote_incCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_incSize" TYPE bigint USING "___remote_incSize"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decCount" TYPE bigint USING "___remote_decCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__drive" ALTER COLUMN "___remote_decSize" TYPE bigint USING "___remote_decSize"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incCount" TYPE bigint USING "___local_incCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_incSize" TYPE bigint USING "___local_incSize"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decCount" TYPE bigint USING "___local_decCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___local_decSize" TYPE bigint USING "___local_decSize"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incCount" TYPE bigint USING "___remote_incCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_incSize" TYPE bigint USING "___remote_incSize"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decCount" TYPE bigint USING "___remote_decCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__drive" ALTER COLUMN "___remote_decSize" TYPE bigint USING "___remote_decSize"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___local_count" TYPE bigint USING "___local_count"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_reaction" ALTER COLUMN "___remote_count" TYPE bigint USING "___remote_count"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___local_count" TYPE bigint USING "___local_count"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_reaction" ALTER COLUMN "___remote_count" TYPE bigint USING "___remote_count"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_total" TYPE bigint USING "___local_followings_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_inc" TYPE bigint USING "___local_followings_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followings_dec" TYPE bigint USING "___local_followings_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_total" TYPE bigint USING "___local_followers_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_inc" TYPE bigint USING "___local_followers_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___local_followers_dec" TYPE bigint USING "___local_followers_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_total" TYPE bigint USING "___remote_followings_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_inc" TYPE bigint USING "___remote_followings_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followings_dec" TYPE bigint USING "___remote_followings_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_total" TYPE bigint USING "___remote_followers_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_inc" TYPE bigint USING "___remote_followers_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_following" ALTER COLUMN "___remote_followers_dec" TYPE bigint USING "___remote_followers_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_total" TYPE bigint USING "___local_followings_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_inc" TYPE bigint USING "___local_followings_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followings_dec" TYPE bigint USING "___local_followings_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_total" TYPE bigint USING "___local_followers_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_inc" TYPE bigint USING "___local_followers_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___local_followers_dec" TYPE bigint USING "___local_followers_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_total" TYPE bigint USING "___remote_followings_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_inc" TYPE bigint USING "___remote_followings_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followings_dec" TYPE bigint USING "___remote_followings_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_total" TYPE bigint USING "___remote_followers_total"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_inc" TYPE bigint USING "___remote_followers_inc"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_following" ALTER COLUMN "___remote_followers_dec" TYPE bigint USING "___remote_followers_dec"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalCount" TYPE bigint USING "___totalCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___totalSize" TYPE bigint USING "___totalSize"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incCount" TYPE bigint USING "___incCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___incSize" TYPE bigint USING "___incSize"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decCount" TYPE bigint USING "___decCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_drive" ALTER COLUMN "___decSize" TYPE bigint USING "___decSize"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalCount" TYPE bigint USING "___totalCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___totalSize" TYPE bigint USING "___totalSize"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incCount" TYPE bigint USING "___incCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___incSize" TYPE bigint USING "___incSize"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decCount" TYPE bigint USING "___decCount"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_drive" ALTER COLUMN "___decSize" TYPE bigint USING "___decSize"::bigint`, + ); } } diff --git a/packages/backend/migration/1644059847460-chart-v8.js b/packages/backend/migration/1644059847460-chart-v8.js index a5339c0ebd..f9357c8ca1 100644 --- a/packages/backend/migration/1644059847460-chart-v8.js +++ b/packages/backend/migration/1644059847460-chart-v8.js @@ -1,25 +1,46 @@ - - export class chartV81644059847460 { - name = 'chartV81644059847460' + name = "chartV81644059847460"; - async up(queryRunner) { - await queryRunner.query(`UPDATE "__chart__active_users" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__active_users" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__active_users" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__active_users" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`); + async up(queryRunner) { + await queryRunner.query( + `UPDATE "__chart__active_users" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__active_users" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__active_users" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__active_users" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`, + ); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`); - } - - async down(queryRunner) { - - await queryRunner.query(`ALTER TABLE "__chart__active_users" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`); - } + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`, + ); + } + + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`, + ); + } } diff --git a/packages/backend/migration/1644060125705-chart-v9.js b/packages/backend/migration/1644060125705-chart-v9.js index da35d42315..7d7934e319 100644 --- a/packages/backend/migration/1644060125705-chart-v9.js +++ b/packages/backend/migration/1644060125705-chart-v9.js @@ -1,25 +1,46 @@ - - export class chartV91644060125705 { - name = 'chartV91644060125705' + name = "chartV91644060125705"; - async up(queryRunner) { - await queryRunner.query(`UPDATE "__chart__hashtag" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`); - await queryRunner.query(`UPDATE "__chart__hashtag" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__hashtag" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`); - await queryRunner.query(`UPDATE "__chart_day__hashtag" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`); + async up(queryRunner) { + await queryRunner.query( + `UPDATE "__chart__hashtag" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart__hashtag" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__hashtag" SET "___local_users"=2147483647 WHERE "___local_users" > 2147483647`, + ); + await queryRunner.query( + `UPDATE "__chart_day__hashtag" SET "___remote_users"=2147483647 WHERE "___remote_users" > 2147483647`, + ); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`); - } - - async down(queryRunner) { - - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`); - await queryRunner.query(`ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`); - } + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___local_users" TYPE integer USING "___local_users"::integer`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___remote_users" TYPE integer USING "___remote_users"::integer`, + ); + } + + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__hashtag" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___local_users" TYPE bigint USING "___local_users"::bigint`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__hashtag" ALTER COLUMN "___remote_users" TYPE bigint USING "___remote_users"::bigint`, + ); + } } diff --git a/packages/backend/migration/1644073149413-chart-v10.js b/packages/backend/migration/1644073149413-chart-v10.js index 7260bbeca4..8038dad156 100644 --- a/packages/backend/migration/1644073149413-chart-v10.js +++ b/packages/backend/migration/1644073149413-chart-v10.js @@ -1,35 +1,77 @@ - - export class chartV101644073149413 { - name = 'chartV101644073149413' + name = "chartV101644073149413"; - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "__chart__ap_request" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___deliverFailed" integer NOT NULL DEFAULT '0', "___deliverSucceeded" integer NOT NULL DEFAULT '0', "___inboxReceived" integer NOT NULL DEFAULT '0', CONSTRAINT "UQ_e56f4beac5746d44bc3e19c80d0" UNIQUE ("date"), CONSTRAINT "PK_56a25cd447c7ee08876b3baf8d8" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_e56f4beac5746d44bc3e19c80d" ON "__chart__ap_request" ("date") `); - await queryRunner.query(`CREATE TABLE "__chart_day__ap_request" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___deliverFailed" integer NOT NULL DEFAULT '0', "___deliverSucceeded" integer NOT NULL DEFAULT '0', "___inboxReceived" integer NOT NULL DEFAULT '0', CONSTRAINT "UQ_a848f66d6cec11980a5dd595822" UNIQUE ("date"), CONSTRAINT "PK_9318b49daee320194e23f712e69" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a848f66d6cec11980a5dd59582" ON "__chart_day__ap_request" ("date") `); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "unique_temp___deliveredInstances" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___deliveredInstances" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "unique_temp___inboxInstances" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___inboxInstances" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "unique_temp___deliveredInstances" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___deliveredInstances" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "unique_temp___inboxInstances" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___inboxInstances" smallint NOT NULL DEFAULT '0'`); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "__chart__ap_request" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___deliverFailed" integer NOT NULL DEFAULT '0', "___deliverSucceeded" integer NOT NULL DEFAULT '0', "___inboxReceived" integer NOT NULL DEFAULT '0', CONSTRAINT "UQ_e56f4beac5746d44bc3e19c80d0" UNIQUE ("date"), CONSTRAINT "PK_56a25cd447c7ee08876b3baf8d8" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_e56f4beac5746d44bc3e19c80d" ON "__chart__ap_request" ("date") `, + ); + await queryRunner.query( + `CREATE TABLE "__chart_day__ap_request" ("id" SERIAL NOT NULL, "date" integer NOT NULL, "___deliverFailed" integer NOT NULL DEFAULT '0', "___deliverSucceeded" integer NOT NULL DEFAULT '0', "___inboxReceived" integer NOT NULL DEFAULT '0', CONSTRAINT "UQ_a848f66d6cec11980a5dd595822" UNIQUE ("date"), CONSTRAINT "PK_9318b49daee320194e23f712e69" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_a848f66d6cec11980a5dd59582" ON "__chart_day__ap_request" ("date") `, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "unique_temp___deliveredInstances" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "___deliveredInstances" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "unique_temp___inboxInstances" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "___inboxInstances" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "unique_temp___deliveredInstances" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "___deliveredInstances" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "unique_temp___inboxInstances" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "___inboxInstances" smallint NOT NULL DEFAULT '0'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___inboxInstances"`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "unique_temp___inboxInstances"`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___deliveredInstances"`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "unique_temp___deliveredInstances"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___inboxInstances"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "unique_temp___inboxInstances"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___deliveredInstances"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "unique_temp___deliveredInstances"`); - await queryRunner.query(`DROP INDEX "public"."IDX_a848f66d6cec11980a5dd59582"`); - await queryRunner.query(`DROP TABLE "__chart_day__ap_request"`); - await queryRunner.query(`DROP INDEX "public"."IDX_e56f4beac5746d44bc3e19c80d"`); - await queryRunner.query(`DROP TABLE "__chart__ap_request"`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "___inboxInstances"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "unique_temp___inboxInstances"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "___deliveredInstances"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "unique_temp___deliveredInstances"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "___inboxInstances"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "unique_temp___inboxInstances"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "___deliveredInstances"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "unique_temp___deliveredInstances"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_a848f66d6cec11980a5dd59582"`, + ); + await queryRunner.query(`DROP TABLE "__chart_day__ap_request"`); + await queryRunner.query( + `DROP INDEX "public"."IDX_e56f4beac5746d44bc3e19c80d"`, + ); + await queryRunner.query(`DROP TABLE "__chart__ap_request"`); + } } diff --git a/packages/backend/migration/1644095659741-chart-v11.js b/packages/backend/migration/1644095659741-chart-v11.js index 309fff1d9a..8db122d4f1 100644 --- a/packages/backend/migration/1644095659741-chart-v11.js +++ b/packages/backend/migration/1644095659741-chart-v11.js @@ -1,91 +1,249 @@ - - export class chartV111644095659741 { - name = 'chartV111644095659741' + name = "chartV111644095659741"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___local_users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___remote_users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredWithinWeek" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___registeredWithinWeek" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredWithinMonth" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___registeredWithinMonth" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredWithinYear" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___registeredWithinYear" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredOutsideWeek" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___registeredOutsideWeek" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredOutsideMonth" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___registeredOutsideMonth" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredOutsideYear" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___registeredOutsideYear" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredWithinWeek" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___registeredWithinWeek" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredWithinMonth" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___registeredWithinMonth" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredWithinYear" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___registeredWithinYear" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredOutsideWeek" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___registeredOutsideWeek" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredOutsideMonth" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___registeredOutsideMonth" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredOutsideYear" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___registeredOutsideYear" smallint NOT NULL DEFAULT '0'`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___local_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___remote_users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredWithinWeek" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___registeredWithinWeek" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredWithinMonth" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___registeredWithinMonth" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredWithinYear" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___registeredWithinYear" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredOutsideWeek" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___registeredOutsideWeek" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredOutsideMonth" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___registeredOutsideMonth" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___registeredOutsideYear" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___registeredOutsideYear" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredWithinWeek" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___registeredWithinWeek" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredWithinMonth" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___registeredWithinMonth" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredWithinYear" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___registeredWithinYear" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredOutsideWeek" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___registeredOutsideWeek" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredOutsideMonth" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___registeredOutsideMonth" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___registeredOutsideYear" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___registeredOutsideYear" smallint NOT NULL DEFAULT '0'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredOutsideYear"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredOutsideYear"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredOutsideMonth"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredOutsideMonth"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredOutsideWeek"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredOutsideWeek"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredWithinYear"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredWithinYear"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredWithinMonth"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredWithinMonth"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredWithinWeek"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredWithinWeek"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___notedUsers"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___notedUsers"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredOutsideYear"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredOutsideYear"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredOutsideMonth"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredOutsideMonth"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredOutsideWeek"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredOutsideWeek"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredWithinYear"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredWithinYear"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredWithinMonth"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredWithinMonth"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredWithinWeek"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredWithinWeek"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___notedUsers"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___notedUsers"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___remote_users" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___local_users" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___remote_users" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___local_users" integer NOT NULL DEFAULT '0'`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredOutsideYear"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredOutsideYear"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredOutsideMonth"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredOutsideMonth"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredOutsideWeek"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredOutsideWeek"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredWithinYear"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredWithinYear"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredWithinMonth"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredWithinMonth"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___registeredWithinWeek"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___registeredWithinWeek"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___notedUsers"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___notedUsers"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredOutsideYear"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredOutsideYear"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredOutsideMonth"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredOutsideMonth"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredOutsideWeek"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredOutsideWeek"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredWithinYear"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredWithinYear"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredWithinMonth"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredWithinMonth"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___registeredWithinWeek"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___registeredWithinWeek"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___notedUsers"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___notedUsers"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___remote_users" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___local_users" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___remote_users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___local_users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___remote_users" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___local_users" integer NOT NULL DEFAULT '0'`, + ); + } } diff --git a/packages/backend/migration/1644328606241-chart-v12.js b/packages/backend/migration/1644328606241-chart-v12.js index c3c7e44f95..ea363e12fd 100644 --- a/packages/backend/migration/1644328606241-chart-v12.js +++ b/packages/backend/migration/1644328606241-chart-v12.js @@ -1,27 +1,57 @@ - - export class chartV121644328606241 { - name = 'chartV121644328606241' + name = "chartV121644328606241"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__notes" ADD "___local_diffs_withFile" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__notes" ADD "___remote_diffs_withFile" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ADD "___local_diffs_withFile" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" ADD "___remote_diffs_withFile" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__instance" ADD "___notes_diffs_withFile" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" ADD "___notes_diffs_withFile" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" ADD "___diffs_withFile" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" ADD "___diffs_withFile" smallint NOT NULL DEFAULT '0'`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__notes" ADD "___local_diffs_withFile" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" ADD "___remote_diffs_withFile" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ADD "___local_diffs_withFile" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" ADD "___remote_diffs_withFile" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" ADD "___notes_diffs_withFile" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" ADD "___notes_diffs_withFile" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" ADD "___diffs_withFile" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" ADD "___diffs_withFile" smallint NOT NULL DEFAULT '0'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart_day__per_user_notes" DROP COLUMN "___diffs_withFile"`); - await queryRunner.query(`ALTER TABLE "__chart__per_user_notes" DROP COLUMN "___diffs_withFile"`); - await queryRunner.query(`ALTER TABLE "__chart_day__instance" DROP COLUMN "___notes_diffs_withFile"`); - await queryRunner.query(`ALTER TABLE "__chart__instance" DROP COLUMN "___notes_diffs_withFile"`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" DROP COLUMN "___remote_diffs_withFile"`); - await queryRunner.query(`ALTER TABLE "__chart_day__notes" DROP COLUMN "___local_diffs_withFile"`); - await queryRunner.query(`ALTER TABLE "__chart__notes" DROP COLUMN "___remote_diffs_withFile"`); - await queryRunner.query(`ALTER TABLE "__chart__notes" DROP COLUMN "___local_diffs_withFile"`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart_day__per_user_notes" DROP COLUMN "___diffs_withFile"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__per_user_notes" DROP COLUMN "___diffs_withFile"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__instance" DROP COLUMN "___notes_diffs_withFile"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__instance" DROP COLUMN "___notes_diffs_withFile"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" DROP COLUMN "___remote_diffs_withFile"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__notes" DROP COLUMN "___local_diffs_withFile"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" DROP COLUMN "___remote_diffs_withFile"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__notes" DROP COLUMN "___local_diffs_withFile"`, + ); + } } diff --git a/packages/backend/migration/1644331238153-chart-v13.js b/packages/backend/migration/1644331238153-chart-v13.js index 639f7b4e20..cbb1830f50 100644 --- a/packages/backend/migration/1644331238153-chart-v13.js +++ b/packages/backend/migration/1644331238153-chart-v13.js @@ -1,19 +1,33 @@ - - export class chartV131644331238153 { - name = 'chartV131644331238153' + name = "chartV131644331238153"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "unique_temp___stalled" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___stalled" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "unique_temp___stalled" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___stalled" smallint NOT NULL DEFAULT '0'`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "unique_temp___stalled" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "___stalled" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "unique_temp___stalled" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "___stalled" smallint NOT NULL DEFAULT '0'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___stalled"`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "unique_temp___stalled"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___stalled"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "unique_temp___stalled"`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "___stalled"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "unique_temp___stalled"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "___stalled"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "unique_temp___stalled"`, + ); + } } diff --git a/packages/backend/migration/1644344266289-chart-v14.js b/packages/backend/migration/1644344266289-chart-v14.js index a0d9cfc38c..6e6c030833 100644 --- a/packages/backend/migration/1644344266289-chart-v14.js +++ b/packages/backend/migration/1644344266289-chart-v14.js @@ -1,47 +1,117 @@ - - export class chartV141644344266289 { - name = 'chartV141644344266289' + name = "chartV141644344266289"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___users"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___notedUsers"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___notedUsers"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___users"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___notedUsers"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___notedUsers"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___readWrite" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___read" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___read" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___write" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___write" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___readWrite" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___read" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___read" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___write" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___write" smallint NOT NULL DEFAULT '0'`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___notedUsers"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___notedUsers"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___users"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___notedUsers"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___notedUsers"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___readWrite" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___read" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___read" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___write" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___write" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___readWrite" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___read" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___read" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___write" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___write" smallint NOT NULL DEFAULT '0'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___write"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___write"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___read"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___read"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" DROP COLUMN "___readWrite"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___write"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___write"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___read"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___read"`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" DROP COLUMN "___readWrite"`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___write"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___write"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___read"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "unique_temp___read"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" DROP COLUMN "___readWrite"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___write"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___write"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___read"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "unique_temp___read"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" DROP COLUMN "___readWrite"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___notedUsers" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___notedUsers" character varying array NOT NULL DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "___users" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__active_users" ADD "unique_temp___users" character varying array NOT NULL DEFAULT '{}'`, + ); + } } diff --git a/packages/backend/migration/1644395759931-instance-theme-color.js b/packages/backend/migration/1644395759931-instance-theme-color.js index 8f335ad210..1e0ee04bc2 100644 --- a/packages/backend/migration/1644395759931-instance-theme-color.js +++ b/packages/backend/migration/1644395759931-instance-theme-color.js @@ -1,13 +1,13 @@ - - export class instanceThemeColor1644395759931 { - name = 'instanceThemeColor1644395759931' + name = "instanceThemeColor1644395759931"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "themeColor" character varying(512)`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "themeColor" character varying(512)`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "themeColor"`); - } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "themeColor"`); + } } diff --git a/packages/backend/migration/1644481657998-chart-v15.js b/packages/backend/migration/1644481657998-chart-v15.js index b50ca87c40..a8e1b89cb1 100644 --- a/packages/backend/migration/1644481657998-chart-v15.js +++ b/packages/backend/migration/1644481657998-chart-v15.js @@ -1,31 +1,69 @@ - - export class chartV151644481657998 { - name = 'chartV151644481657998' + name = "chartV151644481657998"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___instance_total"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___instance_inc"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___instance_dec"`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___instance_total"`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___instance_inc"`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___instance_dec"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___sub" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___pub" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___sub" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___pub" smallint NOT NULL DEFAULT '0'`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "___instance_total"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "___instance_inc"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "___instance_dec"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "___instance_total"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "___instance_inc"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "___instance_dec"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "___sub" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "___pub" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "___sub" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "___pub" smallint NOT NULL DEFAULT '0'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___pub"`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___sub"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___pub"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___sub"`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___instance_dec" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___instance_inc" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___instance_total" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___instance_dec" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___instance_inc" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___instance_total" integer NOT NULL DEFAULT '0'`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "___pub"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "___sub"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "___pub"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "___sub"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "___instance_dec" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "___instance_inc" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "___instance_total" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "___instance_dec" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "___instance_inc" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "___instance_total" integer NOT NULL DEFAULT '0'`, + ); + } } diff --git a/packages/backend/migration/1644551208096-following-indexes.js b/packages/backend/migration/1644551208096-following-indexes.js index 276473ff6c..b06f764e58 100644 --- a/packages/backend/migration/1644551208096-following-indexes.js +++ b/packages/backend/migration/1644551208096-following-indexes.js @@ -1,15 +1,21 @@ - - export class followingIndexes1644551208096 { - name = 'followingIndexes1644551208096' + name = "followingIndexes1644551208096"; - async up(queryRunner) { - await queryRunner.query(`CREATE INDEX "IDX_4ccd2239268ebbd1b35e318754" ON "following" ("followerHost") `); - await queryRunner.query(`CREATE INDEX "IDX_fcdafee716dfe9c3b5fde90f30" ON "following" ("followeeHost") `); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE INDEX "IDX_4ccd2239268ebbd1b35e318754" ON "following" ("followerHost") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_fcdafee716dfe9c3b5fde90f30" ON "following" ("followeeHost") `, + ); + } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "public"."IDX_fcdafee716dfe9c3b5fde90f30"`); - await queryRunner.query(`DROP INDEX "public"."IDX_4ccd2239268ebbd1b35e318754"`); - } + async down(queryRunner) { + await queryRunner.query( + `DROP INDEX "public"."IDX_fcdafee716dfe9c3b5fde90f30"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_4ccd2239268ebbd1b35e318754"`, + ); + } } diff --git a/packages/backend/migration/1645340161439-remove-max-note-text-length.js b/packages/backend/migration/1645340161439-remove-max-note-text-length.js index c88cb70bfb..d17ef8c124 100644 --- a/packages/backend/migration/1645340161439-remove-max-note-text-length.js +++ b/packages/backend/migration/1645340161439-remove-max-note-text-length.js @@ -1,13 +1,15 @@ - - export class removeMaxNoteTextLength1645340161439 { - name = 'removeMaxNoteTextLength1645340161439' + name = "removeMaxNoteTextLength1645340161439"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "maxNoteTextLength"`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "maxNoteTextLength"`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "maxNoteTextLength" integer NOT NULL DEFAULT '500'`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "maxNoteTextLength" integer NOT NULL DEFAULT '500'`, + ); + } } diff --git a/packages/backend/migration/1645599900873-federation-chart-pubsub.js b/packages/backend/migration/1645599900873-federation-chart-pubsub.js index fd7cb6d5a1..58e2b4c00d 100644 --- a/packages/backend/migration/1645599900873-federation-chart-pubsub.js +++ b/packages/backend/migration/1645599900873-federation-chart-pubsub.js @@ -1,15 +1,21 @@ - - export class federationChartPubsub1645599900873 { - name = 'federationChartPubsub1645599900873' + name = "federationChartPubsub1645599900873"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___pubsub" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___pubsub" smallint NOT NULL DEFAULT '0'`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "___pubsub" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "___pubsub" smallint NOT NULL DEFAULT '0'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___pubsub"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___pubsub"`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "___pubsub"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "___pubsub"`, + ); + } } diff --git a/packages/backend/migration/1646143552768-instance-default-theme.js b/packages/backend/migration/1646143552768-instance-default-theme.js index 029354fd92..d97efcaa6e 100644 --- a/packages/backend/migration/1646143552768-instance-default-theme.js +++ b/packages/backend/migration/1646143552768-instance-default-theme.js @@ -1,13 +1,21 @@ export class instanceDefaultTheme1646143552768 { - name = 'instanceDefaultTheme1646143552768' + name = "instanceDefaultTheme1646143552768"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "defaultLightTheme" character varying(8192)`); - await queryRunner.query(`ALTER TABLE "meta" ADD "defaultDarkTheme" character varying(8192)`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "defaultLightTheme" character varying(8192)`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "defaultDarkTheme" character varying(8192)`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "defaultDarkTheme"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "defaultLightTheme"`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "defaultDarkTheme"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "defaultLightTheme"`, + ); + } } diff --git a/packages/backend/migration/1646387162108-mute-expires-at.js b/packages/backend/migration/1646387162108-mute-expires-at.js index c8be8f3c54..52fe101bd1 100644 --- a/packages/backend/migration/1646387162108-mute-expires-at.js +++ b/packages/backend/migration/1646387162108-mute-expires-at.js @@ -1,13 +1,19 @@ export class muteExpiresAt1646387162108 { - name = 'muteExpiresAt1646387162108' + name = "muteExpiresAt1646387162108"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "muting" ADD "expiresAt" TIMESTAMP WITH TIME ZONE`); - await queryRunner.query(`CREATE INDEX "IDX_c1fd1c3dfb0627aa36c253fd14" ON "muting" ("expiresAt") `); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "muting" ADD "expiresAt" TIMESTAMP WITH TIME ZONE`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_c1fd1c3dfb0627aa36c253fd14" ON "muting" ("expiresAt") `, + ); + } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "public"."IDX_c1fd1c3dfb0627aa36c253fd14"`); - await queryRunner.query(`ALTER TABLE "muting" DROP COLUMN "expiresAt"`); - } + async down(queryRunner) { + await queryRunner.query( + `DROP INDEX "public"."IDX_c1fd1c3dfb0627aa36c253fd14"`, + ); + await queryRunner.query(`ALTER TABLE "muting" DROP COLUMN "expiresAt"`); + } } diff --git a/packages/backend/migration/1646549089451-poll-ended-notification.js b/packages/backend/migration/1646549089451-poll-ended-notification.js index 38a38ce64d..cc96a62a7e 100644 --- a/packages/backend/migration/1646549089451-poll-ended-notification.js +++ b/packages/backend/migration/1646549089451-poll-ended-notification.js @@ -1,18 +1,29 @@ - export class pollEndedNotification1646549089451 { - name = 'pollEndedNotification1646549089451' + name = "pollEndedNotification1646549089451"; - async up(queryRunner) { - await queryRunner.query(`ALTER TYPE "public"."notification_type_enum" RENAME TO "notification_type_enum_old"`); - await queryRunner.query(`CREATE TYPE "public"."notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`); - await queryRunner.query(`ALTER TABLE "notification" ALTER COLUMN "type" TYPE "public"."notification_type_enum" USING "type"::"text"::"public"."notification_type_enum"`); - await queryRunner.query(`DROP TYPE "public"."notification_type_enum_old"`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TYPE "public"."notification_type_enum" RENAME TO "notification_type_enum_old"`, + ); + await queryRunner.query( + `CREATE TYPE "public"."notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, + ); + await queryRunner.query( + `ALTER TABLE "notification" ALTER COLUMN "type" TYPE "public"."notification_type_enum" USING "type"::"text"::"public"."notification_type_enum"`, + ); + await queryRunner.query(`DROP TYPE "public"."notification_type_enum_old"`); + } - async down(queryRunner) { - await queryRunner.query(`CREATE TYPE "public"."notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`); - await queryRunner.query(`ALTER TABLE "notification" ALTER COLUMN "type" TYPE "public"."notification_type_enum_old" USING "type"::"text"::"public"."notification_type_enum_old"`); - await queryRunner.query(`DROP TYPE "public"."notification_type_enum"`); - await queryRunner.query(`ALTER TYPE "public"."notification_type_enum_old" RENAME TO "notification_type_enum"`); - } + async down(queryRunner) { + await queryRunner.query( + `CREATE TYPE "public"."notification_type_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, + ); + await queryRunner.query( + `ALTER TABLE "notification" ALTER COLUMN "type" TYPE "public"."notification_type_enum_old" USING "type"::"text"::"public"."notification_type_enum_old"`, + ); + await queryRunner.query(`DROP TYPE "public"."notification_type_enum"`); + await queryRunner.query( + `ALTER TYPE "public"."notification_type_enum_old" RENAME TO "notification_type_enum"`, + ); + } } diff --git a/packages/backend/migration/1646633030285-chart-federation-active.js b/packages/backend/migration/1646633030285-chart-federation-active.js index 952289c8f8..3cb2dffe3f 100644 --- a/packages/backend/migration/1646633030285-chart-federation-active.js +++ b/packages/backend/migration/1646633030285-chart-federation-active.js @@ -1,13 +1,21 @@ export class chartFederationActive1646633030285 { - name = 'chartFederationActive1646633030285' + name = "chartFederationActive1646633030285"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___active" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___active" smallint NOT NULL DEFAULT '0'`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "___active" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "___active" smallint NOT NULL DEFAULT '0'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___active"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___active"`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "___active"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "___active"`, + ); + } } diff --git a/packages/backend/migration/1646655454495-remove-instance-drive-columns.js b/packages/backend/migration/1646655454495-remove-instance-drive-columns.js index a0ee1b2c43..12f56bc2d7 100644 --- a/packages/backend/migration/1646655454495-remove-instance-drive-columns.js +++ b/packages/backend/migration/1646655454495-remove-instance-drive-columns.js @@ -1,13 +1,17 @@ export class removeInstanceDriveColumns1646655454495 { - name = 'removeInstanceDriveColumns1646655454495' + name = "removeInstanceDriveColumns1646655454495"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "driveUsage"`); - await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "driveFiles"`); - } + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "driveUsage"`); + await queryRunner.query(`ALTER TABLE "instance" DROP COLUMN "driveFiles"`); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "instance" ADD "driveFiles" integer NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "instance" ADD "driveUsage" bigint NOT NULL DEFAULT '0'`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "instance" ADD "driveFiles" integer NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "instance" ADD "driveUsage" bigint NOT NULL DEFAULT '0'`, + ); + } } diff --git a/packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js b/packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js index c9a847cbcf..e34b9a22e9 100644 --- a/packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js +++ b/packages/backend/migration/1646732390560-chart-federation-active-sub-pub.js @@ -1,21 +1,45 @@ export class chartFederationActiveSubPub1646732390560 { - name = 'chartFederationActiveSubPub1646732390560' + name = "chartFederationActiveSubPub1646732390560"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___active"`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___active"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___subActive" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___pubActive" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___subActive" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___pubActive" smallint NOT NULL DEFAULT '0'`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "___active"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "___active"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "___subActive" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "___pubActive" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "___subActive" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "___pubActive" smallint NOT NULL DEFAULT '0'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___pubActive"`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___subActive"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___pubActive"`); - await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___subActive"`); - await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___active" smallint NOT NULL DEFAULT '0'`); - await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___active" smallint NOT NULL DEFAULT '0'`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "___pubActive"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" DROP COLUMN "___subActive"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "___pubActive"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" DROP COLUMN "___subActive"`, + ); + await queryRunner.query( + `ALTER TABLE "__chart_day__federation" ADD "___active" smallint NOT NULL DEFAULT '0'`, + ); + await queryRunner.query( + `ALTER TABLE "__chart__federation" ADD "___active" smallint NOT NULL DEFAULT '0'`, + ); + } } diff --git a/packages/backend/migration/1648548247382-webhook.js b/packages/backend/migration/1648548247382-webhook.js index aea369a5cc..3e7160e2b2 100644 --- a/packages/backend/migration/1648548247382-webhook.js +++ b/packages/backend/migration/1648548247382-webhook.js @@ -1,19 +1,37 @@ export class webhook1648548247382 { - name = 'webhook1648548247382' + name = "webhook1648548247382"; - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "webhook" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "on" character varying(128) array NOT NULL DEFAULT '{}', "url" character varying(1024) NOT NULL, "secret" character varying(1024) NOT NULL, "active" boolean NOT NULL DEFAULT true, CONSTRAINT "PK_e6765510c2d078db49632b59020" PRIMARY KEY ("id")); COMMENT ON COLUMN "webhook"."createdAt" IS 'The created date of the Antenna.'; COMMENT ON COLUMN "webhook"."userId" IS 'The owner ID.'; COMMENT ON COLUMN "webhook"."name" IS 'The name of the Antenna.'`); - await queryRunner.query(`CREATE INDEX "IDX_f272c8c8805969e6a6449c77b3" ON "webhook" ("userId") `); - await queryRunner.query(`CREATE INDEX "IDX_8063a0586ed1dfbe86e982d961" ON "webhook" ("on") `); - await queryRunner.query(`CREATE INDEX "IDX_5a056076f76b2efe08216ba655" ON "webhook" ("active") `); - await queryRunner.query(`ALTER TABLE "webhook" ADD CONSTRAINT "FK_f272c8c8805969e6a6449c77b3c" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "webhook" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "name" character varying(128) NOT NULL, "on" character varying(128) array NOT NULL DEFAULT '{}', "url" character varying(1024) NOT NULL, "secret" character varying(1024) NOT NULL, "active" boolean NOT NULL DEFAULT true, CONSTRAINT "PK_e6765510c2d078db49632b59020" PRIMARY KEY ("id")); COMMENT ON COLUMN "webhook"."createdAt" IS 'The created date of the Antenna.'; COMMENT ON COLUMN "webhook"."userId" IS 'The owner ID.'; COMMENT ON COLUMN "webhook"."name" IS 'The name of the Antenna.'`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f272c8c8805969e6a6449c77b3" ON "webhook" ("userId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_8063a0586ed1dfbe86e982d961" ON "webhook" ("on") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_5a056076f76b2efe08216ba655" ON "webhook" ("active") `, + ); + await queryRunner.query( + `ALTER TABLE "webhook" ADD CONSTRAINT "FK_f272c8c8805969e6a6449c77b3c" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`, + ); } async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "webhook" DROP CONSTRAINT "FK_f272c8c8805969e6a6449c77b3c"`); - await queryRunner.query(`DROP INDEX "public"."IDX_5a056076f76b2efe08216ba655"`); - await queryRunner.query(`DROP INDEX "public"."IDX_8063a0586ed1dfbe86e982d961"`); - await queryRunner.query(`DROP INDEX "public"."IDX_f272c8c8805969e6a6449c77b3"`); - await queryRunner.query(`DROP TABLE "webhook"`); + await queryRunner.query( + `ALTER TABLE "webhook" DROP CONSTRAINT "FK_f272c8c8805969e6a6449c77b3c"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_5a056076f76b2efe08216ba655"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_8063a0586ed1dfbe86e982d961"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_f272c8c8805969e6a6449c77b3"`, + ); + await queryRunner.query(`DROP TABLE "webhook"`); } } diff --git a/packages/backend/migration/1648816172177-webhook-2.js b/packages/backend/migration/1648816172177-webhook-2.js index 2feb68d611..a4ab4ef8f8 100644 --- a/packages/backend/migration/1648816172177-webhook-2.js +++ b/packages/backend/migration/1648816172177-webhook-2.js @@ -1,14 +1,15 @@ - export class webhook21648816172177 { - name = 'webhook21648816172177' + name = "webhook21648816172177"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "webhook" ADD "latestSentAt" TIMESTAMP WITH TIME ZONE`); - await queryRunner.query(`ALTER TABLE "webhook" ADD "latestStatus" integer`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "webhook" ADD "latestSentAt" TIMESTAMP WITH TIME ZONE`, + ); + await queryRunner.query(`ALTER TABLE "webhook" ADD "latestStatus" integer`); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "webhook" DROP COLUMN "latestStatus"`); - await queryRunner.query(`ALTER TABLE "webhook" DROP COLUMN "latestSentAt"`); - } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "webhook" DROP COLUMN "latestStatus"`); + await queryRunner.query(`ALTER TABLE "webhook" DROP COLUMN "latestSentAt"`); + } } diff --git a/packages/backend/migration/1651224615271-foreign-key.js b/packages/backend/migration/1651224615271-foreign-key.js index 535d21731a..7e6bc79623 100644 --- a/packages/backend/migration/1651224615271-foreign-key.js +++ b/packages/backend/migration/1651224615271-foreign-key.js @@ -1,89 +1,187 @@ export class foreignKeyReports1651224615271 { - name = 'foreignKeyReports1651224615271' + name = "foreignKeyReports1651224615271"; - async up(queryRunner) { - await Promise.all([ - queryRunner.query(`ALTER INDEX "public"."IDX_seoignmeoprigmkpodgrjmkpormg" RENAME TO "IDX_c8cc87bd0f2f4487d17c651fbf"`), - queryRunner.query(`DROP INDEX "public"."IDX_note_on_channelId_and_id_desc"`), + async up(queryRunner) { + await Promise.all([ + queryRunner.query( + `ALTER INDEX "public"."IDX_seoignmeoprigmkpodgrjmkpormg" RENAME TO "IDX_c8cc87bd0f2f4487d17c651fbf"`, + ), + queryRunner.query( + `DROP INDEX "public"."IDX_note_on_channelId_and_id_desc"`, + ), - // remove unnecessary default null, see also down - queryRunner.query(`ALTER TABLE "user" ALTER COLUMN "followersUri" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "session" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "appId" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "name" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "description" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "access_token" ALTER COLUMN "iconUrl" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "softwareName" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "softwareVersion" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "name" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "description" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "maintainerName" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "maintainerEmail" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "iconUrl" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "faviconUrl" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "instance" ALTER COLUMN "themeColor" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "clip" ALTER COLUMN "description" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "note" ALTER COLUMN "channelId" DROP DEFAULT`), - queryRunner.query(`ALTER TABLE "abuse_user_report" ALTER COLUMN "comment" DROP DEFAULT`), + // remove unnecessary default null, see also down + queryRunner.query( + `ALTER TABLE "user" ALTER COLUMN "followersUri" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "access_token" ALTER COLUMN "session" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "access_token" ALTER COLUMN "appId" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "access_token" ALTER COLUMN "name" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "access_token" ALTER COLUMN "description" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "access_token" ALTER COLUMN "iconUrl" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "instance" ALTER COLUMN "softwareName" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "instance" ALTER COLUMN "softwareVersion" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "instance" ALTER COLUMN "name" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "instance" ALTER COLUMN "description" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "instance" ALTER COLUMN "maintainerName" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "instance" ALTER COLUMN "maintainerEmail" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "instance" ALTER COLUMN "iconUrl" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "instance" ALTER COLUMN "faviconUrl" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "instance" ALTER COLUMN "themeColor" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "clip" ALTER COLUMN "description" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "note" ALTER COLUMN "channelId" DROP DEFAULT`, + ), + queryRunner.query( + `ALTER TABLE "abuse_user_report" ALTER COLUMN "comment" DROP DEFAULT`, + ), - queryRunner.query(`CREATE INDEX "IDX_315c779174fe8247ab324f036e" ON "drive_file" ("isLink")`), - queryRunner.query(`CREATE INDEX "IDX_f22169eb10657bded6d875ac8f" ON "note" ("channelId")`), - //queryRunner.query(`CREATE INDEX "IDX_a9021cc2e1feb5f72d3db6e9f5" ON "abuse_user_report" ("targetUserId")`), + queryRunner.query( + `CREATE INDEX "IDX_315c779174fe8247ab324f036e" ON "drive_file" ("isLink")`, + ), + queryRunner.query( + `CREATE INDEX "IDX_f22169eb10657bded6d875ac8f" ON "note" ("channelId")`, + ), + //queryRunner.query(`CREATE INDEX "IDX_a9021cc2e1feb5f72d3db6e9f5" ON "abuse_user_report" ("targetUserId")`), - //queryRunner.query(`DELETE FROM "abuse_user_report" WHERE "targetUserId" NOT IN (SELECT "id" FROM "user")`).then(() => { - // queryRunner.query(`ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_a9021cc2e1feb5f72d3db6e9f5f" FOREIGN KEY ("targetUserId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - //}), + //queryRunner.query(`DELETE FROM "abuse_user_report" WHERE "targetUserId" NOT IN (SELECT "id" FROM "user")`).then(() => { + // queryRunner.query(`ALTER TABLE "abuse_user_report" ADD CONSTRAINT "FK_a9021cc2e1feb5f72d3db6e9f5f" FOREIGN KEY ("targetUserId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + //}), - queryRunner.query(`ALTER TABLE "poll" ADD CONSTRAINT "UQ_da851e06d0dfe2ef397d8b1bf1b" UNIQUE ("noteId")`), - queryRunner.query(`ALTER TABLE "user_keypair" ADD CONSTRAINT "UQ_f4853eb41ab722fe05f81cedeb6" UNIQUE ("userId")`), - queryRunner.query(`ALTER TABLE "user_profile" ADD CONSTRAINT "UQ_51cb79b5555effaf7d69ba1cff9" UNIQUE ("userId")`), - queryRunner.query(`ALTER TABLE "user_publickey" ADD CONSTRAINT "UQ_10c146e4b39b443ede016f6736d" UNIQUE ("userId")`), - queryRunner.query(`ALTER TABLE "promo_note" ADD CONSTRAINT "UQ_e263909ca4fe5d57f8d4230dd5c" UNIQUE ("noteId")`), + queryRunner.query( + `ALTER TABLE "poll" ADD CONSTRAINT "UQ_da851e06d0dfe2ef397d8b1bf1b" UNIQUE ("noteId")`, + ), + queryRunner.query( + `ALTER TABLE "user_keypair" ADD CONSTRAINT "UQ_f4853eb41ab722fe05f81cedeb6" UNIQUE ("userId")`, + ), + queryRunner.query( + `ALTER TABLE "user_profile" ADD CONSTRAINT "UQ_51cb79b5555effaf7d69ba1cff9" UNIQUE ("userId")`, + ), + queryRunner.query( + `ALTER TABLE "user_publickey" ADD CONSTRAINT "UQ_10c146e4b39b443ede016f6736d" UNIQUE ("userId")`, + ), + queryRunner.query( + `ALTER TABLE "promo_note" ADD CONSTRAINT "UQ_e263909ca4fe5d57f8d4230dd5c" UNIQUE ("noteId")`, + ), - queryRunner.query(`ALTER TABLE "page" RENAME CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10" TO "FK_a9ca79ad939bf06066b81c9d3aa"`), + queryRunner.query( + `ALTER TABLE "page" RENAME CONSTRAINT "FK_3126dd7c502c9e4d7597ef7ef10" TO "FK_a9ca79ad939bf06066b81c9d3aa"`, + ), - queryRunner.query(`ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum" ADD VALUE 'pollEnded' AFTER 'pollVote'`), - ]); - } + queryRunner.query( + `ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum" ADD VALUE 'pollEnded' AFTER 'pollVote'`, + ), + ]); + } - async down(queryRunner) { - await Promise.all([ - // There is no ALTER TYPE REMOVE VALUE query, so the reverse operation is a bit more complex - queryRunner.query(`UPDATE "user_profile" SET "mutingNotificationTypes" = array_remove("mutingNotificationTypes", 'pollEnded')`) - .then(() => - queryRunner.query(`CREATE TYPE "public"."user_profile_mutingnotificationtypes_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`) - ).then(() => - queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" DROP DEFAULT`) - ).then(() => - queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" TYPE "public"."user_profile_mutingnotificationtypes_enum_old"[] USING "mutingNotificationTypes"::"text"::"public"."user_profile_mutingnotificationtypes_enum_old"[]`) - ).then(() => - queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" SET DEFAULT '{}'`) - ).then(() => - queryRunner.query(`DROP TYPE "public"."user_profile_mutingnotificationtypes_enum"`) - ).then(() => - queryRunner.query(`ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum_old" RENAME TO "user_profile_mutingnotificationtypes_enum"`) - ), + async down(queryRunner) { + await Promise.all([ + // There is no ALTER TYPE REMOVE VALUE query, so the reverse operation is a bit more complex + queryRunner + .query( + `UPDATE "user_profile" SET "mutingNotificationTypes" = array_remove("mutingNotificationTypes", 'pollEnded')`, + ) + .then(() => + queryRunner.query( + `CREATE TYPE "public"."user_profile_mutingnotificationtypes_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app')`, + ), + ) + .then(() => + queryRunner.query( + `ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" DROP DEFAULT`, + ), + ) + .then(() => + queryRunner.query( + `ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" TYPE "public"."user_profile_mutingnotificationtypes_enum_old"[] USING "mutingNotificationTypes"::"text"::"public"."user_profile_mutingnotificationtypes_enum_old"[]`, + ), + ) + .then(() => + queryRunner.query( + `ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" SET DEFAULT '{}'`, + ), + ) + .then(() => + queryRunner.query( + `DROP TYPE "public"."user_profile_mutingnotificationtypes_enum"`, + ), + ) + .then(() => + queryRunner.query( + `ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum_old" RENAME TO "user_profile_mutingnotificationtypes_enum"`, + ), + ), - queryRunner.query(`ALTER TABLE "page" RENAME CONSTRAINT "FK_a9ca79ad939bf06066b81c9d3aa" TO "FK_3126dd7c502c9e4d7597ef7ef10"`), + queryRunner.query( + `ALTER TABLE "page" RENAME CONSTRAINT "FK_a9ca79ad939bf06066b81c9d3aa" TO "FK_3126dd7c502c9e4d7597ef7ef10"`, + ), - queryRunner.query(`ALTER TABLE "promo_note" DROP CONSTRAINT "UQ_e263909ca4fe5d57f8d4230dd5c"`), - queryRunner.query(`ALTER TABLE "user_publickey" DROP CONSTRAINT "UQ_10c146e4b39b443ede016f6736d"`), - queryRunner.query(`ALTER TABLE "user_profile" DROP CONSTRAINT "UQ_51cb79b5555effaf7d69ba1cff9"`), - queryRunner.query(`ALTER TABLE "user_keypair" DROP CONSTRAINT "UQ_f4853eb41ab722fe05f81cedeb6"`), - queryRunner.query(`ALTER TABLE "poll" DROP CONSTRAINT "UQ_da851e06d0dfe2ef397d8b1bf1b"`), + queryRunner.query( + `ALTER TABLE "promo_note" DROP CONSTRAINT "UQ_e263909ca4fe5d57f8d4230dd5c"`, + ), + queryRunner.query( + `ALTER TABLE "user_publickey" DROP CONSTRAINT "UQ_10c146e4b39b443ede016f6736d"`, + ), + queryRunner.query( + `ALTER TABLE "user_profile" DROP CONSTRAINT "UQ_51cb79b5555effaf7d69ba1cff9"`, + ), + queryRunner.query( + `ALTER TABLE "user_keypair" DROP CONSTRAINT "UQ_f4853eb41ab722fe05f81cedeb6"`, + ), + queryRunner.query( + `ALTER TABLE "poll" DROP CONSTRAINT "UQ_da851e06d0dfe2ef397d8b1bf1b"`, + ), - queryRunner.query(`ALTER TABLE "abuse_user_report" ALTER COLUMN "comment" SET DEFAULT '{}'`), - queryRunner.query(`ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_a9021cc2e1feb5f72d3db6e9f5f"`), + queryRunner.query( + `ALTER TABLE "abuse_user_report" ALTER COLUMN "comment" SET DEFAULT '{}'`, + ), + queryRunner.query( + `ALTER TABLE "abuse_user_report" DROP CONSTRAINT "FK_a9021cc2e1feb5f72d3db6e9f5f"`, + ), - queryRunner.query(`DROP INDEX "public"."IDX_a9021cc2e1feb5f72d3db6e9f5"`), - queryRunner.query(`DROP INDEX "public"."IDX_f22169eb10657bded6d875ac8f"`), - queryRunner.query(`DROP INDEX "public"."IDX_315c779174fe8247ab324f036e"`), + queryRunner.query(`DROP INDEX "public"."IDX_a9021cc2e1feb5f72d3db6e9f5"`), + queryRunner.query(`DROP INDEX "public"."IDX_f22169eb10657bded6d875ac8f"`), + queryRunner.query(`DROP INDEX "public"."IDX_315c779174fe8247ab324f036e"`), - /* DEFAULT's are not set again because if the column can be NULL, then DEFAULT NULL is not necessary. + /* DEFAULT's are not set again because if the column can be NULL, then DEFAULT NULL is not necessary. see also https://github.com/typeorm/typeorm/issues/7579#issuecomment-835423615 */ - queryRunner.query(`CREATE INDEX "IDX_note_on_channelId_and_id_desc" ON "note" ("id", "channelId") `), - queryRunner.query(`ALTER INDEX "public"."IDX_c8cc87bd0f2f4487d17c651fbf" RENAME TO "IDX_seoignmeoprigmkpodgrjmkpormg"`), - ]); - } + queryRunner.query( + `CREATE INDEX "IDX_note_on_channelId_and_id_desc" ON "note" ("id", "channelId") `, + ), + queryRunner.query( + `ALTER INDEX "public"."IDX_c8cc87bd0f2f4487d17c651fbf" RENAME TO "IDX_seoignmeoprigmkpodgrjmkpormg"`, + ), + ]); + } } diff --git a/packages/backend/migration/1652859567549-uniform-themecolor.js b/packages/backend/migration/1652859567549-uniform-themecolor.js index 8da1fd7fbb..8c91854d53 100644 --- a/packages/backend/migration/1652859567549-uniform-themecolor.js +++ b/packages/backend/migration/1652859567549-uniform-themecolor.js @@ -1,7 +1,7 @@ -import tinycolor from 'tinycolor2'; +import tinycolor from "tinycolor2"; export class uniformThemecolor1652859567549 { - name = 'uniformThemecolor1652859567549' + name = "uniformThemecolor1652859567549"; async up(queryRunner) { const formatColor = (color) => { @@ -13,20 +13,35 @@ export class uniformThemecolor1652859567549 { } }; - await queryRunner.query('SELECT "id", "themeColor" FROM "instance" WHERE "themeColor" IS NOT NULL') - .then(instances => Promise.all(instances.map(instance => { - // update theme color to uniform format, e.g. #00ff00 - // invalid theme colors get set to null - return queryRunner.query('UPDATE "instance" SET "themeColor" = $1 WHERE "id" = $2', [formatColor(instance.themeColor), instance.id]); - }))); + await queryRunner + .query( + 'SELECT "id", "themeColor" FROM "instance" WHERE "themeColor" IS NOT NULL', + ) + .then((instances) => + Promise.all( + instances.map((instance) => { + // update theme color to uniform format, e.g. #00ff00 + // invalid theme colors get set to null + return queryRunner.query( + 'UPDATE "instance" SET "themeColor" = $1 WHERE "id" = $2', + [formatColor(instance.themeColor), instance.id], + ); + }), + ), + ); // also fix own theme color - await queryRunner.query('SELECT "themeColor" FROM "meta" WHERE "themeColor" IS NOT NULL LIMIT 1') - .then(metas => { - if (metas.length > 0) { - return queryRunner.query('UPDATE "meta" SET "themeColor" = $1', [formatColor(metas[0].themeColor)]); - } - }); + await queryRunner + .query( + 'SELECT "themeColor" FROM "meta" WHERE "themeColor" IS NOT NULL LIMIT 1', + ) + .then((metas) => { + if (metas.length > 0) { + return queryRunner.query('UPDATE "meta" SET "themeColor" = $1', [ + formatColor(metas[0].themeColor), + ]); + } + }); } async down(queryRunner) { diff --git a/packages/backend/migration/1655368940105-nsfw-detection.js b/packages/backend/migration/1655368940105-nsfw-detection.js index 9268f43407..f1bcda50e5 100644 --- a/packages/backend/migration/1655368940105-nsfw-detection.js +++ b/packages/backend/migration/1655368940105-nsfw-detection.js @@ -1,23 +1,51 @@ export class nsfwDetection1655368940105 { - name = 'nsfwDetection1655368940105' + name = "nsfwDetection1655368940105"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "drive_file" ADD "forceIsSensitive" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`ALTER TABLE "drive_file" ADD "predictedIsSensitive" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."predictedIsSensitive" IS 'Whether the DriveFile is NSFW. (predict)'`); - await queryRunner.query(`CREATE TYPE "public"."meta_sensitiveimagedetection_enum" AS ENUM('none', 'all', 'local', 'remote')`); - await queryRunner.query(`ALTER TABLE "meta" ADD "sensitiveImageDetection" "public"."meta_sensitiveimagedetection_enum" NOT NULL DEFAULT 'none'`); - await queryRunner.query(`ALTER TABLE "meta" ADD "forceIsSensitiveWhenPredicted" boolean NOT NULL DEFAULT true`); - await queryRunner.query(`CREATE INDEX "IDX_fc2d74a6d7d8b11292a851d8f8" ON "drive_file" ("predictedIsSensitive") `); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "drive_file" ADD "forceIsSensitive" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" ADD "predictedIsSensitive" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."predictedIsSensitive" IS 'Whether the DriveFile is NSFW. (predict)'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."meta_sensitiveimagedetection_enum" AS ENUM('none', 'all', 'local', 'remote')`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "sensitiveImageDetection" "public"."meta_sensitiveimagedetection_enum" NOT NULL DEFAULT 'none'`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "forceIsSensitiveWhenPredicted" boolean NOT NULL DEFAULT true`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_fc2d74a6d7d8b11292a851d8f8" ON "drive_file" ("predictedIsSensitive") `, + ); + } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "public"."IDX_fc2d74a6d7d8b11292a851d8f8"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "forceIsSensitiveWhenPredicted"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "sensitiveImageDetection"`); - await queryRunner.query(`DROP TYPE "public"."meta_sensitiveimagedetection_enum"`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."predictedIsSensitive" IS 'Whether the DriveFile is NSFW. (predict)'`); - await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "predictedIsSensitive"`); - await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "forceIsSensitive"`); - } + async down(queryRunner) { + await queryRunner.query( + `DROP INDEX "public"."IDX_fc2d74a6d7d8b11292a851d8f8"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "forceIsSensitiveWhenPredicted"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "sensitiveImageDetection"`, + ); + await queryRunner.query( + `DROP TYPE "public"."meta_sensitiveimagedetection_enum"`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."predictedIsSensitive" IS 'Whether the DriveFile is NSFW. (predict)'`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" DROP COLUMN "predictedIsSensitive"`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" DROP COLUMN "forceIsSensitive"`, + ); + } } diff --git a/packages/backend/migration/1655371960534-nsfw-detection-2.js b/packages/backend/migration/1655371960534-nsfw-detection-2.js index aac6f37dad..236cd70913 100644 --- a/packages/backend/migration/1655371960534-nsfw-detection-2.js +++ b/packages/backend/migration/1655371960534-nsfw-detection-2.js @@ -1,15 +1,27 @@ export class nsfwDetection21655371960534 { - name = 'nsfwDetection21655371960534' + name = "nsfwDetection21655371960534"; - async up(queryRunner) { - await queryRunner.query(`CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" AS ENUM('medium', 'low', 'high')`); - await queryRunner.query(`ALTER TABLE "meta" ADD "sensitiveImageDetectionSensitivity" "public"."meta_sensitiveimagedetectionsensitivity_enum" NOT NULL DEFAULT 'medium'`); - await queryRunner.query(`ALTER TABLE "meta" ADD "disallowUploadWhenPredictedAsPorn" boolean NOT NULL DEFAULT false`); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" AS ENUM('medium', 'low', 'high')`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "sensitiveImageDetectionSensitivity" "public"."meta_sensitiveimagedetectionsensitivity_enum" NOT NULL DEFAULT 'medium'`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "disallowUploadWhenPredictedAsPorn" boolean NOT NULL DEFAULT false`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "disallowUploadWhenPredictedAsPorn"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "sensitiveImageDetectionSensitivity"`); - await queryRunner.query(`DROP TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum"`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "disallowUploadWhenPredictedAsPorn"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "sensitiveImageDetectionSensitivity"`, + ); + await queryRunner.query( + `DROP TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum"`, + ); + } } diff --git a/packages/backend/migration/1655388169582-nsfw-detection-3.js b/packages/backend/migration/1655388169582-nsfw-detection-3.js index a5c80cf968..6a6ceeafba 100644 --- a/packages/backend/migration/1655388169582-nsfw-detection-3.js +++ b/packages/backend/migration/1655388169582-nsfw-detection-3.js @@ -1,21 +1,45 @@ export class nsfwDetection31655388169582 { - name = 'nsfwDetection31655388169582' + name = "nsfwDetection31655388169582"; - async up(queryRunner) { - await queryRunner.query(`ALTER TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" RENAME TO "meta_sensitiveimagedetectionsensitivity_enum_old"`); - await queryRunner.query(`CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" AS ENUM('medium', 'low', 'high', 'veryLow', 'veryHigh')`); - await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" USING "sensitiveImageDetectionSensitivity"::"text"::"public"."meta_sensitiveimagedetectionsensitivity_enum"`); - await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" SET DEFAULT 'medium'`); - await queryRunner.query(`DROP TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum_old"`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" RENAME TO "meta_sensitiveimagedetectionsensitivity_enum_old"`, + ); + await queryRunner.query( + `CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" AS ENUM('medium', 'low', 'high', 'veryLow', 'veryHigh')`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" USING "sensitiveImageDetectionSensitivity"::"text"::"public"."meta_sensitiveimagedetectionsensitivity_enum"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" SET DEFAULT 'medium'`, + ); + await queryRunner.query( + `DROP TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum_old"`, + ); + } - async down(queryRunner) { - await queryRunner.query(`CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum_old" AS ENUM('medium', 'low', 'high')`); - await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum_old" USING "sensitiveImageDetectionSensitivity"::"text"::"public"."meta_sensitiveimagedetectionsensitivity_enum_old"`); - await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" SET DEFAULT 'medium'`); - await queryRunner.query(`DROP TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum"`); - await queryRunner.query(`ALTER TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum_old" RENAME TO "meta_sensitiveimagedetectionsensitivity_enum"`); - } + async down(queryRunner) { + await queryRunner.query( + `CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum_old" AS ENUM('medium', 'low', 'high')`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" DROP DEFAULT`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum_old" USING "sensitiveImageDetectionSensitivity"::"text"::"public"."meta_sensitiveimagedetectionsensitivity_enum_old"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ALTER COLUMN "sensitiveImageDetectionSensitivity" SET DEFAULT 'medium'`, + ); + await queryRunner.query( + `DROP TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum"`, + ); + await queryRunner.query( + `ALTER TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum_old" RENAME TO "meta_sensitiveimagedetectionsensitivity_enum"`, + ); + } } diff --git a/packages/backend/migration/1655393015659-nsfw-detection-4.js b/packages/backend/migration/1655393015659-nsfw-detection-4.js index e780732623..3e45897327 100644 --- a/packages/backend/migration/1655393015659-nsfw-detection-4.js +++ b/packages/backend/migration/1655393015659-nsfw-detection-4.js @@ -1,25 +1,57 @@ export class nsfwDetection41655393015659 { - name = 'nsfwDetection41655393015659' + name = "nsfwDetection41655393015659"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "sensitiveImageDetection"`); - await queryRunner.query(`DROP TYPE "public"."meta_sensitiveimagedetection_enum"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "sensitiveImageDetectionSensitivity"`); - await queryRunner.query(`DROP TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum"`); - await queryRunner.query(`CREATE TYPE "public"."meta_sensitivemediadetection_enum" AS ENUM('none', 'all', 'local', 'remote')`); - await queryRunner.query(`ALTER TABLE "meta" ADD "sensitiveMediaDetection" "public"."meta_sensitivemediadetection_enum" NOT NULL DEFAULT 'none'`); - await queryRunner.query(`CREATE TYPE "public"."meta_sensitivemediadetectionsensitivity_enum" AS ENUM('medium', 'low', 'high', 'veryLow', 'veryHigh')`); - await queryRunner.query(`ALTER TABLE "meta" ADD "sensitiveMediaDetectionSensitivity" "public"."meta_sensitivemediadetectionsensitivity_enum" NOT NULL DEFAULT 'medium'`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "sensitiveImageDetection"`, + ); + await queryRunner.query( + `DROP TYPE "public"."meta_sensitiveimagedetection_enum"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "sensitiveImageDetectionSensitivity"`, + ); + await queryRunner.query( + `DROP TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum"`, + ); + await queryRunner.query( + `CREATE TYPE "public"."meta_sensitivemediadetection_enum" AS ENUM('none', 'all', 'local', 'remote')`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "sensitiveMediaDetection" "public"."meta_sensitivemediadetection_enum" NOT NULL DEFAULT 'none'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."meta_sensitivemediadetectionsensitivity_enum" AS ENUM('medium', 'low', 'high', 'veryLow', 'veryHigh')`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "sensitiveMediaDetectionSensitivity" "public"."meta_sensitivemediadetectionsensitivity_enum" NOT NULL DEFAULT 'medium'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "sensitiveMediaDetectionSensitivity"`); - await queryRunner.query(`DROP TYPE "public"."meta_sensitivemediadetectionsensitivity_enum"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "sensitiveMediaDetection"`); - await queryRunner.query(`DROP TYPE "public"."meta_sensitivemediadetection_enum"`); - await queryRunner.query(`CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" AS ENUM('medium', 'low', 'high', 'veryLow', 'veryHigh')`); - await queryRunner.query(`ALTER TABLE "meta" ADD "sensitiveImageDetectionSensitivity" "public"."meta_sensitiveimagedetectionsensitivity_enum" NOT NULL DEFAULT 'medium'`); - await queryRunner.query(`CREATE TYPE "public"."meta_sensitiveimagedetection_enum" AS ENUM('none', 'all', 'local', 'remote')`); - await queryRunner.query(`ALTER TABLE "meta" ADD "sensitiveImageDetection" "public"."meta_sensitiveimagedetection_enum" NOT NULL DEFAULT 'none'`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "sensitiveMediaDetectionSensitivity"`, + ); + await queryRunner.query( + `DROP TYPE "public"."meta_sensitivemediadetectionsensitivity_enum"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "sensitiveMediaDetection"`, + ); + await queryRunner.query( + `DROP TYPE "public"."meta_sensitivemediadetection_enum"`, + ); + await queryRunner.query( + `CREATE TYPE "public"."meta_sensitiveimagedetectionsensitivity_enum" AS ENUM('medium', 'low', 'high', 'veryLow', 'veryHigh')`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "sensitiveImageDetectionSensitivity" "public"."meta_sensitiveimagedetectionsensitivity_enum" NOT NULL DEFAULT 'medium'`, + ); + await queryRunner.query( + `CREATE TYPE "public"."meta_sensitiveimagedetection_enum" AS ENUM('none', 'all', 'local', 'remote')`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "sensitiveImageDetection" "public"."meta_sensitiveimagedetection_enum" NOT NULL DEFAULT 'none'`, + ); + } } diff --git a/packages/backend/migration/1655813815729-driveCapacityOverrideMb.js b/packages/backend/migration/1655813815729-driveCapacityOverrideMb.js index f257cd112f..e43f0af5c1 100644 --- a/packages/backend/migration/1655813815729-driveCapacityOverrideMb.js +++ b/packages/backend/migration/1655813815729-driveCapacityOverrideMb.js @@ -1,13 +1,21 @@ export class driveCapacityOverrideMb1655813815729 { - name = 'driveCapacityOverrideMb1655813815729' + name = "driveCapacityOverrideMb1655813815729"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" ADD "driveCapacityOverrideMb" integer`); - await queryRunner.query(`COMMENT ON COLUMN "user"."driveCapacityOverrideMb" IS 'Overrides user drive capacity limit'`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user" ADD "driveCapacityOverrideMb" integer`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."driveCapacityOverrideMb" IS 'Overrides user drive capacity limit'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`COMMENT ON COLUMN "user"."driveCapacityOverrideMb" IS 'Overrides user drive capacity limit'`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "driveCapacityOverrideMb"`); - } + async down(queryRunner) { + await queryRunner.query( + `COMMENT ON COLUMN "user"."driveCapacityOverrideMb" IS 'Overrides user drive capacity limit'`, + ); + await queryRunner.query( + `ALTER TABLE "user" DROP COLUMN "driveCapacityOverrideMb"`, + ); + } } diff --git a/packages/backend/migration/1655918165614-user-ip.js b/packages/backend/migration/1655918165614-user-ip.js index 2294fbaf19..2c5dc1c821 100644 --- a/packages/backend/migration/1655918165614-user-ip.js +++ b/packages/backend/migration/1655918165614-user-ip.js @@ -1,17 +1,31 @@ export class userIp1655918165614 { - name = 'userIp1655918165614' + name = "userIp1655918165614"; - async up(queryRunner) { - await queryRunner.query(`CREATE TABLE "user_ip" ("id" SERIAL NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "ip" character varying(128) NOT NULL, CONSTRAINT "PK_2c44ddfbf7c0464d028dcef325e" PRIMARY KEY ("id"))`); - await queryRunner.query(`CREATE INDEX "IDX_7f7f1c66f48e9a8e18a33bc515" ON "user_ip" ("userId") `); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_361b500e06721013c124b7b6c5" ON "user_ip" ("userId", "ip") `); - await queryRunner.query(`ALTER TABLE "user_ip" ADD CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); - } + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "user_ip" ("id" SERIAL NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "ip" character varying(128) NOT NULL, CONSTRAINT "PK_2c44ddfbf7c0464d028dcef325e" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7f7f1c66f48e9a8e18a33bc515" ON "user_ip" ("userId") `, + ); + await queryRunner.query( + `CREATE UNIQUE INDEX "IDX_361b500e06721013c124b7b6c5" ON "user_ip" ("userId", "ip") `, + ); + await queryRunner.query( + `ALTER TABLE "user_ip" ADD CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_ip" DROP CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150"`); - await queryRunner.query(`DROP INDEX "public"."IDX_361b500e06721013c124b7b6c5"`); - await queryRunner.query(`DROP INDEX "public"."IDX_7f7f1c66f48e9a8e18a33bc515"`); - await queryRunner.query(`DROP TABLE "user_ip"`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_ip" DROP CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_361b500e06721013c124b7b6c5"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_7f7f1c66f48e9a8e18a33bc515"`, + ); + await queryRunner.query(`DROP TABLE "user_ip"`); + } } diff --git a/packages/backend/migration/1656122560740-file-ip.js b/packages/backend/migration/1656122560740-file-ip.js index b59e7a911f..534097adb3 100644 --- a/packages/backend/migration/1656122560740-file-ip.js +++ b/packages/backend/migration/1656122560740-file-ip.js @@ -1,13 +1,19 @@ export class fileIp1656122560740 { - name = 'fileIp1656122560740' + name = "fileIp1656122560740"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "drive_file" ADD "requestHeaders" jsonb DEFAULT '{}'`); - await queryRunner.query(`ALTER TABLE "drive_file" ADD "requestIp" character varying(128)`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "drive_file" ADD "requestHeaders" jsonb DEFAULT '{}'`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" ADD "requestIp" character varying(128)`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "requestIp"`); - await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "requestHeaders"`); - } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "requestIp"`); + await queryRunner.query( + `ALTER TABLE "drive_file" DROP COLUMN "requestHeaders"`, + ); + } } diff --git a/packages/backend/migration/1656251734807-nsfw-detection-5.js b/packages/backend/migration/1656251734807-nsfw-detection-5.js index 6f0c536907..7a2206e018 100644 --- a/packages/backend/migration/1656251734807-nsfw-detection-5.js +++ b/packages/backend/migration/1656251734807-nsfw-detection-5.js @@ -1,33 +1,79 @@ export class nsfwDetection51656251734807 { - name = 'nsfwDetection51656251734807' + name = "nsfwDetection51656251734807"; - async up(queryRunner) { - await queryRunner.query(`DROP INDEX "public"."IDX_fc2d74a6d7d8b11292a851d8f8"`); - await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "forceIsSensitive"`); - await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "predictedIsSensitive"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "forceIsSensitiveWhenPredicted"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "disallowUploadWhenPredictedAsPorn"`); - await queryRunner.query(`ALTER TABLE "drive_file" ADD "maybeSensitive" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."maybeSensitive" IS 'Whether the DriveFile is NSFW. (predict)'`); - await queryRunner.query(`ALTER TABLE "drive_file" ADD "maybePorn" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`ALTER TABLE "meta" ADD "setSensitiveFlagAutomatically" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`ALTER TABLE "user_profile" ADD "autoSensitive" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`CREATE INDEX "IDX_3b33dff77bb64b23c88151d23e" ON "drive_file" ("maybeSensitive") `); - await queryRunner.query(`CREATE INDEX "IDX_8bdcd3dd2bddb78014999a16ce" ON "drive_file" ("maybePorn") `); - } + async up(queryRunner) { + await queryRunner.query( + `DROP INDEX "public"."IDX_fc2d74a6d7d8b11292a851d8f8"`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" DROP COLUMN "forceIsSensitive"`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" DROP COLUMN "predictedIsSensitive"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "forceIsSensitiveWhenPredicted"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "disallowUploadWhenPredictedAsPorn"`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" ADD "maybeSensitive" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."maybeSensitive" IS 'Whether the DriveFile is NSFW. (predict)'`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" ADD "maybePorn" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "setSensitiveFlagAutomatically" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "autoSensitive" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_3b33dff77bb64b23c88151d23e" ON "drive_file" ("maybeSensitive") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_8bdcd3dd2bddb78014999a16ce" ON "drive_file" ("maybePorn") `, + ); + } - async down(queryRunner) { - await queryRunner.query(`DROP INDEX "public"."IDX_8bdcd3dd2bddb78014999a16ce"`); - await queryRunner.query(`DROP INDEX "public"."IDX_3b33dff77bb64b23c88151d23e"`); - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "autoSensitive"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "setSensitiveFlagAutomatically"`); - await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "maybePorn"`); - await queryRunner.query(`COMMENT ON COLUMN "drive_file"."maybeSensitive" IS 'Whether the DriveFile is NSFW. (predict)'`); - await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "maybeSensitive"`); - await queryRunner.query(`ALTER TABLE "meta" ADD "disallowUploadWhenPredictedAsPorn" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`ALTER TABLE "meta" ADD "forceIsSensitiveWhenPredicted" boolean NOT NULL DEFAULT true`); - await queryRunner.query(`ALTER TABLE "drive_file" ADD "predictedIsSensitive" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`ALTER TABLE "drive_file" ADD "forceIsSensitive" boolean NOT NULL DEFAULT false`); - await queryRunner.query(`CREATE INDEX "IDX_fc2d74a6d7d8b11292a851d8f8" ON "drive_file" ("predictedIsSensitive") `); - } + async down(queryRunner) { + await queryRunner.query( + `DROP INDEX "public"."IDX_8bdcd3dd2bddb78014999a16ce"`, + ); + await queryRunner.query( + `DROP INDEX "public"."IDX_3b33dff77bb64b23c88151d23e"`, + ); + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "autoSensitive"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "setSensitiveFlagAutomatically"`, + ); + await queryRunner.query(`ALTER TABLE "drive_file" DROP COLUMN "maybePorn"`); + await queryRunner.query( + `COMMENT ON COLUMN "drive_file"."maybeSensitive" IS 'Whether the DriveFile is NSFW. (predict)'`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" DROP COLUMN "maybeSensitive"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "disallowUploadWhenPredictedAsPorn" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "forceIsSensitiveWhenPredicted" boolean NOT NULL DEFAULT true`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" ADD "predictedIsSensitive" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `ALTER TABLE "drive_file" ADD "forceIsSensitive" boolean NOT NULL DEFAULT false`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_fc2d74a6d7d8b11292a851d8f8" ON "drive_file" ("predictedIsSensitive") `, + ); + } } diff --git a/packages/backend/migration/1656328812281-ip-2.js b/packages/backend/migration/1656328812281-ip-2.js index b0ee1ebfc7..ab4096e9c6 100644 --- a/packages/backend/migration/1656328812281-ip-2.js +++ b/packages/backend/migration/1656328812281-ip-2.js @@ -1,13 +1,19 @@ export class ip21656328812281 { - name = 'ip21656328812281' + name = "ip21656328812281"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_ip" DROP CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150"`); - await queryRunner.query(`ALTER TABLE "meta" ADD "enableIpLogging" boolean NOT NULL DEFAULT false`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_ip" DROP CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "enableIpLogging" boolean NOT NULL DEFAULT false`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableIpLogging"`); - await queryRunner.query(`ALTER TABLE "user_ip" ADD CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); - } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableIpLogging"`); + await queryRunner.query( + `ALTER TABLE "user_ip" ADD CONSTRAINT "FK_7f7f1c66f48e9a8e18a33bc5150" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + } } diff --git a/packages/backend/migration/1656408772602-nsfw-detection-6.js b/packages/backend/migration/1656408772602-nsfw-detection-6.js index 7ef223a4c6..4ef237308f 100644 --- a/packages/backend/migration/1656408772602-nsfw-detection-6.js +++ b/packages/backend/migration/1656408772602-nsfw-detection-6.js @@ -1,11 +1,15 @@ export class nsfwDetection61656408772602 { - name = 'nsfwDetection61656408772602' + name = "nsfwDetection61656408772602"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "enableSensitiveMediaDetectionForVideos" boolean NOT NULL DEFAULT false`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "enableSensitiveMediaDetectionForVideos" boolean NOT NULL DEFAULT false`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableSensitiveMediaDetectionForVideos"`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "enableSensitiveMediaDetectionForVideos"`, + ); + } } diff --git a/packages/backend/migration/1656772790599-user-moderation-note.js b/packages/backend/migration/1656772790599-user-moderation-note.js index 133bcffe1a..11d3124aeb 100644 --- a/packages/backend/migration/1656772790599-user-moderation-note.js +++ b/packages/backend/migration/1656772790599-user-moderation-note.js @@ -1,11 +1,15 @@ export class userModerationNote1656772790599 { - name = 'userModerationNote1656772790599' + name = "userModerationNote1656772790599"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" ADD "moderationNote" character varying(8192) NOT NULL DEFAULT ''`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" ADD "moderationNote" character varying(8192) NOT NULL DEFAULT ''`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "moderationNote"`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "user_profile" DROP COLUMN "moderationNote"`, + ); + } } diff --git a/packages/backend/migration/1657346559800-active-email-validation.js b/packages/backend/migration/1657346559800-active-email-validation.js index f8e03eeb07..4e3fd3f820 100644 --- a/packages/backend/migration/1657346559800-active-email-validation.js +++ b/packages/backend/migration/1657346559800-active-email-validation.js @@ -1,11 +1,15 @@ export class activeEmailValidation1657346559800 { - name = 'activeEmailValidation1657346559800' + name = "activeEmailValidation1657346559800"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "enableActiveEmailValidation" boolean NOT NULL DEFAULT true`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "enableActiveEmailValidation" boolean NOT NULL DEFAULT true`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableActiveEmailValidation"`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "enableActiveEmailValidation"`, + ); + } } diff --git a/packages/backend/migration/1658203170545calckey.js b/packages/backend/migration/1658203170545calckey.js index eb5913e811..95c3f05d3d 100644 --- a/packages/backend/migration/1658203170545calckey.js +++ b/packages/backend/migration/1658203170545calckey.js @@ -1,15 +1,27 @@ export class calckey1658203170545 { - name = 'calckey1658203170545' + name = "calckey1658203170545"; - async up(queryRunner) { - await queryRunner.query(`UPDATE meta SET "useStarForReactionFallback" = TRUE;`); - await queryRunner.query(`UPDATE meta SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`); - await queryRunner.query(`UPDATE meta SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`); - } + async up(queryRunner) { + await queryRunner.query( + `UPDATE meta SET "useStarForReactionFallback" = TRUE;`, + ); + await queryRunner.query( + `UPDATE meta SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`, + ); + await queryRunner.query( + `UPDATE meta SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`UPDATE meta SET "useStarForReactionFallback" = FALSE;`); - await queryRunner.query(`UPDATE meta SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`); - await queryRunner.query(`UPDATE meta SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`); - } + async down(queryRunner) { + await queryRunner.query( + `UPDATE meta SET "useStarForReactionFallback" = FALSE;`, + ); + await queryRunner.query( + `UPDATE meta SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`, + ); + await queryRunner.query( + `UPDATE meta SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`, + ); + } } diff --git a/packages/backend/migration/1658656633972-note-replies-function.js b/packages/backend/migration/1658656633972-note-replies-function.js index de2e28c6f2..810e238439 100644 --- a/packages/backend/migration/1658656633972-note-replies-function.js +++ b/packages/backend/migration/1658656633972-note-replies-function.js @@ -1,5 +1,5 @@ export class noteRepliesFunction1658656633972 { - name = 'noteRepliesFunction1658656633972' + name = "noteRepliesFunction1658656633972"; async up(queryRunner) { await queryRunner.query(` diff --git a/packages/backend/migration/1658939464003CustomMOTD.js b/packages/backend/migration/1658939464003CustomMOTD.js index eac03451dc..ee1b182e5d 100644 --- a/packages/backend/migration/1658939464003CustomMOTD.js +++ b/packages/backend/migration/1658939464003CustomMOTD.js @@ -1,8 +1,10 @@ export class CustomMOTD1658939464003 { - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "customMOTD" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "customMOTD"`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "customMOTD" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`, + ); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "customMOTD"`); + } } diff --git a/packages/backend/migration/1658941974648CustomSplashIcons.js b/packages/backend/migration/1658941974648CustomSplashIcons.js index fce5eb7671..5c6a874d0f 100644 --- a/packages/backend/migration/1658941974648CustomSplashIcons.js +++ b/packages/backend/migration/1658941974648CustomSplashIcons.js @@ -1,8 +1,12 @@ export class CustomSplashIcons1658941974648 { - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "customSplashIcons" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "customSplashIcons"`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "customSplashIcons" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`, + ); + } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "customSplashIcons"`, + ); + } } diff --git a/packages/backend/migration/1658981842728FixCalckey.js b/packages/backend/migration/1658981842728FixCalckey.js index 7d8750634b..1a0305538d 100644 --- a/packages/backend/migration/1658981842728FixCalckey.js +++ b/packages/backend/migration/1658981842728FixCalckey.js @@ -1,15 +1,27 @@ export class FixCalckey1658981842728 { - name = 'FixCalckey1658981842728' + name = "FixCalckey1658981842728"; - async up(queryRunner) { - await queryRunner.query(`UPDATE "meta" SET "useStarForReactionFallback" = TRUE;`); - await queryRunner.query(`UPDATE "meta" SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`); - await queryRunner.query(`UPDATE "meta" SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`); + async up(queryRunner) { + await queryRunner.query( + `UPDATE "meta" SET "useStarForReactionFallback" = TRUE;`, + ); + await queryRunner.query( + `UPDATE "meta" SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`, + ); + await queryRunner.query( + `UPDATE "meta" SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`, + ); } async down(queryRunner) { - await queryRunner.query(`UPDATE "meta" SET "useStarForReactionFallback" = FALSE;`); - await queryRunner.query(`UPDATE "meta" SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`); - await queryRunner.query(`UPDATE "meta" SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`); + await queryRunner.query( + `UPDATE "meta" SET "useStarForReactionFallback" = FALSE;`, + ); + await queryRunner.query( + `UPDATE "meta" SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`, + ); + await queryRunner.query( + `UPDATE "meta" SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`, + ); } } diff --git a/packages/backend/migration/1659042130648RecommendedTimeline.js b/packages/backend/migration/1659042130648RecommendedTimeline.js index 39c9b41636..01d28b2f38 100644 --- a/packages/backend/migration/1659042130648RecommendedTimeline.js +++ b/packages/backend/migration/1659042130648RecommendedTimeline.js @@ -1,11 +1,19 @@ export class RecommendedTimeline1659042130648 { - name = 'RecommendedTimeline1659042130648' - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "disableRecommendedTimeline" boolean NOT NULL DEFAULT true`); - await queryRunner.query(`ALTER TABLE "meta" ADD "recommendedInstances" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "disableRecommendedTimeline"`); - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "recommendedInstances"`); - } + name = "RecommendedTimeline1659042130648"; + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "disableRecommendedTimeline" boolean NOT NULL DEFAULT true`, + ); + await queryRunner.query( + `ALTER TABLE "meta" ADD "recommendedInstances" character varying(256) array NOT NULL DEFAULT '{}'::varchar[]`, + ); } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "disableRecommendedTimeline"`, + ); + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "recommendedInstances"`, + ); + } +} diff --git a/packages/backend/migration/1660068273737GuestTimeline.js b/packages/backend/migration/1660068273737GuestTimeline.js index 23d3bc51b0..9a42f602da 100644 --- a/packages/backend/migration/1660068273737GuestTimeline.js +++ b/packages/backend/migration/1660068273737GuestTimeline.js @@ -1,9 +1,13 @@ export class GuestTimeline1660068273737 { - name = 'GuestTimeline1660068273737' - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "enableGuestTimeline" boolean NOT NULL DEFAULT false`); - } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableGuestTimeline"`); - } + name = "GuestTimeline1660068273737"; + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" ADD "enableGuestTimeline" boolean NOT NULL DEFAULT false`, + ); } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "meta" DROP COLUMN "enableGuestTimeline"`, + ); + } +} diff --git a/packages/backend/migration/1665091090561-add-renote-muting.js b/packages/backend/migration/1665091090561-add-renote-muting.js new file mode 100644 index 0000000000..2c76aaff5f --- /dev/null +++ b/packages/backend/migration/1665091090561-add-renote-muting.js @@ -0,0 +1,22 @@ +export class addRenoteMuting1665091090561 { + constructor() { + this.name = "addRenoteMuting1665091090561"; + } + + async up(queryRunner) { + await queryRunner.query( + `CREATE TABLE "renote_muting" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "muteeId" character varying(32) NOT NULL, "muterId" character varying(32) NOT NULL, CONSTRAINT "PK_renoteMuting_id" PRIMARY KEY ("id"))`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_renote_muting_createdAt" ON "muting" ("createdAt") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_renote_muting_muteeId" ON "muting" ("muteeId") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_renote_muting_muterId" ON "muting" ("muterId") `, + ); + } + + async down(queryRunner) {} +} diff --git a/packages/backend/migration/1668828368510PageDraft.js b/packages/backend/migration/1668828368510PageDraft.js index 4a68189120..a5cc88b26e 100644 --- a/packages/backend/migration/1668828368510PageDraft.js +++ b/packages/backend/migration/1668828368510PageDraft.js @@ -1,8 +1,10 @@ export class Page1668828368510 { async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "page" ADD "isPublic" boolean NOT NULL DEFAULT true`); + await queryRunner.query( + `ALTER TABLE "page" ADD "isPublic" boolean NOT NULL DEFAULT true`, + ); } async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "page" DROP COLUMN "isPublic"`); + await queryRunner.query(`ALTER TABLE "page" DROP COLUMN "isPublic"`); } } diff --git a/packages/backend/migration/1668831378728FixCalckeyAgain.js b/packages/backend/migration/1668831378728FixCalckeyAgain.js index d5e67a48c3..c65dd54cd7 100644 --- a/packages/backend/migration/1668831378728FixCalckeyAgain.js +++ b/packages/backend/migration/1668831378728FixCalckeyAgain.js @@ -1,11 +1,15 @@ export class FixCalckeyAgain1668831378728 { - name = 'FixCalckeyAgain1668831378728' + name = "FixCalckeyAgain1668831378728"; async up(queryRunner) { - await queryRunner.query(`UPDATE "meta" SET "useStarForReactionFallback" = TRUE`); + await queryRunner.query( + `UPDATE "meta" SET "useStarForReactionFallback" = TRUE`, + ); } async down(queryRunner) { - await queryRunner.query(`UPDATE "meta" SET "useStarForReactionFallback" = FALSE`); + await queryRunner.query( + `UPDATE "meta" SET "useStarForReactionFallback" = FALSE`, + ); } } diff --git a/packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js b/packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js new file mode 100644 index 0000000000..101972a68c --- /dev/null +++ b/packages/backend/migration/1669138716634-whetherPushNotifyToSendReadMessage.js @@ -0,0 +1,15 @@ +export class whetherPushNotifyToSendReadMessage1669138716634 { + name = "whetherPushNotifyToSendReadMessage1669138716634"; + + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "sw_subscription" ADD "sendReadMessage" boolean NOT NULL DEFAULT false`, + ); + } + + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "sw_subscription" DROP COLUMN "sendReadMessage"`, + ); + } +} diff --git a/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js b/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js index 8b3c770acb..c34764e0b0 100644 --- a/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js +++ b/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js @@ -1,16 +1,21 @@ export class addMovedToAndKnownAs1669288094000 { - name = 'addMovedToAndKnownAs1669288094000' + name = "addMovedToAndKnownAs1669288094000"; async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" ADD "movedToUri" character varying(512)`); - await queryRunner.query(`ALTER TABLE "user" ADD "alsoKnownAs" TEXT`); - await queryRunner.query(`COMMENT ON COLUMN "user"."movedToUri" IS 'The URI of the new account of the User'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."alsoKnownAs" IS 'URIs the user is known as too'`); + await queryRunner.query( + `ALTER TABLE "user" ADD "movedToUri" character varying(512)`, + ); + await queryRunner.query(`ALTER TABLE "user" ADD "alsoKnownAs" TEXT`); + await queryRunner.query( + `COMMENT ON COLUMN "user"."movedToUri" IS 'The URI of the new account of the User'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "user"."alsoKnownAs" IS 'URIs the user is known as too'`, + ); } async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "movedToUri"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "alsoKnownAs"`); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "movedToUri"`); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "alsoKnownAs"`); } - } diff --git a/packages/backend/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.js b/packages/backend/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.js index 68f560b478..96ed8e1d6b 100644 --- a/packages/backend/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.js +++ b/packages/backend/migration/1671199573000-AddFkAbuseUserReportTargetUserIdToUserId.js @@ -1,12 +1,18 @@ export class addFkAbuseUserReportTargetUserIdToUserId1671199573000 { - name = 'addFkAbuseUserReportTargetUserIdToUserId1671199573000' + name = "addFkAbuseUserReportTargetUserIdToUserId1671199573000"; async up(queryRunner) { - await queryRunner.query(`DELETE FROM abuse_user_report WHERE NOT EXISTS (SELECT 1 FROM "user" WHERE "user"."id" = "abuse_user_report"."targetUserId")`); - await queryRunner.query(`ALTER TABLE abuse_user_report ADD CONSTRAINT fk_7f4e851a35d81b64dda28eee0 FOREIGN KEY ("targetUserId") REFERENCES "user"("id") ON DELETE CASCADE`); + await queryRunner.query( + `DELETE FROM abuse_user_report WHERE NOT EXISTS (SELECT 1 FROM "user" WHERE "user"."id" = "abuse_user_report"."targetUserId")`, + ); + await queryRunner.query( + `ALTER TABLE abuse_user_report ADD CONSTRAINT fk_7f4e851a35d81b64dda28eee0 FOREIGN KEY ("targetUserId") REFERENCES "user"("id") ON DELETE CASCADE`, + ); } async down(queryRunner) { - await queryRunner.query(`ALTER TABLE abuse_user_report DROP CONSTRAINT fk_7f4e851a35d81b64dda28eee0`); + await queryRunner.query( + `ALTER TABLE abuse_user_report DROP CONSTRAINT fk_7f4e851a35d81b64dda28eee0`, + ); } } diff --git a/packages/backend/migration/1671388343000-CalckeyRepoMove.js b/packages/backend/migration/1671388343000-CalckeyRepoMove.js index df933bcb97..60550f0446 100644 --- a/packages/backend/migration/1671388343000-CalckeyRepoMove.js +++ b/packages/backend/migration/1671388343000-CalckeyRepoMove.js @@ -1,15 +1,23 @@ /* "CalckeyRepoMove1671388343000" is a class that updates the "useStarForReactionFallback" column in the "meta" table to TRUE */ export class CalckeyRepoMove1671388343000 { - name = 'CalckeyRepoMove1671388343000' + name = "CalckeyRepoMove1671388343000"; async up(queryRunner) { - await queryRunner.query(`UPDATE meta SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`); - await queryRunner.query(`UPDATE meta SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`); + await queryRunner.query( + `UPDATE meta SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`, + ); + await queryRunner.query( + `UPDATE meta SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`, + ); } async down(queryRunner) { - await queryRunner.query(`UPDATE meta SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`); - await queryRunner.query(`UPDATE meta SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`); + await queryRunner.query( + `UPDATE meta SET "repositoryUrl" = 'https://codeberg/calckey/calckey'`, + ); + await queryRunner.query( + `UPDATE meta SET "feedbackUrl" = 'https://codeberg/calckey/calckey/issues'`, + ); } } diff --git a/packages/backend/migration/1672882664294-DefaultReaction.js b/packages/backend/migration/1672882664294-DefaultReaction.js index 498a1810d6..6ce1146ecb 100644 --- a/packages/backend/migration/1672882664294-DefaultReaction.js +++ b/packages/backend/migration/1672882664294-DefaultReaction.js @@ -1,9 +1,13 @@ export class DefaultReaction1672882664294 { - name = 'DefaultReaction1672882664294' + name = "DefaultReaction1672882664294"; async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "defaultReaction" character varying(256) NOT NULL DEFAULT '⭐'`); - await queryRunner.query(`COMMENT ON COLUMN "meta"."defaultReaction" IS 'The fallback reaction for emoji reacts'`); + await queryRunner.query( + `ALTER TABLE "meta" ADD "defaultReaction" character varying(256) NOT NULL DEFAULT '⭐'`, + ); + await queryRunner.query( + `COMMENT ON COLUMN "meta"."defaultReaction" IS 'The fallback reaction for emoji reacts'`, + ); } async down(queryRunner) { diff --git a/packages/backend/migration/1673336077243-PollChoiceLength.js b/packages/backend/migration/1673336077243-PollChoiceLength.js index 13db7dd963..a0e3350162 100644 --- a/packages/backend/migration/1673336077243-PollChoiceLength.js +++ b/packages/backend/migration/1673336077243-PollChoiceLength.js @@ -1,11 +1,15 @@ export class PollChoiceLength1673336077243 { - name = 'PollChoiceLength1673336077243' + name = "PollChoiceLength1673336077243"; async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "poll" ALTER COLUMN "choices" TYPE character varying(256) array`); + await queryRunner.query( + `ALTER TABLE "poll" ALTER COLUMN "choices" TYPE character varying(256) array`, + ); } async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "poll" ALTER COLUMN "choices" TYPE character varying(128) array`); + await queryRunner.query( + `ALTER TABLE "poll" ALTER COLUMN "choices" TYPE character varying(128) array`, + ); } } diff --git a/packages/backend/migration/1676093997212-AntennaInstances.js b/packages/backend/migration/1676093997212-AntennaInstances.js index 7553e12557..ffd428f7dc 100644 --- a/packages/backend/migration/1676093997212-AntennaInstances.js +++ b/packages/backend/migration/1676093997212-AntennaInstances.js @@ -1,17 +1,27 @@ export class AntennaInstances1676093997212 { - name = 'AntennaInstances1676093997212' + name = "AntennaInstances1676093997212"; - async up(queryRunner) { - await queryRunner.query(`ALTER TYPE "antenna_src_enum" ADD VALUE 'instances'`); - await queryRunner.query(`ALTER TABLE "antenna" ADD "instances" jsonb NOT NULL DEFAULT '[]'`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TYPE "antenna_src_enum" ADD VALUE 'instances'`, + ); + await queryRunner.query( + `ALTER TABLE "antenna" ADD "instances" jsonb NOT NULL DEFAULT '[]'`, + ); + } - async down(queryRunner) { - await queryRunner.query(`DELETE FROM "antenna" WHERE "src" = 'instances'`); - await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "instances"`); - await queryRunner.query(`CREATE TYPE "public"."antenna_src_enum_old" AS ENUM('home', 'all', 'users', 'list', 'group')`); - await queryRunner.query(`ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "public"."antenna_src_enum_old" USING "src"::"text"::"public"."antenna_src_enum_old"`); - await queryRunner.query(`DROP TYPE "public"."antenna_src_enum"`); - await queryRunner.query(`ALTER TYPE "public"."antenna_src_enum_old" RENAME TO "antenna_src_enum"`); - } + async down(queryRunner) { + await queryRunner.query(`DELETE FROM "antenna" WHERE "src" = 'instances'`); + await queryRunner.query(`ALTER TABLE "antenna" DROP COLUMN "instances"`); + await queryRunner.query( + `CREATE TYPE "public"."antenna_src_enum_old" AS ENUM('home', 'all', 'users', 'list', 'group')`, + ); + await queryRunner.query( + `ALTER TABLE "antenna" ALTER COLUMN "src" TYPE "public"."antenna_src_enum_old" USING "src"::"text"::"public"."antenna_src_enum_old"`, + ); + await queryRunner.query(`DROP TYPE "public"."antenna_src_enum"`); + await queryRunner.query( + `ALTER TYPE "public"."antenna_src_enum_old" RENAME TO "antenna_src_enum"`, + ); + } } diff --git a/packages/backend/migration/1677935903517-DriveComment.js b/packages/backend/migration/1677935903517-DriveComment.js index 41c7556f0c..571958f294 100644 --- a/packages/backend/migration/1677935903517-DriveComment.js +++ b/packages/backend/migration/1677935903517-DriveComment.js @@ -1,11 +1,15 @@ export class DriveComment1677935903517 { - name = 'DriveComment1677935903517' + name = "DriveComment1677935903517"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "drive_file" ALTER "comment" TYPE character varying(8192)`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "drive_file" ALTER "comment" TYPE character varying(8192)`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "drive_file" ALTER "comment" TYPE character varying(512)`); - } + async down(queryRunner) { + await queryRunner.query( + `ALTER TABLE "drive_file" ALTER "comment" TYPE character varying(512)`, + ); + } } diff --git a/packages/backend/migration/1678945242650-add-props-for-custom-emoji.js b/packages/backend/migration/1678945242650-add-props-for-custom-emoji.js index 656a921770..f3de7ce278 100644 --- a/packages/backend/migration/1678945242650-add-props-for-custom-emoji.js +++ b/packages/backend/migration/1678945242650-add-props-for-custom-emoji.js @@ -1,11 +1,13 @@ export class addPropsForCustomEmoji1678945242650 { - name = 'addPropsForCustomEmoji1678945242650' + name = "addPropsForCustomEmoji1678945242650"; - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "emoji" ADD "license" character varying(1024)`); - } + async up(queryRunner) { + await queryRunner.query( + `ALTER TABLE "emoji" ADD "license" character varying(1024)`, + ); + } - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "license"`); - } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "license"`); + } } diff --git a/packages/backend/migration/1679269929000-fix-repo.js b/packages/backend/migration/1679269929000-fix-repo.js index 6784b3793c..3571da4f51 100644 --- a/packages/backend/migration/1679269929000-fix-repo.js +++ b/packages/backend/migration/1679269929000-fix-repo.js @@ -1,13 +1,21 @@ export class FixRepo1679269929000 { - name = 'FixRepo1679269929000' + name = "FixRepo1679269929000"; async up(queryRunner) { - await queryRunner.query(`UPDATE meta SET "repositoryUrl" = 'https://codeberg.org/calckey/calckey'`); - await queryRunner.query(`UPDATE meta SET "feedbackUrl" = 'https://codeberg.org/calckey/calckey/issues'`); + await queryRunner.query( + `UPDATE meta SET "repositoryUrl" = 'https://codeberg.org/calckey/calckey'`, + ); + await queryRunner.query( + `UPDATE meta SET "feedbackUrl" = 'https://codeberg.org/calckey/calckey/issues'`, + ); } async down(queryRunner) { - await queryRunner.query(`UPDATE meta SET "repositoryUrl" = 'https://codeberg.org/calckey/calckey'`); - await queryRunner.query(`UPDATE meta SET "feedbackUrl" = 'https://codeberg.org/calckey/calckey/issues'`); + await queryRunner.query( + `UPDATE meta SET "repositoryUrl" = 'https://codeberg.org/calckey/calckey'`, + ); + await queryRunner.query( + `UPDATE meta SET "feedbackUrl" = 'https://codeberg.org/calckey/calckey/issues'`, + ); } } diff --git a/packages/backend/migration/1680375641101-clean-charts.js b/packages/backend/migration/1680375641101-clean-charts.js index c125f43a34..bfb8aa9d92 100644 --- a/packages/backend/migration/1680375641101-clean-charts.js +++ b/packages/backend/migration/1680375641101-clean-charts.js @@ -1,17 +1,25 @@ export class CleanCharts1680375641101 { - constructor() { - this.name = 'CleanCharts1680375641101'; - } - async up(queryRunner) { - await queryRunner.query(`delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`); - await queryRunner.query(`delete from __chart_day__hashtag where ___local_users = 0 and ___remote_users = 0;`); - await queryRunner.query(`COMMIT;`); - await queryRunner.query(`vacuum __chart__hashtag;`); - await queryRunner.query(`vacuum __chart_day__hashtag;`); - await queryRunner.query(`COMMIT;`); - } - async down(queryRunner) { - await queryRunner.query(`delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`); - await queryRunner.query(`delete from __chart_day__hashtag where ___local_users = 0 and ___remote_users = 0;`); - } + constructor() { + this.name = "CleanCharts1680375641101"; + } + async up(queryRunner) { + await queryRunner.query( + `delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`, + ); + await queryRunner.query( + `delete from __chart_day__hashtag where ___local_users = 0 and ___remote_users = 0;`, + ); + await queryRunner.query(`COMMIT;`); + await queryRunner.query(`vacuum __chart__hashtag;`); + await queryRunner.query(`vacuum __chart_day__hashtag;`); + await queryRunner.query(`COMMIT;`); + } + async down(queryRunner) { + await queryRunner.query( + `delete from __chart__hashtag where ___local_users = 0 and ___remote_users = 0;`, + ); + await queryRunner.query( + `delete from __chart_day__hashtag where ___local_users = 0 and ___remote_users = 0;`, + ); + } } diff --git a/packages/backend/migration/1680426269172-SpeakAsCat.js b/packages/backend/migration/1680426269172-SpeakAsCat.js index 3655e27265..375098542c 100644 --- a/packages/backend/migration/1680426269172-SpeakAsCat.js +++ b/packages/backend/migration/1680426269172-SpeakAsCat.js @@ -1,20 +1,20 @@ export class SpeakAsCat1680426269172 { - name = 'SpeakAsCat1680426269172' + name = "SpeakAsCat1680426269172"; - async up(queryRunner) { - await queryRunner.query(` + async up(queryRunner) { + await queryRunner.query(` ALTER TABLE "user" ADD "speakAsCat" boolean NOT NULL DEFAULT true `); - await queryRunner.query(` + await queryRunner.query(` COMMENT ON COLUMN "user"."speakAsCat" IS 'Whether to speak as a cat if isCat.' `); - } + } - async down(queryRunner) { - await queryRunner.query(` + async down(queryRunner) { + await queryRunner.query(` ALTER TABLE "user" DROP COLUMN "speakAsCat" `); - } + } } diff --git a/packages/backend/native-utils/__test__/index.spec.mjs b/packages/backend/native-utils/__test__/index.spec.mjs index 1ade4cafe8..0d41e012dd 100644 --- a/packages/backend/native-utils/__test__/index.spec.mjs +++ b/packages/backend/native-utils/__test__/index.spec.mjs @@ -1,7 +1,7 @@ -import test from 'ava' +import test from "ava"; -import { sum } from '../index.js' +import { sum } from "../index.js"; -test('sum from native', (t) => { - t.is(sum(1, 2), 3) -}) +test("sum from native", (t) => { + t.is(sum(1, 2), 3); +}); diff --git a/packages/backend/ormconfig.js b/packages/backend/ormconfig.js index a4e903abad..5f85cead8a 100644 --- a/packages/backend/ormconfig.js +++ b/packages/backend/ormconfig.js @@ -1,9 +1,9 @@ -import { DataSource } from 'typeorm'; -import config from './built/config/index.js'; -import { entities } from './built/db/postgre.js'; +import { DataSource } from "typeorm"; +import config from "./built/config/index.js"; +import { entities } from "./built/db/postgre.js"; export default new DataSource({ - type: 'postgres', + type: "postgres", host: config.db.host, port: config.db.port, username: config.db.user, @@ -11,5 +11,5 @@ export default new DataSource({ database: config.db.db, extra: config.db.extra, entities: entities, - migrations: ['migration/*.js'], + migrations: ["migration/*.js"], }); diff --git a/packages/backend/package.json b/packages/backend/package.json index 61ba601cd1..9139d24eee 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -49,7 +49,7 @@ "blurhash": "1.1.5", "bull": "4.10.2", "cacheable-lookup": "7.0.0", - "calckey-js": "^0.0.22", + "calckey-js": "workspace:*", "cbor": "8.1.0", "chalk": "5.2.0", "chalk-template": "0.4.0", diff --git a/packages/backend/src/db/postgre.ts b/packages/backend/src/db/postgre.ts index f95bd2594d..bdeb910e84 100644 --- a/packages/backend/src/db/postgre.ts +++ b/packages/backend/src/db/postgre.ts @@ -23,6 +23,7 @@ import { Meta } from "@/models/entities/meta.js"; import { Following } from "@/models/entities/following.js"; import { Instance } from "@/models/entities/instance.js"; import { Muting } from "@/models/entities/muting.js"; +import { RenoteMuting } from "@/models/entities/renote-muting.js"; import { SwSubscription } from "@/models/entities/sw-subscription.js"; import { Blocking } from "@/models/entities/blocking.js"; import { UserList } from "@/models/entities/user-list.js"; @@ -136,6 +137,7 @@ export const entities = [ Following, FollowRequest, Muting, + RenoteMuting, Blocking, Note, NoteFavorite, diff --git a/packages/backend/src/misc/check-word-mute.ts b/packages/backend/src/misc/check-word-mute.ts index ffdf3caf84..53193d851a 100644 --- a/packages/backend/src/misc/check-word-mute.ts +++ b/packages/backend/src/misc/check-word-mute.ts @@ -5,46 +5,74 @@ import type { User } from "@/models/entities/user.js"; type NoteLike = { userId: Note["userId"]; text: Note["text"]; + cw?: Note["cw"]; }; type UserLike = { id: User["id"]; }; -export async function checkWordMute( +export type Muted = { + muted: boolean; + matched: string[]; +}; + +const NotMuted = { muted: false, matched: [] }; + +function escapeRegExp(x: string) { + return x.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string +} + +export async function getWordMute( note: NoteLike, me: UserLike | null | undefined, mutedWords: Array, -): Promise { +): Promise { // 自分自身 - if (me && note.userId === me.id) return false; + if (me && note.userId === me.id) { + return NotMuted; + } if (mutedWords.length > 0) { const text = ((note.cw ?? "") + "\n" + (note.text ?? "")).trim(); - if (text === "") return false; + if (text === "") { + return NotMuted; + } - const matched = mutedWords.some((filter) => { - if (Array.isArray(filter)) { - return filter.every((keyword) => text.includes(keyword)); - } else { - // represents RegExp - const regexp = filter.match(/^\/(.+)\/(.*)$/); + for (const mutePattern of mutedWords) { + let mute: RE2; + let matched: string[]; + if (Array.isArray(mutePattern)) { + matched = mutePattern.filter((keyword) => keyword !== ""); - // This should never happen due to input sanitisation. - if (!regexp) return false; - - try { - return new RE2(regexp[1], regexp[2]).test(text); - } catch (err) { - // This should never happen due to input sanitisation. - return false; + if (matched.length === 0) { + continue; } + mute = new RE2( + `\\b${matched.map(escapeRegExp).join("\\b.*\\b")}\\b`, + "g", + ); + } else { + const regexp = mutePattern.match(/^\/(.+)\/(.*)$/); + // This should never happen due to input sanitisation. + if (!regexp) { + console.warn(`Found invalid regex in word mutes: ${mutePattern}`); + continue; + } + mute = new RE2(regexp[1], regexp[2]); + matched = [mutePattern]; } - }); - if (matched) return true; + try { + if (mute.test(text)) { + return { muted: true, matched }; + } + } catch (err) { + // This should never happen due to input sanitisation. + } + } } - return false; + return NotMuted; } diff --git a/packages/backend/src/misc/schema.ts b/packages/backend/src/misc/schema.ts index 35637e6ed5..7eaeb92e04 100644 --- a/packages/backend/src/misc/schema.ts +++ b/packages/backend/src/misc/schema.ts @@ -16,6 +16,7 @@ import { packedDriveFileSchema } from "@/models/schema/drive-file.js"; import { packedDriveFolderSchema } from "@/models/schema/drive-folder.js"; import { packedFollowingSchema } from "@/models/schema/following.js"; import { packedMutingSchema } from "@/models/schema/muting.js"; +import { packedRenoteMutingSchema } from "@/models/schema/renote-muting.js"; import { packedBlockingSchema } from "@/models/schema/blocking.js"; import { packedNoteReactionSchema } from "@/models/schema/note-reaction.js"; import { packedHashtagSchema } from "@/models/schema/hashtag.js"; @@ -51,6 +52,7 @@ export const refs = { DriveFolder: packedDriveFolderSchema, Following: packedFollowingSchema, Muting: packedMutingSchema, + RenoteMuting: packedRenoteMutingSchema, Blocking: packedBlockingSchema, Hashtag: packedHashtagSchema, Page: packedPageSchema, diff --git a/packages/backend/src/models/entities/renote-muting.ts b/packages/backend/src/models/entities/renote-muting.ts new file mode 100644 index 0000000000..64ec7f583f --- /dev/null +++ b/packages/backend/src/models/entities/renote-muting.ts @@ -0,0 +1,49 @@ +import { + PrimaryColumn, + Entity, + Index, + JoinColumn, + Column, + ManyToOne, +} from "typeorm"; +import { id } from "../id.js"; +import { User } from "./user.js"; + +@Entity() +@Index(["muterId", "muteeId"], { unique: true }) +export class RenoteMuting { + @PrimaryColumn(id()) + public id: string; + + @Index() + @Column("timestamp with time zone", { + comment: "The created date of the Muting.", + }) + public createdAt: Date; + + @Index() + @Column({ + ...id(), + comment: "The mutee user ID.", + }) + public muteeId: User["id"]; + + @ManyToOne(type => User, { + onDelete: "CASCADE", + }) + @JoinColumn() + public mutee: User | null; + + @Index() + @Column({ + ...id(), + comment: "The muter user ID.", + }) + public muterId: User["id"]; + + @ManyToOne(type => User, { + onDelete: "CASCADE", + }) + @JoinColumn() + public muter: User | null; +} diff --git a/packages/backend/src/models/entities/sw-subscription.ts b/packages/backend/src/models/entities/sw-subscription.ts index 26891c1ce7..8f18688eab 100644 --- a/packages/backend/src/models/entities/sw-subscription.ts +++ b/packages/backend/src/models/entities/sw-subscription.ts @@ -41,4 +41,9 @@ export class SwSubscription { length: 128, }) public publickey: string; + + @Column('boolean', { + default: false, + }) + public sendReadMessage: boolean; } diff --git a/packages/backend/src/models/index.ts b/packages/backend/src/models/index.ts index 98f6705f42..f68166c17f 100644 --- a/packages/backend/src/models/index.ts +++ b/packages/backend/src/models/index.ts @@ -27,6 +27,7 @@ import { UserGroupJoining } from "./entities/user-group-joining.js"; import { UserGroupInvitationRepository } from "./repositories/user-group-invitation.js"; import { FollowRequestRepository } from "./repositories/follow-request.js"; import { MutingRepository } from "./repositories/muting.js"; +import { RenoteMutingRepository } from "./repositories/renote-muting.js"; import { BlockingRepository } from "./repositories/blocking.js"; import { NoteReactionRepository } from "./repositories/note-reaction.js"; import { NotificationRepository } from "./repositories/notification.js"; @@ -102,6 +103,7 @@ export const DriveFolders = DriveFolderRepository; export const Notifications = NotificationRepository; export const Metas = db.getRepository(Meta); export const Mutings = MutingRepository; +export const RenoteMutings = RenoteMutingRepository; export const Blockings = BlockingRepository; export const SwSubscriptions = db.getRepository(SwSubscription); export const Hashtags = HashtagRepository; diff --git a/packages/backend/src/models/repositories/renote-muting.ts b/packages/backend/src/models/repositories/renote-muting.ts new file mode 100644 index 0000000000..18fd343a05 --- /dev/null +++ b/packages/backend/src/models/repositories/renote-muting.ts @@ -0,0 +1,29 @@ +import { db } from "@/db/postgre.js"; +import { Packed } from "@/misc/schema.js"; +import { RenoteMuting } from "@/models/entities/renote-muting.js"; +import { User } from "@/models/entities/user.js"; +import { awaitAll } from "@/prelude/await-all.js"; +import { Users } from "../index.js"; + +export const RenoteMutingRepository = db.getRepository(RenoteMuting).extend({ + async pack( + src: RenoteMuting["id"] | RenoteMuting, + me?: { id: User["id"] } | null | undefined, + ): Promise> { + const muting = + typeof src === "object" ? src : await this.findOneByOrFail({ id: src }); + + return await awaitAll({ + id: muting.id, + createdAt: muting.createdAt.toISOString(), + muteeId: muting.muteeId, + mutee: Users.pack(muting.muteeId, me, { + detail: true, + }), + }); + }, + + packMany(mutings: any[], me: { id: User["id"] }) { + return Promise.all(mutings.map((x) => this.pack(x, me))); + }, +}); diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index 27b0c78d6e..f6fcdae296 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -28,6 +28,7 @@ import { Instances, MessagingMessages, Mutings, + RenoteMutings, Notes, NoteUnreads, Notifications, @@ -171,6 +172,13 @@ export const UserRepository = db.getRepository(User).extend({ }, take: 1, }).then((n) => n > 0), + isRenoteMuted: RenoteMutings.count({ + where: { + muterId: me, + muteeId: target, + }, + take: 1, + }).then((n) => n > 0), }); }, @@ -585,6 +593,7 @@ export const UserRepository = db.getRepository(User).extend({ isBlocking: relation.isBlocking, isBlocked: relation.isBlocked, isMuted: relation.isMuted, + isRenoteMuted: relation.isRenoteMuted, } : {}), } as Promiseable> as Promiseable< diff --git a/packages/backend/src/models/schema/renote-muting.ts b/packages/backend/src/models/schema/renote-muting.ts new file mode 100644 index 0000000000..2a5824e32b --- /dev/null +++ b/packages/backend/src/models/schema/renote-muting.ts @@ -0,0 +1,30 @@ +export const packedRenoteMutingSchema = { + type: "object", + properties: { + id: { + type: "string", + optional: false, + nullable: false, + format: "id", + example: "xxxxxxxxxx", + }, + createdAt: { + type: "string", + optional: false, + nullable: false, + format: "date-time", + }, + muteeId: { + type: "string", + optional: false, + nullable: false, + format: "id", + }, + mutee: { + type: "object", + optional: false, + nullable: false, + ref: "UserDetailed", + }, + }, +} as const; diff --git a/packages/backend/src/models/schema/user.ts b/packages/backend/src/models/schema/user.ts index 7f76891650..80e94fe508 100644 --- a/packages/backend/src/models/schema/user.ts +++ b/packages/backend/src/models/schema/user.ts @@ -335,6 +335,11 @@ export const packedUserDetailedNotMeOnlySchema = { nullable: false, optional: true, }, + isRenoteMuted: { + type: "boolean", + nullable: false, + optional: true, + }, //#endregion }, } as const; diff --git a/packages/backend/src/remote/activitypub/kernel/move/index.ts b/packages/backend/src/remote/activitypub/kernel/move/index.ts index 47a55b8ab3..800fd7bfea 100644 --- a/packages/backend/src/remote/activitypub/kernel/move/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/move/index.ts @@ -1,19 +1,14 @@ import type { CacheableRemoteUser } from "@/models/entities/user.js"; -import { IRemoteUser, User } from "@/models/entities/user.js"; -import DbResolver from "@/remote/activitypub/db-resolver.js"; -import { getRemoteUser } from "@/server/api/common/getters.js"; -import { updatePerson } from "@/remote/activitypub/models/person.js"; import { Followings, Users } from "@/models/index.js"; -import { makePaginationQuery } from "@/server/api/common/make-pagination-query.js"; -import deleteFollowing from "@/services/following/delete.js"; +import { + resolvePerson, + updatePerson, +} from "@/remote/activitypub/models/person.js"; import create from "@/services/following/create.js"; -import { getUser } from "@/server/api/common/getters.js"; -import { IdentifiableError } from "@/misc/identifiable-error.js"; -import { ApiError } from "@/server/api/error.js"; -import { meta } from "@/server/api/endpoints/following/create.js"; -import { IObject } from "../../type.js"; -import type { IMove, IActor } from "../../type.js"; -import Resolver from "@/remote/activitypub/resolver.js"; +import deleteFollowing from "@/services/following/delete.js"; + +import type { IMove } from "../../type.js"; +import { getApHrefNullable } from "../../type.js"; export default async ( actor: CacheableRemoteUser, @@ -21,68 +16,50 @@ export default async ( ): Promise => { // ※ There is a block target in activity.object, which should be a local user that exists. - const dbResolver = new DbResolver(); - const resolver = new Resolver(); - let new_acc = await dbResolver.getUserFromApId(activity.target); - let actor_new; - if (!new_acc) - actor_new = (await resolver.resolve(activity.target)) as IActor; + // fetch the new and old accounts + const targetUri = getApHrefNullable(activity.target); + if (!targetUri) return "move: target uri is null"; + let new_acc = await resolvePerson(targetUri); + if (!actor.uri) return "move: actor uri is null"; + let old_acc = await resolvePerson(actor.uri); - if ( - (!new_acc || new_acc.uri === null) && - (!actor_new || actor_new.id === null) - ) { - return "move: new acc not found"; + // update them if they're remote + if (new_acc.uri) await updatePerson(new_acc.uri); + if (old_acc.uri) await updatePerson(old_acc.uri); + + // retrieve updated users + new_acc = await resolvePerson(targetUri); + old_acc = await resolvePerson(actor.uri); + + // check if alsoKnownAs of the new account is valid + let isValidMove = true; + if (old_acc.uri) { + if (!new_acc.alsoKnownAs?.includes(old_acc.uri)) { + isValidMove = false; + } + } else if (!new_acc.alsoKnownAs?.includes(old_acc.id)) { + isValidMove = false; + } + if (!isValidMove) { + return "skip: accounts invalid"; } - const newUri = new_acc ? new_acc.uri : actor_new?.url?.toString(); - - if (newUri === null || newUri === undefined) - return "move: new acc not found #2"; - - await updatePerson(newUri); - await updatePerson(actor.uri!); - - new_acc = await dbResolver.getUserFromApId(newUri); - const old = await dbResolver.getUserFromApId(actor.uri!); - - if ( - old === null || - old.uri === null || - !new_acc?.alsoKnownAs?.includes(old.uri) - ) - return "move: accounts invalid"; - - old.movedToUri = new_acc.uri; - - const followee = await getUser(actor.id).catch((e) => { - if (e.id === "15348ddd-432d-49c2-8a5a-8069753becff") - throw new ApiError(meta.errors.noSuchUser); - throw e; - }); - - const followeeNew = await getUser(new_acc.id).catch((e) => { - if (e.id === "15348ddd-432d-49c2-8a5a-8069753becff") - throw new ApiError(meta.errors.noSuchUser); - throw e; - }); + // add target uri to movedToUri in order to indicate that the user has moved + await Users.update(old_acc.id, { movedToUri: targetUri }); + // follow the new account and unfollow the old one const followings = await Followings.findBy({ - followeeId: followee.id, + followeeId: old_acc.id, }); - followings.forEach(async (following) => { - //if follower is local + // If follower is local if (!following.followerHost) { - const follower = await getUser(following.followerId).catch((e) => { - if (e.id === "15348ddd-432d-49c2-8a5a-8069753becff") - throw new ApiError(meta.errors.noSuchUser); - throw e; - }); - await deleteFollowing(follower!, followee); try { - await create(follower!, followeeNew); - } catch (e) { + const follower = await Users.findOneBy({ id: following.followerId }); + if (!follower) return; + await create(follower, new_acc); + await deleteFollowing(follower, old_acc); + } catch { /* empty */ } } diff --git a/packages/backend/src/server/api/common/generated-muted-renote-query.ts b/packages/backend/src/server/api/common/generated-muted-renote-query.ts new file mode 100644 index 0000000000..3fcd9b28e8 --- /dev/null +++ b/packages/backend/src/server/api/common/generated-muted-renote-query.ts @@ -0,0 +1,28 @@ +import { Brackets, SelectQueryBuilder } from "typeorm"; +import { User } from "@/models/entities/user.js"; +import { RenoteMutings } from "@/models/index.js"; + +export function generateMutedUserRenotesQueryForNotes( + q: SelectQueryBuilder, + me: { id: User["id"] }, +): void { + const mutingQuery = RenoteMutings.createQueryBuilder("renote_muting") + .select("renote_muting.muteeId") + .where("renote_muting.muterId = :muterId", { muterId: me.id }); + + q.andWhere( + new Brackets((qb) => { + qb.where( + new Brackets((qb) => { + qb.where("note.renoteId IS NOT NULL"); + qb.andWhere("note.text IS NULL"); + qb.andWhere(`note.userId NOT IN (${mutingQuery.getQuery()})`); + }), + ) + .orWhere("note.renoteId IS NULL") + .orWhere("note.text IS NOT NULL"); + }), + ); + + q.setParameters(mutingQuery.getParameters()); +} diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts index 920f871995..3f82eb7a73 100644 --- a/packages/backend/src/server/api/endpoints.ts +++ b/packages/backend/src/server/api/endpoints.ts @@ -231,6 +231,9 @@ import * as ep___miauth_genToken from "./endpoints/miauth/gen-token.js"; import * as ep___mute_create from "./endpoints/mute/create.js"; import * as ep___mute_delete from "./endpoints/mute/delete.js"; import * as ep___mute_list from "./endpoints/mute/list.js"; +import * as ep___renote_mute_create from "./endpoints/renote-mute/create.js"; +import * as ep___renote_mute_delete from "./endpoints/renote-mute/delete.js"; +import * as ep___renote_mute_list from "./endpoints/renote-mute/list.js"; import * as ep___my_apps from "./endpoints/my/apps.js"; import * as ep___notes from "./endpoints/notes.js"; import * as ep___notes_children from "./endpoints/notes/children.js"; @@ -290,6 +293,8 @@ import * as ep___resetDb from "./endpoints/reset-db.js"; import * as ep___resetPassword from "./endpoints/reset-password.js"; import * as ep___serverInfo from "./endpoints/server-info.js"; import * as ep___stats from "./endpoints/stats.js"; +import * as ep___sw_show_registration from "./endpoints/sw/show-registration.js"; +import * as ep___sw_update_registration from "./endpoints/sw/update-registration.js"; import * as ep___sw_register from "./endpoints/sw/register.js"; import * as ep___sw_unregister from "./endpoints/sw/unregister.js"; import * as ep___test from "./endpoints/test.js"; @@ -624,6 +629,9 @@ const eps = [ ["ping", ep___ping], ["pinned-users", ep___pinnedUsers], ["recommended-instances", ep___recommendedInstances], + ["renote-mute/create", ep___renote_mute_create], + ["renote-mute/delete", ep___renote_mute_delete], + ["renote-mute/list", ep___renote_mute_list], ["custom-motd", ep___customMOTD], ["custom-splash-icons", ep___customSplashIcons], ["latest-version", ep___latestVersion], @@ -637,6 +645,8 @@ const eps = [ ["stats", ep___stats], ["sw/register", ep___sw_register], ["sw/unregister", ep___sw_unregister], + ["sw/show-registration", ep___sw_show_registration], + ["sw/update-registration", ep___sw_update_registration], ["test", ep___test], ["username/available", ep___username_available], ["users", ep___users], 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 28aac4a4d4..f7e79b64b5 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -209,7 +209,12 @@ export default define(meta, paramDef, async (ps, me) => { } if (Array.isArray(ps.blockedHosts)) { - set.blockedHosts = ps.blockedHosts.filter(Boolean); + let lastValue = ""; + set.blockedHosts = ps.blockedHosts.sort().filter((h) => { + const lv = lastValue; + lastValue = h; + return h !== "" && h !== lv; + }); } if (ps.themeColor !== undefined) { diff --git a/packages/backend/src/server/api/endpoints/i/move.ts b/packages/backend/src/server/api/endpoints/i/move.ts index bfeba04595..3d947063ff 100644 --- a/packages/backend/src/server/api/endpoints/i/move.ts +++ b/packages/backend/src/server/api/endpoints/i/move.ts @@ -3,7 +3,6 @@ import { resolveUser } from "@/remote/resolve-user.js"; import { DAY } from "@/const.js"; import DeliverManager from "@/remote/activitypub/deliver-manager.js"; import { renderActivity } from "@/remote/activitypub/renderer/index.js"; -import { genId } from "@/misc/gen-id.js"; import define from "../../define.js"; import { ApiError } from "../../error.js"; import { apiLogger } from "../../logger.js"; @@ -81,7 +80,7 @@ export const paramDef = { function moveActivity(toUrl: string, fromUrl: string) { const activity = { - id: genId(), + id: null, actor: fromUrl, type: "Move", object: fromUrl, diff --git a/packages/backend/src/server/api/endpoints/notes/featured.ts b/packages/backend/src/server/api/endpoints/notes/featured.ts index a6d764bf37..47c1e13812 100644 --- a/packages/backend/src/server/api/endpoints/notes/featured.ts +++ b/packages/backend/src/server/api/endpoints/notes/featured.ts @@ -32,17 +32,17 @@ export const paramDef = { enum: ["combined", "local", "remote"], default: "local", }, + days: { type: "integer", minimum: 1, maximum: 365, default: 3 }, }, required: [], } as const; export default define(meta, paramDef, async (ps, user) => { const max = 30; - const day = 1000 * 60 * 60 * 24 * 3; // 3日前まで + const day = 1000 * 60 * 60 * 24 * ps.days; const query = Notes.createQueryBuilder("note") .addSelect("note.score") - // .where("note.userHost IS NULL") .andWhere("note.score > 0") .andWhere("note.createdAt > :date", { date: new Date(Date.now() - day) }) .andWhere("note.visibility = 'public'") 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 584a6ce020..077a1ad5e1 100644 --- a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts @@ -8,6 +8,7 @@ import { generateMutedUserQuery } from "../../common/generate-muted-user-query.j import { generateRepliesQuery } from "../../common/generate-replies-query.js"; import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; export const meta = { tags: ["notes"], @@ -86,6 +87,7 @@ export default define(meta, paramDef, async (ps, user) => { generateMutedUserQuery(query, user); generateMutedNoteQuery(query, user); generateBlockedUserQuery(query, user); + generateMutedUserRenotesQueryForNotes(query, user); } if (ps.withFiles) { @@ -98,7 +100,7 @@ export default define(meta, paramDef, async (ps, user) => { activeUsersChart.read(user); } }); - + // We fetch more than requested because some may be filtered out, and if there's less than // requested, the pagination stops. const found = []; @@ -106,7 +108,7 @@ export default define(meta, paramDef, async (ps, user) => { let skip = 0; while (found.length < ps.limit) { const notes = await query.take(take).skip(skip).getMany(); - found.push(...await Notes.packMany(notes, user)) + found.push(...(await Notes.packMany(notes, user))); skip += take; if (notes.length < take) break; } 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 78846861ad..3c171278b4 100644 --- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -11,6 +11,7 @@ import { generateRepliesQuery } from "../../common/generate-replies-query.js"; import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; import { generateChannelQuery } from "../../common/generate-channel-query.js"; import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; export const meta = { tags: ["notes"], @@ -103,6 +104,7 @@ export default define(meta, paramDef, async (ps, user) => { generateMutedUserQuery(query, user); generateMutedNoteQuery(query, user); generateBlockedUserQuery(query, user); + generateMutedUserRenotesQueryForNotes(query, user); if (ps.includeMyRenotes === false) { query.andWhere( @@ -162,7 +164,7 @@ export default define(meta, paramDef, async (ps, user) => { let skip = 0; while (found.length < ps.limit) { const notes = await query.take(take).skip(skip).getMany(); - found.push(...await Notes.packMany(notes, user)) + found.push(...(await Notes.packMany(notes, user))); skip += take; if (notes.length < take) break; } 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 fead877387..cec371c8dc 100644 --- a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts @@ -11,6 +11,7 @@ import { generateRepliesQuery } from "../../common/generate-replies-query.js"; import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; import { generateChannelQuery } from "../../common/generate-channel-query.js"; import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; export const meta = { tags: ["notes"], @@ -96,6 +97,7 @@ export default define(meta, paramDef, async (ps, user) => { if (user) generateMutedUserQuery(query, user); if (user) generateMutedNoteQuery(query, user); if (user) generateBlockedUserQuery(query, user); + if (user) generateMutedUserRenotesQueryForNotes(query, user); if (ps.withFiles) { query.andWhere("note.fileIds != '{}'"); @@ -136,7 +138,7 @@ export default define(meta, paramDef, async (ps, user) => { let skip = 0; while (found.length < ps.limit) { const notes = await query.take(take).skip(skip).getMany(); - found.push(...await Notes.packMany(notes, user)) + found.push(...(await Notes.packMany(notes, user))); skip += take; if (notes.length < take) break; } diff --git a/packages/backend/src/server/api/endpoints/notes/mentions.ts b/packages/backend/src/server/api/endpoints/notes/mentions.ts index 7ffe83e5c9..68688b504c 100644 --- a/packages/backend/src/server/api/endpoints/notes/mentions.ts +++ b/packages/backend/src/server/api/endpoints/notes/mentions.ts @@ -86,7 +86,6 @@ export default define(meta, paramDef, async (ps, user) => { query.setParameters(followingQuery.getParameters()); } - // We fetch more than requested because some may be filtered out, and if there's less than // requested, the pagination stops. const found = []; @@ -94,7 +93,7 @@ export default define(meta, paramDef, async (ps, user) => { let skip = 0; while (found.length < ps.limit) { const notes = await query.take(take).skip(skip).getMany(); - found.push(...await Notes.packMany(notes, user)) + found.push(...(await Notes.packMany(notes, user))); skip += take; if (notes.length < take) break; } diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index c73114de61..e009233c4a 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -139,7 +139,7 @@ export default define(meta, paramDef, async (ps, user) => { let skip = 0; while (found.length < ps.limit) { const notes = await query.take(take).skip(skip).getMany(); - found.push(...await Notes.packMany(notes, user)) + found.push(...(await Notes.packMany(notes, user))); skip += take; if (notes.length < take) break; } diff --git a/packages/backend/src/server/api/endpoints/notes/renotes.ts b/packages/backend/src/server/api/endpoints/notes/renotes.ts index 60d398088a..f313616be2 100644 --- a/packages/backend/src/server/api/endpoints/notes/renotes.ts +++ b/packages/backend/src/server/api/endpoints/notes/renotes.ts @@ -81,7 +81,7 @@ export default define(meta, paramDef, async (ps, user) => { let skip = 0; while (found.length < ps.limit) { const notes = await query.take(take).skip(skip).getMany(); - found.push(...await Notes.packMany(notes, user)) + found.push(...(await Notes.packMany(notes, user))); skip += take; if (notes.length < take) break; } diff --git a/packages/backend/src/server/api/endpoints/notes/replies.ts b/packages/backend/src/server/api/endpoints/notes/replies.ts index 94a752a64b..5ea4d479c5 100644 --- a/packages/backend/src/server/api/endpoints/notes/replies.ts +++ b/packages/backend/src/server/api/endpoints/notes/replies.ts @@ -65,7 +65,7 @@ export default define(meta, paramDef, async (ps, user) => { let skip = 0; while (found.length < ps.limit) { const notes = await query.take(take).skip(skip).getMany(); - found.push(...await Notes.packMany(notes, user)) + found.push(...(await Notes.packMany(notes, user))); skip += take; if (notes.length < take) break; } 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 f1cae78ba9..f988acaa51 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 @@ -152,7 +152,7 @@ export default define(meta, paramDef, async (ps, me) => { let skip = 0; while (found.length < ps.limit) { const notes = await query.take(take).skip(skip).getMany(); - found.push(...await Notes.packMany(notes, me)) + found.push(...(await Notes.packMany(notes, me))); skip += take; if (notes.length < take) break; } diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index e79f6b5898..f85c0cfd32 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -9,6 +9,7 @@ import { generateRepliesQuery } from "../../common/generate-replies-query.js"; import { generateMutedNoteQuery } from "../../common/generate-muted-note-query.js"; import { generateChannelQuery } from "../../common/generate-channel-query.js"; import { generateBlockedUserQuery } from "../../common/generate-block-query.js"; +import { generateMutedUserRenotesQueryForNotes } from "../../common/generated-muted-renote-query.js"; export const meta = { tags: ["notes"], @@ -95,6 +96,7 @@ export default define(meta, paramDef, async (ps, user) => { generateMutedUserQuery(query, user); generateMutedNoteQuery(query, user); generateBlockedUserQuery(query, user); + generateMutedUserRenotesQueryForNotes(query, user); if (ps.includeMyRenotes === false) { query.andWhere( @@ -154,7 +156,7 @@ export default define(meta, paramDef, async (ps, user) => { let skip = 0; while (found.length < ps.limit) { const notes = await query.take(take).skip(skip).getMany(); - found.push(...await Notes.packMany(notes, user)) + found.push(...(await Notes.packMany(notes, user))); skip += take; if (notes.length < take) break; } 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 1123a33ae7..03f5cee3f3 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 @@ -151,7 +151,7 @@ export default define(meta, paramDef, async (ps, user) => { let skip = 0; while (found.length < ps.limit) { const notes = await query.take(take).skip(skip).getMany(); - found.push(...await Notes.packMany(notes, user)) + found.push(...(await Notes.packMany(notes, user))); skip += take; if (notes.length < take) break; } diff --git a/packages/backend/src/server/api/endpoints/renote-mute/create.ts b/packages/backend/src/server/api/endpoints/renote-mute/create.ts new file mode 100644 index 0000000000..857cbd9756 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/renote-mute/create.ts @@ -0,0 +1,68 @@ +import { genId } from "@/misc/gen-id.js"; +import { RenoteMutings } from "@/models/index.js"; +import { RenoteMuting } from "@/models/entities/renote-muting.js"; +import define from "../../define.js"; +import { ApiError } from "../../error.js"; +import { getUser } from "../../common/getters.js"; + +export const meta = { + tags: ["account"], + + requireCredential: true, + + kind: "write:mutes", + + errors: { + noSuchUser: { + message: "No such user.", + code: "NO_SUCH_USER", + id: "6fef56f3-e765-4957-88e5-c6f65329b8a5", + }, + + alreadyMuting: { + message: "You are already muting that user.", + code: "ALREADY_MUTING", + id: "7e7359cb-160c-4956-b08f-4d1c653cd007", + }, + }, +} as const; + +export const paramDef = { + type: "object", + properties: { + userId: { type: "string", format: "misskey:id" }, + }, + required: ["userId"], +} as const; + +// eslint-disable-next-line import/no-default-export +export default define(meta, paramDef, async (ps, user) => { + const muter = user; + + // Get mutee + const mutee = await getUser(ps.userId).catch((e) => { + if (e.id === "15348ddd-432d-49c2-8a5a-8069753becff") + throw new ApiError(meta.errors.noSuchUser); + throw e; + }); + + // Check if already muting + const exist = await RenoteMutings.findOneBy({ + muterId: muter.id, + muteeId: mutee.id, + }); + + if (exist != null) { + throw new ApiError(meta.errors.alreadyMuting); + } + + // Create mute + await RenoteMutings.insert({ + id: genId(), + createdAt: new Date(), + muterId: muter.id, + muteeId: mutee.id, + } as RenoteMuting); + + // publishUserEvent(user.id, "mute", mutee); +}); diff --git a/packages/backend/src/server/api/endpoints/renote-mute/delete.ts b/packages/backend/src/server/api/endpoints/renote-mute/delete.ts new file mode 100644 index 0000000000..fb4c972af0 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/renote-mute/delete.ts @@ -0,0 +1,63 @@ +import { RenoteMutings } from "@/models/index.js"; +import define from "../../define.js"; +import { ApiError } from "../../error.js"; +import { getUser } from "../../common/getters.js"; + +export const meta = { + tags: ["account"], + + requireCredential: true, + + kind: "write:mutes", + + errors: { + noSuchUser: { + message: "No such user.", + code: "NO_SUCH_USER", + id: "b851d00b-8ab1-4a56-8b1b-e24187cb48ef", + }, + + notMuting: { + message: "You are not muting that user.", + code: "NOT_MUTING", + id: "5467d020-daa9-4553-81e1-135c0c35a96d", + }, + }, +} as const; + +export const paramDef = { + type: "object", + properties: { + userId: { type: "string", format: "misskey:id" }, + }, + required: ["userId"], +} as const; + +// eslint-disable-next-line import/no-default-export +export default define(meta, paramDef, async (ps, user) => { + const muter = user; + + // Get mutee + const mutee = await getUser(ps.userId).catch((e) => { + if (e.id === "15348ddd-432d-49c2-8a5a-8069753becff") + throw new ApiError(meta.errors.noSuchUser); + throw e; + }); + + // Check not muting + const exist = await RenoteMutings.findOneBy({ + muterId: muter.id, + muteeId: mutee.id, + }); + + if (exist == null) { + throw new ApiError(meta.errors.notMuting); + } + + // Delete mute + await RenoteMutings.delete({ + id: exist.id, + }); + + // publishUserEvent(user.id, "unmute", mutee); +}); diff --git a/packages/backend/src/server/api/endpoints/renote-mute/list.ts b/packages/backend/src/server/api/endpoints/renote-mute/list.ts new file mode 100644 index 0000000000..9149dd9753 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/renote-mute/list.ts @@ -0,0 +1,46 @@ +import { RenoteMutings } from "@/models/index.js"; +import define from "../../define.js"; +import { makePaginationQuery } from "../../common/make-pagination-query.js"; + +export const meta = { + tags: ["account"], + + requireCredential: true, + + kind: "read:mutes", + + res: { + type: "array", + optional: false, + nullable: false, + items: { + type: "object", + optional: false, + nullable: false, + ref: "RenoteMuting", + }, + }, +} as const; + +export const paramDef = { + type: "object", + properties: { + limit: { type: "integer", minimum: 1, maximum: 100, default: 30 }, + sinceId: { type: "string", format: "misskey:id" }, + untilId: { type: "string", format: "misskey:id" }, + }, + required: [], +} as const; + +// eslint-disable-next-line import/no-default-export +export default define(meta, paramDef, async (ps, me) => { + const query = makePaginationQuery( + RenoteMutings.createQueryBuilder("muting"), + ps.sinceId, + ps.untilId, + ).andWhere("muting.muterId = :meId", { meId: me.id }); + + const mutings = await query.take(ps.limit).getMany(); + + return await RenoteMutings.packMany(mutings, me); +}); diff --git a/packages/backend/src/server/api/endpoints/sw/register.ts b/packages/backend/src/server/api/endpoints/sw/register.ts index 7218b0d50a..42a35fb685 100644 --- a/packages/backend/src/server/api/endpoints/sw/register.ts +++ b/packages/backend/src/server/api/endpoints/sw/register.ts @@ -26,6 +26,21 @@ export const meta = { optional: false, nullable: true, }, + userId: { + type: "string", + optional: false, + nullable: false, + }, + endpoint: { + type: "string", + optional: false, + nullable: false, + }, + sendReadMessage: { + type: "boolean", + optional: false, + nullable: false, + }, }, }, } as const; @@ -36,14 +51,15 @@ export const paramDef = { endpoint: { type: "string" }, auth: { type: "string" }, publickey: { type: "string" }, + sendReadMessage: { type: "boolean", default: false }, }, required: ["endpoint", "auth", "publickey"], } as const; -export default define(meta, paramDef, async (ps, user) => { +export default define(meta, paramDef, async (ps, me) => { // if already subscribed const exist = await SwSubscriptions.findOneBy({ - userId: user.id, + userId: me.id, endpoint: ps.endpoint, auth: ps.auth, publickey: ps.publickey, @@ -55,20 +71,27 @@ export default define(meta, paramDef, async (ps, user) => { return { state: "already-subscribed" as const, key: instance.swPublicKey, + userId: me.id, + endpoint: exist.endpoint, + sendReadMessage: exist.sendReadMessage, }; } await SwSubscriptions.insert({ id: genId(), createdAt: new Date(), - userId: user.id, + userId: me.id, endpoint: ps.endpoint, auth: ps.auth, publickey: ps.publickey, + sendReadMessage: ps.sendReadMessage, }); return { state: "subscribed" as const, key: instance.swPublicKey, + userId: me.id, + endpoint: ps.endpoint, + sendReadMessage: ps.sendReadMessage, }; }); diff --git a/packages/backend/src/server/api/endpoints/sw/show-registration.ts b/packages/backend/src/server/api/endpoints/sw/show-registration.ts new file mode 100644 index 0000000000..c7a9609cff --- /dev/null +++ b/packages/backend/src/server/api/endpoints/sw/show-registration.ts @@ -0,0 +1,59 @@ +import { SwSubscriptions } from "@/models/index.js"; +import define from "../../define.js"; + +export const meta = { + tags: ["account"], + + requireCredential: true, + + description: "Check push notification registration exists.", + + res: { + type: "object", + optional: false, + nullable: true, + properties: { + userId: { + type: "string", + optional: false, + nullable: false, + }, + endpoint: { + type: "string", + optional: false, + nullable: false, + }, + sendReadMessage: { + type: "boolean", + optional: false, + nullable: false, + }, + }, + }, +} as const; + +export const paramDef = { + type: "object", + properties: { + endpoint: { type: "string" }, + }, + required: ["endpoint"], +} as const; + +// eslint-disable-next-line import/no-default-export +export default define(meta, paramDef, async (ps, me) => { + const exist = await SwSubscriptions.findOneBy({ + userId: me.id, + endpoint: ps.endpoint, + }); + + if (exist != null) { + return { + userId: exist.userId, + endpoint: exist.endpoint, + sendReadMessage: exist.sendReadMessage, + }; + } + + return null; +}); diff --git a/packages/backend/src/server/api/endpoints/sw/unregister.ts b/packages/backend/src/server/api/endpoints/sw/unregister.ts index b025630e4b..e2a40f51cb 100644 --- a/packages/backend/src/server/api/endpoints/sw/unregister.ts +++ b/packages/backend/src/server/api/endpoints/sw/unregister.ts @@ -4,7 +4,7 @@ import define from "../../define.js"; export const meta = { tags: ["account"], - requireCredential: true, + requireCredential: false, description: "Unregister from receiving push notifications.", } as const; @@ -17,9 +17,9 @@ export const paramDef = { required: ["endpoint"], } as const; -export default define(meta, paramDef, async (ps, user) => { +export default define(meta, paramDef, async (ps, me) => { await SwSubscriptions.delete({ - userId: user.id, + ...(me ? { userId: me.id } : {}), endpoint: ps.endpoint, }); }); diff --git a/packages/backend/src/server/api/endpoints/sw/update-registration.ts b/packages/backend/src/server/api/endpoints/sw/update-registration.ts new file mode 100644 index 0000000000..5ba53ee8a7 --- /dev/null +++ b/packages/backend/src/server/api/endpoints/sw/update-registration.ts @@ -0,0 +1,44 @@ +import { SwSubscriptions } from "@/models/index.js"; +import define from "../../define.js"; + +export const meta = { + tags: ["account"], + + requireCredential: true, + + description: "Unregister from receiving push notifications.", +} as const; + +export const paramDef = { + type: "object", + properties: { + endpoint: { type: "string" }, + sendReadMessage: { type: "boolean" }, + }, + required: ["endpoint"], +} as const; + +export default define(meta, paramDef, async (ps, me) => { + const swSubscription = await SwSubscriptions.findOneBy({ + userId: me.id, + endpoint: ps.endpoint, + }); + + if (swSubscription === null) { + throw new Error("No such registration"); + } + + if (ps.sendReadMessage !== undefined) { + swSubscription.sendReadMessage = ps.sendReadMessage; + } + + await SwSubscriptions.update(swSubscription.id, { + sendReadMessage: swSubscription.sendReadMessage, + }); + + return { + userId: swSubscription.userId, + endpoint: swSubscription.endpoint, + sendReadMessage: swSubscription.sendReadMessage, + }; +}); diff --git a/packages/backend/src/server/api/endpoints/users/relation.ts b/packages/backend/src/server/api/endpoints/users/relation.ts index 01f39396de..5580eaea0b 100644 --- a/packages/backend/src/server/api/endpoints/users/relation.ts +++ b/packages/backend/src/server/api/endpoints/users/relation.ts @@ -57,6 +57,11 @@ export const meta = { optional: false, nullable: false, }, + isRenoteMuted: { + type: "boolean", + optional: false, + nullable: false, + }, }, }, { @@ -107,6 +112,11 @@ export const meta = { optional: false, nullable: false, }, + isRenoteMuted: { + type: "boolean", + optional: false, + nullable: false, + }, }, }, }, diff --git a/packages/backend/src/server/api/index.ts b/packages/backend/src/server/api/index.ts index bfc373e58c..b8e4231655 100644 --- a/packages/backend/src/server/api/index.ts +++ b/packages/backend/src/server/api/index.ts @@ -24,7 +24,10 @@ import discord from "./service/discord.js"; import github from "./service/github.js"; import twitter from "./service/twitter.js"; import { koaBody } from "koa-body"; -import { convertId, IdConvertType as IdType } from "../../../native-utils/built/index.js"; +import { + convertId, + IdConvertType as IdType, +} from "../../../native-utils/built/index.js"; // re-export native rust id conversion (function and enum) export { IdType, convertId }; diff --git a/packages/backend/src/server/api/stream/channel.ts b/packages/backend/src/server/api/stream/channel.ts index 93dbdc426c..fc8e0ce35e 100644 --- a/packages/backend/src/server/api/stream/channel.ts +++ b/packages/backend/src/server/api/stream/channel.ts @@ -30,6 +30,10 @@ export default abstract class Channel { return this.connection.muting; } + protected get renoteMuting() { + return this.connection.renoteMuting; + } + protected get blocking() { return this.connection.blocking; } diff --git a/packages/backend/src/server/api/stream/channels/antenna.ts b/packages/backend/src/server/api/stream/channels/antenna.ts index 8e0d081107..050a8d1019 100644 --- a/packages/backend/src/server/api/stream/channels/antenna.ts +++ b/packages/backend/src/server/api/stream/channels/antenna.ts @@ -34,6 +34,9 @@ export default class extends Channel { // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する if (isUserRelated(note, this.blocking)) return; + if (note.renote && !note.text && isUserRelated(note, this.renoteMuting)) + return; + this.connection.cacheNote(note); this.send("note", note); diff --git a/packages/backend/src/server/api/stream/channels/channel.ts b/packages/backend/src/server/api/stream/channels/channel.ts index d2a2269a47..d046579f42 100644 --- a/packages/backend/src/server/api/stream/channels/channel.ts +++ b/packages/backend/src/server/api/stream/channels/channel.ts @@ -36,6 +36,9 @@ export default class extends Channel { // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する if (isUserRelated(note, this.blocking)) return; + if (note.renote && !note.text && isUserRelated(note, this.renoteMuting)) + return; + this.connection.cacheNote(note); this.send("note", note); 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 bea201088f..aa3844c7e3 100644 --- a/packages/backend/src/server/api/stream/channels/global-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts @@ -1,6 +1,6 @@ import Channel from "../channel.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import { checkWordMute } from "@/misc/check-word-mute.js"; +import { getWordMute } from "@/misc/check-word-mute.js"; import { isInstanceMuted } from "@/misc/is-instance-muted.js"; import { isUserRelated } from "@/misc/is-user-related.js"; import type { Packed } from "@/misc/schema.js"; @@ -56,14 +56,17 @@ export default class extends Channel { // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する if (isUserRelated(note, this.blocking)) return; + if (note.renote && !note.text && isUserRelated(note, this.renoteMuting)) + return; + // 流れてきたNoteがミュートすべきNoteだったら無視する // TODO: 将来的には、単にMutedNoteテーブルにレコードがあるかどうかで判定したい(以下の理由により難しそうではある) // 現状では、ワードミュートにおけるMutedNoteレコードの追加処理はストリーミングに流す処理と並列で行われるため、 // レコードが追加されるNoteでも追加されるより先にここのストリーミングの処理に到達することが起こる。 - // そのためレコードが存在するかのチェックでは不十分なので、改めてcheckWordMuteを呼んでいる + // そのためレコードが存在するかのチェックでは不十分なので、改めてgetWordMuteを呼んでいる if ( this.userProfile && - (await checkWordMute(note, this.user, this.userProfile.mutedWords)) + (await getWordMute(note, this.user, this.userProfile.mutedWords)).muted ) return; diff --git a/packages/backend/src/server/api/stream/channels/hashtag.ts b/packages/backend/src/server/api/stream/channels/hashtag.ts index 9d7b518d9f..a2e5481abb 100644 --- a/packages/backend/src/server/api/stream/channels/hashtag.ts +++ b/packages/backend/src/server/api/stream/channels/hashtag.ts @@ -37,6 +37,9 @@ export default class extends Channel { // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する if (isUserRelated(note, this.blocking)) return; + if (note.renote && !note.text && isUserRelated(note, this.renoteMuting)) + return; + this.connection.cacheNote(note); this.send("note", 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 47d7736388..fa4a8a3901 100644 --- a/packages/backend/src/server/api/stream/channels/home-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts @@ -1,5 +1,5 @@ import Channel from "../channel.js"; -import { checkWordMute } from "@/misc/check-word-mute.js"; +import { getWordMute } from "@/misc/check-word-mute.js"; import { isUserRelated } from "@/misc/is-user-related.js"; import { isInstanceMuted } from "@/misc/is-instance-muted.js"; import type { Packed } from "@/misc/schema.js"; @@ -54,14 +54,17 @@ export default class extends Channel { // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する if (isUserRelated(note, this.blocking)) return; + if (note.renote && !note.text && isUserRelated(note, this.renoteMuting)) + return; + // 流れてきたNoteがミュートすべきNoteだったら無視する // TODO: 将来的には、単にMutedNoteテーブルにレコードがあるかどうかで判定したい(以下の理由により難しそうではある) // 現状では、ワードミュートにおけるMutedNoteレコードの追加処理はストリーミングに流す処理と並列で行われるため、 // レコードが追加されるNoteでも追加されるより先にここのストリーミングの処理に到達することが起こる。 - // そのためレコードが存在するかのチェックでは不十分なので、改めてcheckWordMuteを呼んでいる + // そのためレコードが存在するかのチェックでは不十分なので、改めてgetWordMuteを呼んでいる if ( this.userProfile && - (await checkWordMute(note, this.user, this.userProfile.mutedWords)) + (await getWordMute(note, this.user, this.userProfile.mutedWords)).muted ) return; 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 398127c402..557bb96827 100644 --- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts @@ -1,6 +1,6 @@ import Channel from "../channel.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import { checkWordMute } from "@/misc/check-word-mute.js"; +import { getWordMute } from "@/misc/check-word-mute.js"; import { isUserRelated } from "@/misc/is-user-related.js"; import { isInstanceMuted } from "@/misc/is-instance-muted.js"; import type { Packed } from "@/misc/schema.js"; @@ -71,14 +71,17 @@ export default class extends Channel { // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する if (isUserRelated(note, this.blocking)) return; + if (note.renote && !note.text && isUserRelated(note, this.renoteMuting)) + return; + // 流れてきたNoteがミュートすべきNoteだったら無視する // TODO: 将来的には、単にMutedNoteテーブルにレコードがあるかどうかで判定したい(以下の理由により難しそうではある) // 現状では、ワードミュートにおけるMutedNoteレコードの追加処理はストリーミングに流す処理と並列で行われるため、 // レコードが追加されるNoteでも追加されるより先にここのストリーミングの処理に到達することが起こる。 - // そのためレコードが存在するかのチェックでは不十分なので、改めてcheckWordMuteを呼んでいる + // そのためレコードが存在するかのチェックでは不十分なので、改めてgetWordMuteを呼んでいる if ( this.userProfile && - (await checkWordMute(note, this.user, this.userProfile.mutedWords)) + (await getWordMute(note, this.user, this.userProfile.mutedWords)).muted ) return; 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 6f8075b7aa..dc3aab8d7d 100644 --- a/packages/backend/src/server/api/stream/channels/local-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/local-timeline.ts @@ -1,6 +1,6 @@ import Channel from "../channel.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import { checkWordMute } from "@/misc/check-word-mute.js"; +import { getWordMute } from "@/misc/check-word-mute.js"; import { isUserRelated } from "@/misc/is-user-related.js"; import type { Packed } from "@/misc/schema.js"; @@ -48,14 +48,17 @@ export default class extends Channel { // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する if (isUserRelated(note, this.blocking)) return; + if (note.renote && !note.text && isUserRelated(note, this.renoteMuting)) + return; + // 流れてきたNoteがミュートすべきNoteだったら無視する // TODO: 将来的には、単にMutedNoteテーブルにレコードがあるかどうかで判定したい(以下の理由により難しそうではある) // 現状では、ワードミュートにおけるMutedNoteレコードの追加処理はストリーミングに流す処理と並列で行われるため、 // レコードが追加されるNoteでも追加されるより先にここのストリーミングの処理に到達することが起こる。 - // そのためレコードが存在するかのチェックでは不十分なので、改めてcheckWordMuteを呼んでいる + // そのためレコードが存在するかのチェックでは不十分なので、改めてgetWordMuteを呼んでいる if ( this.userProfile && - (await checkWordMute(note, this.user, this.userProfile.mutedWords)) + (await getWordMute(note, this.user, this.userProfile.mutedWords)).muted ) return; diff --git a/packages/backend/src/server/api/stream/channels/recommended-timeline.ts b/packages/backend/src/server/api/stream/channels/recommended-timeline.ts index a2a03fca12..28e57ef53e 100644 --- a/packages/backend/src/server/api/stream/channels/recommended-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/recommended-timeline.ts @@ -1,6 +1,6 @@ import Channel from "../channel.js"; import { fetchMeta } from "@/misc/fetch-meta.js"; -import { checkWordMute } from "@/misc/check-word-mute.js"; +import { getWordMute } from "@/misc/check-word-mute.js"; import { isUserRelated } from "@/misc/is-user-related.js"; import { isInstanceMuted } from "@/misc/is-instance-muted.js"; import type { Packed } from "@/misc/schema.js"; @@ -73,10 +73,10 @@ export default class extends Channel { // TODO: 将来的には、単にMutedNoteテーブルにレコードがあるかどうかで判定したい(以下の理由により難しそうではある) // 現状では、ワードミュートにおけるMutedNoteレコードの追加処理はストリーミングに流す処理と並列で行われるため、 // レコードが追加されるNoteでも追加されるより先にここのストリーミングの処理に到達することが起こる。 - // そのためレコードが存在するかのチェックでは不十分なので、改めてcheckWordMuteを呼んでいる + // そのためレコードが存在するかのチェックでは不十分なので、改めてgetWordMuteを呼んでいる if ( this.userProfile && - (await checkWordMute(note, this.user, this.userProfile.mutedWords)) + (await getWordMute(note, this.user, this.userProfile.mutedWords)).muted ) return; 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 f63776c9e9..105c45955c 100644 --- a/packages/backend/src/server/api/stream/channels/user-list.ts +++ b/packages/backend/src/server/api/stream/channels/user-list.ts @@ -56,6 +56,9 @@ export default class extends Channel { // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する if (isUserRelated(note, this.blocking)) return; + if (note.renote && !note.text && isUserRelated(note, this.renoteMuting)) + return; + this.send("note", note); } diff --git a/packages/backend/src/server/api/stream/index.ts b/packages/backend/src/server/api/stream/index.ts index 03cecf5429..055fe200b7 100644 --- a/packages/backend/src/server/api/stream/index.ts +++ b/packages/backend/src/server/api/stream/index.ts @@ -7,6 +7,7 @@ import { Users, Followings, Mutings, + RenoteMutings, UserProfiles, ChannelFollowings, Blockings, @@ -36,6 +37,7 @@ export default class Connection { public userProfile?: UserProfile | null; public following: Set = new Set(); public muting: Set = new Set(); + public renoteMuting: Set = new Set(); public blocking: Set = new Set(); // "被"blocking public followingChannels: Set = new Set(); public token?: AccessToken; @@ -80,6 +82,7 @@ export default class Connection { if (this.user) { this.updateFollowing(); this.updateMuting(); + this.updateRenoteMuting(); this.updateBlocking(); this.updateFollowingChannels(); this.updateUserProfile(); @@ -114,6 +117,7 @@ export default class Connection { this.muting.delete(data.body.id); break; + // TODO: renote mute events // TODO: block events case "followChannel": @@ -564,6 +568,17 @@ export default class Connection { this.muting = new Set(mutings.map((x) => x.muteeId)); } + private async updateRenoteMuting() { + const renoteMutings = await RenoteMutings.find({ + where: { + muterId: this.user!.id, + }, + select: ["muteeId"], + }); + + this.renoteMuting = new Set(renoteMutings.map((x) => x.muteeId)); + } + private async updateBlocking() { // ここでいうBlockingは被Blockingの意 const blockings = await Blockings.find({ diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index 6c7fd9ad57..5dd324d89a 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -53,7 +53,7 @@ import { Poll } from "@/models/entities/poll.js"; import { createNotification } from "../create-notification.js"; import { isDuplicateKeyValueError } from "@/misc/is-duplicate-key-value-error.js"; import { checkHitAntenna } from "@/misc/check-hit-antenna.js"; -import { checkWordMute } from "@/misc/check-word-mute.js"; +import { getWordMute } from "@/misc/check-word-mute.js"; import { addNoteToAntenna } from "../add-note-to-antenna.js"; import { countSameRenotes } from "@/misc/count-same-renotes.js"; import { deliverToRelays } from "../relay.js"; @@ -343,9 +343,9 @@ export default async ( ) .then((us) => { for (const u of us) { - checkWordMute(note, { id: u.userId }, u.mutedWords).then( + getWordMute(note, { id: u.userId }, u.mutedWords).then( (shouldMute) => { - if (shouldMute) { + if (shouldMute.muted) { MutedNotes.insert({ id: genId(), userId: u.userId, diff --git a/packages/backend/src/services/push-notification.ts b/packages/backend/src/services/push-notification.ts index 0e51ad9675..a207fae391 100644 --- a/packages/backend/src/services/push-notification.ts +++ b/packages/backend/src/services/push-notification.ts @@ -63,6 +63,17 @@ export async function pushNotification( }); for (const subscription of subscriptions) { + if ( + [ + "readNotifications", + "readAllNotifications", + "readAllMessagingMessages", + "readAllMessagingMessagesOfARoom", + ].includes(type) && + !subscription.sendReadMessage + ) + continue; + const pushSubscription = { endpoint: subscription.endpoint, keys: { diff --git a/packages/backend/test/activitypub.ts b/packages/backend/test/activitypub.ts index f4ae27e5ec..7b6f85f5a1 100644 --- a/packages/backend/test/activitypub.ts +++ b/packages/backend/test/activitypub.ts @@ -1,42 +1,44 @@ -process.env.NODE_ENV = 'test'; +process.env.NODE_ENV = "test"; -import * as assert from 'assert'; -import rndstr from 'rndstr'; -import { initDb } from '../src/db/postgre.js'; -import { initTestDb } from './utils.js'; +import * as assert from "assert"; +import rndstr from "rndstr"; +import { initDb } from "../src/db/postgre.js"; +import { initTestDb } from "./utils.js"; -describe('ActivityPub', () => { +describe("ActivityPub", () => { before(async () => { //await initTestDb(); await initDb(); }); - describe('Parse minimum object', () => { - const host = 'https://host1.test'; - const preferredUsername = `${rndstr('A-Z', 4)}${rndstr('a-z', 4)}`; + describe("Parse minimum object", () => { + const host = "https://host1.test"; + const preferredUsername = `${rndstr("A-Z", 4)}${rndstr("a-z", 4)}`; const actorId = `${host}/users/${preferredUsername.toLowerCase()}`; const actor = { - '@context': 'https://www.w3.org/ns/activitystreams', + "@context": "https://www.w3.org/ns/activitystreams", id: actorId, - type: 'Person', + type: "Person", preferredUsername, inbox: `${actorId}/inbox`, outbox: `${actorId}/outbox`, }; const post = { - '@context': 'https://www.w3.org/ns/activitystreams', - id: `${host}/users/${rndstr('0-9a-z', 8)}`, - type: 'Note', + "@context": "https://www.w3.org/ns/activitystreams", + id: `${host}/users/${rndstr("0-9a-z", 8)}`, + type: "Note", attributedTo: actor.id, - to: 'https://www.w3.org/ns/activitystreams#Public', - content: 'あ', + to: "https://www.w3.org/ns/activitystreams#Public", + content: "あ", }; - it('Minimum Actor', async () => { - const { MockResolver } = await import('./misc/mock-resolver.js'); - const { createPerson } = await import('../src/remote/activitypub/models/person.js'); + it("Minimum Actor", async () => { + const { MockResolver } = await import("./misc/mock-resolver.js"); + const { createPerson } = await import( + "../src/remote/activitypub/models/person.js" + ); const resolver = new MockResolver(); resolver._register(actor.id, actor); @@ -48,9 +50,11 @@ describe('ActivityPub', () => { assert.deepStrictEqual(user.inbox, actor.inbox); }); - it('Minimum Note', async () => { - const { MockResolver } = await import('./misc/mock-resolver.js'); - const { createNote } = await import('../src/remote/activitypub/models/note.js'); + it("Minimum Note", async () => { + const { MockResolver } = await import("./misc/mock-resolver.js"); + const { createNote } = await import( + "../src/remote/activitypub/models/note.js" + ); const resolver = new MockResolver(); resolver._register(actor.id, actor); @@ -59,31 +63,33 @@ describe('ActivityPub', () => { const note = await createNote(post.id, resolver, true); assert.deepStrictEqual(note?.uri, post.id); - assert.deepStrictEqual(note.visibility, 'public'); + assert.deepStrictEqual(note.visibility, "public"); assert.deepStrictEqual(note.text, post.content); }); }); - describe('Truncate long name', () => { - const host = 'https://host1.test'; - const preferredUsername = `${rndstr('A-Z', 4)}${rndstr('a-z', 4)}`; + describe("Truncate long name", () => { + const host = "https://host1.test"; + const preferredUsername = `${rndstr("A-Z", 4)}${rndstr("a-z", 4)}`; const actorId = `${host}/users/${preferredUsername.toLowerCase()}`; - const name = rndstr('0-9a-z', 129); + const name = rndstr("0-9a-z", 129); const actor = { - '@context': 'https://www.w3.org/ns/activitystreams', + "@context": "https://www.w3.org/ns/activitystreams", id: actorId, - type: 'Person', + type: "Person", preferredUsername, name, inbox: `${actorId}/inbox`, outbox: `${actorId}/outbox`, }; - it('Actor', async () => { - const { MockResolver } = await import('./misc/mock-resolver.js'); - const { createPerson } = await import('../src/remote/activitypub/models/person.js'); + it("Actor", async () => { + const { MockResolver } = await import("./misc/mock-resolver.js"); + const { createPerson } = await import( + "../src/remote/activitypub/models/person.js" + ); const resolver = new MockResolver(); resolver._register(actor.id, actor); diff --git a/packages/backend/test/ap-request.ts b/packages/backend/test/ap-request.ts index 744b2f2c95..bf77a38532 100644 --- a/packages/backend/test/ap-request.ts +++ b/packages/backend/test/ap-request.ts @@ -1,53 +1,73 @@ -import * as assert from 'assert'; -import httpSignature from '@peertube/http-signature'; -import { genRsaKeyPair } from '../src/misc/gen-key-pair.js'; -import { createSignedPost, createSignedGet } from '../src/remote/activitypub/ap-request.js'; +import * as assert from "assert"; +import httpSignature from "@peertube/http-signature"; +import { genRsaKeyPair } from "../src/misc/gen-key-pair.js"; +import { + createSignedPost, + createSignedGet, +} from "../src/remote/activitypub/ap-request.js"; -export const buildParsedSignature = (signingString: string, signature: string, algorithm: string) => { +export const buildParsedSignature = ( + signingString: string, + signature: string, + algorithm: string, +) => { return { - scheme: 'Signature', + scheme: "Signature", params: { - keyId: 'KeyID', // dummy, not used for verify + keyId: "KeyID", // dummy, not used for verify algorithm: algorithm, - headers: [ '(request-target)', 'date', 'host', 'digest' ], // dummy, not used for verify + headers: ["(request-target)", "date", "host", "digest"], // dummy, not used for verify signature: signature, }, signingString: signingString, algorithm: algorithm.toUpperCase(), - keyId: 'KeyID', // dummy, not used for verify + keyId: "KeyID", // dummy, not used for verify }; }; -describe('ap-request', () => { - it('createSignedPost with verify', async () => { +describe("ap-request", () => { + it("createSignedPost with verify", async () => { const keypair = await genRsaKeyPair(); - const key = { keyId: 'x', 'privateKeyPem': keypair.privateKey }; - const url = 'https://example.com/inbox'; + const key = { keyId: "x", privateKeyPem: keypair.privateKey }; + const url = "https://example.com/inbox"; const activity = { a: 1 }; const body = JSON.stringify(activity); const headers = { - 'User-Agent': 'UA', + "User-Agent": "UA", }; - const req = createSignedPost({ key, url, body, additionalHeaders: headers }); + const req = createSignedPost({ + key, + url, + body, + additionalHeaders: headers, + }); - const parsed = buildParsedSignature(req.signingString, req.signature, 'rsa-sha256'); + const parsed = buildParsedSignature( + req.signingString, + req.signature, + "rsa-sha256", + ); const result = httpSignature.verifySignature(parsed, keypair.publicKey); assert.deepStrictEqual(result, true); }); - it('createSignedGet with verify', async () => { + it("createSignedGet with verify", async () => { const keypair = await genRsaKeyPair(); - const key = { keyId: 'x', 'privateKeyPem': keypair.privateKey }; - const url = 'https://example.com/outbox'; + const key = { keyId: "x", privateKeyPem: keypair.privateKey }; + const url = "https://example.com/outbox"; const headers = { - 'User-Agent': 'UA', + "User-Agent": "UA", }; const req = createSignedGet({ key, url, additionalHeaders: headers }); - const parsed = buildParsedSignature(req.signingString, req.signature, 'rsa-sha256'); + const parsed = buildParsedSignature( + req.signingString, + req.signature, + "rsa-sha256", + ); const result = httpSignature.verifySignature(parsed, keypair.publicKey); assert.deepStrictEqual(result, true); diff --git a/packages/backend/test/api-visibility.ts b/packages/backend/test/api-visibility.ts index cde3cd2d06..0ee4a4d337 100644 --- a/packages/backend/test/api-visibility.ts +++ b/packages/backend/test/api-visibility.ts @@ -1,10 +1,17 @@ -process.env.NODE_ENV = 'test'; +process.env.NODE_ENV = "test"; -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, startServer, shutdownServer } from './utils.js'; +import * as assert from "assert"; +import * as childProcess from "child_process"; +import { + async, + signup, + request, + post, + startServer, + shutdownServer, +} from "./utils.js"; -describe('API visibility', () => { +describe("API visibility", () => { let p: childProcess.ChildProcess; before(async () => { @@ -15,7 +22,7 @@ describe('API visibility', () => { await shutdownServer(p); }); - describe('Note visibility', async () => { + describe("Note visibility", async () => { //#region vars /** ヒロイン */ let alice: any; @@ -60,130 +67,170 @@ describe('API visibility', () => { //#endregion const show = async (noteId: any, by: any) => { - return await request('/notes/show', { - noteId, - }, by); + return await request( + "/notes/show", + { + noteId, + }, + by, + ); }; before(async () => { //#region prepare // signup - alice = await signup({ username: 'alice' }); - follower = await signup({ username: 'follower' }); - other = await signup({ username: 'other' }); - target = await signup({ username: 'target' }); - target2 = await signup({ username: 'target2' }); + alice = await signup({ username: "alice" }); + follower = await signup({ username: "follower" }); + other = await signup({ username: "other" }); + target = await signup({ username: "target" }); + target2 = await signup({ username: "target2" }); // follow alice <= follower - await request('/following/create', { userId: alice.id }, follower); + await request("/following/create", { userId: alice.id }, follower); // normal posts - pub = await post(alice, { text: 'x', visibility: 'public' }); - home = await post(alice, { text: 'x', visibility: 'home' }); - fol = await post(alice, { text: 'x', visibility: 'followers' }); - spe = await post(alice, { text: 'x', visibility: 'specified', visibleUserIds: [target.id] }); + pub = await post(alice, { text: "x", visibility: "public" }); + home = await post(alice, { text: "x", visibility: "home" }); + fol = await post(alice, { text: "x", visibility: "followers" }); + spe = await post(alice, { + text: "x", + visibility: "specified", + visibleUserIds: [target.id], + }); // replies - tgt = await post(target, { text: 'y', visibility: 'public' }); - pubR = await post(alice, { text: 'x', replyId: tgt.id, visibility: 'public' }); - homeR = await post(alice, { text: 'x', replyId: tgt.id, visibility: 'home' }); - folR = await post(alice, { text: 'x', replyId: tgt.id, visibility: 'followers' }); - speR = await post(alice, { text: 'x', replyId: tgt.id, visibility: 'specified' }); + tgt = await post(target, { text: "y", visibility: "public" }); + pubR = await post(alice, { + text: "x", + replyId: tgt.id, + visibility: "public", + }); + homeR = await post(alice, { + text: "x", + replyId: tgt.id, + visibility: "home", + }); + folR = await post(alice, { + text: "x", + replyId: tgt.id, + visibility: "followers", + }); + speR = await post(alice, { + text: "x", + replyId: tgt.id, + visibility: "specified", + }); // mentions - pubM = await post(alice, { text: '@target x', replyId: tgt.id, visibility: 'public' }); - homeM = await post(alice, { text: '@target x', replyId: tgt.id, visibility: 'home' }); - folM = await post(alice, { text: '@target x', replyId: tgt.id, visibility: 'followers' }); - speM = await post(alice, { text: '@target2 x', replyId: tgt.id, visibility: 'specified' }); + pubM = await post(alice, { + text: "@target x", + replyId: tgt.id, + visibility: "public", + }); + homeM = await post(alice, { + text: "@target x", + replyId: tgt.id, + visibility: "home", + }); + folM = await post(alice, { + text: "@target x", + replyId: tgt.id, + visibility: "followers", + }); + speM = await post(alice, { + text: "@target2 x", + replyId: tgt.id, + visibility: "specified", + }); //#endregion }); //#region show post // public - it('[show] public-postを自分が見れる', async(async () => { + it("[show] public-postを自分が見れる", async(async () => { const res = await show(pub.id, alice); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] public-postをフォロワーが見れる', async(async () => { + it("[show] public-postをフォロワーが見れる", async(async () => { const res = await show(pub.id, follower); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] public-postを非フォロワーが見れる', async(async () => { + it("[show] public-postを非フォロワーが見れる", async(async () => { const res = await show(pub.id, other); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] public-postを未認証が見れる', async(async () => { + it("[show] public-postを未認証が見れる", async(async () => { const res = await show(pub.id, null); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); // home - it('[show] home-postを自分が見れる', async(async () => { + it("[show] home-postを自分が見れる", async(async () => { const res = await show(home.id, alice); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] home-postをフォロワーが見れる', async(async () => { + it("[show] home-postをフォロワーが見れる", async(async () => { const res = await show(home.id, follower); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] home-postを非フォロワーが見れる', async(async () => { + it("[show] home-postを非フォロワーが見れる", async(async () => { const res = await show(home.id, other); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] home-postを未認証が見れる', async(async () => { + it("[show] home-postを未認証が見れる", async(async () => { const res = await show(home.id, null); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); // followers - it('[show] followers-postを自分が見れる', async(async () => { + it("[show] followers-postを自分が見れる", async(async () => { const res = await show(fol.id, alice); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] followers-postをフォロワーが見れる', async(async () => { + it("[show] followers-postをフォロワーが見れる", async(async () => { const res = await show(fol.id, follower); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] followers-postを非フォロワーが見れない', async(async () => { + it("[show] followers-postを非フォロワーが見れない", async(async () => { const res = await show(fol.id, other); assert.strictEqual(res.status, 404); })); - it('[show] followers-postを未認証が見れない', async(async () => { + it("[show] followers-postを未認証が見れない", async(async () => { const res = await show(fol.id, null); assert.strictEqual(res.status, 404); })); // specified - it('[show] specified-postを自分が見れる', async(async () => { + it("[show] specified-postを自分が見れる", async(async () => { const res = await show(spe.id, alice); assert.strictEqual(res.status, 404); })); - it('[show] specified-postを指定ユーザーが見れる', async(async () => { + it("[show] specified-postを指定ユーザーが見れる", async(async () => { const res = await show(spe.id, target); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] specified-postをフォロワーが見れない', async(async () => { + it("[show] specified-postをフォロワーが見れない", async(async () => { const res = await show(spe.id, follower); assert.strictEqual(res.status, 404); })); - it('[show] specified-postを非フォロワーが見れない', async(async () => { + it("[show] specified-postを非フォロワーが見れない", async(async () => { const res = await show(spe.id, other); assert.strictEqual(res.status, 404); })); - it('[show] specified-postを未認証が見れない', async(async () => { + it("[show] specified-postを未認証が見れない", async(async () => { const res = await show(spe.id, null); assert.strictEqual(res.status, 404); })); @@ -191,110 +238,110 @@ describe('API visibility', () => { //#region show reply // public - it('[show] public-replyを自分が見れる', async(async () => { + it("[show] public-replyを自分が見れる", async(async () => { const res = await show(pubR.id, alice); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] public-replyをされた人が見れる', async(async () => { + it("[show] public-replyをされた人が見れる", async(async () => { const res = await show(pubR.id, target); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] public-replyをフォロワーが見れる', async(async () => { + it("[show] public-replyをフォロワーが見れる", async(async () => { const res = await show(pubR.id, follower); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] public-replyを非フォロワーが見れる', async(async () => { + it("[show] public-replyを非フォロワーが見れる", async(async () => { const res = await show(pubR.id, other); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] public-replyを未認証が見れる', async(async () => { + it("[show] public-replyを未認証が見れる", async(async () => { const res = await show(pubR.id, null); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); // home - it('[show] home-replyを自分が見れる', async(async () => { + it("[show] home-replyを自分が見れる", async(async () => { const res = await show(homeR.id, alice); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] home-replyをされた人が見れる', async(async () => { + it("[show] home-replyをされた人が見れる", async(async () => { const res = await show(homeR.id, target); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] home-replyをフォロワーが見れる', async(async () => { + it("[show] home-replyをフォロワーが見れる", async(async () => { const res = await show(homeR.id, follower); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] home-replyを非フォロワーが見れる', async(async () => { + it("[show] home-replyを非フォロワーが見れる", async(async () => { const res = await show(homeR.id, other); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] home-replyを未認証が見れる', async(async () => { + it("[show] home-replyを未認証が見れる", async(async () => { const res = await show(homeR.id, null); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); // followers - it('[show] followers-replyを自分が見れる', async(async () => { + it("[show] followers-replyを自分が見れる", async(async () => { const res = await show(folR.id, alice); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] followers-replyを非フォロワーでもリプライされていれば見れる', async(async () => { + it("[show] followers-replyを非フォロワーでもリプライされていれば見れる", async(async () => { const res = await show(folR.id, target); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] followers-replyをフォロワーが見れる', async(async () => { + it("[show] followers-replyをフォロワーが見れる", async(async () => { const res = await show(folR.id, follower); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] followers-replyを非フォロワーが見れない', async(async () => { + it("[show] followers-replyを非フォロワーが見れない", async(async () => { const res = await show(folR.id, other); assert.strictEqual(res.status, 404); })); - it('[show] followers-replyを未認証が見れない', async(async () => { + it("[show] followers-replyを未認証が見れない", async(async () => { const res = await show(folR.id, null); assert.strictEqual(res.status, 404); })); // specified - it('[show] specified-replyを自分が見れる', async(async () => { + it("[show] specified-replyを自分が見れる", async(async () => { const res = await show(speR.id, alice); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] specified-replyを指定ユーザーが見れる', async(async () => { + it("[show] specified-replyを指定ユーザーが見れる", async(async () => { const res = await show(speR.id, target); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] specified-replyをされた人が指定されてなくても見れる', async(async () => { + it("[show] specified-replyをされた人が指定されてなくても見れる", async(async () => { const res = await show(speR.id, target); - assert.strictEqual(res.body.text, 'x'); + assert.strictEqual(res.body.text, "x"); })); - it('[show] specified-replyをフォロワーが見れない', async(async () => { + it("[show] specified-replyをフォロワーが見れない", async(async () => { const res = await show(speR.id, follower); assert.strictEqual(res.status, 404); })); - it('[show] specified-replyを非フォロワーが見れない', async(async () => { + it("[show] specified-replyを非フォロワーが見れない", async(async () => { const res = await show(speR.id, other); assert.strictEqual(res.status, 404); })); - it('[show] specified-replyを未認証が見れない', async(async () => { + it("[show] specified-replyを未認証が見れない", async(async () => { const res = await show(speR.id, null); assert.strictEqual(res.status, 404); })); @@ -302,174 +349,186 @@ describe('API visibility', () => { //#region show mention // public - it('[show] public-mentionを自分が見れる', async(async () => { + it("[show] public-mentionを自分が見れる", async(async () => { const res = await show(pubM.id, alice); - assert.strictEqual(res.body.text, '@target x'); + assert.strictEqual(res.body.text, "@target x"); })); - it('[show] public-mentionをされた人が見れる', async(async () => { + it("[show] public-mentionをされた人が見れる", async(async () => { const res = await show(pubM.id, target); - assert.strictEqual(res.body.text, '@target x'); + assert.strictEqual(res.body.text, "@target x"); })); - it('[show] public-mentionをフォロワーが見れる', async(async () => { + it("[show] public-mentionをフォロワーが見れる", async(async () => { const res = await show(pubM.id, follower); - assert.strictEqual(res.body.text, '@target x'); + assert.strictEqual(res.body.text, "@target x"); })); - it('[show] public-mentionを非フォロワーが見れる', async(async () => { + it("[show] public-mentionを非フォロワーが見れる", async(async () => { const res = await show(pubM.id, other); - assert.strictEqual(res.body.text, '@target x'); + assert.strictEqual(res.body.text, "@target x"); })); - it('[show] public-mentionを未認証が見れる', async(async () => { + it("[show] public-mentionを未認証が見れる", async(async () => { const res = await show(pubM.id, null); - assert.strictEqual(res.body.text, '@target x'); + assert.strictEqual(res.body.text, "@target x"); })); // home - it('[show] home-mentionを自分が見れる', async(async () => { + it("[show] home-mentionを自分が見れる", async(async () => { const res = await show(homeM.id, alice); - assert.strictEqual(res.body.text, '@target x'); + assert.strictEqual(res.body.text, "@target x"); })); - it('[show] home-mentionをされた人が見れる', async(async () => { + it("[show] home-mentionをされた人が見れる", async(async () => { const res = await show(homeM.id, target); - assert.strictEqual(res.body.text, '@target x'); + assert.strictEqual(res.body.text, "@target x"); })); - it('[show] home-mentionをフォロワーが見れる', async(async () => { + it("[show] home-mentionをフォロワーが見れる", async(async () => { const res = await show(homeM.id, follower); - assert.strictEqual(res.body.text, '@target x'); + assert.strictEqual(res.body.text, "@target x"); })); - it('[show] home-mentionを非フォロワーが見れる', async(async () => { + it("[show] home-mentionを非フォロワーが見れる", async(async () => { const res = await show(homeM.id, other); - assert.strictEqual(res.body.text, '@target x'); + assert.strictEqual(res.body.text, "@target x"); })); - it('[show] home-mentionを未認証が見れる', async(async () => { + it("[show] home-mentionを未認証が見れる", async(async () => { const res = await show(homeM.id, null); - assert.strictEqual(res.body.text, '@target x'); + assert.strictEqual(res.body.text, "@target x"); })); // followers - it('[show] followers-mentionを自分が見れる', async(async () => { + it("[show] followers-mentionを自分が見れる", async(async () => { const res = await show(folM.id, alice); - assert.strictEqual(res.body.text, '@target x'); + assert.strictEqual(res.body.text, "@target x"); })); - it('[show] followers-mentionをメンションされていれば非フォロワーでも見れる', async(async () => { + it("[show] followers-mentionをメンションされていれば非フォロワーでも見れる", async(async () => { const res = await show(folM.id, target); - assert.strictEqual(res.body.text, '@target x'); + assert.strictEqual(res.body.text, "@target x"); })); - it('[show] followers-mentionをフォロワーが見れる', async(async () => { + it("[show] followers-mentionをフォロワーが見れる", async(async () => { const res = await show(folM.id, follower); - assert.strictEqual(res.body.text, '@target x'); + assert.strictEqual(res.body.text, "@target x"); })); - it('[show] followers-mentionを非フォロワーが見れない', async(async () => { + it("[show] followers-mentionを非フォロワーが見れない", async(async () => { const res = await show(folM.id, other); assert.strictEqual(res.status, 404); })); - it('[show] followers-mentionを未認証が見れない', async(async () => { + it("[show] followers-mentionを未認証が見れない", async(async () => { const res = await show(folM.id, null); assert.strictEqual(res.status, 404); })); // specified - it('[show] specified-mentionを自分が見れる', async(async () => { + it("[show] specified-mentionを自分が見れる", async(async () => { const res = await show(speM.id, alice); - assert.strictEqual(res.body.text, '@target2 x'); + assert.strictEqual(res.body.text, "@target2 x"); })); - it('[show] specified-mentionを指定ユーザーが見れる', async(async () => { + it("[show] specified-mentionを指定ユーザーが見れる", async(async () => { const res = await show(speM.id, target); - assert.strictEqual(res.body.text, '@target2 x'); + assert.strictEqual(res.body.text, "@target2 x"); })); - it('[show] specified-mentionをされた人が指定されてなかったら見れない', async(async () => { + it("[show] specified-mentionをされた人が指定されてなかったら見れない", async(async () => { const res = await show(speM.id, target2); assert.strictEqual(res.status, 404); })); - it('[show] specified-mentionをフォロワーが見れない', async(async () => { + it("[show] specified-mentionをフォロワーが見れない", async(async () => { const res = await show(speM.id, follower); assert.strictEqual(res.status, 404); })); - it('[show] specified-mentionを非フォロワーが見れない', async(async () => { + it("[show] specified-mentionを非フォロワーが見れない", async(async () => { const res = await show(speM.id, other); assert.strictEqual(res.status, 404); })); - it('[show] specified-mentionを未認証が見れない', async(async () => { + it("[show] specified-mentionを未認証が見れない", async(async () => { const res = await show(speM.id, null); assert.strictEqual(res.status, 404); })); //#endregion //#region HTL - it('[HTL] public-post が 自分が見れる', async(async () => { - const res = await request('/notes/timeline', { limit: 100 }, alice); + it("[HTL] public-post が 自分が見れる", async(async () => { + const res = await request("/notes/timeline", { limit: 100 }, alice); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id == pub.id); - assert.strictEqual(notes[0].text, 'x'); + assert.strictEqual(notes[0].text, "x"); })); - it('[HTL] public-post が 非フォロワーから見れない', async(async () => { - const res = await request('/notes/timeline', { limit: 100 }, other); + it("[HTL] public-post が 非フォロワーから見れない", async(async () => { + const res = await request("/notes/timeline", { limit: 100 }, other); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id == pub.id); assert.strictEqual(notes.length, 0); })); - it('[HTL] followers-post が フォロワーから見れる', async(async () => { - const res = await request('/notes/timeline', { limit: 100 }, follower); + it("[HTL] followers-post が フォロワーから見れる", async(async () => { + const res = await request("/notes/timeline", { limit: 100 }, follower); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id == fol.id); - assert.strictEqual(notes[0].text, 'x'); + assert.strictEqual(notes[0].text, "x"); })); //#endregion //#region RTL - it('[replies] followers-reply が フォロワーから見れる', async(async () => { - const res = await request('/notes/replies', { noteId: tgt.id, limit: 100 }, follower); + it("[replies] followers-reply が フォロワーから見れる", async(async () => { + const res = await request( + "/notes/replies", + { noteId: tgt.id, limit: 100 }, + follower, + ); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id == folR.id); - assert.strictEqual(notes[0].text, 'x'); + assert.strictEqual(notes[0].text, "x"); })); - it('[replies] followers-reply が 非フォロワー (リプライ先ではない) から見れない', async(async () => { - const res = await request('/notes/replies', { noteId: tgt.id, limit: 100 }, other); + it("[replies] followers-reply が 非フォロワー (リプライ先ではない) から見れない", async(async () => { + const res = await request( + "/notes/replies", + { noteId: tgt.id, limit: 100 }, + other, + ); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id == folR.id); assert.strictEqual(notes.length, 0); })); - it('[replies] followers-reply が 非フォロワー (リプライ先である) から見れる', async(async () => { - const res = await request('/notes/replies', { noteId: tgt.id, limit: 100 }, target); + it("[replies] followers-reply が 非フォロワー (リプライ先である) から見れる", async(async () => { + const res = await request( + "/notes/replies", + { noteId: tgt.id, limit: 100 }, + target, + ); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id == folR.id); - assert.strictEqual(notes[0].text, 'x'); + assert.strictEqual(notes[0].text, "x"); })); //#endregion //#region MTL - it('[mentions] followers-reply が 非フォロワー (リプライ先である) から見れる', async(async () => { - const res = await request('/notes/mentions', { limit: 100 }, target); + it("[mentions] followers-reply が 非フォロワー (リプライ先である) から見れる", async(async () => { + const res = await request("/notes/mentions", { limit: 100 }, target); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id == folR.id); - assert.strictEqual(notes[0].text, 'x'); + assert.strictEqual(notes[0].text, "x"); })); - it('[mentions] followers-mention が 非フォロワー (メンション先である) から見れる', async(async () => { - const res = await request('/notes/mentions', { limit: 100 }, target); + it("[mentions] followers-mention が 非フォロワー (メンション先である) から見れる", async(async () => { + const res = await request("/notes/mentions", { limit: 100 }, target); assert.strictEqual(res.status, 200); const notes = res.body.filter((n: any) => n.id == folM.id); - assert.strictEqual(notes[0].text, '@target x'); + assert.strictEqual(notes[0].text, "@target x"); })); //#endregion }); diff --git a/packages/backend/test/api.ts b/packages/backend/test/api.ts index b1b2ecafc7..19a754552c 100644 --- a/packages/backend/test/api.ts +++ b/packages/backend/test/api.ts @@ -1,10 +1,19 @@ -process.env.NODE_ENV = 'test'; +process.env.NODE_ENV = "test"; -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, react, uploadFile, startServer, shutdownServer } from './utils.js'; +import * as assert from "assert"; +import * as childProcess from "child_process"; +import { + async, + signup, + request, + post, + react, + uploadFile, + startServer, + shutdownServer, +} from "./utils.js"; -describe('API', () => { +describe("API", () => { let p: childProcess.ChildProcess; let alice: any; let bob: any; @@ -12,58 +21,58 @@ describe('API', () => { before(async () => { p = await startServer(); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - carol = await signup({ username: 'carol' }); + alice = await signup({ username: "alice" }); + bob = await signup({ username: "bob" }); + carol = await signup({ username: "carol" }); }); after(async () => { await shutdownServer(p); }); - describe('General validation', () => { - it('wrong type', async(async () => { - const res = await request('/test', { + describe("General validation", () => { + it("wrong type", async(async () => { + const res = await request("/test", { required: true, string: 42, }); assert.strictEqual(res.status, 400); })); - it('missing require param', async(async () => { - const res = await request('/test', { - string: 'a', + it("missing require param", async(async () => { + const res = await request("/test", { + string: "a", }); assert.strictEqual(res.status, 400); })); - it('invalid misskey:id (empty string)', async(async () => { - const res = await request('/test', { + it("invalid misskey:id (empty string)", async(async () => { + const res = await request("/test", { required: true, - id: '', + id: "", }); assert.strictEqual(res.status, 400); })); - it('valid misskey:id', async(async () => { - const res = await request('/test', { + it("valid misskey:id", async(async () => { + const res = await request("/test", { required: true, - id: '8wvhjghbxu', + id: "8wvhjghbxu", }); assert.strictEqual(res.status, 200); })); - it('default value', async(async () => { - const res = await request('/test', { + it("default value", async(async () => { + const res = await request("/test", { required: true, - string: 'a', + string: "a", }); assert.strictEqual(res.status, 200); - assert.strictEqual(res.body.default, 'hello'); + assert.strictEqual(res.body.default, "hello"); })); - it('can set null even if it has default value', async(async () => { - const res = await request('/test', { + it("can set null even if it has default value", async(async () => { + const res = await request("/test", { required: true, nullableDefault: null, }); @@ -71,13 +80,13 @@ describe('API', () => { assert.strictEqual(res.body.nullableDefault, null); })); - it('cannot set undefined if it has default value', async(async () => { - const res = await request('/test', { + it("cannot set undefined if it has default value", async(async () => { + const res = await request("/test", { required: true, nullableDefault: undefined, }); assert.strictEqual(res.status, 200); - assert.strictEqual(res.body.nullableDefault, 'hello'); + assert.strictEqual(res.body.nullableDefault, "hello"); })); }); }); diff --git a/packages/backend/test/block.ts b/packages/backend/test/block.ts index b3343813cd..08192e4869 100644 --- a/packages/backend/test/block.ts +++ b/packages/backend/test/block.ts @@ -1,10 +1,17 @@ -process.env.NODE_ENV = 'test'; +process.env.NODE_ENV = "test"; -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, startServer, shutdownServer } from './utils.js'; +import * as assert from "assert"; +import * as childProcess from "child_process"; +import { + async, + signup, + request, + post, + startServer, + shutdownServer, +} from "./utils.js"; -describe('Block', () => { +describe("Block", () => { let p: childProcess.ChildProcess; // alice blocks bob @@ -14,72 +21,109 @@ describe('Block', () => { before(async () => { p = await startServer(); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - carol = await signup({ username: 'carol' }); + alice = await signup({ username: "alice" }); + bob = await signup({ username: "bob" }); + carol = await signup({ username: "carol" }); }); after(async () => { await shutdownServer(p); }); - it('Block作成', async(async () => { - const res = await request('/blocking/create', { - userId: bob.id, - }, alice); + it("Block作成", async(async () => { + const res = await request( + "/blocking/create", + { + userId: bob.id, + }, + alice, + ); assert.strictEqual(res.status, 200); })); - it('ブロックされているユーザーをフォローできない', async(async () => { - const res = await request('/following/create', { userId: alice.id }, bob); + it("ブロックされているユーザーをフォローできない", async(async () => { + const res = await request("/following/create", { userId: alice.id }, bob); assert.strictEqual(res.status, 400); - assert.strictEqual(res.body.error.id, 'c4ab57cc-4e41-45e9-bfd9-584f61e35ce0'); + assert.strictEqual( + res.body.error.id, + "c4ab57cc-4e41-45e9-bfd9-584f61e35ce0", + ); })); - it('ブロックされているユーザーにリアクションできない', async(async () => { - const note = await post(alice, { text: 'hello' }); + it("ブロックされているユーザーにリアクションできない", async(async () => { + const note = await post(alice, { text: "hello" }); - const res = await request('/notes/reactions/create', { noteId: note.id, reaction: '👍' }, bob); + const res = await request( + "/notes/reactions/create", + { noteId: note.id, reaction: "👍" }, + bob, + ); assert.strictEqual(res.status, 400); - assert.strictEqual(res.body.error.id, '20ef5475-9f38-4e4c-bd33-de6d979498ec'); + assert.strictEqual( + res.body.error.id, + "20ef5475-9f38-4e4c-bd33-de6d979498ec", + ); })); - it('ブロックされているユーザーに返信できない', async(async () => { - const note = await post(alice, { text: 'hello' }); + it("ブロックされているユーザーに返信できない", async(async () => { + const note = await post(alice, { text: "hello" }); - const res = await request('/notes/create', { replyId: note.id, text: 'yo' }, bob); + const res = await request( + "/notes/create", + { replyId: note.id, text: "yo" }, + bob, + ); assert.strictEqual(res.status, 400); - assert.strictEqual(res.body.error.id, 'b390d7e1-8a5e-46ed-b625-06271cafd3d3'); + assert.strictEqual( + res.body.error.id, + "b390d7e1-8a5e-46ed-b625-06271cafd3d3", + ); })); - it('ブロックされているユーザーのノートをRenoteできない', async(async () => { - const note = await post(alice, { text: 'hello' }); + it("ブロックされているユーザーのノートをRenoteできない", async(async () => { + const note = await post(alice, { text: "hello" }); - const res = await request('/notes/create', { renoteId: note.id, text: 'yo' }, bob); + const res = await request( + "/notes/create", + { renoteId: note.id, text: "yo" }, + bob, + ); assert.strictEqual(res.status, 400); - assert.strictEqual(res.body.error.id, 'b390d7e1-8a5e-46ed-b625-06271cafd3d3'); + assert.strictEqual( + res.body.error.id, + "b390d7e1-8a5e-46ed-b625-06271cafd3d3", + ); })); // TODO: ユーザーリストに入れられないテスト // TODO: ユーザーリストから除外されるテスト - it('タイムライン(LTL)にブロックされているユーザーの投稿が含まれない', async(async () => { + it("タイムライン(LTL)にブロックされているユーザーの投稿が含まれない", async(async () => { const aliceNote = await post(alice); const bobNote = await post(bob); const carolNote = await post(carol); - const res = await request('/notes/local-timeline', {}, bob); + const res = await request("/notes/local-timeline", {}, bob); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), false); - assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); - assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true); + assert.strictEqual( + res.body.some((note: any) => note.id === aliceNote.id), + false, + ); + assert.strictEqual( + res.body.some((note: any) => note.id === bobNote.id), + true, + ); + assert.strictEqual( + res.body.some((note: any) => note.id === carolNote.id), + true, + ); })); }); diff --git a/packages/backend/test/chart.ts b/packages/backend/test/chart.ts index ac0844679f..e194c6c195 100644 --- a/packages/backend/test/chart.ts +++ b/packages/backend/test/chart.ts @@ -1,14 +1,14 @@ -process.env.NODE_ENV = 'test'; +process.env.NODE_ENV = "test"; -import * as assert from 'assert'; -import * as lolex from '@sinonjs/fake-timers'; -import TestChart from '../src/services/chart/charts/test.js'; -import TestGroupedChart from '../src/services/chart/charts/test-grouped.js'; -import TestUniqueChart from '../src/services/chart/charts/test-unique.js'; -import TestIntersectionChart from '../src/services/chart/charts/test-intersection.js'; -import { initDb } from '../src/db/postgre.js'; +import * as assert from "assert"; +import * as lolex from "@sinonjs/fake-timers"; +import TestChart from "../src/services/chart/charts/test.js"; +import TestGroupedChart from "../src/services/chart/charts/test-grouped.js"; +import TestUniqueChart from "../src/services/chart/charts/test-unique.js"; +import TestIntersectionChart from "../src/services/chart/charts/test-intersection.js"; +import { initDb } from "../src/db/postgre.js"; -describe('Chart', () => { +describe("Chart", () => { let testChart: TestChart; let testGroupedChart: TestGroupedChart; let testUniqueChart: TestUniqueChart; @@ -33,12 +33,12 @@ describe('Chart', () => { clock.uninstall(); }); - it('Can updates', async () => { + it("Can updates", async () => { await testChart.increment(); await testChart.save(); - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); + const chartHours = await testChart.getChart("hour", 3, null); + const chartDays = await testChart.getChart("day", 3, null); assert.deepStrictEqual(chartHours, { foo: { @@ -57,12 +57,12 @@ describe('Chart', () => { }); }); - it('Can updates (dec)', async () => { + it("Can updates (dec)", async () => { await testChart.decrement(); await testChart.save(); - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); + const chartHours = await testChart.getChart("hour", 3, null); + const chartDays = await testChart.getChart("day", 3, null); assert.deepStrictEqual(chartHours, { foo: { @@ -81,9 +81,9 @@ describe('Chart', () => { }); }); - it('Empty chart', async () => { - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); + it("Empty chart", async () => { + const chartHours = await testChart.getChart("hour", 3, null); + const chartDays = await testChart.getChart("day", 3, null); assert.deepStrictEqual(chartHours, { foo: { @@ -102,14 +102,14 @@ describe('Chart', () => { }); }); - it('Can updates at multiple times at same time', async () => { + it("Can updates at multiple times at same time", async () => { await testChart.increment(); await testChart.increment(); await testChart.increment(); await testChart.save(); - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); + const chartHours = await testChart.getChart("hour", 3, null); + const chartDays = await testChart.getChart("day", 3, null); assert.deepStrictEqual(chartHours, { foo: { @@ -128,14 +128,14 @@ describe('Chart', () => { }); }); - it('複数回saveされてもデータの更新は一度だけ', async () => { + it("複数回saveされてもデータの更新は一度だけ", async () => { await testChart.increment(); await testChart.save(); await testChart.save(); await testChart.save(); - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); + const chartHours = await testChart.getChart("hour", 3, null); + const chartDays = await testChart.getChart("day", 3, null); assert.deepStrictEqual(chartHours, { foo: { @@ -154,17 +154,17 @@ describe('Chart', () => { }); }); - it('Can updates at different times', async () => { + it("Can updates at different times", async () => { await testChart.increment(); await testChart.save(); - clock.tick('01:00:00'); + clock.tick("01:00:00"); await testChart.increment(); await testChart.save(); - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); + const chartHours = await testChart.getChart("hour", 3, null); + const chartDays = await testChart.getChart("day", 3, null); assert.deepStrictEqual(chartHours, { foo: { @@ -214,17 +214,17 @@ describe('Chart', () => { }); */ - it('Can padding', async () => { + it("Can padding", async () => { await testChart.increment(); await testChart.save(); - clock.tick('02:00:00'); + clock.tick("02:00:00"); await testChart.increment(); await testChart.save(); - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); + const chartHours = await testChart.getChart("hour", 3, null); + const chartDays = await testChart.getChart("day", 3, null); assert.deepStrictEqual(chartHours, { foo: { @@ -244,14 +244,14 @@ describe('Chart', () => { }); // 要求された範囲にログがひとつもない場合でもパディングできる - it('Can padding from past range', async () => { + it("Can padding from past range", async () => { await testChart.increment(); await testChart.save(); - clock.tick('05:00:00'); + clock.tick("05:00:00"); - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); + const chartHours = await testChart.getChart("hour", 3, null); + const chartDays = await testChart.getChart("day", 3, null); assert.deepStrictEqual(chartHours, { foo: { @@ -272,17 +272,17 @@ describe('Chart', () => { // 要求された範囲の最も古い箇所に位置するログが存在しない場合でもパディングできる // Issue #3190 - it('Can padding from past range 2', async () => { + it("Can padding from past range 2", async () => { await testChart.increment(); await testChart.save(); - clock.tick('05:00:00'); + clock.tick("05:00:00"); await testChart.increment(); await testChart.save(); - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); + const chartHours = await testChart.getChart("hour", 3, null); + const chartDays = await testChart.getChart("day", 3, null); assert.deepStrictEqual(chartHours, { foo: { @@ -301,17 +301,25 @@ describe('Chart', () => { }); }); - it('Can specify offset', async () => { + it("Can specify offset", async () => { await testChart.increment(); await testChart.save(); - clock.tick('01:00:00'); + clock.tick("01:00:00"); await testChart.increment(); await testChart.save(); - const chartHours = await testChart.getChart('hour', 3, new Date(Date.UTC(2000, 0, 1, 0, 0, 0))); - const chartDays = await testChart.getChart('day', 3, new Date(Date.UTC(2000, 0, 1, 0, 0, 0))); + const chartHours = await testChart.getChart( + "hour", + 3, + new Date(Date.UTC(2000, 0, 1, 0, 0, 0)), + ); + const chartDays = await testChart.getChart( + "day", + 3, + new Date(Date.UTC(2000, 0, 1, 0, 0, 0)), + ); assert.deepStrictEqual(chartHours, { foo: { @@ -330,19 +338,27 @@ describe('Chart', () => { }); }); - it('Can specify offset (floor time)', async () => { - clock.tick('00:30:00'); + it("Can specify offset (floor time)", async () => { + clock.tick("00:30:00"); await testChart.increment(); await testChart.save(); - clock.tick('01:30:00'); + clock.tick("01:30:00"); await testChart.increment(); await testChart.save(); - const chartHours = await testChart.getChart('hour', 3, new Date(Date.UTC(2000, 0, 1, 0, 0, 0))); - const chartDays = await testChart.getChart('day', 3, new Date(Date.UTC(2000, 0, 1, 0, 0, 0))); + const chartHours = await testChart.getChart( + "hour", + 3, + new Date(Date.UTC(2000, 0, 1, 0, 0, 0)), + ); + const chartDays = await testChart.getChart( + "day", + 3, + new Date(Date.UTC(2000, 0, 1, 0, 0, 0)), + ); assert.deepStrictEqual(chartHours, { foo: { @@ -361,15 +377,35 @@ describe('Chart', () => { }); }); - describe('Grouped', () => { - it('Can updates', async () => { - await testGroupedChart.increment('alice'); + describe("Grouped", () => { + it("Can updates", async () => { + await testGroupedChart.increment("alice"); await testGroupedChart.save(); - const aliceChartHours = await testGroupedChart.getChart('hour', 3, null, 'alice'); - const aliceChartDays = await testGroupedChart.getChart('day', 3, null, 'alice'); - const bobChartHours = await testGroupedChart.getChart('hour', 3, null, 'bob'); - const bobChartDays = await testGroupedChart.getChart('day', 3, null, 'bob'); + const aliceChartHours = await testGroupedChart.getChart( + "hour", + 3, + null, + "alice", + ); + const aliceChartDays = await testGroupedChart.getChart( + "day", + 3, + null, + "alice", + ); + const bobChartHours = await testGroupedChart.getChart( + "hour", + 3, + null, + "bob", + ); + const bobChartDays = await testGroupedChart.getChart( + "day", + 3, + null, + "bob", + ); assert.deepStrictEqual(aliceChartHours, { foo: { @@ -405,15 +441,15 @@ describe('Chart', () => { }); }); - describe('Unique increment', () => { - it('Can updates', async () => { - await testUniqueChart.uniqueIncrement('alice'); - await testUniqueChart.uniqueIncrement('alice'); - await testUniqueChart.uniqueIncrement('bob'); + describe("Unique increment", () => { + it("Can updates", async () => { + await testUniqueChart.uniqueIncrement("alice"); + await testUniqueChart.uniqueIncrement("alice"); + await testUniqueChart.uniqueIncrement("bob"); await testUniqueChart.save(); - const chartHours = await testUniqueChart.getChart('hour', 3, null); - const chartDays = await testUniqueChart.getChart('day', 3, null); + const chartHours = await testUniqueChart.getChart("hour", 3, null); + const chartDays = await testUniqueChart.getChart("day", 3, null); assert.deepStrictEqual(chartHours, { foo: [2, 0, 0], @@ -424,22 +460,26 @@ describe('Chart', () => { }); }); - describe('Intersection', () => { - it('条件が満たされていない場合はカウントされない', async () => { - await testIntersectionChart.addA('alice'); - await testIntersectionChart.addA('bob'); - await testIntersectionChart.addB('carol'); + describe("Intersection", () => { + it("条件が満たされていない場合はカウントされない", async () => { + await testIntersectionChart.addA("alice"); + await testIntersectionChart.addA("bob"); + await testIntersectionChart.addB("carol"); await testIntersectionChart.save(); - - const chartHours = await testIntersectionChart.getChart('hour', 3, null); - const chartDays = await testIntersectionChart.getChart('day', 3, null); - + + const chartHours = await testIntersectionChart.getChart( + "hour", + 3, + null, + ); + const chartDays = await testIntersectionChart.getChart("day", 3, null); + assert.deepStrictEqual(chartHours, { a: [2, 0, 0], b: [1, 0, 0], aAndB: [0, 0, 0], }); - + assert.deepStrictEqual(chartDays, { a: [2, 0, 0], b: [1, 0, 0], @@ -447,22 +487,26 @@ describe('Chart', () => { }); }); - it('条件が満たされている場合にカウントされる', async () => { - await testIntersectionChart.addA('alice'); - await testIntersectionChart.addA('bob'); - await testIntersectionChart.addB('carol'); - await testIntersectionChart.addB('alice'); + it("条件が満たされている場合にカウントされる", async () => { + await testIntersectionChart.addA("alice"); + await testIntersectionChart.addA("bob"); + await testIntersectionChart.addB("carol"); + await testIntersectionChart.addB("alice"); await testIntersectionChart.save(); - - const chartHours = await testIntersectionChart.getChart('hour', 3, null); - const chartDays = await testIntersectionChart.getChart('day', 3, null); - + + const chartHours = await testIntersectionChart.getChart( + "hour", + 3, + null, + ); + const chartDays = await testIntersectionChart.getChart("day", 3, null); + assert.deepStrictEqual(chartHours, { a: [2, 0, 0], b: [2, 0, 0], aAndB: [1, 0, 0], }); - + assert.deepStrictEqual(chartDays, { a: [2, 0, 0], b: [2, 0, 0], @@ -472,14 +516,14 @@ describe('Chart', () => { }); }); - describe('Resync', () => { - it('Can resync', async () => { + describe("Resync", () => { + it("Can resync", async () => { testChart.total = 1; await testChart.resync(); - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); + const chartHours = await testChart.getChart("hour", 3, null); + const chartDays = await testChart.getChart("day", 3, null); assert.deepStrictEqual(chartHours, { foo: { @@ -498,18 +542,18 @@ describe('Chart', () => { }); }); - it('Can resync (2)', async () => { + it("Can resync (2)", async () => { await testChart.increment(); await testChart.save(); - clock.tick('01:00:00'); + clock.tick("01:00:00"); testChart.total = 100; await testChart.resync(); - const chartHours = await testChart.getChart('hour', 3, null); - const chartDays = await testChart.getChart('day', 3, null); + const chartHours = await testChart.getChart("hour", 3, null); + const chartDays = await testChart.getChart("day", 3, null); assert.deepStrictEqual(chartHours, { foo: { diff --git a/packages/backend/test/extract-mentions.ts b/packages/backend/test/extract-mentions.ts index 85afb098d8..f400e1e634 100644 --- a/packages/backend/test/extract-mentions.ts +++ b/packages/backend/test/extract-mentions.ts @@ -1,42 +1,50 @@ -import * as assert from 'assert'; +import * as assert from "assert"; -import { parse } from 'mfm-js'; -import { extractMentions } from '../src/misc/extract-mentions.js'; +import { parse } from "mfm-js"; +import { extractMentions } from "../src/misc/extract-mentions.js"; -describe('Extract mentions', () => { - it('simple', () => { - const ast = parse('@foo @bar @baz')!; +describe("Extract mentions", () => { + it("simple", () => { + const ast = parse("@foo @bar @baz")!; const mentions = extractMentions(ast); - assert.deepStrictEqual(mentions, [{ - username: 'foo', - acct: '@foo', - host: null, - }, { - username: 'bar', - acct: '@bar', - host: null, - }, { - username: 'baz', - acct: '@baz', - host: null, - }]); + assert.deepStrictEqual(mentions, [ + { + username: "foo", + acct: "@foo", + host: null, + }, + { + username: "bar", + acct: "@bar", + host: null, + }, + { + username: "baz", + acct: "@baz", + host: null, + }, + ]); }); - it('nested', () => { - const ast = parse('@foo **@bar** @baz')!; + it("nested", () => { + const ast = parse("@foo **@bar** @baz")!; const mentions = extractMentions(ast); - assert.deepStrictEqual(mentions, [{ - username: 'foo', - acct: '@foo', - host: null, - }, { - username: 'bar', - acct: '@bar', - host: null, - }, { - username: 'baz', - acct: '@baz', - host: null, - }]); + assert.deepStrictEqual(mentions, [ + { + username: "foo", + acct: "@foo", + host: null, + }, + { + username: "bar", + acct: "@bar", + host: null, + }, + { + username: "baz", + acct: "@baz", + host: null, + }, + ]); }); }); diff --git a/packages/backend/test/fetch-resource.ts b/packages/backend/test/fetch-resource.ts index ddb0e94b86..da3116f0e8 100644 --- a/packages/backend/test/fetch-resource.ts +++ b/packages/backend/test/fetch-resource.ts @@ -1,22 +1,31 @@ -process.env.NODE_ENV = 'test'; +process.env.NODE_ENV = "test"; -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import * as openapi from '@redocly/openapi-core'; -import { async, startServer, signup, post, request, simpleGet, port, shutdownServer } from './utils.js'; +import * as assert from "assert"; +import * as childProcess from "child_process"; +import * as openapi from "@redocly/openapi-core"; +import { + async, + startServer, + signup, + post, + request, + simpleGet, + port, + shutdownServer, +} from "./utils.js"; // Request Accept -const ONLY_AP = 'application/activity+json'; -const PREFER_AP = 'application/activity+json, */*'; -const PREFER_HTML = 'text/html, */*'; -const UNSPECIFIED = '*/*'; +const ONLY_AP = "application/activity+json"; +const PREFER_AP = "application/activity+json, */*"; +const PREFER_HTML = "text/html, */*"; +const UNSPECIFIED = "*/*"; // Response Contet-Type -const AP = 'application/activity+json; charset=utf-8'; -const JSON = 'application/json; charset=utf-8'; -const HTML = 'text/html; charset=utf-8'; +const AP = "application/activity+json; charset=utf-8"; +const JSON = "application/json; charset=utf-8"; +const HTML = "text/html; charset=utf-8"; -describe('Fetch resource', () => { +describe("Fetch resource", () => { let p: childProcess.ChildProcess; let alice: any; @@ -24,9 +33,9 @@ describe('Fetch resource', () => { before(async () => { p = await startServer(); - alice = await signup({ username: 'alice' }); + alice = await signup({ username: "alice" }); alicesPost = await post(alice, { - text: 'test', + text: "test", }); }); @@ -34,39 +43,38 @@ describe('Fetch resource', () => { await shutdownServer(p); }); - describe('Common', () => { - it('meta', async(async () => { - const res = await request('/meta', { - }); + describe("Common", () => { + it("meta", async(async () => { + const res = await request("/meta", {}); assert.strictEqual(res.status, 200); })); - it('GET root', async(async () => { - const res = await simpleGet('/'); + it("GET root", async(async () => { + const res = await simpleGet("/"); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); })); - it('GET docs', async(async () => { - const res = await simpleGet('/docs/ja-JP/about'); + it("GET docs", async(async () => { + const res = await simpleGet("/docs/ja-JP/about"); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); })); - it('GET api-doc', async(async () => { - const res = await simpleGet('/api-doc'); + it("GET api-doc", async(async () => { + const res = await simpleGet("/api-doc"); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); })); - it('GET api.json', async(async () => { - const res = await simpleGet('/api.json'); + it("GET api.json", async(async () => { + const res = await simpleGet("/api.json"); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, JSON); })); - it('Validate api.json', async(async () => { + it("Validate api.json", async(async () => { const config = await openapi.loadConfig(); const result = await openapi.bundle({ config, @@ -80,126 +88,126 @@ describe('Fetch resource', () => { assert.strictEqual(result.problems.length, 0); })); - it('GET favicon.ico', async(async () => { - const res = await simpleGet('/favicon.ico'); + it("GET favicon.ico", async(async () => { + const res = await simpleGet("/favicon.ico"); assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'image/x-icon'); + assert.strictEqual(res.type, "image/x-icon"); })); - it('GET apple-touch-icon.png', async(async () => { - const res = await simpleGet('/apple-touch-icon.png'); + it("GET apple-touch-icon.png", async(async () => { + const res = await simpleGet("/apple-touch-icon.png"); assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'image/png'); + assert.strictEqual(res.type, "image/png"); })); - it('GET twemoji svg', async(async () => { - const res = await simpleGet('/twemoji/2764.svg'); + it("GET twemoji svg", async(async () => { + const res = await simpleGet("/twemoji/2764.svg"); assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'image/svg+xml'); + assert.strictEqual(res.type, "image/svg+xml"); })); - it('GET twemoji svg with hyphen', async(async () => { - const res = await simpleGet('/twemoji/2764-fe0f-200d-1f525.svg'); + it("GET twemoji svg with hyphen", async(async () => { + const res = await simpleGet("/twemoji/2764-fe0f-200d-1f525.svg"); assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'image/svg+xml'); + assert.strictEqual(res.type, "image/svg+xml"); })); }); - describe('/@:username', () => { - it('Only AP => AP', async(async () => { + describe("/@:username", () => { + it("Only AP => AP", async(async () => { const res = await simpleGet(`/@${alice.username}`, ONLY_AP); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, AP); })); - it('Prefer AP => AP', async(async () => { + it("Prefer AP => AP", async(async () => { const res = await simpleGet(`/@${alice.username}`, PREFER_AP); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, AP); })); - it('Prefer HTML => HTML', async(async () => { + it("Prefer HTML => HTML", async(async () => { const res = await simpleGet(`/@${alice.username}`, PREFER_HTML); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); })); - it('Unspecified => HTML', async(async () => { + it("Unspecified => HTML", async(async () => { const res = await simpleGet(`/@${alice.username}`, UNSPECIFIED); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); })); }); - describe('/users/:id', () => { - it('Only AP => AP', async(async () => { + describe("/users/:id", () => { + it("Only AP => AP", async(async () => { const res = await simpleGet(`/users/${alice.id}`, ONLY_AP); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, AP); })); - it('Prefer AP => AP', async(async () => { + it("Prefer AP => AP", async(async () => { const res = await simpleGet(`/users/${alice.id}`, PREFER_AP); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, AP); })); - it('Prefer HTML => Redirect to /@:username', async(async () => { + it("Prefer HTML => Redirect to /@:username", async(async () => { const res = await simpleGet(`/users/${alice.id}`, PREFER_HTML); assert.strictEqual(res.status, 302); assert.strictEqual(res.location, `/@${alice.username}`); })); - it('Undecided => HTML', async(async () => { + it("Undecided => HTML", async(async () => { const res = await simpleGet(`/users/${alice.id}`, UNSPECIFIED); assert.strictEqual(res.status, 302); assert.strictEqual(res.location, `/@${alice.username}`); })); }); - describe('/notes/:id', () => { - it('Only AP => AP', async(async () => { + describe("/notes/:id", () => { + it("Only AP => AP", async(async () => { const res = await simpleGet(`/notes/${alicesPost.id}`, ONLY_AP); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, AP); })); - it('Prefer AP => AP', async(async () => { + it("Prefer AP => AP", async(async () => { const res = await simpleGet(`/notes/${alicesPost.id}`, PREFER_AP); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, AP); })); - it('Prefer HTML => HTML', async(async () => { + it("Prefer HTML => HTML", async(async () => { const res = await simpleGet(`/notes/${alicesPost.id}`, PREFER_HTML); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); })); - it('Unspecified => HTML', async(async () => { + it("Unspecified => HTML", async(async () => { const res = await simpleGet(`/notes/${alicesPost.id}`, UNSPECIFIED); assert.strictEqual(res.status, 200); assert.strictEqual(res.type, HTML); })); }); - describe('Feeds', () => { - it('RSS', async(async () => { + describe("Feeds", () => { + it("RSS", async(async () => { const res = await simpleGet(`/@${alice.username}.rss`, UNSPECIFIED); assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'application/rss+xml; charset=utf-8'); + assert.strictEqual(res.type, "application/rss+xml; charset=utf-8"); })); - it('ATOM', async(async () => { + it("ATOM", async(async () => { const res = await simpleGet(`/@${alice.username}.atom`, UNSPECIFIED); assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'application/atom+xml; charset=utf-8'); + assert.strictEqual(res.type, "application/atom+xml; charset=utf-8"); })); - it('JSON', async(async () => { + it("JSON", async(async () => { const res = await simpleGet(`/@${alice.username}.json`, UNSPECIFIED); assert.strictEqual(res.status, 200); - assert.strictEqual(res.type, 'application/json; charset=utf-8'); + assert.strictEqual(res.type, "application/json; charset=utf-8"); })); }); }); diff --git a/packages/backend/test/ff-visibility.ts b/packages/backend/test/ff-visibility.ts index 4f6847be6d..f898926d99 100644 --- a/packages/backend/test/ff-visibility.ts +++ b/packages/backend/test/ff-visibility.ts @@ -1,10 +1,20 @@ -process.env.NODE_ENV = 'test'; +process.env.NODE_ENV = "test"; -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, react, connectStream, startServer, shutdownServer, simpleGet } from './utils.js'; +import * as assert from "assert"; +import * as childProcess from "child_process"; +import { + async, + signup, + request, + post, + react, + connectStream, + startServer, + shutdownServer, + simpleGet, +} from "./utils.js"; -describe('FF visibility', () => { +describe("FF visibility", () => { let p: childProcess.ChildProcess; let alice: any; @@ -13,152 +23,258 @@ describe('FF visibility', () => { before(async () => { p = await startServer(); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - carol = await signup({ username: 'carol' }); + alice = await signup({ username: "alice" }); + bob = await signup({ username: "bob" }); + carol = await signup({ username: "carol" }); }); after(async () => { await shutdownServer(p); }); - it('ffVisibility が public なユーザーのフォロー/フォロワーを誰でも見れる', async(async () => { - await request('/i/update', { - ffVisibility: 'public', - }, alice); - - const followingRes = await request('/users/following', { - userId: alice.id, - }, bob); - const followersRes = await request('/users/followers', { - userId: alice.id, - }, bob); - - assert.strictEqual(followingRes.status, 200); - assert.strictEqual(Array.isArray(followingRes.body), true); - assert.strictEqual(followersRes.status, 200); - assert.strictEqual(Array.isArray(followersRes.body), true); - })); - - it('ffVisibility が followers なユーザーのフォロー/フォロワーを自分で見れる', async(async () => { - await request('/i/update', { - ffVisibility: 'followers', - }, alice); - - const followingRes = await request('/users/following', { - userId: alice.id, - }, alice); - const followersRes = await request('/users/followers', { - userId: alice.id, - }, alice); - - assert.strictEqual(followingRes.status, 200); - assert.strictEqual(Array.isArray(followingRes.body), true); - assert.strictEqual(followersRes.status, 200); - assert.strictEqual(Array.isArray(followersRes.body), true); - })); - - it('ffVisibility が followers なユーザーのフォロー/フォロワーを非フォロワーが見れない', async(async () => { - await request('/i/update', { - ffVisibility: 'followers', - }, alice); - - const followingRes = await request('/users/following', { - userId: alice.id, - }, bob); - const followersRes = await request('/users/followers', { - userId: alice.id, - }, bob); - - assert.strictEqual(followingRes.status, 400); - assert.strictEqual(followersRes.status, 400); - })); - - it('ffVisibility が followers なユーザーのフォロー/フォロワーをフォロワーが見れる', async(async () => { - await request('/i/update', { - ffVisibility: 'followers', - }, alice); - - await request('/following/create', { - userId: alice.id, - }, bob); - - const followingRes = await request('/users/following', { - userId: alice.id, - }, bob); - const followersRes = await request('/users/followers', { - userId: alice.id, - }, bob); - - assert.strictEqual(followingRes.status, 200); - assert.strictEqual(Array.isArray(followingRes.body), true); - assert.strictEqual(followersRes.status, 200); - assert.strictEqual(Array.isArray(followersRes.body), true); - })); - - it('ffVisibility が private なユーザーのフォロー/フォロワーを自分で見れる', async(async () => { - await request('/i/update', { - ffVisibility: 'private', - }, alice); - - const followingRes = await request('/users/following', { - userId: alice.id, - }, alice); - const followersRes = await request('/users/followers', { - userId: alice.id, - }, alice); - - assert.strictEqual(followingRes.status, 200); - assert.strictEqual(Array.isArray(followingRes.body), true); - assert.strictEqual(followersRes.status, 200); - assert.strictEqual(Array.isArray(followersRes.body), true); - })); - - it('ffVisibility が private なユーザーのフォロー/フォロワーを他人が見れない', async(async () => { - await request('/i/update', { - ffVisibility: 'private', - }, alice); - - const followingRes = await request('/users/following', { - userId: alice.id, - }, bob); - const followersRes = await request('/users/followers', { - userId: alice.id, - }, bob); - - assert.strictEqual(followingRes.status, 400); - assert.strictEqual(followersRes.status, 400); - })); - - describe('AP', () => { - it('ffVisibility が public 以外ならばAPからは取得できない', async(async () => { + it("ffVisibility が public なユーザーのフォロー/フォロワーを誰でも見れる", async(async () => { + await request( + "/i/update", { - await request('/i/update', { - ffVisibility: 'public', - }, alice); + ffVisibility: "public", + }, + alice, + ); - const followingRes = await simpleGet(`/users/${alice.id}/following`, 'application/activity+json'); - const followersRes = await simpleGet(`/users/${alice.id}/followers`, 'application/activity+json'); + const followingRes = await request( + "/users/following", + { + userId: alice.id, + }, + bob, + ); + const followersRes = await request( + "/users/followers", + { + userId: alice.id, + }, + bob, + ); + + assert.strictEqual(followingRes.status, 200); + assert.strictEqual(Array.isArray(followingRes.body), true); + assert.strictEqual(followersRes.status, 200); + assert.strictEqual(Array.isArray(followersRes.body), true); + })); + + it("ffVisibility が followers なユーザーのフォロー/フォロワーを自分で見れる", async(async () => { + await request( + "/i/update", + { + ffVisibility: "followers", + }, + alice, + ); + + const followingRes = await request( + "/users/following", + { + userId: alice.id, + }, + alice, + ); + const followersRes = await request( + "/users/followers", + { + userId: alice.id, + }, + alice, + ); + + assert.strictEqual(followingRes.status, 200); + assert.strictEqual(Array.isArray(followingRes.body), true); + assert.strictEqual(followersRes.status, 200); + assert.strictEqual(Array.isArray(followersRes.body), true); + })); + + it("ffVisibility が followers なユーザーのフォロー/フォロワーを非フォロワーが見れない", async(async () => { + await request( + "/i/update", + { + ffVisibility: "followers", + }, + alice, + ); + + const followingRes = await request( + "/users/following", + { + userId: alice.id, + }, + bob, + ); + const followersRes = await request( + "/users/followers", + { + userId: alice.id, + }, + bob, + ); + + assert.strictEqual(followingRes.status, 400); + assert.strictEqual(followersRes.status, 400); + })); + + it("ffVisibility が followers なユーザーのフォロー/フォロワーをフォロワーが見れる", async(async () => { + await request( + "/i/update", + { + ffVisibility: "followers", + }, + alice, + ); + + await request( + "/following/create", + { + userId: alice.id, + }, + bob, + ); + + const followingRes = await request( + "/users/following", + { + userId: alice.id, + }, + bob, + ); + const followersRes = await request( + "/users/followers", + { + userId: alice.id, + }, + bob, + ); + + assert.strictEqual(followingRes.status, 200); + assert.strictEqual(Array.isArray(followingRes.body), true); + assert.strictEqual(followersRes.status, 200); + assert.strictEqual(Array.isArray(followersRes.body), true); + })); + + it("ffVisibility が private なユーザーのフォロー/フォロワーを自分で見れる", async(async () => { + await request( + "/i/update", + { + ffVisibility: "private", + }, + alice, + ); + + const followingRes = await request( + "/users/following", + { + userId: alice.id, + }, + alice, + ); + const followersRes = await request( + "/users/followers", + { + userId: alice.id, + }, + alice, + ); + + assert.strictEqual(followingRes.status, 200); + assert.strictEqual(Array.isArray(followingRes.body), true); + assert.strictEqual(followersRes.status, 200); + assert.strictEqual(Array.isArray(followersRes.body), true); + })); + + it("ffVisibility が private なユーザーのフォロー/フォロワーを他人が見れない", async(async () => { + await request( + "/i/update", + { + ffVisibility: "private", + }, + alice, + ); + + const followingRes = await request( + "/users/following", + { + userId: alice.id, + }, + bob, + ); + const followersRes = await request( + "/users/followers", + { + userId: alice.id, + }, + bob, + ); + + assert.strictEqual(followingRes.status, 400); + assert.strictEqual(followersRes.status, 400); + })); + + describe("AP", () => { + it("ffVisibility が public 以外ならばAPからは取得できない", async(async () => { + { + await request( + "/i/update", + { + ffVisibility: "public", + }, + alice, + ); + + const followingRes = await simpleGet( + `/users/${alice.id}/following`, + "application/activity+json", + ); + const followersRes = await simpleGet( + `/users/${alice.id}/followers`, + "application/activity+json", + ); assert.strictEqual(followingRes.status, 200); assert.strictEqual(followersRes.status, 200); } { - await request('/i/update', { - ffVisibility: 'followers', - }, alice); + await request( + "/i/update", + { + ffVisibility: "followers", + }, + alice, + ); - const followingRes = await simpleGet(`/users/${alice.id}/following`, 'application/activity+json').catch(res => ({ status: res.statusCode })); - const followersRes = await simpleGet(`/users/${alice.id}/followers`, 'application/activity+json').catch(res => ({ status: res.statusCode })); + const followingRes = await simpleGet( + `/users/${alice.id}/following`, + "application/activity+json", + ).catch((res) => ({ status: res.statusCode })); + const followersRes = await simpleGet( + `/users/${alice.id}/followers`, + "application/activity+json", + ).catch((res) => ({ status: res.statusCode })); assert.strictEqual(followingRes.status, 403); assert.strictEqual(followersRes.status, 403); } { - await request('/i/update', { - ffVisibility: 'private', - }, alice); + await request( + "/i/update", + { + ffVisibility: "private", + }, + alice, + ); - const followingRes = await simpleGet(`/users/${alice.id}/following`, 'application/activity+json').catch(res => ({ status: res.statusCode })); - const followersRes = await simpleGet(`/users/${alice.id}/followers`, 'application/activity+json').catch(res => ({ status: res.statusCode })); + const followingRes = await simpleGet( + `/users/${alice.id}/following`, + "application/activity+json", + ).catch((res) => ({ status: res.statusCode })); + const followersRes = await simpleGet( + `/users/${alice.id}/followers`, + "application/activity+json", + ).catch((res) => ({ status: res.statusCode })); assert.strictEqual(followingRes.status, 403); assert.strictEqual(followersRes.status, 403); } diff --git a/packages/backend/test/get-file-info.ts b/packages/backend/test/get-file-info.ts index 09378fec88..22dc28c8e0 100644 --- a/packages/backend/test/get-file-info.ts +++ b/packages/backend/test/get-file-info.ts @@ -1,25 +1,27 @@ -import * as assert from 'assert'; -import { fileURLToPath } from 'node:url'; -import { dirname } from 'node:path'; -import { getFileInfo } from '../src/misc/get-file-info.js'; -import { async } from './utils.js'; +import * as assert from "assert"; +import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; +import { getFileInfo } from "../src/misc/get-file-info.js"; +import { async } from "./utils.js"; const _filename = fileURLToPath(import.meta.url); const _dirname = dirname(_filename); -describe('Get file info', () => { - it('Empty file', async (async () => { +describe("Get file info", () => { + it("Empty file", async(async () => { const path = `${_dirname}/resources/emptyfile`; - const info = await getFileInfo(path, { skipSensitiveDetection: true }) as any; + const info = (await getFileInfo(path, { + skipSensitiveDetection: true, + })) as any; delete info.warnings; delete info.blurhash; delete info.sensitive; delete info.porn; assert.deepStrictEqual(info, { size: 0, - md5: 'd41d8cd98f00b204e9800998ecf8427e', + md5: "d41d8cd98f00b204e9800998ecf8427e", type: { - mime: 'application/octet-stream', + mime: "application/octet-stream", ext: null, }, width: undefined, @@ -28,19 +30,21 @@ describe('Get file info', () => { }); })); - it('Generic JPEG', async (async () => { + it("Generic JPEG", async(async () => { const path = `${_dirname}/resources/Lenna.jpg`; - const info = await getFileInfo(path, { skipSensitiveDetection: true }) as any; + const info = (await getFileInfo(path, { + skipSensitiveDetection: true, + })) as any; delete info.warnings; delete info.blurhash; delete info.sensitive; delete info.porn; assert.deepStrictEqual(info, { size: 25360, - md5: '091b3f259662aa31e2ffef4519951168', + md5: "091b3f259662aa31e2ffef4519951168", type: { - mime: 'image/jpeg', - ext: 'jpg', + mime: "image/jpeg", + ext: "jpg", }, width: 512, height: 512, @@ -48,19 +52,21 @@ describe('Get file info', () => { }); })); - it('Generic APNG', async (async () => { + it("Generic APNG", async(async () => { const path = `${_dirname}/resources/anime.png`; - const info = await getFileInfo(path, { skipSensitiveDetection: true }) as any; + const info = (await getFileInfo(path, { + skipSensitiveDetection: true, + })) as any; delete info.warnings; delete info.blurhash; delete info.sensitive; delete info.porn; assert.deepStrictEqual(info, { size: 1868, - md5: '08189c607bea3b952704676bb3c979e0', + md5: "08189c607bea3b952704676bb3c979e0", type: { - mime: 'image/apng', - ext: 'apng', + mime: "image/apng", + ext: "apng", }, width: 256, height: 256, @@ -68,19 +74,21 @@ describe('Get file info', () => { }); })); - it('Generic AGIF', async (async () => { + it("Generic AGIF", async(async () => { const path = `${_dirname}/resources/anime.gif`; - const info = await getFileInfo(path, { skipSensitiveDetection: true }) as any; + const info = (await getFileInfo(path, { + skipSensitiveDetection: true, + })) as any; delete info.warnings; delete info.blurhash; delete info.sensitive; delete info.porn; assert.deepStrictEqual(info, { size: 2248, - md5: '32c47a11555675d9267aee1a86571e7e', + md5: "32c47a11555675d9267aee1a86571e7e", type: { - mime: 'image/gif', - ext: 'gif', + mime: "image/gif", + ext: "gif", }, width: 256, height: 256, @@ -88,19 +96,21 @@ describe('Get file info', () => { }); })); - it('PNG with alpha', async (async () => { + it("PNG with alpha", async(async () => { const path = `${_dirname}/resources/with-alpha.png`; - const info = await getFileInfo(path, { skipSensitiveDetection: true }) as any; + const info = (await getFileInfo(path, { + skipSensitiveDetection: true, + })) as any; delete info.warnings; delete info.blurhash; delete info.sensitive; delete info.porn; assert.deepStrictEqual(info, { size: 3772, - md5: 'f73535c3e1e27508885b69b10cf6e991', + md5: "f73535c3e1e27508885b69b10cf6e991", type: { - mime: 'image/png', - ext: 'png', + mime: "image/png", + ext: "png", }, width: 256, height: 256, @@ -108,19 +118,21 @@ describe('Get file info', () => { }); })); - it('Generic SVG', async (async () => { + it("Generic SVG", async(async () => { const path = `${_dirname}/resources/image.svg`; - const info = await getFileInfo(path, { skipSensitiveDetection: true }) as any; + const info = (await getFileInfo(path, { + skipSensitiveDetection: true, + })) as any; delete info.warnings; delete info.blurhash; delete info.sensitive; delete info.porn; assert.deepStrictEqual(info, { size: 505, - md5: 'b6f52b4b021e7b92cdd04509c7267965', + md5: "b6f52b4b021e7b92cdd04509c7267965", type: { - mime: 'image/svg+xml', - ext: 'svg', + mime: "image/svg+xml", + ext: "svg", }, width: 256, height: 256, @@ -128,20 +140,22 @@ describe('Get file info', () => { }); })); - it('SVG with XML definition', async (async () => { + it("SVG with XML definition", async(async () => { // https://github.com/misskey-dev/misskey/issues/4413 const path = `${_dirname}/resources/with-xml-def.svg`; - const info = await getFileInfo(path, { skipSensitiveDetection: true }) as any; + const info = (await getFileInfo(path, { + skipSensitiveDetection: true, + })) as any; delete info.warnings; delete info.blurhash; delete info.sensitive; delete info.porn; assert.deepStrictEqual(info, { size: 544, - md5: '4b7a346cde9ccbeb267e812567e33397', + md5: "4b7a346cde9ccbeb267e812567e33397", type: { - mime: 'image/svg+xml', - ext: 'svg', + mime: "image/svg+xml", + ext: "svg", }, width: 256, height: 256, @@ -149,18 +163,20 @@ describe('Get file info', () => { }); })); - it('Dimension limit', async (async () => { + it("Dimension limit", async(async () => { const path = `${_dirname}/resources/25000x25000.png`; - const info = await getFileInfo(path, { skipSensitiveDetection: true }) as any; + const info = (await getFileInfo(path, { + skipSensitiveDetection: true, + })) as any; delete info.warnings; delete info.blurhash; delete info.sensitive; delete info.porn; assert.deepStrictEqual(info, { size: 75933, - md5: '268c5dde99e17cf8fe09f1ab3f97df56', + md5: "268c5dde99e17cf8fe09f1ab3f97df56", type: { - mime: 'application/octet-stream', // do not treat as image + mime: "application/octet-stream", // do not treat as image ext: null, }, width: 25000, @@ -169,19 +185,21 @@ describe('Get file info', () => { }); })); - it('Rotate JPEG', async (async () => { + it("Rotate JPEG", async(async () => { const path = `${_dirname}/resources/rotate.jpg`; - const info = await getFileInfo(path, { skipSensitiveDetection: true }) as any; + const info = (await getFileInfo(path, { + skipSensitiveDetection: true, + })) as any; delete info.warnings; delete info.blurhash; delete info.sensitive; delete info.porn; assert.deepStrictEqual(info, { size: 12624, - md5: '68d5b2d8d1d1acbbce99203e3ec3857e', + md5: "68d5b2d8d1d1acbbce99203e3ec3857e", type: { - mime: 'image/jpeg', - ext: 'jpg', + mime: "image/jpeg", + ext: "jpg", }, width: 512, height: 256, diff --git a/packages/backend/test/loader.js b/packages/backend/test/loader.js index 6b21587e32..7e1bf379dc 100644 --- a/packages/backend/test/loader.js +++ b/packages/backend/test/loader.js @@ -6,18 +6,21 @@ * ※ https://github.com/TypeStrong/ts-node/pull/1585 が取り込まれたらこのカスタムローダーは必要なくなる */ -import { resolve as resolveTs, load } from 'ts-node/esm'; -import { loadConfig, createMatchPath } from 'tsconfig-paths'; -import { pathToFileURL } from 'url'; +import { resolve as resolveTs, load } from "ts-node/esm"; +import { loadConfig, createMatchPath } from "tsconfig-paths"; +import { pathToFileURL } from "url"; const tsconfig = loadConfig(); const matchPath = createMatchPath(tsconfig.absoluteBaseUrl, tsconfig.paths); export function resolve(specifier, ctx, defaultResolve) { let resolvedSpecifier; - if (specifier.endsWith('.js')) { + if (specifier.endsWith(".js")) { // maybe transpiled - const specifierWithoutExtension = specifier.substring(0, specifier.length - '.js'.length); + const specifierWithoutExtension = specifier.substring( + 0, + specifier.length - ".js".length, + ); const matchedSpecifier = matchPath(specifierWithoutExtension); if (matchedSpecifier) { resolvedSpecifier = pathToFileURL(`${matchedSpecifier}.js`).href; diff --git a/packages/backend/test/mfm.ts b/packages/backend/test/mfm.ts index 5218942a5a..605daa7107 100644 --- a/packages/backend/test/mfm.ts +++ b/packages/backend/test/mfm.ts @@ -1,89 +1,127 @@ -import * as assert from 'assert'; -import * as mfm from 'mfm-js'; +import * as assert from "assert"; +import * as mfm from "mfm-js"; -import { toHtml } from '../src/mfm/to-html.js'; -import { fromHtml } from '../src/mfm/from-html.js'; +import { toHtml } from "../src/mfm/to-html.js"; +import { fromHtml } from "../src/mfm/from-html.js"; -describe('toHtml', () => { - it('br', () => { - const input = 'foo\nbar\nbaz'; - const output = '

foo
bar
baz

'; +describe("toHtml", () => { + it("br", () => { + const input = "foo\nbar\nbaz"; + const output = "

foo
bar
baz

"; assert.equal(toHtml(mfm.parse(input)), output); }); - it('br alt', () => { - const input = 'foo\r\nbar\rbaz'; - const output = '

foo
bar
baz

'; + it("br alt", () => { + const input = "foo\r\nbar\rbaz"; + const output = "

foo
bar
baz

"; assert.equal(toHtml(mfm.parse(input)), output); }); }); -describe('fromHtml', () => { - it('p', () => { - assert.deepStrictEqual(fromHtml('

a

b

'), 'a\n\nb'); +describe("fromHtml", () => { + it("p", () => { + assert.deepStrictEqual(fromHtml("

a

b

"), "a\n\nb"); }); - it('block element', () => { - assert.deepStrictEqual(fromHtml('
a
b
'), 'a\nb'); + it("block element", () => { + assert.deepStrictEqual(fromHtml("
a
b
"), "a\nb"); }); - it('inline element', () => { - assert.deepStrictEqual(fromHtml('
  • a
  • b
'), 'a\nb'); + it("inline element", () => { + assert.deepStrictEqual(fromHtml("
  • a
  • b
"), "a\nb"); }); - it('block code', () => { - assert.deepStrictEqual(fromHtml('
a\nb
'), '```\na\nb\n```'); + it("block code", () => { + assert.deepStrictEqual( + fromHtml("
a\nb
"), + "```\na\nb\n```", + ); }); - it('inline code', () => { - assert.deepStrictEqual(fromHtml('a'), '`a`'); + it("inline code", () => { + assert.deepStrictEqual(fromHtml("a"), "`a`"); }); - it('quote', () => { - assert.deepStrictEqual(fromHtml('
a\nb
'), '> a\n> b'); + it("quote", () => { + assert.deepStrictEqual( + fromHtml("
a\nb
"), + "> a\n> b", + ); }); - it('br', () => { - assert.deepStrictEqual(fromHtml('

abc

d

'), 'abc\n\nd'); + it("br", () => { + assert.deepStrictEqual(fromHtml("

abc

d

"), "abc\n\nd"); }); - it('link with different text', () => { - assert.deepStrictEqual(fromHtml('

a c d

'), 'a [c](https://example.com/b) d'); + it("link with different text", () => { + assert.deepStrictEqual( + fromHtml('

a c d

'), + "a [c](https://example.com/b) d", + ); }); - it('link with different text, but not encoded', () => { - assert.deepStrictEqual(fromHtml('

a c d

'), 'a [c]() d'); + it("link with different text, but not encoded", () => { + assert.deepStrictEqual( + fromHtml('

a c d

'), + "a [c]() d", + ); }); - it('link with same text', () => { - assert.deepStrictEqual(fromHtml('

a https://example.com/b d

'), 'a https://example.com/b d'); + it("link with same text", () => { + assert.deepStrictEqual( + fromHtml( + '

a https://example.com/b d

', + ), + "a https://example.com/b d", + ); }); - it('link with same text, but not encoded', () => { - assert.deepStrictEqual(fromHtml('

a https://example.com/ä d

'), 'a d'); + it("link with same text, but not encoded", () => { + assert.deepStrictEqual( + fromHtml( + '

a https://example.com/ä d

', + ), + "a d", + ); }); - it('link with no url', () => { - assert.deepStrictEqual(fromHtml('

a c d

'), 'a [c](b) d'); + it("link with no url", () => { + assert.deepStrictEqual( + fromHtml('

a c d

'), + "a [c](b) d", + ); }); - it('link without href', () => { - assert.deepStrictEqual(fromHtml('

a c d

'), 'a c d'); + it("link without href", () => { + assert.deepStrictEqual(fromHtml("

a c d

"), "a c d"); }); - it('link without text', () => { - assert.deepStrictEqual(fromHtml('

a d

'), 'a https://example.com/b d'); + it("link without text", () => { + assert.deepStrictEqual( + fromHtml('

a d

'), + "a https://example.com/b d", + ); }); - it('link without both', () => { - assert.deepStrictEqual(fromHtml('

a d

'), 'a d'); + it("link without both", () => { + assert.deepStrictEqual(fromHtml("

a d

"), "a d"); }); - it('mention', () => { - assert.deepStrictEqual(fromHtml('

a @user d

'), 'a @user@example.com d'); + it("mention", () => { + assert.deepStrictEqual( + fromHtml( + '

a @user d

', + ), + "a @user@example.com d", + ); }); - it('hashtag', () => { - assert.deepStrictEqual(fromHtml('

a #a d

', ['#a']), 'a #a d'); + it("hashtag", () => { + assert.deepStrictEqual( + fromHtml('

a #a d

', [ + "#a", + ]), + "a #a d", + ); }); }); diff --git a/packages/backend/test/misc/mock-resolver.ts b/packages/backend/test/misc/mock-resolver.ts index ba89ac329a..74c67e3d3f 100644 --- a/packages/backend/test/misc/mock-resolver.ts +++ b/packages/backend/test/misc/mock-resolver.ts @@ -1,5 +1,5 @@ -import Resolver from '../../src/remote/activitypub/resolver.js'; -import { IObject } from '../../src/remote/activitypub/type.js'; +import Resolver from "../../src/remote/activitypub/resolver.js"; +import { IObject } from "../../src/remote/activitypub/type.js"; type MockResponse = { type: string; @@ -8,23 +8,27 @@ type MockResponse = { export class MockResolver extends Resolver { private _rs = new Map(); - public async _register(uri: string, content: string | Record, type = 'application/activity+json') { + public async _register( + uri: string, + content: string | Record, + type = "application/activity+json", + ) { this._rs.set(uri, { type, - content: typeof content === 'string' ? content : JSON.stringify(content), + content: typeof content === "string" ? content : JSON.stringify(content), }); } public async resolve(value: string | IObject): Promise { - if (typeof value !== 'string') return value; + if (typeof value !== "string") return value; const r = this._rs.get(value); if (!r) { throw { - name: 'StatusError', + name: "StatusError", statusCode: 404, - message: 'Not registed for mock', + message: "Not registed for mock", }; } diff --git a/packages/backend/test/mute.ts b/packages/backend/test/mute.ts index 465633973c..c511628342 100644 --- a/packages/backend/test/mute.ts +++ b/packages/backend/test/mute.ts @@ -1,10 +1,19 @@ -process.env.NODE_ENV = 'test'; +process.env.NODE_ENV = "test"; -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, react, startServer, shutdownServer, waitFire } from './utils.js'; +import * as assert from "assert"; +import * as childProcess from "child_process"; +import { + async, + signup, + request, + post, + react, + startServer, + shutdownServer, + waitFire, +} from "./utils.js"; -describe('Mute', () => { +describe("Mute", () => { let p: childProcess.ChildProcess; // alice mutes carol @@ -14,110 +23,154 @@ describe('Mute', () => { before(async () => { p = await startServer(); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - carol = await signup({ username: 'carol' }); + alice = await signup({ username: "alice" }); + bob = await signup({ username: "bob" }); + carol = await signup({ username: "carol" }); }); after(async () => { await shutdownServer(p); }); - it('ミュート作成', async(async () => { - const res = await request('/mute/create', { - userId: carol.id, - }, alice); + it("ミュート作成", async(async () => { + const res = await request( + "/mute/create", + { + userId: carol.id, + }, + alice, + ); assert.strictEqual(res.status, 204); })); - it('「自分宛ての投稿」にミュートしているユーザーの投稿が含まれない', async(async () => { - const bobNote = await post(bob, { text: '@alice hi' }); - const carolNote = await post(carol, { text: '@alice hi' }); + it("「自分宛ての投稿」にミュートしているユーザーの投稿が含まれない", async(async () => { + const bobNote = await post(bob, { text: "@alice hi" }); + const carolNote = await post(carol, { text: "@alice hi" }); - const res = await request('/notes/mentions', {}, alice); + const res = await request("/notes/mentions", {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); - assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); + assert.strictEqual( + res.body.some((note: any) => note.id === bobNote.id), + true, + ); + assert.strictEqual( + res.body.some((note: any) => note.id === carolNote.id), + false, + ); })); - it('ミュートしているユーザーからメンションされても、hasUnreadMentions が true にならない', async(async () => { + it("ミュートしているユーザーからメンションされても、hasUnreadMentions が true にならない", async(async () => { // 状態リセット - await request('/i/read-all-unread-notes', {}, alice); + await request("/i/read-all-unread-notes", {}, alice); - await post(carol, { text: '@alice hi' }); + await post(carol, { text: "@alice hi" }); - const res = await request('/i', {}, alice); + const res = await request("/i", {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(res.body.hasUnreadMentions, false); })); - it('ミュートしているユーザーからメンションされても、ストリームに unreadMention イベントが流れてこない', async () => { + it("ミュートしているユーザーからメンションされても、ストリームに unreadMention イベントが流れてこない", async () => { // 状態リセット - await request('/i/read-all-unread-notes', {}, alice); + await request("/i/read-all-unread-notes", {}, alice); - const fired = await waitFire(alice, 'main', () => post(carol, { text: '@alice hi' }), msg => msg.type === 'unreadMention'); + const fired = await waitFire( + alice, + "main", + () => post(carol, { text: "@alice hi" }), + (msg) => msg.type === "unreadMention", + ); assert.strictEqual(fired, false); }); - it('ミュートしているユーザーからメンションされても、ストリームに unreadNotification イベントが流れてこない', async () => { + it("ミュートしているユーザーからメンションされても、ストリームに unreadNotification イベントが流れてこない", async () => { // 状態リセット - await request('/i/read-all-unread-notes', {}, alice); - await request('/notifications/mark-all-as-read', {}, alice); + await request("/i/read-all-unread-notes", {}, alice); + await request("/notifications/mark-all-as-read", {}, alice); - const fired = await waitFire(alice, 'main', () => post(carol, { text: '@alice hi' }), msg => msg.type === 'unreadNotification'); + const fired = await waitFire( + alice, + "main", + () => post(carol, { text: "@alice hi" }), + (msg) => msg.type === "unreadNotification", + ); assert.strictEqual(fired, false); }); - describe('Timeline', () => { - it('タイムラインにミュートしているユーザーの投稿が含まれない', async(async () => { + describe("Timeline", () => { + it("タイムラインにミュートしているユーザーの投稿が含まれない", async(async () => { const aliceNote = await post(alice); const bobNote = await post(bob); const carolNote = await post(carol); - const res = await request('/notes/local-timeline', {}, alice); + const res = await request("/notes/local-timeline", {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); - assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); - assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); + assert.strictEqual( + res.body.some((note: any) => note.id === aliceNote.id), + true, + ); + assert.strictEqual( + res.body.some((note: any) => note.id === bobNote.id), + true, + ); + assert.strictEqual( + res.body.some((note: any) => note.id === carolNote.id), + false, + ); })); - it('タイムラインにミュートしているユーザーの投稿のRenoteが含まれない', async(async () => { + it("タイムラインにミュートしているユーザーの投稿のRenoteが含まれない", async(async () => { const aliceNote = await post(alice); const carolNote = await post(carol); const bobNote = await post(bob, { renoteId: carolNote.id, }); - const res = await request('/notes/local-timeline', {}, alice); + const res = await request("/notes/local-timeline", {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((note: any) => note.id === aliceNote.id), true); - assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); - assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), false); + assert.strictEqual( + res.body.some((note: any) => note.id === aliceNote.id), + true, + ); + assert.strictEqual( + res.body.some((note: any) => note.id === bobNote.id), + false, + ); + assert.strictEqual( + res.body.some((note: any) => note.id === carolNote.id), + false, + ); })); }); - describe('Notification', () => { - it('通知にミュートしているユーザーの通知が含まれない(リアクション)', async(async () => { + describe("Notification", () => { + it("通知にミュートしているユーザーの通知が含まれない(リアクション)", async(async () => { const aliceNote = await post(alice); - await react(bob, aliceNote, 'like'); - await react(carol, aliceNote, 'like'); + await react(bob, aliceNote, "like"); + await react(carol, aliceNote, "like"); - const res = await request('/i/notifications', {}, alice); + const res = await request("/i/notifications", {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((notification: any) => notification.userId === bob.id), true); - assert.strictEqual(res.body.some((notification: any) => notification.userId === carol.id), false); + assert.strictEqual( + res.body.some((notification: any) => notification.userId === bob.id), + true, + ); + assert.strictEqual( + res.body.some((notification: any) => notification.userId === carol.id), + false, + ); })); }); }); diff --git a/packages/backend/test/note.ts b/packages/backend/test/note.ts index b495d8b7bb..3af4b88d87 100644 --- a/packages/backend/test/note.ts +++ b/packages/backend/test/note.ts @@ -1,11 +1,21 @@ -process.env.NODE_ENV = 'test'; +process.env.NODE_ENV = "test"; -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { Note } from '../src/models/entities/note.js'; -import { async, signup, request, post, uploadUrl, startServer, shutdownServer, initTestDb, api } from './utils.js'; +import * as assert from "assert"; +import * as childProcess from "child_process"; +import { Note } from "../src/models/entities/note.js"; +import { + async, + signup, + request, + post, + uploadUrl, + startServer, + shutdownServer, + initTestDb, + api, +} from "./utils.js"; -describe('Note', () => { +describe("Note", () => { let p: childProcess.ChildProcess; let Notes: any; @@ -16,351 +26,488 @@ describe('Note', () => { p = await startServer(); const connection = await initTestDb(true); Notes = connection.getRepository(Note); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); + alice = await signup({ username: "alice" }); + bob = await signup({ username: "bob" }); }); after(async () => { await shutdownServer(p); }); - it('投稿できる', async(async () => { + it("投稿できる", async(async () => { const post = { - text: 'test', + text: "test", }; - const res = await request('/notes/create', post, alice); + const res = await request("/notes/create", post, alice); assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); + assert.strictEqual( + typeof res.body === "object" && !Array.isArray(res.body), + true, + ); assert.strictEqual(res.body.createdNote.text, post.text); })); - it('ファイルを添付できる', async(async () => { - const file = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); + it("ファイルを添付できる", async(async () => { + const file = await uploadUrl( + alice, + "https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg", + ); - const res = await request('/notes/create', { - fileIds: [file.id], - }, alice); + const res = await request( + "/notes/create", + { + fileIds: [file.id], + }, + alice, + ); assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); + assert.strictEqual( + typeof res.body === "object" && !Array.isArray(res.body), + true, + ); assert.deepStrictEqual(res.body.createdNote.fileIds, [file.id]); })); - it('他人のファイルは無視', async(async () => { - const file = await uploadUrl(bob, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); + it("他人のファイルは無視", async(async () => { + const file = await uploadUrl( + bob, + "https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg", + ); - const res = await request('/notes/create', { - text: 'test', - fileIds: [file.id], - }, alice); + const res = await request( + "/notes/create", + { + text: "test", + fileIds: [file.id], + }, + alice, + ); assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); + assert.strictEqual( + typeof res.body === "object" && !Array.isArray(res.body), + true, + ); assert.deepStrictEqual(res.body.createdNote.fileIds, []); })); - it('存在しないファイルは無視', async(async () => { - const res = await request('/notes/create', { - text: 'test', - fileIds: ['000000000000000000000000'], - }, alice); + it("存在しないファイルは無視", async(async () => { + const res = await request( + "/notes/create", + { + text: "test", + fileIds: ["000000000000000000000000"], + }, + alice, + ); assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); + assert.strictEqual( + typeof res.body === "object" && !Array.isArray(res.body), + true, + ); assert.deepStrictEqual(res.body.createdNote.fileIds, []); })); - it('不正なファイルIDは無視', async(async () => { - const res = await request('/notes/create', { - fileIds: ['kyoppie'], - }, alice); + it("不正なファイルIDは無視", async(async () => { + const res = await request( + "/notes/create", + { + fileIds: ["kyoppie"], + }, + alice, + ); assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); + assert.strictEqual( + typeof res.body === "object" && !Array.isArray(res.body), + true, + ); assert.deepStrictEqual(res.body.createdNote.fileIds, []); })); - it('返信できる', async(async () => { + it("返信できる", async(async () => { const bobPost = await post(bob, { - text: 'foo', + text: "foo", }); const alicePost = { - text: 'bar', + text: "bar", replyId: bobPost.id, }; - const res = await request('/notes/create', alicePost, alice); + const res = await request("/notes/create", alicePost, alice); assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); + assert.strictEqual( + typeof res.body === "object" && !Array.isArray(res.body), + true, + ); assert.strictEqual(res.body.createdNote.text, alicePost.text); assert.strictEqual(res.body.createdNote.replyId, alicePost.replyId); assert.strictEqual(res.body.createdNote.reply.text, bobPost.text); })); - it('renoteできる', async(async () => { + it("renoteできる", async(async () => { const bobPost = await post(bob, { - text: 'test', + text: "test", }); const alicePost = { renoteId: bobPost.id, }; - const res = await request('/notes/create', alicePost, alice); + const res = await request("/notes/create", alicePost, alice); assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); + assert.strictEqual( + typeof res.body === "object" && !Array.isArray(res.body), + true, + ); assert.strictEqual(res.body.createdNote.renoteId, alicePost.renoteId); assert.strictEqual(res.body.createdNote.renote.text, bobPost.text); })); - it('引用renoteできる', async(async () => { + it("引用renoteできる", async(async () => { const bobPost = await post(bob, { - text: 'test', + text: "test", }); const alicePost = { - text: 'test', + text: "test", renoteId: bobPost.id, }; - const res = await request('/notes/create', alicePost, alice); + const res = await request("/notes/create", alicePost, alice); assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); + assert.strictEqual( + typeof res.body === "object" && !Array.isArray(res.body), + true, + ); assert.strictEqual(res.body.createdNote.text, alicePost.text); assert.strictEqual(res.body.createdNote.renoteId, alicePost.renoteId); assert.strictEqual(res.body.createdNote.renote.text, bobPost.text); })); - it('文字数ぎりぎりで怒られない', async(async () => { + it("文字数ぎりぎりで怒られない", async(async () => { const post = { - text: '!'.repeat(3000), + text: "!".repeat(3000), }; - const res = await request('/notes/create', post, alice); + const res = await request("/notes/create", post, alice); assert.strictEqual(res.status, 200); })); - it('文字数オーバーで怒られる', async(async () => { + it("文字数オーバーで怒られる", async(async () => { const post = { - text: '!'.repeat(3001), + text: "!".repeat(3001), }; - const res = await request('/notes/create', post, alice); + const res = await request("/notes/create", post, alice); assert.strictEqual(res.status, 400); })); - it('存在しないリプライ先で怒られる', async(async () => { + it("存在しないリプライ先で怒られる", async(async () => { const post = { - text: 'test', - replyId: '000000000000000000000000', + text: "test", + replyId: "000000000000000000000000", }; - const res = await request('/notes/create', post, alice); + const res = await request("/notes/create", post, alice); assert.strictEqual(res.status, 400); })); - it('存在しないrenote対象で怒られる', async(async () => { + it("存在しないrenote対象で怒られる", async(async () => { const post = { - renoteId: '000000000000000000000000', + renoteId: "000000000000000000000000", }; - const res = await request('/notes/create', post, alice); + const res = await request("/notes/create", post, alice); assert.strictEqual(res.status, 400); })); - it('不正なリプライ先IDで怒られる', async(async () => { + it("不正なリプライ先IDで怒られる", async(async () => { const post = { - text: 'test', - replyId: 'foo', + text: "test", + replyId: "foo", }; - const res = await request('/notes/create', post, alice); + const res = await request("/notes/create", post, alice); assert.strictEqual(res.status, 400); })); - it('不正なrenote対象IDで怒られる', async(async () => { + it("不正なrenote対象IDで怒られる", async(async () => { const post = { - renoteId: 'foo', + renoteId: "foo", }; - const res = await request('/notes/create', post, alice); + const res = await request("/notes/create", post, alice); assert.strictEqual(res.status, 400); })); - it('存在しないユーザーにメンションできる', async(async () => { + it("存在しないユーザーにメンションできる", async(async () => { const post = { - text: '@ghost yo', + text: "@ghost yo", }; - const res = await request('/notes/create', post, alice); + const res = await request("/notes/create", post, alice); assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); + assert.strictEqual( + typeof res.body === "object" && !Array.isArray(res.body), + true, + ); assert.strictEqual(res.body.createdNote.text, post.text); })); - it('同じユーザーに複数メンションしても内部的にまとめられる', async(async () => { + it("同じユーザーに複数メンションしても内部的にまとめられる", async(async () => { const post = { - text: '@bob @bob @bob yo', + text: "@bob @bob @bob yo", }; - const res = await request('/notes/create', post, alice); + const res = await request("/notes/create", post, alice); assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); + assert.strictEqual( + typeof res.body === "object" && !Array.isArray(res.body), + true, + ); assert.strictEqual(res.body.createdNote.text, post.text); const noteDoc = await Notes.findOneBy({ id: res.body.createdNote.id }); assert.deepStrictEqual(noteDoc.mentions, [bob.id]); })); - describe('notes/create', () => { - it('投票を添付できる', async(async () => { - const res = await request('/notes/create', { - text: 'test', - poll: { - choices: ['foo', 'bar'], + describe("notes/create", () => { + it("投票を添付できる", async(async () => { + const res = await request( + "/notes/create", + { + text: "test", + poll: { + choices: ["foo", "bar"], + }, }, - }, alice); + alice, + ); assert.strictEqual(res.status, 200); - assert.strictEqual(typeof res.body === 'object' && !Array.isArray(res.body), true); + assert.strictEqual( + typeof res.body === "object" && !Array.isArray(res.body), + true, + ); assert.strictEqual(res.body.createdNote.poll != null, true); })); - it('投票の選択肢が無くて怒られる', async(async () => { - const res = await request('/notes/create', { - poll: {}, - }, alice); + it("投票の選択肢が無くて怒られる", async(async () => { + const res = await request( + "/notes/create", + { + poll: {}, + }, + alice, + ); assert.strictEqual(res.status, 400); })); - it('投票の選択肢が無くて怒られる (空の配列)', async(async () => { - const res = await request('/notes/create', { - poll: { - choices: [], + it("投票の選択肢が無くて怒られる (空の配列)", async(async () => { + const res = await request( + "/notes/create", + { + poll: { + choices: [], + }, }, - }, alice); + alice, + ); assert.strictEqual(res.status, 400); })); - it('投票の選択肢が1つで怒られる', async(async () => { - const res = await request('/notes/create', { - poll: { - choices: ['Strawberry Pasta'], + it("投票の選択肢が1つで怒られる", async(async () => { + const res = await request( + "/notes/create", + { + poll: { + choices: ["Strawberry Pasta"], + }, }, - }, alice); + alice, + ); assert.strictEqual(res.status, 400); })); - it('投票できる', async(async () => { - const { body } = await request('/notes/create', { - text: 'test', - poll: { - choices: ['sakura', 'izumi', 'ako'], + it("投票できる", async(async () => { + const { body } = await request( + "/notes/create", + { + text: "test", + poll: { + choices: ["sakura", "izumi", "ako"], + }, }, - }, alice); + alice, + ); - const res = await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 1, - }, alice); + const res = await request( + "/notes/polls/vote", + { + noteId: body.createdNote.id, + choice: 1, + }, + alice, + ); assert.strictEqual(res.status, 204); })); - it('複数投票できない', async(async () => { - const { body } = await request('/notes/create', { - text: 'test', - poll: { - choices: ['sakura', 'izumi', 'ako'], + it("複数投票できない", async(async () => { + const { body } = await request( + "/notes/create", + { + text: "test", + poll: { + choices: ["sakura", "izumi", "ako"], + }, }, - }, alice); + alice, + ); - await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 0, - }, alice); + await request( + "/notes/polls/vote", + { + noteId: body.createdNote.id, + choice: 0, + }, + alice, + ); - const res = await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 2, - }, alice); + const res = await request( + "/notes/polls/vote", + { + noteId: body.createdNote.id, + choice: 2, + }, + alice, + ); assert.strictEqual(res.status, 400); })); - it('許可されている場合は複数投票できる', async(async () => { - const { body } = await request('/notes/create', { - text: 'test', - poll: { - choices: ['sakura', 'izumi', 'ako'], - multiple: true, + it("許可されている場合は複数投票できる", async(async () => { + const { body } = await request( + "/notes/create", + { + text: "test", + poll: { + choices: ["sakura", "izumi", "ako"], + multiple: true, + }, }, - }, alice); + alice, + ); - await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 0, - }, alice); + await request( + "/notes/polls/vote", + { + noteId: body.createdNote.id, + choice: 0, + }, + alice, + ); - await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 1, - }, alice); + await request( + "/notes/polls/vote", + { + noteId: body.createdNote.id, + choice: 1, + }, + alice, + ); - const res = await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 2, - }, alice); + const res = await request( + "/notes/polls/vote", + { + noteId: body.createdNote.id, + choice: 2, + }, + alice, + ); assert.strictEqual(res.status, 204); })); - it('締め切られている場合は投票できない', async(async () => { - const { body } = await request('/notes/create', { - text: 'test', - poll: { - choices: ['sakura', 'izumi', 'ako'], - expiredAfter: 1, + it("締め切られている場合は投票できない", async(async () => { + const { body } = await request( + "/notes/create", + { + text: "test", + poll: { + choices: ["sakura", "izumi", "ako"], + expiredAfter: 1, + }, }, - }, alice); + alice, + ); - await new Promise(x => setTimeout(x, 2)); + await new Promise((x) => setTimeout(x, 2)); - const res = await request('/notes/polls/vote', { - noteId: body.createdNote.id, - choice: 1, - }, alice); + const res = await request( + "/notes/polls/vote", + { + noteId: body.createdNote.id, + choice: 1, + }, + alice, + ); assert.strictEqual(res.status, 400); })); }); - describe('notes/delete', () => { - it('delete a reply', async(async () => { - const mainNoteRes = await api('notes/create', { - text: 'main post', - }, alice); - const replyOneRes = await api('notes/create', { - text: 'reply one', - replyId: mainNoteRes.body.createdNote.id, - }, alice); - const replyTwoRes = await api('notes/create', { - text: 'reply two', - replyId: mainNoteRes.body.createdNote.id, - }, alice); + describe("notes/delete", () => { + it("delete a reply", async(async () => { + const mainNoteRes = await api( + "notes/create", + { + text: "main post", + }, + alice, + ); + const replyOneRes = await api( + "notes/create", + { + text: "reply one", + replyId: mainNoteRes.body.createdNote.id, + }, + alice, + ); + const replyTwoRes = await api( + "notes/create", + { + text: "reply two", + replyId: mainNoteRes.body.createdNote.id, + }, + alice, + ); - const deleteOneRes = await api('notes/delete', { - noteId: replyOneRes.body.createdNote.id, - }, alice); + const deleteOneRes = await api( + "notes/delete", + { + noteId: replyOneRes.body.createdNote.id, + }, + alice, + ); assert.strictEqual(deleteOneRes.status, 204); - let mainNote = await Notes.findOneBy({ id: mainNoteRes.body.createdNote.id }); + let mainNote = await Notes.findOneBy({ + id: mainNoteRes.body.createdNote.id, + }); assert.strictEqual(mainNote.repliesCount, 1); - const deleteTwoRes = await api('notes/delete', { - noteId: replyTwoRes.body.createdNote.id, - }, alice); + const deleteTwoRes = await api( + "notes/delete", + { + noteId: replyTwoRes.body.createdNote.id, + }, + alice, + ); assert.strictEqual(deleteTwoRes.status, 204); mainNote = await Notes.findOneBy({ id: mainNoteRes.body.createdNote.id }); diff --git a/packages/backend/test/prelude/maybe.ts b/packages/backend/test/prelude/maybe.ts index 0f4b00065f..df589981c3 100644 --- a/packages/backend/test/prelude/maybe.ts +++ b/packages/backend/test/prelude/maybe.ts @@ -1,18 +1,18 @@ -import * as assert from 'assert'; -import { just, nothing } from '../../src/prelude/maybe.js'; +import * as assert from "assert"; +import { just, nothing } from "../../src/prelude/maybe.js"; -describe('just', () => { - it('has a value', () => { +describe("just", () => { + it("has a value", () => { assert.deepStrictEqual(just(3).isJust(), true); }); - it('has the inverse called get', () => { + it("has the inverse called get", () => { assert.deepStrictEqual(just(3).get(), 3); }); }); -describe('nothing', () => { - it('has no value', () => { +describe("nothing", () => { + it("has no value", () => { assert.deepStrictEqual(nothing().isJust(), false); }); }); diff --git a/packages/backend/test/prelude/url.ts b/packages/backend/test/prelude/url.ts index df102c8dfe..5d08ff8924 100644 --- a/packages/backend/test/prelude/url.ts +++ b/packages/backend/test/prelude/url.ts @@ -1,13 +1,13 @@ -import * as assert from 'assert'; -import { query } from '../../src/prelude/url.js'; +import * as assert from "assert"; +import { query } from "../../src/prelude/url.js"; -describe('url', () => { - it('query', () => { +describe("url", () => { + it("query", () => { const s = query({ - foo: 'ふぅ', - bar: 'b a r', + foo: "ふぅ", + bar: "b a r", baz: undefined, }); - assert.deepStrictEqual(s, 'foo=%E3%81%B5%E3%81%85&bar=b%20a%20r'); + assert.deepStrictEqual(s, "foo=%E3%81%B5%E3%81%85&bar=b%20a%20r"); }); }); diff --git a/packages/backend/test/streaming.ts b/packages/backend/test/streaming.ts index c2043ea562..3292c66e17 100644 --- a/packages/backend/test/streaming.ts +++ b/packages/backend/test/streaming.ts @@ -1,17 +1,26 @@ -process.env.NODE_ENV = 'test'; +process.env.NODE_ENV = "test"; -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { Following } from '../src/models/entities/following.js'; -import { connectStream, signup, api, post, startServer, shutdownServer, initTestDb, waitFire } from './utils.js'; +import * as assert from "assert"; +import * as childProcess from "child_process"; +import { Following } from "../src/models/entities/following.js"; +import { + connectStream, + signup, + api, + post, + startServer, + shutdownServer, + initTestDb, + waitFire, +} from "./utils.js"; -describe('Streaming', () => { +describe("Streaming", () => { let p: childProcess.ChildProcess; let Followings: any; const follow = async (follower: any, followee: any) => { await Followings.save({ - id: 'a', + id: "a", createdAt: new Date(), followerId: follower.id, followeeId: followee.id, @@ -24,7 +33,7 @@ describe('Streaming', () => { }); }; - describe('Streaming', () => { + describe("Streaming", () => { // Local users let ayano: any; let kyoko: any; @@ -42,576 +51,716 @@ describe('Streaming', () => { const connection = await initTestDb(true); Followings = connection.getRepository(Following); - ayano = await signup({ username: 'ayano' }); - kyoko = await signup({ username: 'kyoko' }); - chitose = await signup({ username: 'chitose' }); + ayano = await signup({ username: "ayano" }); + kyoko = await signup({ username: "kyoko" }); + chitose = await signup({ username: "chitose" }); - akari = await signup({ username: 'akari', host: 'example.com' }); - chinatsu = await signup({ username: 'chinatsu', host: 'example.com' }); + akari = await signup({ username: "akari", host: "example.com" }); + chinatsu = await signup({ username: "chinatsu", host: "example.com" }); - kyokoNote = await post(kyoko, { text: 'foo' }); + kyokoNote = await post(kyoko, { text: "foo" }); // Follow: ayano => kyoko - await api('following/create', { userId: kyoko.id }, ayano); + await api("following/create", { userId: kyoko.id }, ayano); // Follow: ayano => akari await follow(ayano, akari); // List: chitose => ayano, kyoko - list = await api('users/lists/create', { - name: 'my list', - }, chitose).then(x => x.body); + list = await api( + "users/lists/create", + { + name: "my list", + }, + chitose, + ).then((x) => x.body); - await api('users/lists/push', { - listId: list.id, - userId: ayano.id, - }, chitose); + await api( + "users/lists/push", + { + listId: list.id, + userId: ayano.id, + }, + chitose, + ); - await api('users/lists/push', { - listId: list.id, - userId: kyoko.id, - }, chitose); + await api( + "users/lists/push", + { + listId: list.id, + userId: kyoko.id, + }, + chitose, + ); }); after(async () => { await shutdownServer(p); }); - describe('Events', () => { - it('mention event', async () => { + describe("Events", () => { + it("mention event", async () => { const fired = await waitFire( - kyoko, 'main', // kyoko:main - () => post(ayano, { text: 'foo @kyoko bar' }), // ayano mention => kyoko - msg => msg.type === 'mention' && msg.body.userId === ayano.id // wait ayano + kyoko, + "main", // kyoko:main + () => post(ayano, { text: "foo @kyoko bar" }), // ayano mention => kyoko + (msg) => msg.type === "mention" && msg.body.userId === ayano.id, // wait ayano ); assert.strictEqual(fired, true); }); - it('renote event', async () => { + it("renote event", async () => { const fired = await waitFire( - kyoko, 'main', // kyoko:main - () => post(ayano, { renoteId: kyokoNote.id }), // ayano renote - msg => msg.type === 'renote' && msg.body.renoteId === kyokoNote.id // wait renote + kyoko, + "main", // kyoko:main + () => post(ayano, { renoteId: kyokoNote.id }), // ayano renote + (msg) => msg.type === "renote" && msg.body.renoteId === kyokoNote.id, // wait renote ); assert.strictEqual(fired, true); }); }); - describe('Home Timeline', () => { - it('自分の投稿が流れる', async () => { + describe("Home Timeline", () => { + it("自分の投稿が流れる", async () => { const fired = await waitFire( - ayano, 'homeTimeline', // ayano:Home - () => api('notes/create', { text: 'foo' }, ayano), // ayano posts - msg => msg.type === 'note' && msg.body.text === 'foo' + ayano, + "homeTimeline", // ayano:Home + () => api("notes/create", { text: "foo" }, ayano), // ayano posts + (msg) => msg.type === "note" && msg.body.text === "foo", ); assert.strictEqual(fired, true); }); - it('フォローしているユーザーの投稿が流れる', async () => { + it("フォローしているユーザーの投稿が流れる", async () => { const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'foo' }, kyoko), // kyoko posts - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko + ayano, + "homeTimeline", // ayano:home + () => api("notes/create", { text: "foo" }, kyoko), // kyoko posts + (msg) => msg.type === "note" && msg.body.userId === kyoko.id, // wait kyoko ); assert.strictEqual(fired, true); }); - it('フォローしていないユーザーの投稿は流れない', async () => { + it("フォローしていないユーザーの投稿は流れない", async () => { const fired = await waitFire( - kyoko, 'homeTimeline', // kyoko:home - () => api('notes/create', { text: 'foo' }, ayano), // ayano posts - msg => msg.type === 'note' && msg.body.userId === ayano.id // wait ayano + kyoko, + "homeTimeline", // kyoko:home + () => api("notes/create", { text: "foo" }, ayano), // ayano posts + (msg) => msg.type === "note" && msg.body.userId === ayano.id, // wait ayano ); assert.strictEqual(fired, false); }); - it('フォローしているユーザーのダイレクト投稿が流れる', async () => { + it("フォローしているユーザーのダイレクト投稿が流れる", async () => { const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [ayano.id], }, kyoko), // kyoko dm => ayano - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko + ayano, + "homeTimeline", // ayano:home + () => + api( + "notes/create", + { + text: "foo", + visibility: "specified", + visibleUserIds: [ayano.id], + }, + kyoko, + ), // kyoko dm => ayano + (msg) => msg.type === "note" && msg.body.userId === kyoko.id, // wait kyoko ); assert.strictEqual(fired, true); }); - it('フォローしているユーザーでも自分が指定されていないダイレクト投稿は流れない', async () => { + it("フォローしているユーザーでも自分が指定されていないダイレクト投稿は流れない", async () => { const fired = await waitFire( - ayano, 'homeTimeline', // ayano:home - () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [chitose.id], }, kyoko), // kyoko dm => chitose - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko + ayano, + "homeTimeline", // ayano:home + () => + api( + "notes/create", + { + text: "foo", + visibility: "specified", + visibleUserIds: [chitose.id], + }, + kyoko, + ), // kyoko dm => chitose + (msg) => msg.type === "note" && msg.body.userId === kyoko.id, // wait kyoko ); assert.strictEqual(fired, false); }); - }); // Home + }); // Home - describe('Local Timeline', () => { - it('自分の投稿が流れる', async () => { + describe("Local Timeline", () => { + it("自分の投稿が流れる", async () => { const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo' }, ayano), // ayano posts - msg => msg.type === 'note' && msg.body.text === 'foo' + ayano, + "localTimeline", // ayano:Local + () => api("notes/create", { text: "foo" }, ayano), // ayano posts + (msg) => msg.type === "note" && msg.body.text === "foo", ); assert.strictEqual(fired, true); }); - it('フォローしていないローカルユーザーの投稿が流れる', async () => { + it("フォローしていないローカルユーザーの投稿が流れる", async () => { const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo' }, chitose), // chitose posts - msg => msg.type === 'note' && msg.body.userId === chitose.id // wait chitose + ayano, + "localTimeline", // ayano:Local + () => api("notes/create", { text: "foo" }, chitose), // chitose posts + (msg) => msg.type === "note" && msg.body.userId === chitose.id, // wait chitose ); assert.strictEqual(fired, true); }); - it('リモートユーザーの投稿は流れない', async () => { + it("リモートユーザーの投稿は流れない", async () => { const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo' }, chinatsu), // chinatsu posts - msg => msg.type === 'note' && msg.body.userId === chinatsu.id // wait chinatsu + ayano, + "localTimeline", // ayano:Local + () => api("notes/create", { text: "foo" }, chinatsu), // chinatsu posts + (msg) => msg.type === "note" && msg.body.userId === chinatsu.id, // wait chinatsu ); assert.strictEqual(fired, false); }); - it('フォローしてたとしてもリモートユーザーの投稿は流れない', async () => { + it("フォローしてたとしてもリモートユーザーの投稿は流れない", async () => { const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo' }, akari), // akari posts - msg => msg.type === 'note' && msg.body.userId === akari.id // wait akari + ayano, + "localTimeline", // ayano:Local + () => api("notes/create", { text: "foo" }, akari), // akari posts + (msg) => msg.type === "note" && msg.body.userId === akari.id, // wait akari ); assert.strictEqual(fired, false); }); - it('ホーム指定の投稿は流れない', async () => { + it("ホーム指定の投稿は流れない", async () => { const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo', visibility: 'home' }, kyoko), // kyoko home posts - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko + ayano, + "localTimeline", // ayano:Local + () => api("notes/create", { text: "foo", visibility: "home" }, kyoko), // kyoko home posts + (msg) => msg.type === "note" && msg.body.userId === kyoko.id, // wait kyoko ); assert.strictEqual(fired, false); }); - it('フォローしているローカルユーザーのダイレクト投稿は流れない', async () => { + it("フォローしているローカルユーザーのダイレクト投稿は流れない", async () => { const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [ayano.id] }, kyoko), // kyoko DM => ayano - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko + ayano, + "localTimeline", // ayano:Local + () => + api( + "notes/create", + { + text: "foo", + visibility: "specified", + visibleUserIds: [ayano.id], + }, + kyoko, + ), // kyoko DM => ayano + (msg) => msg.type === "note" && msg.body.userId === kyoko.id, // wait kyoko ); assert.strictEqual(fired, false); }); - it('フォローしていないローカルユーザーのフォロワー宛て投稿は流れない', async () => { + it("フォローしていないローカルユーザーのフォロワー宛て投稿は流れない", async () => { const fired = await waitFire( - ayano, 'localTimeline', // ayano:Local - () => api('notes/create', { text: 'foo', visibility: 'followers' }, chitose), - msg => msg.type === 'note' && msg.body.userId === chitose.id // wait chitose + ayano, + "localTimeline", // ayano:Local + () => + api( + "notes/create", + { text: "foo", visibility: "followers" }, + chitose, + ), + (msg) => msg.type === "note" && msg.body.userId === chitose.id, // wait chitose ); assert.strictEqual(fired, false); }); }); - describe('Recommended Timeline', () => { - it('自分の投稿が流れる', async () => { + describe("Recommended Timeline", () => { + it("自分の投稿が流れる", async () => { const fired = await waitFire( - ayano, 'recommendedTimeline', // ayano:Local - () => api('notes/create', { text: 'foo' }, ayano), // ayano posts - msg => msg.type === 'note' && msg.body.text === 'foo' + ayano, + "recommendedTimeline", // ayano:Local + () => api("notes/create", { text: "foo" }, ayano), // ayano posts + (msg) => msg.type === "note" && msg.body.text === "foo", ); assert.strictEqual(fired, true); }); - it('フォローしていないローカルユーザーの投稿が流れる', async () => { + it("フォローしていないローカルユーザーの投稿が流れる", async () => { const fired = await waitFire( - ayano, 'recommendedTimeline', // ayano:Local - () => api('notes/create', { text: 'foo' }, chitose), // chitose posts - msg => msg.type === 'note' && msg.body.userId === chitose.id // wait chitose + ayano, + "recommendedTimeline", // ayano:Local + () => api("notes/create", { text: "foo" }, chitose), // chitose posts + (msg) => msg.type === "note" && msg.body.userId === chitose.id, // wait chitose ); assert.strictEqual(fired, true); }); - it('リモートユーザーの投稿は流れない', async () => { + it("リモートユーザーの投稿は流れない", async () => { const fired = await waitFire( - ayano, 'recommendedTimeline', // ayano:Local - () => api('notes/create', { text: 'foo' }, chinatsu), // chinatsu posts - msg => msg.type === 'note' && msg.body.userId === chinatsu.id // wait chinatsu + ayano, + "recommendedTimeline", // ayano:Local + () => api("notes/create", { text: "foo" }, chinatsu), // chinatsu posts + (msg) => msg.type === "note" && msg.body.userId === chinatsu.id, // wait chinatsu ); assert.strictEqual(fired, false); }); - it('フォローしてたとしてもリモートユーザーの投稿は流れない', async () => { + it("フォローしてたとしてもリモートユーザーの投稿は流れない", async () => { const fired = await waitFire( - ayano, 'recommendedTimeline', // ayano:Local - () => api('notes/create', { text: 'foo' }, akari), // akari posts - msg => msg.type === 'note' && msg.body.userId === akari.id // wait akari + ayano, + "recommendedTimeline", // ayano:Local + () => api("notes/create", { text: "foo" }, akari), // akari posts + (msg) => msg.type === "note" && msg.body.userId === akari.id, // wait akari ); assert.strictEqual(fired, false); }); - it('ホーム指定の投稿は流れない', async () => { + it("ホーム指定の投稿は流れない", async () => { const fired = await waitFire( - ayano, 'recommendedTimeline', // ayano:Local - () => api('notes/create', { text: 'foo', visibility: 'home' }, kyoko), // kyoko home posts - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko + ayano, + "recommendedTimeline", // ayano:Local + () => api("notes/create", { text: "foo", visibility: "home" }, kyoko), // kyoko home posts + (msg) => msg.type === "note" && msg.body.userId === kyoko.id, // wait kyoko ); assert.strictEqual(fired, false); }); - it('フォローしているローカルユーザーのダイレクト投稿は流れない', async () => { + it("フォローしているローカルユーザーのダイレクト投稿は流れない", async () => { const fired = await waitFire( - ayano, 'recommendedTimeline', // ayano:Local - () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [ayano.id] }, kyoko), // kyoko DM => ayano - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko + ayano, + "recommendedTimeline", // ayano:Local + () => + api( + "notes/create", + { + text: "foo", + visibility: "specified", + visibleUserIds: [ayano.id], + }, + kyoko, + ), // kyoko DM => ayano + (msg) => msg.type === "note" && msg.body.userId === kyoko.id, // wait kyoko ); assert.strictEqual(fired, false); }); - it('フォローしていないローカルユーザーのフォロワー宛て投稿は流れない', async () => { + it("フォローしていないローカルユーザーのフォロワー宛て投稿は流れない", async () => { const fired = await waitFire( - ayano, 'recommendedTimeline', // ayano:Local - () => api('notes/create', { text: 'foo', visibility: 'followers' }, chitose), - msg => msg.type === 'note' && msg.body.userId === chitose.id // wait chitose + ayano, + "recommendedTimeline", // ayano:Local + () => + api( + "notes/create", + { text: "foo", visibility: "followers" }, + chitose, + ), + (msg) => msg.type === "note" && msg.body.userId === chitose.id, // wait chitose ); assert.strictEqual(fired, false); }); }); - describe('Hybrid Timeline', () => { - it('自分の投稿が流れる', async () => { + describe("Hybrid Timeline", () => { + it("自分の投稿が流れる", async () => { const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo' }, ayano), // ayano posts - msg => msg.type === 'note' && msg.body.text === 'foo' + ayano, + "hybridTimeline", // ayano:Hybrid + () => api("notes/create", { text: "foo" }, ayano), // ayano posts + (msg) => msg.type === "note" && msg.body.text === "foo", ); assert.strictEqual(fired, true); }); - it('フォローしていないローカルユーザーの投稿が流れる', async () => { + it("フォローしていないローカルユーザーの投稿が流れる", async () => { const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo' }, chitose), // chitose posts - msg => msg.type === 'note' && msg.body.userId === chitose.id // wait chitose + ayano, + "hybridTimeline", // ayano:Hybrid + () => api("notes/create", { text: "foo" }, chitose), // chitose posts + (msg) => msg.type === "note" && msg.body.userId === chitose.id, // wait chitose ); assert.strictEqual(fired, true); }); - it('フォローしているリモートユーザーの投稿が流れる', async () => { + it("フォローしているリモートユーザーの投稿が流れる", async () => { const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo' }, akari), // akari posts - msg => msg.type === 'note' && msg.body.userId === akari.id // wait akari + ayano, + "hybridTimeline", // ayano:Hybrid + () => api("notes/create", { text: "foo" }, akari), // akari posts + (msg) => msg.type === "note" && msg.body.userId === akari.id, // wait akari ); assert.strictEqual(fired, true); }); - it('フォローしていないリモートユーザーの投稿は流れない', async () => { + it("フォローしていないリモートユーザーの投稿は流れない", async () => { const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo' }, chinatsu), // chinatsu posts - msg => msg.type === 'note' && msg.body.userId === chinatsu.id // wait chinatsu + ayano, + "hybridTimeline", // ayano:Hybrid + () => api("notes/create", { text: "foo" }, chinatsu), // chinatsu posts + (msg) => msg.type === "note" && msg.body.userId === chinatsu.id, // wait chinatsu ); assert.strictEqual(fired, false); }); - it('フォローしているユーザーのダイレクト投稿が流れる', async () => { + it("フォローしているユーザーのダイレクト投稿が流れる", async () => { const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [ayano.id] }, kyoko), - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko + ayano, + "hybridTimeline", // ayano:Hybrid + () => + api( + "notes/create", + { + text: "foo", + visibility: "specified", + visibleUserIds: [ayano.id], + }, + kyoko, + ), + (msg) => msg.type === "note" && msg.body.userId === kyoko.id, // wait kyoko ); assert.strictEqual(fired, true); }); - it('フォローしているユーザーのホーム投稿が流れる', async () => { + it("フォローしているユーザーのホーム投稿が流れる", async () => { const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo', visibility: 'home' }, kyoko), - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko + ayano, + "hybridTimeline", // ayano:Hybrid + () => api("notes/create", { text: "foo", visibility: "home" }, kyoko), + (msg) => msg.type === "note" && msg.body.userId === kyoko.id, // wait kyoko ); assert.strictEqual(fired, true); }); - it('フォローしていないローカルユーザーのホーム投稿は流れない', async () => { + it("フォローしていないローカルユーザーのホーム投稿は流れない", async () => { const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo', visibility: 'home' }, chitose), - msg => msg.type === 'note' && msg.body.userId === chitose.id + ayano, + "hybridTimeline", // ayano:Hybrid + () => + api("notes/create", { text: "foo", visibility: "home" }, chitose), + (msg) => msg.type === "note" && msg.body.userId === chitose.id, ); assert.strictEqual(fired, false); }); - it('フォローしていないローカルユーザーのフォロワー宛て投稿は流れない', () => async () => { + it("フォローしていないローカルユーザーのフォロワー宛て投稿は流れない", () => + async () => { + const fired = await waitFire( + ayano, + "hybridTimeline", // ayano:Hybrid + () => + api( + "notes/create", + { text: "foo", visibility: "followers" }, + chitose, + ), + (msg) => msg.type === "note" && msg.body.userId === chitose.id, + ); + + assert.strictEqual(fired, false); + }); + }); + + describe("Global Timeline", () => { + it("フォローしていないローカルユーザーの投稿が流れる", () => async () => { const fired = await waitFire( - ayano, 'hybridTimeline', // ayano:Hybrid - () => api('notes/create', { text: 'foo', visibility: 'followers' }, chitose), - msg => msg.type === 'note' && msg.body.userId === chitose.id + ayano, + "globalTimeline", // ayano:Global + () => api("notes/create", { text: "foo" }, chitose), // chitose posts + (msg) => msg.type === "note" && msg.body.userId === chitose.id, // wait chitose + ); + + assert.strictEqual(fired, true); + }); + + it("フォローしていないリモートユーザーの投稿が流れる", () => async () => { + const fired = await waitFire( + ayano, + "globalTimeline", // ayano:Global + () => api("notes/create", { text: "foo" }, chinatsu), // chinatsu posts + (msg) => msg.type === "note" && msg.body.userId === chinatsu.id, // wait chinatsu + ); + + assert.strictEqual(fired, true); + }); + + it("ホーム投稿は流れない", () => async () => { + const fired = await waitFire( + ayano, + "globalTimeline", // ayano:Global + () => api("notes/create", { text: "foo", visibility: "home" }, kyoko), // kyoko posts + (msg) => msg.type === "note" && msg.body.userId === kyoko.id, // wait kyoko ); assert.strictEqual(fired, false); }); }); - describe('Global Timeline', () => { - it('フォローしていないローカルユーザーの投稿が流れる', () => async () => { + describe("UserList Timeline", () => { + it("リストに入れているユーザーの投稿が流れる", () => async () => { const fired = await waitFire( - ayano, 'globalTimeline', // ayano:Global - () => api('notes/create', { text: 'foo' }, chitose), // chitose posts - msg => msg.type === 'note' && msg.body.userId === chitose.id // wait chitose + chitose, + "userList", + () => api("notes/create", { text: "foo" }, ayano), + (msg) => msg.type === "note" && msg.body.userId === ayano.id, + { listId: list.id }, ); assert.strictEqual(fired, true); }); - it('フォローしていないリモートユーザーの投稿が流れる', () => async () => { + it("リストに入れていないユーザーの投稿は流れない", () => async () => { const fired = await waitFire( - ayano, 'globalTimeline', // ayano:Global - () => api('notes/create', { text: 'foo' }, chinatsu), // chinatsu posts - msg => msg.type === 'note' && msg.body.userId === chinatsu.id // wait chinatsu - ); - - assert.strictEqual(fired, true); - }); - - it('ホーム投稿は流れない', () => async () => { - const fired = await waitFire( - ayano, 'globalTimeline', // ayano:Global - () => api('notes/create', { text: 'foo', visibility: 'home' }, kyoko), // kyoko posts - msg => msg.type === 'note' && msg.body.userId === kyoko.id // wait kyoko - ); - - assert.strictEqual(fired, false); - }); - }); - - describe('UserList Timeline', () => { - it('リストに入れているユーザーの投稿が流れる', () => async () => { - const fired = await waitFire( - chitose, 'userList', - () => api('notes/create', { text: 'foo' }, ayano), - msg => msg.type === 'note' && msg.body.userId === ayano.id, - { listId: list.id, } - ); - - assert.strictEqual(fired, true); - }); - - it('リストに入れていないユーザーの投稿は流れない', () => async () => { - const fired = await waitFire( - chitose, 'userList', - () => api('notes/create', { text: 'foo' }, chinatsu), - msg => msg.type === 'note' && msg.body.userId === chinatsu.id, - { listId: list.id, } + chitose, + "userList", + () => api("notes/create", { text: "foo" }, chinatsu), + (msg) => msg.type === "note" && msg.body.userId === chinatsu.id, + { listId: list.id }, ); assert.strictEqual(fired, false); }); // #4471 - it('リストに入れているユーザーのダイレクト投稿が流れる', () => async () => { - const fired = await waitFire( - chitose, 'userList', - () => api('notes/create', { text: 'foo', visibility: 'specified', visibleUserIds: [chitose.id] }, ayano), - msg => msg.type === 'note' && msg.body.userId === ayano.id, - { listId: list.id, } - ); + it("リストに入れているユーザーのダイレクト投稿が流れる", () => + async () => { + const fired = await waitFire( + chitose, + "userList", + () => + api( + "notes/create", + { + text: "foo", + visibility: "specified", + visibleUserIds: [chitose.id], + }, + ayano, + ), + (msg) => msg.type === "note" && msg.body.userId === ayano.id, + { listId: list.id }, + ); - assert.strictEqual(fired, true); - }); + assert.strictEqual(fired, true); + }); // #4335 - it('リストに入れているがフォローはしてないユーザーのフォロワー宛て投稿は流れない', () => async () => { - const fired = await waitFire( - chitose, 'userList', - () => api('notes/create', { text: 'foo', visibility: 'followers' }, kyoko), - msg => msg.type === 'note' && msg.body.userId === kyoko.id, - { listId: list.id, } - ); + it("リストに入れているがフォローはしてないユーザーのフォロワー宛て投稿は流れない", () => + async () => { + const fired = await waitFire( + chitose, + "userList", + () => + api( + "notes/create", + { text: "foo", visibility: "followers" }, + kyoko, + ), + (msg) => msg.type === "note" && msg.body.userId === kyoko.id, + { listId: list.id }, + ); - assert.strictEqual(fired, false); - }); + assert.strictEqual(fired, false); + }); }); - describe('Hashtag Timeline', () => { - it('指定したハッシュタグの投稿が流れる', () => new Promise(async done => { - const ws = await connectStream(chitose, 'hashtag', ({ type, body }) => { - if (type == 'note') { - assert.deepStrictEqual(body.text, '#foo'); + describe("Hashtag Timeline", () => { + it("指定したハッシュタグの投稿が流れる", () => + new Promise(async (done) => { + const ws = await connectStream( + chitose, + "hashtag", + ({ type, body }) => { + if (type == "note") { + assert.deepStrictEqual(body.text, "#foo"); + ws.close(); + done(); + } + }, + { + q: [["foo"]], + }, + ); + + post(chitose, { + text: "#foo", + }); + })); + + it("指定したハッシュタグの投稿が流れる (AND)", () => + new Promise(async (done) => { + let fooCount = 0; + let barCount = 0; + let fooBarCount = 0; + + const ws = await connectStream( + chitose, + "hashtag", + ({ type, body }) => { + if (type == "note") { + if (body.text === "#foo") fooCount++; + if (body.text === "#bar") barCount++; + if (body.text === "#foo #bar") fooBarCount++; + } + }, + { + q: [["foo", "bar"]], + }, + ); + + post(chitose, { + text: "#foo", + }); + + post(chitose, { + text: "#bar", + }); + + post(chitose, { + text: "#foo #bar", + }); + + setTimeout(() => { + assert.strictEqual(fooCount, 0); + assert.strictEqual(barCount, 0); + assert.strictEqual(fooBarCount, 1); ws.close(); done(); - } - }, { - q: [ - ['foo'], - ], - }); + }, 3000); + })); - post(chitose, { - text: '#foo', - }); - })); + it("指定したハッシュタグの投稿が流れる (OR)", () => + new Promise(async (done) => { + let fooCount = 0; + let barCount = 0; + let fooBarCount = 0; + let piyoCount = 0; - it('指定したハッシュタグの投稿が流れる (AND)', () => new Promise(async done => { - let fooCount = 0; - let barCount = 0; - let fooBarCount = 0; - - const ws = await connectStream(chitose, 'hashtag', ({ type, body }) => { - if (type == 'note') { - if (body.text === '#foo') fooCount++; - if (body.text === '#bar') barCount++; - if (body.text === '#foo #bar') fooBarCount++; - } - }, { - q: [ - ['foo', 'bar'], - ], - }); - - post(chitose, { - text: '#foo', - }); - - post(chitose, { - text: '#bar', - }); - - post(chitose, { - text: '#foo #bar', - }); - - setTimeout(() => { - assert.strictEqual(fooCount, 0); - assert.strictEqual(barCount, 0); - assert.strictEqual(fooBarCount, 1); - ws.close(); - done(); - }, 3000); - })); + const ws = await connectStream( + chitose, + "hashtag", + ({ type, body }) => { + if (type == "note") { + if (body.text === "#foo") fooCount++; + if (body.text === "#bar") barCount++; + if (body.text === "#foo #bar") fooBarCount++; + if (body.text === "#piyo") piyoCount++; + } + }, + { + q: [["foo"], ["bar"]], + }, + ); - it('指定したハッシュタグの投稿が流れる (OR)', () => new Promise(async done => { - let fooCount = 0; - let barCount = 0; - let fooBarCount = 0; - let piyoCount = 0; + post(chitose, { + text: "#foo", + }); - const ws = await connectStream(chitose, 'hashtag', ({ type, body }) => { - if (type == 'note') { - if (body.text === '#foo') fooCount++; - if (body.text === '#bar') barCount++; - if (body.text === '#foo #bar') fooBarCount++; - if (body.text === '#piyo') piyoCount++; - } - }, { - q: [ - ['foo'], - ['bar'], - ], - }); + post(chitose, { + text: "#bar", + }); - post(chitose, { - text: '#foo', - }); + post(chitose, { + text: "#foo #bar", + }); - post(chitose, { - text: '#bar', - }); + post(chitose, { + text: "#piyo", + }); - post(chitose, { - text: '#foo #bar', - }); + setTimeout(() => { + assert.strictEqual(fooCount, 1); + assert.strictEqual(barCount, 1); + assert.strictEqual(fooBarCount, 1); + assert.strictEqual(piyoCount, 0); + ws.close(); + done(); + }, 3000); + })); - post(chitose, { - text: '#piyo', - }); + it("指定したハッシュタグの投稿が流れる (AND + OR)", () => + new Promise(async (done) => { + let fooCount = 0; + let barCount = 0; + let fooBarCount = 0; + let piyoCount = 0; + let waaaCount = 0; - setTimeout(() => { - assert.strictEqual(fooCount, 1); - assert.strictEqual(barCount, 1); - assert.strictEqual(fooBarCount, 1); - assert.strictEqual(piyoCount, 0); - ws.close(); - done(); - }, 3000); - })); + const ws = await connectStream( + chitose, + "hashtag", + ({ type, body }) => { + if (type == "note") { + if (body.text === "#foo") fooCount++; + if (body.text === "#bar") barCount++; + if (body.text === "#foo #bar") fooBarCount++; + if (body.text === "#piyo") piyoCount++; + if (body.text === "#waaa") waaaCount++; + } + }, + { + q: [["foo", "bar"], ["piyo"]], + }, + ); - it('指定したハッシュタグの投稿が流れる (AND + OR)', () => new Promise(async done => { - let fooCount = 0; - let barCount = 0; - let fooBarCount = 0; - let piyoCount = 0; - let waaaCount = 0; + post(chitose, { + text: "#foo", + }); - const ws = await connectStream(chitose, 'hashtag', ({ type, body }) => { - if (type == 'note') { - if (body.text === '#foo') fooCount++; - if (body.text === '#bar') barCount++; - if (body.text === '#foo #bar') fooBarCount++; - if (body.text === '#piyo') piyoCount++; - if (body.text === '#waaa') waaaCount++; - } - }, { - q: [ - ['foo', 'bar'], - ['piyo'], - ], - }); + post(chitose, { + text: "#bar", + }); - post(chitose, { - text: '#foo', - }); + post(chitose, { + text: "#foo #bar", + }); - post(chitose, { - text: '#bar', - }); + post(chitose, { + text: "#piyo", + }); - post(chitose, { - text: '#foo #bar', - }); + post(chitose, { + text: "#waaa", + }); - post(chitose, { - text: '#piyo', - }); - - post(chitose, { - text: '#waaa', - }); - - setTimeout(() => { - assert.strictEqual(fooCount, 0); - assert.strictEqual(barCount, 0); - assert.strictEqual(fooBarCount, 1); - assert.strictEqual(piyoCount, 1); - assert.strictEqual(waaaCount, 0); - ws.close(); - done(); - }, 3000); - })); + setTimeout(() => { + assert.strictEqual(fooCount, 0); + assert.strictEqual(barCount, 0); + assert.strictEqual(fooBarCount, 1); + assert.strictEqual(piyoCount, 1); + assert.strictEqual(waaaCount, 0); + ws.close(); + done(); + }, 3000); + })); }); }); }); diff --git a/packages/backend/test/thread-mute.ts b/packages/backend/test/thread-mute.ts index cd3e519394..9b3bb8dfe4 100644 --- a/packages/backend/test/thread-mute.ts +++ b/packages/backend/test/thread-mute.ts @@ -1,10 +1,19 @@ -process.env.NODE_ENV = 'test'; +process.env.NODE_ENV = "test"; -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, react, connectStream, startServer, shutdownServer } from './utils.js'; +import * as assert from "assert"; +import * as childProcess from "child_process"; +import { + async, + signup, + request, + post, + react, + connectStream, + startServer, + shutdownServer, +} from "./utils.js"; -describe('Note thread mute', () => { +describe("Note thread mute", () => { let p: childProcess.ChildProcess; let alice: any; @@ -13,90 +22,139 @@ describe('Note thread mute', () => { before(async () => { p = await startServer(); - alice = await signup({ username: 'alice' }); - bob = await signup({ username: 'bob' }); - carol = await signup({ username: 'carol' }); + alice = await signup({ username: "alice" }); + bob = await signup({ username: "bob" }); + carol = await signup({ username: "carol" }); }); after(async () => { await shutdownServer(p); }); - it('notes/mentions にミュートしているスレッドの投稿が含まれない', async(async () => { - const bobNote = await post(bob, { text: '@alice @carol root note' }); - const aliceReply = await post(alice, { replyId: bobNote.id, text: '@bob @carol child note' }); + it("notes/mentions にミュートしているスレッドの投稿が含まれない", async(async () => { + const bobNote = await post(bob, { text: "@alice @carol root note" }); + const aliceReply = await post(alice, { + replyId: bobNote.id, + text: "@bob @carol child note", + }); - await request('/notes/thread-muting/create', { noteId: bobNote.id }, alice); + await request("/notes/thread-muting/create", { noteId: bobNote.id }, alice); - const carolReply = await post(carol, { replyId: bobNote.id, text: '@bob @alice child note' }); - const carolReplyWithoutMention = await post(carol, { replyId: aliceReply.id, text: 'child note' }); + const carolReply = await post(carol, { + replyId: bobNote.id, + text: "@bob @alice child note", + }); + const carolReplyWithoutMention = await post(carol, { + replyId: aliceReply.id, + text: "child note", + }); - const res = await request('/notes/mentions', {}, alice); + const res = await request("/notes/mentions", {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); - assert.strictEqual(res.body.some((note: any) => note.id === carolReply.id), false); - assert.strictEqual(res.body.some((note: any) => note.id === carolReplyWithoutMention.id), false); + assert.strictEqual( + res.body.some((note: any) => note.id === bobNote.id), + false, + ); + assert.strictEqual( + res.body.some((note: any) => note.id === carolReply.id), + false, + ); + assert.strictEqual( + res.body.some((note: any) => note.id === carolReplyWithoutMention.id), + false, + ); })); - it('ミュートしているスレッドからメンションされても、hasUnreadMentions が true にならない', async(async () => { + it("ミュートしているスレッドからメンションされても、hasUnreadMentions が true にならない", async(async () => { // 状態リセット - await request('/i/read-all-unread-notes', {}, alice); + await request("/i/read-all-unread-notes", {}, alice); - const bobNote = await post(bob, { text: '@alice @carol root note' }); + const bobNote = await post(bob, { text: "@alice @carol root note" }); - await request('/notes/thread-muting/create', { noteId: bobNote.id }, alice); + await request("/notes/thread-muting/create", { noteId: bobNote.id }, alice); - const carolReply = await post(carol, { replyId: bobNote.id, text: '@bob @alice child note' }); + const carolReply = await post(carol, { + replyId: bobNote.id, + text: "@bob @alice child note", + }); - const res = await request('/i', {}, alice); + const res = await request("/i", {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(res.body.hasUnreadMentions, false); })); - it('ミュートしているスレッドからメンションされても、ストリームに unreadMention イベントが流れてこない', () => new Promise(async done => { - // 状態リセット - await request('/i/read-all-unread-notes', {}, alice); + it("ミュートしているスレッドからメンションされても、ストリームに unreadMention イベントが流れてこない", () => + new Promise(async (done) => { + // 状態リセット + await request("/i/read-all-unread-notes", {}, alice); - const bobNote = await post(bob, { text: '@alice @carol root note' }); + const bobNote = await post(bob, { text: "@alice @carol root note" }); - await request('/notes/thread-muting/create', { noteId: bobNote.id }, alice); + await request( + "/notes/thread-muting/create", + { noteId: bobNote.id }, + alice, + ); - let fired = false; + let fired = false; - const ws = await connectStream(alice, 'main', async ({ type, body }) => { - if (type === 'unreadMention') { - if (body === bobNote.id) return; - fired = true; - } + const ws = await connectStream(alice, "main", async ({ type, body }) => { + if (type === "unreadMention") { + if (body === bobNote.id) return; + fired = true; + } + }); + + const carolReply = await post(carol, { + replyId: bobNote.id, + text: "@bob @alice child note", + }); + + setTimeout(() => { + assert.strictEqual(fired, false); + ws.close(); + done(); + }, 5000); + })); + + it("i/notifications にミュートしているスレッドの通知が含まれない", async(async () => { + const bobNote = await post(bob, { text: "@alice @carol root note" }); + const aliceReply = await post(alice, { + replyId: bobNote.id, + text: "@bob @carol child note", }); - const carolReply = await post(carol, { replyId: bobNote.id, text: '@bob @alice child note' }); + await request("/notes/thread-muting/create", { noteId: bobNote.id }, alice); - setTimeout(() => { - assert.strictEqual(fired, false); - ws.close(); - done(); - }, 5000); - })); + const carolReply = await post(carol, { + replyId: bobNote.id, + text: "@bob @alice child note", + }); + const carolReplyWithoutMention = await post(carol, { + replyId: aliceReply.id, + text: "child note", + }); - it('i/notifications にミュートしているスレッドの通知が含まれない', async(async () => { - const bobNote = await post(bob, { text: '@alice @carol root note' }); - const aliceReply = await post(alice, { replyId: bobNote.id, text: '@bob @carol child note' }); - - await request('/notes/thread-muting/create', { noteId: bobNote.id }, alice); - - const carolReply = await post(carol, { replyId: bobNote.id, text: '@bob @alice child note' }); - const carolReplyWithoutMention = await post(carol, { replyId: aliceReply.id, text: 'child note' }); - - const res = await request('/i/notifications', {}, alice); + const res = await request("/i/notifications", {}, alice); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); - assert.strictEqual(res.body.some((notification: any) => notification.note.id === carolReply.id), false); - assert.strictEqual(res.body.some((notification: any) => notification.note.id === carolReplyWithoutMention.id), false); + assert.strictEqual( + res.body.some( + (notification: any) => notification.note.id === carolReply.id, + ), + false, + ); + assert.strictEqual( + res.body.some( + (notification: any) => + notification.note.id === carolReplyWithoutMention.id, + ), + false, + ); // NOTE: bobの投稿はスレッドミュート前に行われたため通知に含まれていてもよい })); diff --git a/packages/backend/test/user-notes.ts b/packages/backend/test/user-notes.ts index 4447754d66..86a541c101 100644 --- a/packages/backend/test/user-notes.ts +++ b/packages/backend/test/user-notes.ts @@ -1,10 +1,18 @@ -process.env.NODE_ENV = 'test'; +process.env.NODE_ENV = "test"; -import * as assert from 'assert'; -import * as childProcess from 'child_process'; -import { async, signup, request, post, uploadUrl, startServer, shutdownServer } from './utils.js'; +import * as assert from "assert"; +import * as childProcess from "child_process"; +import { + async, + signup, + request, + post, + uploadUrl, + startServer, + shutdownServer, +} from "./utils.js"; -describe('users/notes', () => { +describe("users/notes", () => { let p: childProcess.ChildProcess; let alice: any; @@ -14,9 +22,15 @@ describe('users/notes', () => { before(async () => { p = await startServer(); - alice = await signup({ username: 'alice' }); - const jpg = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg'); - const png = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.png'); + alice = await signup({ username: "alice" }); + const jpg = await uploadUrl( + alice, + "https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg", + ); + const png = await uploadUrl( + alice, + "https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.png", + ); jpgNote = await post(alice, { fileIds: [jpg.id], }); @@ -28,34 +42,57 @@ describe('users/notes', () => { }); }); - after(async() => { + after(async () => { await shutdownServer(p); }); - it('ファイルタイプ指定 (jpg)', async(async () => { - const res = await request('/users/notes', { - userId: alice.id, - fileType: ['image/jpeg'], - }, alice); + it("ファイルタイプ指定 (jpg)", async(async () => { + const res = await request( + "/users/notes", + { + userId: alice.id, + fileType: ["image/jpeg"], + }, + alice, + ); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); assert.strictEqual(res.body.length, 2); - assert.strictEqual(res.body.some((note: any) => note.id === jpgNote.id), true); - assert.strictEqual(res.body.some((note: any) => note.id === jpgPngNote.id), true); + assert.strictEqual( + res.body.some((note: any) => note.id === jpgNote.id), + true, + ); + assert.strictEqual( + res.body.some((note: any) => note.id === jpgPngNote.id), + true, + ); })); - it('ファイルタイプ指定 (jpg or png)', async(async () => { - const res = await request('/users/notes', { - userId: alice.id, - fileType: ['image/jpeg', 'image/png'], - }, alice); + it("ファイルタイプ指定 (jpg or png)", async(async () => { + const res = await request( + "/users/notes", + { + userId: alice.id, + fileType: ["image/jpeg", "image/png"], + }, + alice, + ); assert.strictEqual(res.status, 200); assert.strictEqual(Array.isArray(res.body), true); assert.strictEqual(res.body.length, 3); - assert.strictEqual(res.body.some((note: any) => note.id === jpgNote.id), true); - assert.strictEqual(res.body.some((note: any) => note.id === pngNote.id), true); - assert.strictEqual(res.body.some((note: any) => note.id === jpgPngNote.id), true); + assert.strictEqual( + res.body.some((note: any) => note.id === jpgNote.id), + true, + ); + assert.strictEqual( + res.body.some((note: any) => note.id === pngNote.id), + true, + ); + assert.strictEqual( + res.body.some((note: any) => note.id === jpgPngNote.id), + true, + ); })); }); diff --git a/packages/backend/test/utils.ts b/packages/backend/test/utils.ts index 6833e6eb58..f3f68b2609 100644 --- a/packages/backend/test/utils.ts +++ b/packages/backend/test/utils.ts @@ -1,18 +1,18 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; -import { fileURLToPath } from 'node:url'; -import { dirname } from 'node:path'; -import * as childProcess from 'child_process'; -import * as http from 'node:http'; -import { SIGKILL } from 'constants'; -import WebSocket from 'ws'; -import * as misskey from 'calckey-js'; -import fetch from 'node-fetch'; -import FormData from 'form-data'; -import { DataSource } from 'typeorm'; -import loadConfig from '../src/config/load.js'; -import { entities } from '../src/db/postgre.js'; -import got from 'got'; +import * as fs from "node:fs"; +import * as path from "node:path"; +import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; +import * as childProcess from "child_process"; +import * as http from "node:http"; +import { SIGKILL } from "constants"; +import WebSocket from "ws"; +import * as misskey from "calckey-js"; +import fetch from "node-fetch"; +import FormData from "form-data"; +import { DataSource } from "typeorm"; +import loadConfig from "../src/config/load.js"; +import { entities } from "../src/db/postgre.js"; +import got from "got"; const _filename = fileURLToPath(import.meta.url); const _dirname = dirname(_filename); @@ -21,24 +21,29 @@ const config = loadConfig(); export const port = config.port; export const async = (fn: Function) => (done: Function) => { - fn().then(() => { - done(); - }, (err: Error) => { - done(err); - }); + fn().then( + () => { + done(); + }, + (err: Error) => { + done(err); + }, + ); }; export const api = async (endpoint: string, params: any, me?: any) => { - endpoint = endpoint.replace(/^\//, ''); + endpoint = endpoint.replace(/^\//, ""); - const auth = me ? { - i: me.token - } : {}; + const auth = me + ? { + i: me.token, + } + : {}; const res = await got(`http://localhost:${port}/api/${endpoint}`, { - method: 'POST', + method: "POST", headers: { - 'Content-Type': 'application/json' + "Content-Type": "application/json", }, body: JSON.stringify(Object.assign(auth, params)), retry: { @@ -46,12 +51,12 @@ export const api = async (endpoint: string, params: any, me?: any) => { }, hooks: { beforeError: [ - error => { + (error) => { const { response } = error; if (response && response.body) console.warn(response.body); return error; - } - ] + }, + ], }, }); @@ -60,19 +65,25 @@ export const api = async (endpoint: string, params: any, me?: any) => { return { status, - body + body, }; }; -export const request = async (endpoint: string, params: any, me?: any): Promise<{ body: any, status: number }> => { - const auth = me ? { - i: me.token, - } : {}; +export const request = async ( + endpoint: string, + params: any, + me?: any, +): Promise<{ body: any; status: number }> => { + const auth = me + ? { + i: me.token, + } + : {}; const res = await fetch(`http://localhost:${port}/api${endpoint}`, { - method: 'POST', + method: "POST", headers: { - 'Content-Type': 'application/json', + "Content-Type": "application/json", }, body: JSON.stringify(Object.assign(auth, params)), }); @@ -81,36 +92,54 @@ export const request = async (endpoint: string, params: any, me?: any): Promise< const body = res.status !== 204 ? await res.json().catch() : null; return { - body, status, + body, + status, }; }; export const signup = async (params?: any): Promise => { - const q = Object.assign({ - username: 'test', - password: 'test', - }, params); + const q = Object.assign( + { + username: "test", + password: "test", + }, + params, + ); - const res = await api('signup', q); + const res = await api("signup", q); return res.body; }; -export const post = async (user: any, params?: misskey.Endpoints['notes/create']['req']): Promise => { - const q = Object.assign({ - text: 'test', - }, params); +export const post = async ( + user: any, + params?: misskey.Endpoints["notes/create"]["req"], +): Promise => { + const q = Object.assign( + { + text: "test", + }, + params, + ); - const res = await api('notes/create', q, user); + const res = await api("notes/create", q, user); return res.body ? res.body.createdNote : null; }; -export const react = async (user: any, note: any, reaction: string): Promise => { - await api('notes/reactions/create', { - noteId: note.id, - reaction: reaction, - }, user); +export const react = async ( + user: any, + note: any, + reaction: string, +): Promise => { + await api( + "notes/reactions/create", + { + noteId: note.id, + reaction: reaction, + }, + user, + ); }; /** @@ -119,20 +148,28 @@ export const react = async (user: any, note: any, reaction: string): Promise => { - const absPath = _path == null ? `${_dirname}/resources/Lenna.jpg` : path.isAbsolute(_path) ? _path : `${_dirname}/resources/${_path}`; + const absPath = + _path == null + ? `${_dirname}/resources/Lenna.jpg` + : path.isAbsolute(_path) + ? _path + : `${_dirname}/resources/${_path}`; const formData = new FormData() as any; - formData.append('i', user.token); - formData.append('file', fs.createReadStream(absPath)); - formData.append('force', 'true'); + formData.append("i", user.token); + formData.append("file", fs.createReadStream(absPath)); + formData.append("force", "true"); - const res = await got(`http://localhost:${port}/api/drive/files/create`, { - method: 'POST', - body: formData, - retry: { - limit: 0, + const res = await got( + `http://localhost:${port}/api/drive/files/create`, + { + method: "POST", + body: formData, + retry: { + limit: 0, + }, }, - }); + ); const body = res.statusCode !== 204 ? await JSON.parse(res.body) : null; @@ -142,16 +179,20 @@ export const uploadFile = async (user: any, _path?: string): Promise => { export const uploadUrl = async (user: any, url: string) => { let file: any; - const ws = await connectStream(user, 'main', (msg) => { - if (msg.type === 'driveFileCreated') { + const ws = await connectStream(user, "main", (msg) => { + if (msg.type === "driveFileCreated") { file = msg.body; } }); - await api('drive/files/upload-from-url', { - url, - force: true, - }, user); + await api( + "drive/files/upload-from-url", + { + url, + force: true, + }, + user, + ); await sleep(5000); ws.close(); @@ -159,46 +200,66 @@ export const uploadUrl = async (user: any, url: string) => { return file; }; -export function connectStream(user: any, channel: string, listener: (message: Record) => any, params?: any): Promise { +export function connectStream( + user: any, + channel: string, + listener: (message: Record) => any, + params?: any, +): Promise { return new Promise((res, rej) => { - const ws = new WebSocket(`ws://localhost:${port}/streaming?i=${user.token}`); + const ws = new WebSocket( + `ws://localhost:${port}/streaming?i=${user.token}`, + ); - ws.on('open', () => { - ws.on('message', data => { + ws.on("open", () => { + ws.on("message", (data) => { const msg = JSON.parse(data.toString()); - if (msg.type === 'channel' && msg.body.id === 'a') { + if (msg.type === "channel" && msg.body.id === "a") { listener(msg.body); - } else if (msg.type === 'connected' && msg.body.id === 'a') { + } else if (msg.type === "connected" && msg.body.id === "a") { res(ws); } }); - ws.send(JSON.stringify({ - type: 'connect', - body: { - channel: channel, - id: 'a', - pong: true, - params: params, - }, - })); + ws.send( + JSON.stringify({ + type: "connect", + body: { + channel: channel, + id: "a", + pong: true, + params: params, + }, + }), + ); }); }); } -export const waitFire = async (user: any, channel: string, trgr: () => any, cond: (msg: Record) => boolean, params?: any) => { +export const waitFire = async ( + user: any, + channel: string, + trgr: () => any, + cond: (msg: Record) => boolean, + params?: any, +) => { return new Promise(async (res, rej) => { let timer: NodeJS.Timeout; let ws: WebSocket; try { - ws = await connectStream(user, channel, msg => { - if (cond(msg)) { - ws.close(); - if (timer) clearTimeout(timer); - res(true); - } - }, params); + ws = await connectStream( + user, + channel, + (msg) => { + if (cond(msg)) { + ws.close(); + if (timer) clearTimeout(timer); + res(true); + } + }, + params, + ); } catch (e) { rej(e); } @@ -217,50 +278,63 @@ export const waitFire = async (user: any, channel: string, trgr: () => any, cond if (timer) clearTimeout(timer); rej(e); } - }) + }); }; -export const simpleGet = async (path: string, accept = '*/*'): Promise<{ status?: number, type?: string, location?: string }> => { +export const simpleGet = async ( + path: string, + accept = "*/*", +): Promise<{ status?: number; type?: string; location?: string }> => { // node-fetchだと3xxを取れない return await new Promise((resolve, reject) => { - const req = http.request(`http://localhost:${port}${path}`, { - headers: { - Accept: accept, + const req = http.request( + `http://localhost:${port}${path}`, + { + headers: { + Accept: accept, + }, }, - }, res => { - if (res.statusCode! >= 400) { - reject(res); - } else { - resolve({ - status: res.statusCode, - type: res.headers['content-type'], - location: res.headers.location, - }); - } - }); + (res) => { + if (res.statusCode! >= 400) { + reject(res); + } else { + resolve({ + status: res.statusCode, + type: res.headers["content-type"], + location: res.headers.location, + }); + } + }, + ); req.end(); }); }; -export function launchServer(callbackSpawnedProcess: (p: childProcess.ChildProcess) => void, moreProcess: () => Promise = async () => {}) { +export function launchServer( + callbackSpawnedProcess: (p: childProcess.ChildProcess) => void, + moreProcess: () => Promise = async () => {}, +) { return (done: (err?: Error) => any) => { - const p = childProcess.spawn('node', [_dirname + '/../index.js'], { - stdio: ['inherit', 'inherit', 'inherit', 'ipc'], - env: { NODE_ENV: 'test', PATH: process.env.PATH }, + const p = childProcess.spawn("node", [_dirname + "/../index.js"], { + stdio: ["inherit", "inherit", "inherit", "ipc"], + env: { NODE_ENV: "test", PATH: process.env.PATH }, }); callbackSpawnedProcess(p); - p.on('message', message => { - if (message === 'ok') moreProcess().then(() => done()).catch(e => done(e)); + p.on("message", (message) => { + if (message === "ok") + moreProcess() + .then(() => done()) + .catch((e) => done(e)); }); }; } export async function initTestDb(justBorrow = false, initEntities?: any[]) { - if (process.env.NODE_ENV !== 'test') throw 'NODE_ENV is not a test'; + if (process.env.NODE_ENV !== "test") throw "NODE_ENV is not a test"; const db = new DataSource({ - type: 'postgres', + type: "postgres", host: config.db.host, port: config.db.port, username: config.db.user, @@ -276,22 +350,24 @@ export async function initTestDb(justBorrow = false, initEntities?: any[]) { return db; } -export function startServer(timeout = 60 * 1000): Promise { +export function startServer( + timeout = 60 * 1000, +): Promise { return new Promise((res, rej) => { const t = setTimeout(() => { p.kill(SIGKILL); - rej('timeout to start'); + rej("timeout to start"); }, timeout); - const p = childProcess.spawn('node', [_dirname + '/../built/index.js'], { - stdio: ['inherit', 'inherit', 'inherit', 'ipc'], - env: { NODE_ENV: 'test', PATH: process.env.PATH }, + const p = childProcess.spawn("node", [_dirname + "/../built/index.js"], { + stdio: ["inherit", "inherit", "inherit", "ipc"], + env: { NODE_ENV: "test", PATH: process.env.PATH }, }); - p.on('error', e => rej(e)); + p.on("error", (e) => rej(e)); - p.on('message', message => { - if (message === 'ok') { + p.on("message", (message) => { + if (message === "ok") { clearTimeout(t); res(p); } @@ -299,16 +375,19 @@ export function startServer(timeout = 60 * 1000): Promise { const t = setTimeout(() => { p.kill(SIGKILL); - res('force exit'); + res("force exit"); }, timeout); - p.once('exit', () => { + p.once("exit", () => { clearTimeout(t); - res('exited'); + res("exited"); }); p.kill(); @@ -316,7 +395,7 @@ export function shutdownServer(p: childProcess.ChildProcess, timeout = 20 * 1000 } export function sleep(msec: number) { - return new Promise(res => { + return new Promise((res) => { setTimeout(() => { res(); }, msec); diff --git a/packages/calckey-js/.editorconfig b/packages/calckey-js/.editorconfig new file mode 100644 index 0000000000..da178f0707 --- /dev/null +++ b/packages/calckey-js/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +indent_style = tab +indent_size = 2 +charset = utf-8 +insert_final_newline = true diff --git a/packages/calckey-js/.eslintignore b/packages/calckey-js/.eslintignore new file mode 100644 index 0000000000..f22128f047 --- /dev/null +++ b/packages/calckey-js/.eslintignore @@ -0,0 +1,7 @@ +node_modules +/built +/coverage +/.eslintrc.js +/jest.config.ts +/test +/test-d diff --git a/packages/calckey-js/.eslintrc.js b/packages/calckey-js/.eslintrc.js new file mode 100644 index 0000000000..164cf1fbe8 --- /dev/null +++ b/packages/calckey-js/.eslintrc.js @@ -0,0 +1,65 @@ +module.exports = { + root: true, + parser: "@typescript-eslint/parser", + parserOptions: { + tsconfigRootDir: __dirname, + project: ["./tsconfig.json"], + }, + plugins: ["@typescript-eslint"], + extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], + rules: { + indent: [ + "error", + "tab", + { + SwitchCase: 1, + MemberExpression: "off", + flatTernaryExpressions: true, + ArrayExpression: "first", + ObjectExpression: "first", + }, + ], + "eol-last": ["error", "always"], + semi: ["error", "always"], + quotes: ["error", "single"], + "comma-dangle": ["error", "always-multiline"], + "keyword-spacing": [ + "error", + { + before: true, + after: true, + }, + ], + "key-spacing": [ + "error", + { + beforeColon: false, + afterColon: true, + }, + ], + "space-infix-ops": ["error"], + "space-before-blocks": ["error", "always"], + "object-curly-spacing": ["error", "always"], + "nonblock-statement-body-position": ["error", "beside"], + eqeqeq: ["error", "always", { null: "ignore" }], + "no-multiple-empty-lines": ["error", { max: 1 }], + "no-multi-spaces": ["error"], + "no-var": ["error"], + "prefer-arrow-callback": ["error"], + "no-throw-literal": ["error"], + "no-param-reassign": ["warn"], + "no-constant-condition": ["warn"], + "no-empty-pattern": ["warn"], + "@typescript-eslint/no-unnecessary-condition": ["error"], + "@typescript-eslint/no-inferrable-types": ["warn"], + "@typescript-eslint/no-non-null-assertion": ["warn"], + "@typescript-eslint/explicit-function-return-type": ["warn"], + "@typescript-eslint/no-misused-promises": [ + "error", + { + checksVoidReturn: false, + }, + ], + "@typescript-eslint/consistent-type-imports": "error", + }, +}; diff --git a/packages/calckey-js/.gitignore b/packages/calckey-js/.gitignore new file mode 100644 index 0000000000..8a97abf3a4 --- /dev/null +++ b/packages/calckey-js/.gitignore @@ -0,0 +1,113 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# App +temp +# built + +# Yarn +.yarn/* +.pnp.cjs +.pnp.loader.mjs diff --git a/packages/calckey-js/CHANGELOG.md b/packages/calckey-js/CHANGELOG.md new file mode 100644 index 0000000000..88a5c24610 --- /dev/null +++ b/packages/calckey-js/CHANGELOG.md @@ -0,0 +1,29 @@ +# 0.0.14 +- remove needless Object.freeze() + +# 0.0.13 +- expose ChannelConnection and Channels types + +# 0.0.12 +- fix a bug that cannot connect to streaming + +# 0.0.11 +- update user type +- add missing main stream types + +# 0.0.10 +- add consts + +# 0.0.9 +- add list of api permission +- Update Note type + +# 0.0.8 +- add type definition for `messagingMessage` event to main stream channel +- Update Note type + +# 0.0.7 +- Notificationsの型を修正 +- MessagingMessageの型を修正 +- UserLiteの型を修正 +- apiでネイティブfetchを格納する際に無名関数でラップするように diff --git a/packages/calckey-js/LICENSE b/packages/calckey-js/LICENSE new file mode 100644 index 0000000000..11c1f9ce22 --- /dev/null +++ b/packages/calckey-js/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021-2022 syuilo and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/calckey-js/README.md b/packages/calckey-js/README.md new file mode 100644 index 0000000000..b7a699285b --- /dev/null +++ b/packages/calckey-js/README.md @@ -0,0 +1,7 @@ +# Calckey.js + +Fork of Misskey.js for Calckey + +https://www.npmjs.com/package/calckey-js + +![Parody of the Javascript logo with "CK" instead of "JS"](https://codeberg.org/repo-avatars/80771-4d86135f67b9a460cdd1be9e91648e5f) \ No newline at end of file diff --git a/packages/calckey-js/api-extractor.json b/packages/calckey-js/api-extractor.json new file mode 100644 index 0000000000..a95281a6d5 --- /dev/null +++ b/packages/calckey-js/api-extractor.json @@ -0,0 +1,364 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/built/index.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we can specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + */ + "bundledPackages": [], + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + // "reportFileName": ".api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + // "reportFolder": "/etc/", + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/" + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": true + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": false + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning" + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + } + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "none" + // "addToApiReportFile": false + } + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } +} diff --git a/packages/calckey-js/codecov.yml b/packages/calckey-js/codecov.yml new file mode 100644 index 0000000000..5242987213 --- /dev/null +++ b/packages/calckey-js/codecov.yml @@ -0,0 +1,2 @@ +codecov: + token: d55e1270-f20a-4727-aa05-2bd57793315a diff --git a/packages/calckey-js/etc/calckey-js.api.md b/packages/calckey-js/etc/calckey-js.api.md new file mode 100644 index 0000000000..9e19852d4a --- /dev/null +++ b/packages/calckey-js/etc/calckey-js.api.md @@ -0,0 +1,2696 @@ +## API Report File for "calckey-js" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { EventEmitter } from 'eventemitter3'; + +// @public (undocumented) +export type Acct = { + username: string; + host: string | null; +}; + +// Warning: (ae-forgotten-export) The symbol "TODO" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +type Ad = TODO_2; + +// @public (undocumented) +type Announcement = { + id: ID; + createdAt: DateString; + updatedAt: DateString | null; + text: string; + title: string; + imageUrl: string | null; + isRead?: boolean; +}; + +// @public (undocumented) +type Antenna = { + id: ID; + createdAt: DateString; + name: string; + keywords: string[][]; + excludeKeywords: string[][]; + src: 'home' | 'all' | 'users' | 'list' | 'group'; + userListId: ID | null; + userGroupId: ID | null; + users: string[]; + caseSensitive: boolean; + notify: boolean; + withReplies: boolean; + withFile: boolean; + hasUnreadNote: boolean; +}; + +declare namespace api { + export { + isAPIError, + APIError, + FetchLike, + APIClient + } +} +export { api } + +// @public (undocumented) +class APIClient { + constructor(opts: { + origin: APIClient['origin']; + credential?: APIClient['credential']; + fetch?: APIClient['fetch'] | null | undefined; + }); + // (undocumented) + credential: string | null | undefined; + // (undocumented) + fetch: FetchLike; + // (undocumented) + origin: string; + // Warning: (ae-forgotten-export) The symbol "IsCaseMatched" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "GetCaseResult" needs to be exported by the entry point index.d.ts + // + // (undocumented) + request(endpoint: E, params?: P, credential?: string | null | undefined): Promise extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : Endpoints[E]['res']['$switch']['$default'] : Endpoints[E]['res']>; +} + +// @public (undocumented) +type APIError = { + id: string; + code: string; + message: string; + kind: 'client' | 'server'; + info: Record; +}; + +// @public (undocumented) +type App = TODO_2; + +// @public (undocumented) +type AuthSession = { + id: ID; + app: App; + token: string; +}; + +// @public (undocumented) +type Blocking = { + id: ID; + createdAt: DateString; + blockeeId: User['id']; + blockee: UserDetailed; +}; + +// @public (undocumented) +type Channel = { + id: ID; +}; + +// Warning: (ae-forgotten-export) The symbol "AnyOf" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export abstract class ChannelConnection = any> extends EventEmitter { + constructor(stream: Stream, channel: string, name?: string); + // (undocumented) + channel: string; + // (undocumented) + abstract dispose(): void; + // (undocumented) + abstract id: string; + // (undocumented) + inCount: number; + // (undocumented) + name?: string; + // (undocumented) + outCount: number; + // (undocumented) + send(type: T, body: Channel['receives'][T]): void; + // (undocumented) + protected stream: Stream; +} + +// @public (undocumented) +export type Channels = { + main: { + params: null; + events: { + notification: (payload: Notification_2) => void; + mention: (payload: Note) => void; + reply: (payload: Note) => void; + renote: (payload: Note) => void; + follow: (payload: User) => void; + followed: (payload: User) => void; + unfollow: (payload: User) => void; + meUpdated: (payload: MeDetailed) => void; + pageEvent: (payload: PageEvent) => void; + urlUploadFinished: (payload: { + marker: string; + file: DriveFile; + }) => void; + readAllNotifications: () => void; + unreadNotification: (payload: Notification_2) => void; + unreadMention: (payload: Note['id']) => void; + readAllUnreadMentions: () => void; + unreadSpecifiedNote: (payload: Note['id']) => void; + readAllUnreadSpecifiedNotes: () => void; + readAllMessagingMessages: () => void; + messagingMessage: (payload: MessagingMessage) => void; + unreadMessagingMessage: (payload: MessagingMessage) => void; + readAllAntennas: () => void; + unreadAntenna: (payload: Antenna) => void; + readAllAnnouncements: () => void; + readAllChannels: () => void; + unreadChannel: (payload: Note['id']) => void; + myTokenRegenerated: () => void; + reversiNoInvites: () => void; + reversiInvited: (payload: FIXME) => void; + signin: (payload: FIXME) => void; + registryUpdated: (payload: { + scope?: string[]; + key: string; + value: any | null; + }) => void; + driveFileCreated: (payload: DriveFile) => void; + readAntenna: (payload: Antenna) => void; + }; + receives: null; + }; + homeTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + localTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + hybridTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + recommendedTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + globalTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + messaging: { + params: { + otherparty?: User['id'] | null; + group?: UserGroup['id'] | null; + }; + events: { + message: (payload: MessagingMessage) => void; + deleted: (payload: MessagingMessage['id']) => void; + read: (payload: MessagingMessage['id'][]) => void; + typers: (payload: User[]) => void; + }; + receives: { + read: { + id: MessagingMessage['id']; + }; + }; + }; + serverStats: { + params: null; + events: { + stats: (payload: FIXME) => void; + }; + receives: { + requestLog: { + id: string | number; + length: number; + }; + }; + }; + queueStats: { + params: null; + events: { + stats: (payload: FIXME) => void; + }; + receives: { + requestLog: { + id: string | number; + length: number; + }; + }; + }; +}; + +// @public (undocumented) +type Clip = TODO_2; + +// @public (undocumented) +type CustomEmoji = { + id: string; + name: string; + url: string; + category: string; + aliases: string[]; +}; + +// @public (undocumented) +type DateString = string; + +// @public (undocumented) +type DetailedInstanceMetadata = LiteInstanceMetadata & { + features: Record; +}; + +// @public (undocumented) +type DriveFile = { + id: ID; + createdAt: DateString; + isSensitive: boolean; + name: string; + thumbnailUrl: string; + url: string; + type: string; + size: number; + md5: string; + blurhash: string; + comment: string | null; + properties: Record; +}; + +// @public (undocumented) +type DriveFolder = TODO_2; + +// @public (undocumented) +export type Endpoints = { + 'admin/abuse-user-reports': { + req: TODO; + res: TODO; + }; + 'admin/delete-all-files-of-a-user': { + req: { + userId: User['id']; + }; + res: null; + }; + 'admin/delete-logs': { + req: NoParams; + res: null; + }; + 'admin/get-index-stats': { + req: TODO; + res: TODO; + }; + 'admin/get-table-stats': { + req: TODO; + res: TODO; + }; + 'admin/invite': { + req: TODO; + res: TODO; + }; + 'admin/logs': { + req: TODO; + res: TODO; + }; + 'admin/reset-password': { + req: TODO; + res: TODO; + }; + 'admin/resolve-abuse-user-report': { + req: TODO; + res: TODO; + }; + 'admin/resync-chart': { + req: TODO; + res: TODO; + }; + 'admin/send-email': { + req: TODO; + res: TODO; + }; + 'admin/server-info': { + req: TODO; + res: TODO; + }; + 'admin/show-moderation-logs': { + req: TODO; + res: TODO; + }; + 'admin/show-user': { + req: TODO; + res: TODO; + }; + 'admin/show-users': { + req: TODO; + res: TODO; + }; + 'admin/silence-user': { + req: TODO; + res: TODO; + }; + 'admin/suspend-user': { + req: TODO; + res: TODO; + }; + 'admin/unsilence-user': { + req: TODO; + res: TODO; + }; + 'admin/unsuspend-user': { + req: TODO; + res: TODO; + }; + 'admin/update-meta': { + req: TODO; + res: TODO; + }; + 'admin/vacuum': { + req: TODO; + res: TODO; + }; + 'admin/accounts/create': { + req: TODO; + res: TODO; + }; + 'admin/ad/create': { + req: TODO; + res: TODO; + }; + 'admin/ad/delete': { + req: { + id: Ad['id']; + }; + res: null; + }; + 'admin/ad/list': { + req: TODO; + res: TODO; + }; + 'admin/ad/update': { + req: TODO; + res: TODO; + }; + 'admin/announcements/create': { + req: TODO; + res: TODO; + }; + 'admin/announcements/delete': { + req: { + id: Announcement['id']; + }; + res: null; + }; + 'admin/announcements/list': { + req: TODO; + res: TODO; + }; + 'admin/announcements/update': { + req: TODO; + res: TODO; + }; + 'admin/drive/clean-remote-files': { + req: TODO; + res: TODO; + }; + 'admin/drive/cleanup': { + req: TODO; + res: TODO; + }; + 'admin/drive/files': { + req: TODO; + res: TODO; + }; + 'admin/drive/show-file': { + req: TODO; + res: TODO; + }; + 'admin/emoji/add': { + req: TODO; + res: TODO; + }; + 'admin/emoji/copy': { + req: TODO; + res: TODO; + }; + 'admin/emoji/list-remote': { + req: TODO; + res: TODO; + }; + 'admin/emoji/list': { + req: TODO; + res: TODO; + }; + 'admin/emoji/remove': { + req: TODO; + res: TODO; + }; + 'admin/emoji/update': { + req: TODO; + res: TODO; + }; + 'admin/federation/delete-all-files': { + req: { + host: string; + }; + res: null; + }; + 'admin/federation/refresh-remote-instance-metadata': { + req: TODO; + res: TODO; + }; + 'admin/federation/remove-all-following': { + req: TODO; + res: TODO; + }; + 'admin/federation/update-instance': { + req: TODO; + res: TODO; + }; + 'admin/moderators/add': { + req: TODO; + res: TODO; + }; + 'admin/moderators/remove': { + req: TODO; + res: TODO; + }; + 'admin/promo/create': { + req: TODO; + res: TODO; + }; + 'admin/queue/clear': { + req: TODO; + res: TODO; + }; + 'admin/queue/deliver-delayed': { + req: TODO; + res: TODO; + }; + 'admin/queue/inbox-delayed': { + req: TODO; + res: TODO; + }; + 'admin/queue/jobs': { + req: TODO; + res: TODO; + }; + 'admin/queue/stats': { + req: TODO; + res: TODO; + }; + 'admin/relays/add': { + req: TODO; + res: TODO; + }; + 'admin/relays/list': { + req: TODO; + res: TODO; + }; + 'admin/relays/remove': { + req: TODO; + res: TODO; + }; + 'announcements': { + req: { + limit?: number; + withUnreads?: boolean; + sinceId?: Announcement['id']; + untilId?: Announcement['id']; + }; + res: Announcement[]; + }; + 'antennas/create': { + req: TODO; + res: Antenna; + }; + 'antennas/delete': { + req: { + antennaId: Antenna['id']; + }; + res: null; + }; + 'antennas/list': { + req: NoParams; + res: Antenna[]; + }; + 'antennas/notes': { + req: { + antennaId: Antenna['id']; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + }; + res: Note[]; + }; + 'antennas/show': { + req: { + antennaId: Antenna['id']; + }; + res: Antenna; + }; + 'antennas/update': { + req: TODO; + res: Antenna; + }; + 'ap/get': { + req: { + uri: string; + }; + res: Record; + }; + 'ap/show': { + req: { + uri: string; + }; + res: { + type: 'Note'; + object: Note; + } | { + type: 'User'; + object: UserDetailed; + }; + }; + 'app/create': { + req: TODO; + res: App; + }; + 'app/show': { + req: { + appId: App['id']; + }; + res: App; + }; + 'auth/accept': { + req: { + token: string; + }; + res: null; + }; + 'auth/session/generate': { + req: { + appSecret: string; + }; + res: { + token: string; + url: string; + }; + }; + 'auth/session/show': { + req: { + token: string; + }; + res: AuthSession; + }; + 'auth/session/userkey': { + req: { + appSecret: string; + token: string; + }; + res: { + accessToken: string; + user: User; + }; + }; + 'blocking/create': { + req: { + userId: User['id']; + }; + res: UserDetailed; + }; + 'blocking/delete': { + req: { + userId: User['id']; + }; + res: UserDetailed; + }; + 'blocking/list': { + req: { + limit?: number; + sinceId?: Blocking['id']; + untilId?: Blocking['id']; + }; + res: Blocking[]; + }; + 'channels/create': { + req: TODO; + res: TODO; + }; + 'channels/featured': { + req: TODO; + res: TODO; + }; + 'channels/follow': { + req: TODO; + res: TODO; + }; + 'channels/followed': { + req: TODO; + res: TODO; + }; + 'channels/owned': { + req: TODO; + res: TODO; + }; + 'channels/pin-note': { + req: TODO; + res: TODO; + }; + 'channels/show': { + req: TODO; + res: TODO; + }; + 'channels/timeline': { + req: TODO; + res: TODO; + }; + 'channels/unfollow': { + req: TODO; + res: TODO; + }; + 'channels/update': { + req: TODO; + res: TODO; + }; + 'charts/active-users': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + local: { + users: number[]; + }; + remote: { + users: number[]; + }; + }; + }; + 'charts/drive': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + local: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + remote: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + }; + }; + 'charts/federation': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + instance: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + 'charts/hashtag': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: TODO; + }; + 'charts/instance': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + host: string; + }; + res: { + drive: { + decFiles: number[]; + decUsage: number[]; + incFiles: number[]; + incUsage: number[]; + totalFiles: number[]; + totalUsage: number[]; + }; + followers: { + dec: number[]; + inc: number[]; + total: number[]; + }; + following: { + dec: number[]; + inc: number[]; + total: number[]; + }; + notes: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + requests: { + failed: number[]; + received: number[]; + succeeded: number[]; + }; + users: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + 'charts/network': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: TODO; + }; + 'charts/notes': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + local: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + remote: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + }; + }; + 'charts/user/drive': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + userId: User['id']; + }; + res: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + }; + 'charts/user/following': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + userId: User['id']; + }; + res: TODO; + }; + 'charts/user/notes': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + userId: User['id']; + }; + res: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + }; + 'charts/user/reactions': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + userId: User['id']; + }; + res: TODO; + }; + 'charts/users': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + local: { + dec: number[]; + inc: number[]; + total: number[]; + }; + remote: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + 'clips/add-note': { + req: TODO; + res: TODO; + }; + 'clips/create': { + req: TODO; + res: TODO; + }; + 'clips/delete': { + req: { + clipId: Clip['id']; + }; + res: null; + }; + 'clips/list': { + req: TODO; + res: TODO; + }; + 'clips/notes': { + req: TODO; + res: TODO; + }; + 'clips/show': { + req: TODO; + res: TODO; + }; + 'clips/update': { + req: TODO; + res: TODO; + }; + 'drive': { + req: NoParams; + res: { + capacity: number; + usage: number; + }; + }; + 'drive/files': { + req: { + folderId?: DriveFolder['id'] | null; + type?: DriveFile['type'] | null; + limit?: number; + sinceId?: DriveFile['id']; + untilId?: DriveFile['id']; + }; + res: DriveFile[]; + }; + 'drive/files/attached-notes': { + req: TODO; + res: TODO; + }; + 'drive/files/check-existence': { + req: TODO; + res: TODO; + }; + 'drive/files/create': { + req: TODO; + res: TODO; + }; + 'drive/files/delete': { + req: { + fileId: DriveFile['id']; + }; + res: null; + }; + 'drive/files/find-by-hash': { + req: TODO; + res: TODO; + }; + 'drive/files/find': { + req: { + name: string; + folderId?: DriveFolder['id'] | null; + }; + res: DriveFile[]; + }; + 'drive/files/show': { + req: { + fileId?: DriveFile['id']; + url?: string; + }; + res: DriveFile; + }; + 'drive/files/update': { + req: { + fileId: DriveFile['id']; + folderId?: DriveFolder['id'] | null; + name?: string; + isSensitive?: boolean; + comment?: string | null; + }; + res: DriveFile; + }; + 'drive/files/upload-from-url': { + req: { + url: string; + folderId?: DriveFolder['id'] | null; + isSensitive?: boolean; + comment?: string | null; + marker?: string | null; + force?: boolean; + }; + res: null; + }; + 'drive/folders': { + req: { + folderId?: DriveFolder['id'] | null; + limit?: number; + sinceId?: DriveFile['id']; + untilId?: DriveFile['id']; + }; + res: DriveFolder[]; + }; + 'drive/folders/create': { + req: { + name?: string; + parentId?: DriveFolder['id'] | null; + }; + res: DriveFolder; + }; + 'drive/folders/delete': { + req: { + folderId: DriveFolder['id']; + }; + res: null; + }; + 'drive/folders/find': { + req: { + name: string; + parentId?: DriveFolder['id'] | null; + }; + res: DriveFolder[]; + }; + 'drive/folders/show': { + req: { + folderId: DriveFolder['id']; + }; + res: DriveFolder; + }; + 'drive/folders/update': { + req: { + folderId: DriveFolder['id']; + name?: string; + parentId?: DriveFolder['id'] | null; + }; + res: DriveFolder; + }; + 'drive/stream': { + req: { + type?: DriveFile['type'] | null; + limit?: number; + sinceId?: DriveFile['id']; + untilId?: DriveFile['id']; + }; + res: DriveFile[]; + }; + 'endpoint': { + req: { + endpoint: string; + }; + res: { + params: { + name: string; + type: string; + }[]; + }; + }; + 'endpoints': { + req: NoParams; + res: string[]; + }; + 'federation/dns': { + req: { + host: string; + }; + res: { + a: string[]; + aaaa: string[]; + cname: string[]; + txt: string[]; + }; + }; + 'federation/followers': { + req: { + host: string; + limit?: number; + sinceId?: Following['id']; + untilId?: Following['id']; + }; + res: FollowingFolloweePopulated[]; + }; + 'federation/following': { + req: { + host: string; + limit?: number; + sinceId?: Following['id']; + untilId?: Following['id']; + }; + res: FollowingFolloweePopulated[]; + }; + 'federation/instances': { + req: { + host?: string | null; + blocked?: boolean | null; + notResponding?: boolean | null; + suspended?: boolean | null; + federating?: boolean | null; + subscribing?: boolean | null; + publishing?: boolean | null; + limit?: number; + offset?: number; + sort?: '+pubSub' | '-pubSub' | '+notes' | '-notes' | '+users' | '-users' | '+following' | '-following' | '+followers' | '-followers' | '+caughtAt' | '-caughtAt' | '+lastCommunicatedAt' | '-lastCommunicatedAt' | '+driveUsage' | '-driveUsage' | '+driveFiles' | '-driveFiles'; + }; + res: Instance[]; + }; + 'federation/show-instance': { + req: { + host: string; + }; + res: Instance; + }; + 'federation/update-remote-user': { + req: { + userId: User['id']; + }; + res: null; + }; + 'federation/users': { + req: { + host: string; + limit?: number; + sinceId?: User['id']; + untilId?: User['id']; + }; + res: UserDetailed[]; + }; + 'following/create': { + req: { + userId: User['id']; + }; + res: User; + }; + 'following/delete': { + req: { + userId: User['id']; + }; + res: User; + }; + 'following/requests/accept': { + req: { + userId: User['id']; + }; + res: null; + }; + 'following/requests/cancel': { + req: { + userId: User['id']; + }; + res: User; + }; + 'following/requests/list': { + req: NoParams; + res: FollowRequest[]; + }; + 'following/requests/reject': { + req: { + userId: User['id']; + }; + res: null; + }; + 'gallery/featured': { + req: TODO; + res: TODO; + }; + 'gallery/popular': { + req: TODO; + res: TODO; + }; + 'gallery/posts': { + req: TODO; + res: TODO; + }; + 'gallery/posts/create': { + req: TODO; + res: TODO; + }; + 'gallery/posts/delete': { + req: { + postId: GalleryPost['id']; + }; + res: null; + }; + 'gallery/posts/like': { + req: TODO; + res: TODO; + }; + 'gallery/posts/show': { + req: TODO; + res: TODO; + }; + 'gallery/posts/unlike': { + req: TODO; + res: TODO; + }; + 'gallery/posts/update': { + req: TODO; + res: TODO; + }; + 'games/reversi/games': { + req: TODO; + res: TODO; + }; + 'games/reversi/games/show': { + req: TODO; + res: TODO; + }; + 'games/reversi/games/surrender': { + req: TODO; + res: TODO; + }; + 'games/reversi/invitations': { + req: TODO; + res: TODO; + }; + 'games/reversi/match': { + req: TODO; + res: TODO; + }; + 'games/reversi/match/cancel': { + req: TODO; + res: TODO; + }; + 'get-online-users-count': { + req: NoParams; + res: { + count: number; + }; + }; + 'hashtags/list': { + req: TODO; + res: TODO; + }; + 'hashtags/search': { + req: TODO; + res: TODO; + }; + 'hashtags/show': { + req: TODO; + res: TODO; + }; + 'hashtags/trend': { + req: TODO; + res: TODO; + }; + 'hashtags/users': { + req: TODO; + res: TODO; + }; + 'i': { + req: NoParams; + res: User; + }; + 'i/apps': { + req: TODO; + res: TODO; + }; + 'i/authorized-apps': { + req: TODO; + res: TODO; + }; + 'i/change-password': { + req: TODO; + res: TODO; + }; + 'i/delete-account': { + req: { + password: string; + }; + res: null; + }; + 'i/export-blocking': { + req: TODO; + res: TODO; + }; + 'i/export-following': { + req: TODO; + res: TODO; + }; + 'i/export-mute': { + req: TODO; + res: TODO; + }; + 'i/export-notes': { + req: TODO; + res: TODO; + }; + 'i/export-user-lists': { + req: TODO; + res: TODO; + }; + 'i/favorites': { + req: { + limit?: number; + sinceId?: NoteFavorite['id']; + untilId?: NoteFavorite['id']; + }; + res: NoteFavorite[]; + }; + 'i/gallery/likes': { + req: TODO; + res: TODO; + }; + 'i/gallery/posts': { + req: TODO; + res: TODO; + }; + 'i/get-word-muted-notes-count': { + req: TODO; + res: TODO; + }; + 'i/import-following': { + req: TODO; + res: TODO; + }; + 'i/import-user-lists': { + req: TODO; + res: TODO; + }; + 'i/move': { + req: TODO; + res: TODO; + }; + 'i/known-as': { + req: TODO; + res: TODO; + }; + 'i/notifications': { + req: { + limit?: number; + sinceId?: Notification_2['id']; + untilId?: Notification_2['id']; + following?: boolean; + markAsRead?: boolean; + includeTypes?: Notification_2['type'][]; + excludeTypes?: Notification_2['type'][]; + }; + res: Notification_2[]; + }; + 'i/page-likes': { + req: TODO; + res: TODO; + }; + 'i/pages': { + req: TODO; + res: TODO; + }; + 'i/pin': { + req: { + noteId: Note['id']; + }; + res: MeDetailed; + }; + 'i/read-all-messaging-messages': { + req: TODO; + res: TODO; + }; + 'i/read-all-unread-notes': { + req: TODO; + res: TODO; + }; + 'i/read-announcement': { + req: TODO; + res: TODO; + }; + 'i/regenerate-token': { + req: { + password: string; + }; + res: null; + }; + 'i/registry/get-all': { + req: { + scope?: string[]; + }; + res: Record; + }; + 'i/registry/get-detail': { + req: { + key: string; + scope?: string[]; + }; + res: { + updatedAt: DateString; + value: any; + }; + }; + 'i/registry/get': { + req: { + key: string; + scope?: string[]; + }; + res: any; + }; + 'i/registry/keys-with-type': { + req: { + scope?: string[]; + }; + res: Record; + }; + 'i/registry/keys': { + req: { + scope?: string[]; + }; + res: string[]; + }; + 'i/registry/remove': { + req: { + key: string; + scope?: string[]; + }; + res: null; + }; + 'i/registry/scopes': { + req: NoParams; + res: string[][]; + }; + 'i/registry/set': { + req: { + key: string; + value: any; + scope?: string[]; + }; + res: null; + }; + 'i/revoke-token': { + req: TODO; + res: TODO; + }; + 'i/signin-history': { + req: { + limit?: number; + sinceId?: Signin['id']; + untilId?: Signin['id']; + }; + res: Signin[]; + }; + 'i/unpin': { + req: { + noteId: Note['id']; + }; + res: MeDetailed; + }; + 'i/update-email': { + req: { + password: string; + email?: string | null; + }; + res: MeDetailed; + }; + 'i/update': { + req: { + name?: string | null; + description?: string | null; + lang?: string | null; + location?: string | null; + birthday?: string | null; + avatarId?: DriveFile['id'] | null; + bannerId?: DriveFile['id'] | null; + fields?: { + name: string; + value: string; + }[]; + isLocked?: boolean; + isExplorable?: boolean; + hideOnlineStatus?: boolean; + carefulBot?: boolean; + autoAcceptFollowed?: boolean; + noCrawle?: boolean; + isBot?: boolean; + isCat?: boolean; + injectFeaturedNote?: boolean; + receiveAnnouncementEmail?: boolean; + alwaysMarkNsfw?: boolean; + mutedWords?: string[][]; + mutingNotificationTypes?: Notification_2['type'][]; + emailNotificationTypes?: string[]; + }; + res: MeDetailed; + }; + 'i/user-group-invites': { + req: TODO; + res: TODO; + }; + 'i/2fa/done': { + req: TODO; + res: TODO; + }; + 'i/2fa/key-done': { + req: TODO; + res: TODO; + }; + 'i/2fa/password-less': { + req: TODO; + res: TODO; + }; + 'i/2fa/register-key': { + req: TODO; + res: TODO; + }; + 'i/2fa/register': { + req: TODO; + res: TODO; + }; + 'i/2fa/remove-key': { + req: TODO; + res: TODO; + }; + 'i/2fa/unregister': { + req: TODO; + res: TODO; + }; + 'messaging/history': { + req: { + limit?: number; + group?: boolean; + }; + res: MessagingMessage[]; + }; + 'messaging/messages': { + req: { + userId?: User['id']; + groupId?: UserGroup['id']; + limit?: number; + sinceId?: MessagingMessage['id']; + untilId?: MessagingMessage['id']; + markAsRead?: boolean; + }; + res: MessagingMessage[]; + }; + 'messaging/messages/create': { + req: { + userId?: User['id']; + groupId?: UserGroup['id']; + text?: string; + fileId?: DriveFile['id']; + }; + res: MessagingMessage; + }; + 'messaging/messages/delete': { + req: { + messageId: MessagingMessage['id']; + }; + res: null; + }; + 'messaging/messages/read': { + req: { + messageId: MessagingMessage['id']; + }; + res: null; + }; + 'meta': { + req: { + detail?: boolean; + }; + res: { + $switch: { + $cases: [ + [ + { + detail: true; + }, + DetailedInstanceMetadata + ], + [ + { + detail: false; + }, + LiteInstanceMetadata + ], + [ + { + detail: boolean; + }, + LiteInstanceMetadata | DetailedInstanceMetadata + ] + ]; + $default: LiteInstanceMetadata; + }; + }; + }; + 'miauth/gen-token': { + req: TODO; + res: TODO; + }; + 'mute/create': { + req: TODO; + res: TODO; + }; + 'mute/delete': { + req: { + userId: User['id']; + }; + res: null; + }; + 'mute/list': { + req: TODO; + res: TODO; + }; + 'my/apps': { + req: TODO; + res: TODO; + }; + 'notes': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + }; + res: Note[]; + }; + 'notes/children': { + req: { + noteId: Note['id']; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + }; + res: Note[]; + }; + 'notes/clips': { + req: TODO; + res: TODO; + }; + 'notes/conversation': { + req: TODO; + res: TODO; + }; + 'notes/create': { + req: { + visibility?: 'public' | 'home' | 'followers' | 'specified'; + visibleUserIds?: User['id'][]; + text?: null | string; + cw?: null | string; + viaMobile?: boolean; + localOnly?: boolean; + fileIds?: DriveFile['id'][]; + replyId?: null | Note['id']; + renoteId?: null | Note['id']; + channelId?: null | Channel['id']; + poll?: null | { + choices: string[]; + multiple?: boolean; + expiresAt?: null | number; + expiredAfter?: null | number; + }; + }; + res: { + createdNote: Note; + }; + }; + 'notes/delete': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/favorites/create': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/favorites/delete': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/featured': { + req: TODO; + res: Note[]; + }; + 'notes/global-timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/recommended-timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/hybrid-timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/local-timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/mentions': { + req: { + following?: boolean; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + }; + res: Note[]; + }; + 'notes/polls/recommendation': { + req: TODO; + res: TODO; + }; + 'notes/polls/vote': { + req: { + noteId: Note['id']; + choice: number; + }; + res: null; + }; + 'notes/reactions': { + req: { + noteId: Note['id']; + type?: string | null; + limit?: number; + }; + res: NoteReaction[]; + }; + 'notes/reactions/create': { + req: { + noteId: Note['id']; + reaction: string; + }; + res: null; + }; + 'notes/reactions/delete': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/renotes': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + noteId: Note['id']; + }; + res: Note[]; + }; + 'notes/replies': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + noteId: Note['id']; + }; + res: Note[]; + }; + 'notes/search-by-tag': { + req: TODO; + res: TODO; + }; + 'notes/search': { + req: TODO; + res: TODO; + }; + 'notes/show': { + req: { + noteId: Note['id']; + }; + res: Note; + }; + 'notes/state': { + req: TODO; + res: TODO; + }; + 'notes/timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/unrenote': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/user-list-timeline': { + req: { + listId: UserList['id']; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/watching/create': { + req: TODO; + res: TODO; + }; + 'notes/watching/delete': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notifications/create': { + req: { + body: string; + header?: string | null; + icon?: string | null; + }; + res: null; + }; + 'notifications/mark-all-as-read': { + req: NoParams; + res: null; + }; + 'notifications/read': { + req: { + notificationId: Notification_2['id']; + }; + res: null; + }; + 'page-push': { + req: { + pageId: Page['id']; + event: string; + var?: any; + }; + res: null; + }; + 'pages/create': { + req: TODO; + res: Page; + }; + 'pages/delete': { + req: { + pageId: Page['id']; + }; + res: null; + }; + 'pages/featured': { + req: NoParams; + res: Page[]; + }; + 'pages/like': { + req: { + pageId: Page['id']; + }; + res: null; + }; + 'pages/show': { + req: { + pageId?: Page['id']; + name?: string; + username?: string; + }; + res: Page; + }; + 'pages/unlike': { + req: { + pageId: Page['id']; + }; + res: null; + }; + 'pages/update': { + req: TODO; + res: null; + }; + 'ping': { + req: NoParams; + res: { + pong: number; + }; + }; + 'pinned-users': { + req: TODO; + res: TODO; + }; + 'promo/read': { + req: TODO; + res: TODO; + }; + 'request-reset-password': { + req: { + username: string; + email: string; + }; + res: null; + }; + 'reset-password': { + req: { + token: string; + password: string; + }; + res: null; + }; + 'room/show': { + req: TODO; + res: TODO; + }; + 'room/update': { + req: TODO; + res: TODO; + }; + 'stats': { + req: NoParams; + res: Stats; + }; + 'server-info': { + req: NoParams; + res: ServerInfo; + }; + 'latest-version': { + req: NoParams; + res: TODO; + }; + 'sw/register': { + req: TODO; + res: TODO; + }; + 'username/available': { + req: { + username: string; + }; + res: { + available: boolean; + }; + }; + 'users': { + req: { + limit?: number; + offset?: number; + sort?: UserSorting; + origin?: OriginType; + }; + res: User[]; + }; + 'users/clips': { + req: TODO; + res: TODO; + }; + 'users/followers': { + req: { + userId?: User['id']; + username?: User['username']; + host?: User['host'] | null; + limit?: number; + sinceId?: Following['id']; + untilId?: Following['id']; + }; + res: FollowingFollowerPopulated[]; + }; + 'users/following': { + req: { + userId?: User['id']; + username?: User['username']; + host?: User['host'] | null; + limit?: number; + sinceId?: Following['id']; + untilId?: Following['id']; + }; + res: FollowingFolloweePopulated[]; + }; + 'users/gallery/posts': { + req: TODO; + res: TODO; + }; + 'users/get-frequently-replied-users': { + req: TODO; + res: TODO; + }; + 'users/groups/create': { + req: TODO; + res: TODO; + }; + 'users/groups/delete': { + req: { + groupId: UserGroup['id']; + }; + res: null; + }; + 'users/groups/invitations/accept': { + req: TODO; + res: TODO; + }; + 'users/groups/invitations/reject': { + req: TODO; + res: TODO; + }; + 'users/groups/invite': { + req: TODO; + res: TODO; + }; + 'users/groups/joined': { + req: TODO; + res: TODO; + }; + 'users/groups/owned': { + req: TODO; + res: TODO; + }; + 'users/groups/pull': { + req: TODO; + res: TODO; + }; + 'users/groups/show': { + req: TODO; + res: TODO; + }; + 'users/groups/transfer': { + req: TODO; + res: TODO; + }; + 'users/groups/update': { + req: TODO; + res: TODO; + }; + 'users/lists/create': { + req: { + name: string; + }; + res: UserList; + }; + 'users/lists/delete': { + req: { + listId: UserList['id']; + }; + res: null; + }; + 'users/lists/list': { + req: NoParams; + res: UserList[]; + }; + 'users/lists/pull': { + req: { + listId: UserList['id']; + userId: User['id']; + }; + res: null; + }; + 'users/lists/push': { + req: { + listId: UserList['id']; + userId: User['id']; + }; + res: null; + }; + 'users/lists/show': { + req: { + listId: UserList['id']; + }; + res: UserList; + }; + 'users/lists/update': { + req: { + listId: UserList['id']; + name: string; + }; + res: UserList; + }; + 'users/notes': { + req: { + userId: User['id']; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'users/pages': { + req: TODO; + res: TODO; + }; + 'users/recommendation': { + req: TODO; + res: TODO; + }; + 'users/relation': { + req: TODO; + res: TODO; + }; + 'users/report-abuse': { + req: TODO; + res: TODO; + }; + 'users/search-by-username-and-host': { + req: TODO; + res: TODO; + }; + 'users/search': { + req: TODO; + res: TODO; + }; + 'users/show': { + req: ShowUserReq | { + userIds: User['id'][]; + }; + res: { + $switch: { + $cases: [ + [ + { + userIds: User['id'][]; + }, + UserDetailed[] + ] + ]; + $default: UserDetailed; + }; + }; + }; + 'users/stats': { + req: TODO; + res: TODO; + }; +}; + +declare namespace entities { + export { + ID, + DateString, + User, + UserLite, + UserDetailed, + UserGroup, + UserList, + MeDetailed, + DriveFile, + DriveFolder, + GalleryPost, + Note, + NoteReaction, + Notification_2 as Notification, + MessagingMessage, + CustomEmoji, + LiteInstanceMetadata, + DetailedInstanceMetadata, + InstanceMetadata, + ServerInfo, + Stats, + Page, + PageEvent, + Announcement, + Antenna, + App, + AuthSession, + Ad, + Clip, + NoteFavorite, + FollowRequest, + Channel, + Following, + FollowingFolloweePopulated, + FollowingFollowerPopulated, + Blocking, + Instance, + Signin, + UserSorting, + OriginType + } +} +export { entities } + +// @public (undocumented) +type FetchLike = (input: string, init?: { + method?: string; + body?: string; + credentials?: RequestCredentials; + cache?: RequestCache; +}) => Promise<{ + status: number; + json(): Promise; +}>; + +// @public (undocumented) +export const ffVisibility: readonly ["public", "followers", "private"]; + +// @public (undocumented) +type Following = { + id: ID; + createdAt: DateString; + followerId: User['id']; + followeeId: User['id']; +}; + +// @public (undocumented) +type FollowingFolloweePopulated = Following & { + followee: UserDetailed; +}; + +// @public (undocumented) +type FollowingFollowerPopulated = Following & { + follower: UserDetailed; +}; + +// @public (undocumented) +type FollowRequest = { + id: ID; + follower: User; + followee: User; +}; + +// @public (undocumented) +type GalleryPost = TODO_2; + +// @public (undocumented) +type ID = string; + +// @public (undocumented) +type Instance = { + id: ID; + caughtAt: DateString; + host: string; + usersCount: number; + notesCount: number; + followingCount: number; + followersCount: number; + driveUsage: number; + driveFiles: number; + latestRequestSentAt: DateString | null; + latestStatus: number | null; + latestRequestReceivedAt: DateString | null; + lastCommunicatedAt: DateString; + isNotResponding: boolean; + isSuspended: boolean; + softwareName: string | null; + softwareVersion: string | null; + openRegistrations: boolean | null; + name: string | null; + description: string | null; + maintainerName: string | null; + maintainerEmail: string | null; + iconUrl: string | null; + faviconUrl: string | null; + themeColor: string | null; + infoUpdatedAt: DateString | null; +}; + +// @public (undocumented) +type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata; + +// @public (undocumented) +function isAPIError(reason: any): reason is APIError; + +// @public (undocumented) +type LiteInstanceMetadata = { + maintainerName: string | null; + maintainerEmail: string | null; + version: string; + name: string | null; + uri: string; + description: string | null; + tosUrl: string | null; + disableRegistration: boolean; + disableLocalTimeline: boolean; + disableRecommendedTimeline: boolean; + disableGlobalTimeline: boolean; + driveCapacityPerLocalUserMb: number; + driveCapacityPerRemoteUserMb: number; + enableHcaptcha: boolean; + hcaptchaSiteKey: string | null; + enableRecaptcha: boolean; + recaptchaSiteKey: string | null; + swPublickey: string | null; + maxNoteTextLength: number; + enableEmail: boolean; + enableTwitterIntegration: boolean; + enableGithubIntegration: boolean; + enableDiscordIntegration: boolean; + enableServiceWorker: boolean; + emojis: CustomEmoji[]; + ads: { + id: ID; + ratio: number; + place: string; + url: string; + imageUrl: string; + }[]; +}; + +// @public (undocumented) +type MeDetailed = UserDetailed & { + avatarId: DriveFile['id']; + bannerId: DriveFile['id']; + autoAcceptFollowed: boolean; + alwaysMarkNsfw: boolean; + carefulBot: boolean; + emailNotificationTypes: string[]; + hasPendingReceivedFollowRequest: boolean; + hasUnreadAnnouncement: boolean; + hasUnreadAntenna: boolean; + hasUnreadChannel: boolean; + hasUnreadMentions: boolean; + hasUnreadMessagingMessage: boolean; + hasUnreadNotification: boolean; + hasUnreadSpecifiedNotes: boolean; + hideOnlineStatus: boolean; + injectFeaturedNote: boolean; + integrations: Record; + isDeleted: boolean; + isExplorable: boolean; + mutedWords: string[][]; + mutingNotificationTypes: string[]; + noCrawle: boolean; + receiveAnnouncementEmail: boolean; + usePasswordLessLogin: boolean; + [other: string]: any; +}; + +// @public (undocumented) +type MessagingMessage = { + id: ID; + createdAt: DateString; + file: DriveFile | null; + fileId: DriveFile['id'] | null; + isRead: boolean; + reads: User['id'][]; + text: string | null; + user: User; + userId: User['id']; + recipient?: User | null; + recipientId: User['id'] | null; + group?: UserGroup | null; + groupId: UserGroup['id'] | null; +}; + +// @public (undocumented) +export const mutedNoteReasons: readonly ["word", "manual", "spam", "other"]; + +// @public (undocumented) +type Note = { + id: ID; + createdAt: DateString; + text: string | null; + cw: string | null; + user: User; + userId: User['id']; + reply?: Note; + replyId: Note['id']; + renote?: Note; + renoteId: Note['id']; + files: DriveFile[]; + fileIds: DriveFile['id'][]; + visibility: 'public' | 'home' | 'followers' | 'specified'; + visibleUserIds?: User['id'][]; + localOnly?: boolean; + myReaction?: string; + reactions: Record; + renoteCount: number; + repliesCount: number; + poll?: { + expiresAt: DateString | null; + multiple: boolean; + choices: { + isVoted: boolean; + text: string; + votes: number; + }[]; + }; + emojis: { + name: string; + url: string; + }[]; + uri?: string; + url?: string; + isHidden?: boolean; +}; + +// @public (undocumented) +type NoteFavorite = { + id: ID; + createdAt: DateString; + noteId: Note['id']; + note: Note; +}; + +// @public (undocumented) +type NoteReaction = { + id: ID; + createdAt: DateString; + user: UserLite; + type: string; +}; + +// @public (undocumented) +export const noteVisibilities: readonly ["public", "home", "followers", "specified"]; + +// @public (undocumented) +type Notification_2 = { + id: ID; + createdAt: DateString; + isRead: boolean; +} & ({ + type: 'reaction'; + reaction: string; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'reply'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'renote'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'quote'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'mention'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'pollVote'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'follow'; + user: User; + userId: User['id']; +} | { + type: 'followRequestAccepted'; + user: User; + userId: User['id']; +} | { + type: 'receiveFollowRequest'; + user: User; + userId: User['id']; +} | { + type: 'groupInvited'; + invitation: UserGroup; + user: User; + userId: User['id']; +} | { + type: 'app'; + header?: string | null; + body: string; + icon?: string | null; +}); + +// @public (undocumented) +export const notificationTypes: readonly ["follow", "mention", "reply", "renote", "quote", "reaction", "pollVote", "pollEnded", "receiveFollowRequest", "followRequestAccepted", "groupInvited", "app"]; + +// @public (undocumented) +type OriginType = 'combined' | 'local' | 'remote'; + +// @public (undocumented) +type Page = { + id: ID; + createdAt: DateString; + updatedAt: DateString; + userId: User['id']; + user: User; + content: Record[]; + variables: Record[]; + title: string; + name: string; + summary: string | null; + hideTitleWhenPinned: boolean; + alignCenter: boolean; + font: string; + script: string; + eyeCatchingImageId: DriveFile['id'] | null; + eyeCatchingImage: DriveFile | null; + attachedFiles: any; + likedCount: number; + isLiked?: boolean; +}; + +// @public (undocumented) +type PageEvent = { + pageId: Page['id']; + event: string; + var: any; + userId: User['id']; + user: User; +}; + +// @public (undocumented) +export const permissions: string[]; + +// @public (undocumented) +type ServerInfo = { + machine: string; + cpu: { + model: string; + cores: number; + }; + mem: { + total: number; + }; + fs: { + total: number; + used: number; + }; +}; + +// @public (undocumented) +type Signin = { + id: ID; + createdAt: DateString; + ip: string; + headers: Record; + success: boolean; +}; + +// @public (undocumented) +type Stats = { + notesCount: number; + originalNotesCount: number; + usersCount: number; + originalUsersCount: number; + instances: number; + driveUsageLocal: number; + driveUsageRemote: number; +}; + +// Warning: (ae-forgotten-export) The symbol "StreamEvents" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class Stream extends EventEmitter { + constructor(origin: string, user: { + token: string; + } | null, options?: { + WebSocket?: any; + }); + // (undocumented) + close(): void; + // Warning: (ae-forgotten-export) The symbol "NonSharedConnection" needs to be exported by the entry point index.d.ts + // + // (undocumented) + disconnectToChannel(connection: NonSharedConnection): void; + // Warning: (ae-forgotten-export) The symbol "SharedConnection" needs to be exported by the entry point index.d.ts + // + // (undocumented) + removeSharedConnection(connection: SharedConnection): void; + // Warning: (ae-forgotten-export) The symbol "Pool" needs to be exported by the entry point index.d.ts + // + // (undocumented) + removeSharedConnectionPool(pool: Pool): void; + // (undocumented) + send(typeOrPayload: any, payload?: any): void; + // (undocumented) + state: 'initializing' | 'reconnecting' | 'connected'; + // (undocumented) + useChannel(channel: C, params?: Channels[C]['params'], name?: string): ChannelConnection; +} + +// @public (undocumented) +type User = UserLite | UserDetailed; + +// @public (undocumented) +type UserDetailed = UserLite & { + bannerBlurhash: string | null; + bannerColor: string | null; + bannerUrl: string | null; + birthday: string | null; + createdAt: DateString; + description: string | null; + ffVisibility: 'public' | 'followers' | 'private'; + fields: { + name: string; + value: string; + }[]; + followersCount: number; + followingCount: number; + hasPendingFollowRequestFromYou: boolean; + hasPendingFollowRequestToYou: boolean; + isAdmin: boolean; + isBlocked: boolean; + isBlocking: boolean; + isBot: boolean; + isCat: boolean; + isFollowed: boolean; + isFollowing: boolean; + isLocked: boolean; + isModerator: boolean; + isMuted: boolean; + isSilenced: boolean; + isSuspended: boolean; + lang: string | null; + lastFetchedAt?: DateString; + location: string | null; + notesCount: number; + pinnedNoteIds: ID[]; + pinnedNotes: Note[]; + pinnedPage: Page | null; + pinnedPageId: string | null; + publicReactions: boolean; + securityKeys: boolean; + twoFactorEnabled: boolean; + updatedAt: DateString | null; + uri: string | null; + url: string | null; +}; + +// @public (undocumented) +type UserGroup = TODO_2; + +// @public (undocumented) +type UserList = { + id: ID; + createdAt: DateString; + name: string; + userIds: User['id'][]; +}; + +// @public (undocumented) +type UserLite = { + id: ID; + username: string; + host: string | null; + name: string; + onlineStatus: 'online' | 'active' | 'offline' | 'unknown'; + avatarUrl: string; + avatarBlurhash: string; + alsoKnownAs: string[]; + movedToUri: any; + emojis: { + name: string; + url: string; + }[]; + instance?: { + name: Instance['name']; + softwareName: Instance['softwareName']; + softwareVersion: Instance['softwareVersion']; + iconUrl: Instance['iconUrl']; + faviconUrl: Instance['faviconUrl']; + themeColor: Instance['themeColor']; + }; +}; + +// @public (undocumented) +type UserSorting = '+follower' | '-follower' | '+createdAt' | '-createdAt' | '+updatedAt' | '-updatedAt'; + +// Warnings were encountered during analysis: +// +// src/api.types.ts:16:32 - (ae-forgotten-export) The symbol "TODO" needs to be exported by the entry point index.d.ts +// src/api.types.ts:18:25 - (ae-forgotten-export) The symbol "NoParams" needs to be exported by the entry point index.d.ts +// src/api.types.ts:601:18 - (ae-forgotten-export) The symbol "ShowUserReq" needs to be exported by the entry point index.d.ts +// src/streaming.types.ts:35:4 - (ae-forgotten-export) The symbol "FIXME" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/calckey-js/etc/misskey-js.api.md b/packages/calckey-js/etc/misskey-js.api.md new file mode 100644 index 0000000000..269d5cf101 --- /dev/null +++ b/packages/calckey-js/etc/misskey-js.api.md @@ -0,0 +1,2681 @@ +## API Report File for "misskey-js" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { EventEmitter } from 'eventemitter3'; + +// @public (undocumented) +export type Acct = { + username: string; + host: string | null; +}; + +// Warning: (ae-forgotten-export) The symbol "TODO" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +type Ad = TODO_2; + +// @public (undocumented) +type Announcement = { + id: ID; + createdAt: DateString; + updatedAt: DateString | null; + text: string; + title: string; + imageUrl: string | null; + isRead?: boolean; +}; + +// @public (undocumented) +type Antenna = { + id: ID; + createdAt: DateString; + name: string; + keywords: string[][]; + excludeKeywords: string[][]; + src: 'home' | 'all' | 'users' | 'list' | 'group'; + userListId: ID | null; + userGroupId: ID | null; + users: string[]; + caseSensitive: boolean; + notify: boolean; + withReplies: boolean; + withFile: boolean; + hasUnreadNote: boolean; +}; + +declare namespace api { + export { + isAPIError, + APIError, + FetchLike, + APIClient + } +} +export { api } + +// @public (undocumented) +class APIClient { + constructor(opts: { + origin: APIClient['origin']; + credential?: APIClient['credential']; + fetch?: APIClient['fetch'] | null | undefined; + }); + // (undocumented) + credential: string | null | undefined; + // (undocumented) + fetch: FetchLike; + // (undocumented) + origin: string; + // Warning: (ae-forgotten-export) The symbol "IsCaseMatched" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "GetCaseResult" needs to be exported by the entry point index.d.ts + // + // (undocumented) + request(endpoint: E, params?: P, credential?: string | null | undefined): Promise extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : Endpoints[E]['res']['$switch']['$default'] : Endpoints[E]['res']>; +} + +// @public (undocumented) +type APIError = { + id: string; + code: string; + message: string; + kind: 'client' | 'server'; + info: Record; +}; + +// @public (undocumented) +type App = TODO_2; + +// @public (undocumented) +type AuthSession = { + id: ID; + app: App; + token: string; +}; + +// @public (undocumented) +type Blocking = { + id: ID; + createdAt: DateString; + blockeeId: User['id']; + blockee: UserDetailed; +}; + +// @public (undocumented) +type Channel = { + id: ID; +}; + +// Warning: (ae-forgotten-export) The symbol "AnyOf" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export abstract class ChannelConnection = any> extends EventEmitter { + constructor(stream: Stream, channel: string, name?: string); + // (undocumented) + channel: string; + // (undocumented) + abstract dispose(): void; + // (undocumented) + abstract id: string; + // (undocumented) + inCount: number; + // (undocumented) + name?: string; + // (undocumented) + outCount: number; + // (undocumented) + send(type: T, body: Channel['receives'][T]): void; + // (undocumented) + protected stream: Stream; +} + +// @public (undocumented) +export type Channels = { + main: { + params: null; + events: { + notification: (payload: Notification_2) => void; + mention: (payload: Note) => void; + reply: (payload: Note) => void; + renote: (payload: Note) => void; + follow: (payload: User) => void; + followed: (payload: User) => void; + unfollow: (payload: User) => void; + meUpdated: (payload: MeDetailed) => void; + pageEvent: (payload: PageEvent) => void; + urlUploadFinished: (payload: { + marker: string; + file: DriveFile; + }) => void; + readAllNotifications: () => void; + unreadNotification: (payload: Notification_2) => void; + unreadMention: (payload: Note['id']) => void; + readAllUnreadMentions: () => void; + unreadSpecifiedNote: (payload: Note['id']) => void; + readAllUnreadSpecifiedNotes: () => void; + readAllMessagingMessages: () => void; + messagingMessage: (payload: MessagingMessage) => void; + unreadMessagingMessage: (payload: MessagingMessage) => void; + readAllAntennas: () => void; + unreadAntenna: (payload: Antenna) => void; + readAllAnnouncements: () => void; + readAllChannels: () => void; + unreadChannel: (payload: Note['id']) => void; + myTokenRegenerated: () => void; + reversiNoInvites: () => void; + reversiInvited: (payload: FIXME) => void; + signin: (payload: FIXME) => void; + registryUpdated: (payload: { + scope?: string[]; + key: string; + value: any | null; + }) => void; + driveFileCreated: (payload: DriveFile) => void; + readAntenna: (payload: Antenna) => void; + }; + receives: null; + }; + homeTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + localTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + hybridTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + recommendedTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + globalTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + messaging: { + params: { + otherparty?: User['id'] | null; + group?: UserGroup['id'] | null; + }; + events: { + message: (payload: MessagingMessage) => void; + deleted: (payload: MessagingMessage['id']) => void; + read: (payload: MessagingMessage['id'][]) => void; + typers: (payload: User[]) => void; + }; + receives: { + read: { + id: MessagingMessage['id']; + }; + }; + }; + serverStats: { + params: null; + events: { + stats: (payload: FIXME) => void; + }; + receives: { + requestLog: { + id: string | number; + length: number; + }; + }; + }; + queueStats: { + params: null; + events: { + stats: (payload: FIXME) => void; + }; + receives: { + requestLog: { + id: string | number; + length: number; + }; + }; + }; +}; + +// @public (undocumented) +type Clip = TODO_2; + +// @public (undocumented) +type CustomEmoji = { + id: string; + name: string; + url: string; + category: string; + aliases: string[]; +}; + +// @public (undocumented) +type DateString = string; + +// @public (undocumented) +type DetailedInstanceMetadata = LiteInstanceMetadata & { + features: Record; +}; + +// @public (undocumented) +type DriveFile = { + id: ID; + createdAt: DateString; + isSensitive: boolean; + name: string; + thumbnailUrl: string; + url: string; + type: string; + size: number; + md5: string; + blurhash: string; + properties: Record; +}; + +// @public (undocumented) +type DriveFolder = TODO_2; + +// @public (undocumented) +export type Endpoints = { + 'admin/abuse-user-reports': { + req: TODO; + res: TODO; + }; + 'admin/delete-all-files-of-a-user': { + req: { + userId: User['id']; + }; + res: null; + }; + 'admin/delete-logs': { + req: NoParams; + res: null; + }; + 'admin/get-index-stats': { + req: TODO; + res: TODO; + }; + 'admin/get-table-stats': { + req: TODO; + res: TODO; + }; + 'admin/invite': { + req: TODO; + res: TODO; + }; + 'admin/logs': { + req: TODO; + res: TODO; + }; + 'admin/reset-password': { + req: TODO; + res: TODO; + }; + 'admin/resolve-abuse-user-report': { + req: TODO; + res: TODO; + }; + 'admin/resync-chart': { + req: TODO; + res: TODO; + }; + 'admin/send-email': { + req: TODO; + res: TODO; + }; + 'admin/server-info': { + req: TODO; + res: TODO; + }; + 'admin/show-moderation-logs': { + req: TODO; + res: TODO; + }; + 'admin/show-user': { + req: TODO; + res: TODO; + }; + 'admin/show-users': { + req: TODO; + res: TODO; + }; + 'admin/silence-user': { + req: TODO; + res: TODO; + }; + 'admin/suspend-user': { + req: TODO; + res: TODO; + }; + 'admin/unsilence-user': { + req: TODO; + res: TODO; + }; + 'admin/unsuspend-user': { + req: TODO; + res: TODO; + }; + 'admin/update-meta': { + req: TODO; + res: TODO; + }; + 'admin/vacuum': { + req: TODO; + res: TODO; + }; + 'admin/accounts/create': { + req: TODO; + res: TODO; + }; + 'admin/ad/create': { + req: TODO; + res: TODO; + }; + 'admin/ad/delete': { + req: { + id: Ad['id']; + }; + res: null; + }; + 'admin/ad/list': { + req: TODO; + res: TODO; + }; + 'admin/ad/update': { + req: TODO; + res: TODO; + }; + 'admin/announcements/create': { + req: TODO; + res: TODO; + }; + 'admin/announcements/delete': { + req: { + id: Announcement['id']; + }; + res: null; + }; + 'admin/announcements/list': { + req: TODO; + res: TODO; + }; + 'admin/announcements/update': { + req: TODO; + res: TODO; + }; + 'admin/drive/clean-remote-files': { + req: TODO; + res: TODO; + }; + 'admin/drive/cleanup': { + req: TODO; + res: TODO; + }; + 'admin/drive/files': { + req: TODO; + res: TODO; + }; + 'admin/drive/show-file': { + req: TODO; + res: TODO; + }; + 'admin/emoji/add': { + req: TODO; + res: TODO; + }; + 'admin/emoji/copy': { + req: TODO; + res: TODO; + }; + 'admin/emoji/list-remote': { + req: TODO; + res: TODO; + }; + 'admin/emoji/list': { + req: TODO; + res: TODO; + }; + 'admin/emoji/remove': { + req: TODO; + res: TODO; + }; + 'admin/emoji/update': { + req: TODO; + res: TODO; + }; + 'admin/federation/delete-all-files': { + req: { + host: string; + }; + res: null; + }; + 'admin/federation/refresh-remote-instance-metadata': { + req: TODO; + res: TODO; + }; + 'admin/federation/remove-all-following': { + req: TODO; + res: TODO; + }; + 'admin/federation/update-instance': { + req: TODO; + res: TODO; + }; + 'admin/moderators/add': { + req: TODO; + res: TODO; + }; + 'admin/moderators/remove': { + req: TODO; + res: TODO; + }; + 'admin/promo/create': { + req: TODO; + res: TODO; + }; + 'admin/queue/clear': { + req: TODO; + res: TODO; + }; + 'admin/queue/deliver-delayed': { + req: TODO; + res: TODO; + }; + 'admin/queue/inbox-delayed': { + req: TODO; + res: TODO; + }; + 'admin/queue/jobs': { + req: TODO; + res: TODO; + }; + 'admin/queue/stats': { + req: TODO; + res: TODO; + }; + 'admin/relays/add': { + req: TODO; + res: TODO; + }; + 'admin/relays/list': { + req: TODO; + res: TODO; + }; + 'admin/relays/remove': { + req: TODO; + res: TODO; + }; + 'announcements': { + req: { + limit?: number; + withUnreads?: boolean; + sinceId?: Announcement['id']; + untilId?: Announcement['id']; + }; + res: Announcement[]; + }; + 'antennas/create': { + req: TODO; + res: Antenna; + }; + 'antennas/delete': { + req: { + antennaId: Antenna['id']; + }; + res: null; + }; + 'antennas/list': { + req: NoParams; + res: Antenna[]; + }; + 'antennas/notes': { + req: { + antennaId: Antenna['id']; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + }; + res: Note[]; + }; + 'antennas/show': { + req: { + antennaId: Antenna['id']; + }; + res: Antenna; + }; + 'antennas/update': { + req: TODO; + res: Antenna; + }; + 'ap/get': { + req: { + uri: string; + }; + res: Record; + }; + 'ap/show': { + req: { + uri: string; + }; + res: { + type: 'Note'; + object: Note; + } | { + type: 'User'; + object: UserDetailed; + }; + }; + 'app/create': { + req: TODO; + res: App; + }; + 'app/show': { + req: { + appId: App['id']; + }; + res: App; + }; + 'auth/accept': { + req: { + token: string; + }; + res: null; + }; + 'auth/session/generate': { + req: { + appSecret: string; + }; + res: { + token: string; + url: string; + }; + }; + 'auth/session/show': { + req: { + token: string; + }; + res: AuthSession; + }; + 'auth/session/userkey': { + req: { + appSecret: string; + token: string; + }; + res: { + accessToken: string; + user: User; + }; + }; + 'blocking/create': { + req: { + userId: User['id']; + }; + res: UserDetailed; + }; + 'blocking/delete': { + req: { + userId: User['id']; + }; + res: UserDetailed; + }; + 'blocking/list': { + req: { + limit?: number; + sinceId?: Blocking['id']; + untilId?: Blocking['id']; + }; + res: Blocking[]; + }; + 'channels/create': { + req: TODO; + res: TODO; + }; + 'channels/featured': { + req: TODO; + res: TODO; + }; + 'channels/follow': { + req: TODO; + res: TODO; + }; + 'channels/followed': { + req: TODO; + res: TODO; + }; + 'channels/owned': { + req: TODO; + res: TODO; + }; + 'channels/pin-note': { + req: TODO; + res: TODO; + }; + 'channels/show': { + req: TODO; + res: TODO; + }; + 'channels/timeline': { + req: TODO; + res: TODO; + }; + 'channels/unfollow': { + req: TODO; + res: TODO; + }; + 'channels/update': { + req: TODO; + res: TODO; + }; + 'charts/active-users': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + local: { + users: number[]; + }; + remote: { + users: number[]; + }; + }; + }; + 'charts/drive': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + local: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + remote: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + }; + }; + 'charts/federation': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + instance: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + 'charts/hashtag': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: TODO; + }; + 'charts/instance': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + host: string; + }; + res: { + drive: { + decFiles: number[]; + decUsage: number[]; + incFiles: number[]; + incUsage: number[]; + totalFiles: number[]; + totalUsage: number[]; + }; + followers: { + dec: number[]; + inc: number[]; + total: number[]; + }; + following: { + dec: number[]; + inc: number[]; + total: number[]; + }; + notes: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + requests: { + failed: number[]; + received: number[]; + succeeded: number[]; + }; + users: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + 'charts/network': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: TODO; + }; + 'charts/notes': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + local: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + remote: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + }; + }; + 'charts/user/drive': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + userId: User['id']; + }; + res: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + }; + 'charts/user/following': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + userId: User['id']; + }; + res: TODO; + }; + 'charts/user/notes': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + userId: User['id']; + }; + res: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + }; + 'charts/user/reactions': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + userId: User['id']; + }; + res: TODO; + }; + 'charts/users': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + local: { + dec: number[]; + inc: number[]; + total: number[]; + }; + remote: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + 'clips/add-note': { + req: TODO; + res: TODO; + }; + 'clips/create': { + req: TODO; + res: TODO; + }; + 'clips/delete': { + req: { + clipId: Clip['id']; + }; + res: null; + }; + 'clips/list': { + req: TODO; + res: TODO; + }; + 'clips/notes': { + req: TODO; + res: TODO; + }; + 'clips/show': { + req: TODO; + res: TODO; + }; + 'clips/update': { + req: TODO; + res: TODO; + }; + 'drive': { + req: NoParams; + res: { + capacity: number; + usage: number; + }; + }; + 'drive/files': { + req: { + folderId?: DriveFolder['id'] | null; + type?: DriveFile['type'] | null; + limit?: number; + sinceId?: DriveFile['id']; + untilId?: DriveFile['id']; + }; + res: DriveFile[]; + }; + 'drive/files/attached-notes': { + req: TODO; + res: TODO; + }; + 'drive/files/check-existence': { + req: TODO; + res: TODO; + }; + 'drive/files/create': { + req: TODO; + res: TODO; + }; + 'drive/files/delete': { + req: { + fileId: DriveFile['id']; + }; + res: null; + }; + 'drive/files/find-by-hash': { + req: TODO; + res: TODO; + }; + 'drive/files/find': { + req: { + name: string; + folderId?: DriveFolder['id'] | null; + }; + res: DriveFile[]; + }; + 'drive/files/show': { + req: { + fileId?: DriveFile['id']; + url?: string; + }; + res: DriveFile; + }; + 'drive/files/update': { + req: { + fileId: DriveFile['id']; + folderId?: DriveFolder['id'] | null; + name?: string; + isSensitive?: boolean; + comment?: string | null; + }; + res: DriveFile; + }; + 'drive/files/upload-from-url': { + req: { + url: string; + folderId?: DriveFolder['id'] | null; + isSensitive?: boolean; + comment?: string | null; + marker?: string | null; + force?: boolean; + }; + res: null; + }; + 'drive/folders': { + req: { + folderId?: DriveFolder['id'] | null; + limit?: number; + sinceId?: DriveFile['id']; + untilId?: DriveFile['id']; + }; + res: DriveFolder[]; + }; + 'drive/folders/create': { + req: { + name?: string; + parentId?: DriveFolder['id'] | null; + }; + res: DriveFolder; + }; + 'drive/folders/delete': { + req: { + folderId: DriveFolder['id']; + }; + res: null; + }; + 'drive/folders/find': { + req: { + name: string; + parentId?: DriveFolder['id'] | null; + }; + res: DriveFolder[]; + }; + 'drive/folders/show': { + req: { + folderId: DriveFolder['id']; + }; + res: DriveFolder; + }; + 'drive/folders/update': { + req: { + folderId: DriveFolder['id']; + name?: string; + parentId?: DriveFolder['id'] | null; + }; + res: DriveFolder; + }; + 'drive/stream': { + req: { + type?: DriveFile['type'] | null; + limit?: number; + sinceId?: DriveFile['id']; + untilId?: DriveFile['id']; + }; + res: DriveFile[]; + }; + 'endpoint': { + req: { + endpoint: string; + }; + res: { + params: { + name: string; + type: string; + }[]; + }; + }; + 'endpoints': { + req: NoParams; + res: string[]; + }; + 'federation/dns': { + req: { + host: string; + }; + res: { + a: string[]; + aaaa: string[]; + cname: string[]; + txt: string[]; + }; + }; + 'federation/followers': { + req: { + host: string; + limit?: number; + sinceId?: Following['id']; + untilId?: Following['id']; + }; + res: FollowingFolloweePopulated[]; + }; + 'federation/following': { + req: { + host: string; + limit?: number; + sinceId?: Following['id']; + untilId?: Following['id']; + }; + res: FollowingFolloweePopulated[]; + }; + 'federation/instances': { + req: { + host?: string | null; + blocked?: boolean | null; + notResponding?: boolean | null; + suspended?: boolean | null; + federating?: boolean | null; + subscribing?: boolean | null; + publishing?: boolean | null; + limit?: number; + offset?: number; + sort?: '+pubSub' | '-pubSub' | '+notes' | '-notes' | '+users' | '-users' | '+following' | '-following' | '+followers' | '-followers' | '+caughtAt' | '-caughtAt' | '+lastCommunicatedAt' | '-lastCommunicatedAt' | '+driveUsage' | '-driveUsage' | '+driveFiles' | '-driveFiles'; + }; + res: Instance[]; + }; + 'federation/show-instance': { + req: { + host: string; + }; + res: Instance; + }; + 'federation/update-remote-user': { + req: { + userId: User['id']; + }; + res: null; + }; + 'federation/users': { + req: { + host: string; + limit?: number; + sinceId?: User['id']; + untilId?: User['id']; + }; + res: UserDetailed[]; + }; + 'following/create': { + req: { + userId: User['id']; + }; + res: User; + }; + 'following/delete': { + req: { + userId: User['id']; + }; + res: User; + }; + 'following/requests/accept': { + req: { + userId: User['id']; + }; + res: null; + }; + 'following/requests/cancel': { + req: { + userId: User['id']; + }; + res: User; + }; + 'following/requests/list': { + req: NoParams; + res: FollowRequest[]; + }; + 'following/requests/reject': { + req: { + userId: User['id']; + }; + res: null; + }; + 'gallery/featured': { + req: TODO; + res: TODO; + }; + 'gallery/popular': { + req: TODO; + res: TODO; + }; + 'gallery/posts': { + req: TODO; + res: TODO; + }; + 'gallery/posts/create': { + req: TODO; + res: TODO; + }; + 'gallery/posts/delete': { + req: { + postId: GalleryPost['id']; + }; + res: null; + }; + 'gallery/posts/like': { + req: TODO; + res: TODO; + }; + 'gallery/posts/show': { + req: TODO; + res: TODO; + }; + 'gallery/posts/unlike': { + req: TODO; + res: TODO; + }; + 'gallery/posts/update': { + req: TODO; + res: TODO; + }; + 'games/reversi/games': { + req: TODO; + res: TODO; + }; + 'games/reversi/games/show': { + req: TODO; + res: TODO; + }; + 'games/reversi/games/surrender': { + req: TODO; + res: TODO; + }; + 'games/reversi/invitations': { + req: TODO; + res: TODO; + }; + 'games/reversi/match': { + req: TODO; + res: TODO; + }; + 'games/reversi/match/cancel': { + req: TODO; + res: TODO; + }; + 'get-online-users-count': { + req: NoParams; + res: { + count: number; + }; + }; + 'hashtags/list': { + req: TODO; + res: TODO; + }; + 'hashtags/search': { + req: TODO; + res: TODO; + }; + 'hashtags/show': { + req: TODO; + res: TODO; + }; + 'hashtags/trend': { + req: TODO; + res: TODO; + }; + 'hashtags/users': { + req: TODO; + res: TODO; + }; + 'i': { + req: NoParams; + res: User; + }; + 'i/apps': { + req: TODO; + res: TODO; + }; + 'i/authorized-apps': { + req: TODO; + res: TODO; + }; + 'i/change-password': { + req: TODO; + res: TODO; + }; + 'i/delete-account': { + req: { + password: string; + }; + res: null; + }; + 'i/export-blocking': { + req: TODO; + res: TODO; + }; + 'i/export-following': { + req: TODO; + res: TODO; + }; + 'i/export-mute': { + req: TODO; + res: TODO; + }; + 'i/export-notes': { + req: TODO; + res: TODO; + }; + 'i/export-user-lists': { + req: TODO; + res: TODO; + }; + 'i/favorites': { + req: { + limit?: number; + sinceId?: NoteFavorite['id']; + untilId?: NoteFavorite['id']; + }; + res: NoteFavorite[]; + }; + 'i/gallery/likes': { + req: TODO; + res: TODO; + }; + 'i/gallery/posts': { + req: TODO; + res: TODO; + }; + 'i/get-word-muted-notes-count': { + req: TODO; + res: TODO; + }; + 'i/import-following': { + req: TODO; + res: TODO; + }; + 'i/import-user-lists': { + req: TODO; + res: TODO; + }; + 'i/notifications': { + req: { + limit?: number; + sinceId?: Notification_2['id']; + untilId?: Notification_2['id']; + following?: boolean; + markAsRead?: boolean; + includeTypes?: Notification_2['type'][]; + excludeTypes?: Notification_2['type'][]; + }; + res: Notification_2[]; + }; + 'i/page-likes': { + req: TODO; + res: TODO; + }; + 'i/pages': { + req: TODO; + res: TODO; + }; + 'i/pin': { + req: { + noteId: Note['id']; + }; + res: MeDetailed; + }; + 'i/read-all-messaging-messages': { + req: TODO; + res: TODO; + }; + 'i/read-all-unread-notes': { + req: TODO; + res: TODO; + }; + 'i/read-announcement': { + req: TODO; + res: TODO; + }; + 'i/regenerate-token': { + req: { + password: string; + }; + res: null; + }; + 'i/registry/get-all': { + req: { + scope?: string[]; + }; + res: Record; + }; + 'i/registry/get-detail': { + req: { + key: string; + scope?: string[]; + }; + res: { + updatedAt: DateString; + value: any; + }; + }; + 'i/registry/get': { + req: { + key: string; + scope?: string[]; + }; + res: any; + }; + 'i/registry/keys-with-type': { + req: { + scope?: string[]; + }; + res: Record; + }; + 'i/registry/keys': { + req: { + scope?: string[]; + }; + res: string[]; + }; + 'i/registry/remove': { + req: { + key: string; + scope?: string[]; + }; + res: null; + }; + 'i/registry/scopes': { + req: NoParams; + res: string[][]; + }; + 'i/registry/set': { + req: { + key: string; + value: any; + scope?: string[]; + }; + res: null; + }; + 'i/revoke-token': { + req: TODO; + res: TODO; + }; + 'i/signin-history': { + req: { + limit?: number; + sinceId?: Signin['id']; + untilId?: Signin['id']; + }; + res: Signin[]; + }; + 'i/unpin': { + req: { + noteId: Note['id']; + }; + res: MeDetailed; + }; + 'i/update-email': { + req: { + password: string; + email?: string | null; + }; + res: MeDetailed; + }; + 'i/update': { + req: { + name?: string | null; + description?: string | null; + lang?: string | null; + location?: string | null; + birthday?: string | null; + avatarId?: DriveFile['id'] | null; + bannerId?: DriveFile['id'] | null; + fields?: { + name: string; + value: string; + }[]; + isLocked?: boolean; + isExplorable?: boolean; + hideOnlineStatus?: boolean; + carefulBot?: boolean; + autoAcceptFollowed?: boolean; + noCrawle?: boolean; + isBot?: boolean; + isCat?: boolean; + injectFeaturedNote?: boolean; + receiveAnnouncementEmail?: boolean; + alwaysMarkNsfw?: boolean; + mutedWords?: string[][]; + mutingNotificationTypes?: Notification_2['type'][]; + emailNotificationTypes?: string[]; + }; + res: MeDetailed; + }; + 'i/user-group-invites': { + req: TODO; + res: TODO; + }; + 'i/2fa/done': { + req: TODO; + res: TODO; + }; + 'i/2fa/key-done': { + req: TODO; + res: TODO; + }; + 'i/2fa/password-less': { + req: TODO; + res: TODO; + }; + 'i/2fa/register-key': { + req: TODO; + res: TODO; + }; + 'i/2fa/register': { + req: TODO; + res: TODO; + }; + 'i/2fa/remove-key': { + req: TODO; + res: TODO; + }; + 'i/2fa/unregister': { + req: TODO; + res: TODO; + }; + 'messaging/history': { + req: { + limit?: number; + group?: boolean; + }; + res: MessagingMessage[]; + }; + 'messaging/messages': { + req: { + userId?: User['id']; + groupId?: UserGroup['id']; + limit?: number; + sinceId?: MessagingMessage['id']; + untilId?: MessagingMessage['id']; + markAsRead?: boolean; + }; + res: MessagingMessage[]; + }; + 'messaging/messages/create': { + req: { + userId?: User['id']; + groupId?: UserGroup['id']; + text?: string; + fileId?: DriveFile['id']; + }; + res: MessagingMessage; + }; + 'messaging/messages/delete': { + req: { + messageId: MessagingMessage['id']; + }; + res: null; + }; + 'messaging/messages/read': { + req: { + messageId: MessagingMessage['id']; + }; + res: null; + }; + 'meta': { + req: { + detail?: boolean; + }; + res: { + $switch: { + $cases: [ + [ + { + detail: true; + }, + DetailedInstanceMetadata + ], + [ + { + detail: false; + }, + LiteInstanceMetadata + ], + [ + { + detail: boolean; + }, + LiteInstanceMetadata | DetailedInstanceMetadata + ] + ]; + $default: LiteInstanceMetadata; + }; + }; + }; + 'miauth/gen-token': { + req: TODO; + res: TODO; + }; + 'mute/create': { + req: TODO; + res: TODO; + }; + 'mute/delete': { + req: { + userId: User['id']; + }; + res: null; + }; + 'mute/list': { + req: TODO; + res: TODO; + }; + 'my/apps': { + req: TODO; + res: TODO; + }; + 'notes': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + }; + res: Note[]; + }; + 'notes/children': { + req: { + noteId: Note['id']; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + }; + res: Note[]; + }; + 'notes/clips': { + req: TODO; + res: TODO; + }; + 'notes/conversation': { + req: TODO; + res: TODO; + }; + 'notes/create': { + req: { + visibility?: 'public' | 'home' | 'followers' | 'specified'; + visibleUserIds?: User['id'][]; + text?: null | string; + cw?: null | string; + viaMobile?: boolean; + localOnly?: boolean; + fileIds?: DriveFile['id'][]; + replyId?: null | Note['id']; + renoteId?: null | Note['id']; + channelId?: null | Channel['id']; + poll?: null | { + choices: string[]; + multiple?: boolean; + expiresAt?: null | number; + expiredAfter?: null | number; + }; + }; + res: { + createdNote: Note; + }; + }; + 'notes/delete': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/favorites/create': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/favorites/delete': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/featured': { + req: TODO; + res: Note[]; + }; + 'notes/global-timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/recommended-timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/hybrid-timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/local-timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/mentions': { + req: { + following?: boolean; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + }; + res: Note[]; + }; + 'notes/polls/recommendation': { + req: TODO; + res: TODO; + }; + 'notes/polls/vote': { + req: { + noteId: Note['id']; + choice: number; + }; + res: null; + }; + 'notes/reactions': { + req: { + noteId: Note['id']; + type?: string | null; + limit?: number; + }; + res: NoteReaction[]; + }; + 'notes/reactions/create': { + req: { + noteId: Note['id']; + reaction: string; + }; + res: null; + }; + 'notes/reactions/delete': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/renotes': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + noteId: Note['id']; + }; + res: Note[]; + }; + 'notes/replies': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + noteId: Note['id']; + }; + res: Note[]; + }; + 'notes/search-by-tag': { + req: TODO; + res: TODO; + }; + 'notes/search': { + req: TODO; + res: TODO; + }; + 'notes/show': { + req: { + noteId: Note['id']; + }; + res: Note; + }; + 'notes/state': { + req: TODO; + res: TODO; + }; + 'notes/timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/unrenote': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/user-list-timeline': { + req: { + listId: UserList['id']; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/watching/create': { + req: TODO; + res: TODO; + }; + 'notes/watching/delete': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notifications/create': { + req: { + body: string; + header?: string | null; + icon?: string | null; + }; + res: null; + }; + 'notifications/mark-all-as-read': { + req: NoParams; + res: null; + }; + 'notifications/read': { + req: { + notificationId: Notification_2['id']; + }; + res: null; + }; + 'page-push': { + req: { + pageId: Page['id']; + event: string; + var?: any; + }; + res: null; + }; + 'pages/create': { + req: TODO; + res: Page; + }; + 'pages/delete': { + req: { + pageId: Page['id']; + }; + res: null; + }; + 'pages/featured': { + req: NoParams; + res: Page[]; + }; + 'pages/like': { + req: { + pageId: Page['id']; + }; + res: null; + }; + 'pages/show': { + req: { + pageId?: Page['id']; + name?: string; + username?: string; + }; + res: Page; + }; + 'pages/unlike': { + req: { + pageId: Page['id']; + }; + res: null; + }; + 'pages/update': { + req: TODO; + res: null; + }; + 'ping': { + req: NoParams; + res: { + pong: number; + }; + }; + 'pinned-users': { + req: TODO; + res: TODO; + }; + 'promo/read': { + req: TODO; + res: TODO; + }; + 'request-reset-password': { + req: { + username: string; + email: string; + }; + res: null; + }; + 'reset-password': { + req: { + token: string; + password: string; + }; + res: null; + }; + 'room/show': { + req: TODO; + res: TODO; + }; + 'room/update': { + req: TODO; + res: TODO; + }; + 'stats': { + req: NoParams; + res: Stats; + }; + 'server-info': { + req: NoParams; + res: ServerInfo; + }; + 'sw/register': { + req: TODO; + res: TODO; + }; + 'username/available': { + req: { + username: string; + }; + res: { + available: boolean; + }; + }; + 'users': { + req: { + limit?: number; + offset?: number; + sort?: UserSorting; + origin?: OriginType; + }; + res: User[]; + }; + 'users/clips': { + req: TODO; + res: TODO; + }; + 'users/followers': { + req: { + userId?: User['id']; + username?: User['username']; + host?: User['host'] | null; + limit?: number; + sinceId?: Following['id']; + untilId?: Following['id']; + }; + res: FollowingFollowerPopulated[]; + }; + 'users/following': { + req: { + userId?: User['id']; + username?: User['username']; + host?: User['host'] | null; + limit?: number; + sinceId?: Following['id']; + untilId?: Following['id']; + }; + res: FollowingFolloweePopulated[]; + }; + 'users/gallery/posts': { + req: TODO; + res: TODO; + }; + 'users/get-frequently-replied-users': { + req: TODO; + res: TODO; + }; + 'users/groups/create': { + req: TODO; + res: TODO; + }; + 'users/groups/delete': { + req: { + groupId: UserGroup['id']; + }; + res: null; + }; + 'users/groups/invitations/accept': { + req: TODO; + res: TODO; + }; + 'users/groups/invitations/reject': { + req: TODO; + res: TODO; + }; + 'users/groups/invite': { + req: TODO; + res: TODO; + }; + 'users/groups/joined': { + req: TODO; + res: TODO; + }; + 'users/groups/owned': { + req: TODO; + res: TODO; + }; + 'users/groups/pull': { + req: TODO; + res: TODO; + }; + 'users/groups/show': { + req: TODO; + res: TODO; + }; + 'users/groups/transfer': { + req: TODO; + res: TODO; + }; + 'users/groups/update': { + req: TODO; + res: TODO; + }; + 'users/lists/create': { + req: { + name: string; + }; + res: UserList; + }; + 'users/lists/delete': { + req: { + listId: UserList['id']; + }; + res: null; + }; + 'users/lists/list': { + req: NoParams; + res: UserList[]; + }; + 'users/lists/pull': { + req: { + listId: UserList['id']; + userId: User['id']; + }; + res: null; + }; + 'users/lists/push': { + req: { + listId: UserList['id']; + userId: User['id']; + }; + res: null; + }; + 'users/lists/show': { + req: { + listId: UserList['id']; + }; + res: UserList; + }; + 'users/lists/update': { + req: { + listId: UserList['id']; + name: string; + }; + res: UserList; + }; + 'users/notes': { + req: { + userId: User['id']; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'users/pages': { + req: TODO; + res: TODO; + }; + 'users/recommendation': { + req: TODO; + res: TODO; + }; + 'users/relation': { + req: TODO; + res: TODO; + }; + 'users/report-abuse': { + req: TODO; + res: TODO; + }; + 'users/search-by-username-and-host': { + req: TODO; + res: TODO; + }; + 'users/search': { + req: TODO; + res: TODO; + }; + 'users/show': { + req: ShowUserReq | { + userIds: User['id'][]; + }; + res: { + $switch: { + $cases: [ + [ + { + userIds: User['id'][]; + }, + UserDetailed[] + ] + ]; + $default: UserDetailed; + }; + }; + }; + 'users/stats': { + req: TODO; + res: TODO; + }; +}; + +declare namespace entities { + export { + ID, + DateString, + User, + UserLite, + UserDetailed, + UserGroup, + UserList, + MeDetailed, + DriveFile, + DriveFolder, + GalleryPost, + Note, + NoteReaction, + Notification_2 as Notification, + MessagingMessage, + CustomEmoji, + LiteInstanceMetadata, + DetailedInstanceMetadata, + InstanceMetadata, + ServerInfo, + Stats, + Page, + PageEvent, + Announcement, + Antenna, + App, + AuthSession, + Ad, + Clip, + NoteFavorite, + FollowRequest, + Channel, + Following, + FollowingFolloweePopulated, + FollowingFollowerPopulated, + Blocking, + Instance, + Signin, + UserSorting, + OriginType + } +} +export { entities } + +// @public (undocumented) +type FetchLike = (input: string, init?: { + method?: string; + body?: string; + credentials?: RequestCredentials; + cache?: RequestCache; +}) => Promise<{ + status: number; + json(): Promise; +}>; + +// @public (undocumented) +export const ffVisibility: readonly ["public", "followers", "private"]; + +// @public (undocumented) +type Following = { + id: ID; + createdAt: DateString; + followerId: User['id']; + followeeId: User['id']; +}; + +// @public (undocumented) +type FollowingFolloweePopulated = Following & { + followee: UserDetailed; +}; + +// @public (undocumented) +type FollowingFollowerPopulated = Following & { + follower: UserDetailed; +}; + +// @public (undocumented) +type FollowRequest = { + id: ID; + follower: User; + followee: User; +}; + +// @public (undocumented) +type GalleryPost = TODO_2; + +// @public (undocumented) +type ID = string; + +// @public (undocumented) +type Instance = { + id: ID; + caughtAt: DateString; + host: string; + usersCount: number; + notesCount: number; + followingCount: number; + followersCount: number; + driveUsage: number; + driveFiles: number; + latestRequestSentAt: DateString | null; + latestStatus: number | null; + latestRequestReceivedAt: DateString | null; + lastCommunicatedAt: DateString; + isNotResponding: boolean; + isSuspended: boolean; + softwareName: string | null; + softwareVersion: string | null; + openRegistrations: boolean | null; + name: string | null; + description: string | null; + maintainerName: string | null; + maintainerEmail: string | null; + iconUrl: string | null; + faviconUrl: string | null; + themeColor: string | null; + infoUpdatedAt: DateString | null; +}; + +// @public (undocumented) +type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata; + +// @public (undocumented) +function isAPIError(reason: any): reason is APIError; + +// @public (undocumented) +type LiteInstanceMetadata = { + maintainerName: string | null; + maintainerEmail: string | null; + version: string; + name: string | null; + uri: string; + description: string | null; + tosUrl: string | null; + disableRegistration: boolean; + disableLocalTimeline: boolean; + disableRecommendedTimeline: boolean; + disableGlobalTimeline: boolean; + driveCapacityPerLocalUserMb: number; + driveCapacityPerRemoteUserMb: number; + enableHcaptcha: boolean; + hcaptchaSiteKey: string | null; + enableRecaptcha: boolean; + recaptchaSiteKey: string | null; + swPublickey: string | null; + maxNoteTextLength: number; + enableEmail: boolean; + enableTwitterIntegration: boolean; + enableGithubIntegration: boolean; + enableDiscordIntegration: boolean; + enableServiceWorker: boolean; + emojis: CustomEmoji[]; + ads: { + id: ID; + ratio: number; + place: string; + url: string; + imageUrl: string; + }[]; +}; + +// @public (undocumented) +type MeDetailed = UserDetailed & { + avatarId: DriveFile['id']; + bannerId: DriveFile['id']; + autoAcceptFollowed: boolean; + alwaysMarkNsfw: boolean; + carefulBot: boolean; + emailNotificationTypes: string[]; + hasPendingReceivedFollowRequest: boolean; + hasUnreadAnnouncement: boolean; + hasUnreadAntenna: boolean; + hasUnreadChannel: boolean; + hasUnreadMentions: boolean; + hasUnreadMessagingMessage: boolean; + hasUnreadNotification: boolean; + hasUnreadSpecifiedNotes: boolean; + hideOnlineStatus: boolean; + injectFeaturedNote: boolean; + integrations: Record; + isDeleted: boolean; + isExplorable: boolean; + mutedWords: string[][]; + mutingNotificationTypes: string[]; + noCrawle: boolean; + receiveAnnouncementEmail: boolean; + usePasswordLessLogin: boolean; + [other: string]: any; +}; + +// @public (undocumented) +type MessagingMessage = { + id: ID; + createdAt: DateString; + file: DriveFile | null; + fileId: DriveFile['id'] | null; + isRead: boolean; + reads: User['id'][]; + text: string | null; + user: User; + userId: User['id']; + recipient?: User | null; + recipientId: User['id'] | null; + group?: UserGroup | null; + groupId: UserGroup['id'] | null; +}; + +// @public (undocumented) +export const mutedNoteReasons: readonly ["word", "manual", "spam", "other"]; + +// @public (undocumented) +type Note = { + id: ID; + createdAt: DateString; + text: string | null; + cw: string | null; + user: User; + userId: User['id']; + reply?: Note; + replyId: Note['id']; + renote?: Note; + renoteId: Note['id']; + files: DriveFile[]; + fileIds: DriveFile['id'][]; + visibility: 'public' | 'home' | 'followers' | 'specified'; + visibleUserIds?: User['id'][]; + localOnly?: boolean; + myReaction?: string; + reactions: Record; + renoteCount: number; + repliesCount: number; + poll?: { + expiresAt: DateString | null; + multiple: boolean; + choices: { + isVoted: boolean; + text: string; + votes: number; + }[]; + }; + emojis: { + name: string; + url: string; + }[]; + uri?: string; + url?: string; + isHidden?: boolean; +}; + +// @public (undocumented) +type NoteFavorite = { + id: ID; + createdAt: DateString; + noteId: Note['id']; + note: Note; +}; + +// @public (undocumented) +type NoteReaction = { + id: ID; + createdAt: DateString; + user: UserLite; + type: string; +}; + +// @public (undocumented) +export const noteVisibilities: readonly ["public", "home", "followers", "specified"]; + +// @public (undocumented) +type Notification_2 = { + id: ID; + createdAt: DateString; + isRead: boolean; +} & ({ + type: 'reaction'; + reaction: string; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'reply'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'renote'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'quote'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'mention'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'pollVote'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'follow'; + user: User; + userId: User['id']; +} | { + type: 'followRequestAccepted'; + user: User; + userId: User['id']; +} | { + type: 'receiveFollowRequest'; + user: User; + userId: User['id']; +} | { + type: 'groupInvited'; + invitation: UserGroup; + user: User; + userId: User['id']; +} | { + type: 'app'; + header?: string | null; + body: string; + icon?: string | null; +}); + +// @public (undocumented) +export const notificationTypes: readonly ["follow", "mention", "reply", "renote", "quote", "reaction", "pollVote", "receiveFollowRequest", "followRequestAccepted", "groupInvited", "app"]; + +// @public (undocumented) +type OriginType = 'combined' | 'local' | 'remote'; + +// @public (undocumented) +type Page = { + id: ID; + createdAt: DateString; + updatedAt: DateString; + userId: User['id']; + user: User; + content: Record[]; + variables: Record[]; + title: string; + name: string; + summary: string | null; + hideTitleWhenPinned: boolean; + alignCenter: boolean; + font: string; + script: string; + eyeCatchingImageId: DriveFile['id'] | null; + eyeCatchingImage: DriveFile | null; + attachedFiles: any; + likedCount: number; + isLiked?: boolean; +}; + +// @public (undocumented) +type PageEvent = { + pageId: Page['id']; + event: string; + var: any; + userId: User['id']; + user: User; +}; + +// @public (undocumented) +export const permissions: string[]; + +// @public (undocumented) +type ServerInfo = { + machine: string; + cpu: { + model: string; + cores: number; + }; + mem: { + total: number; + }; + fs: { + total: number; + used: number; + }; +}; + +// @public (undocumented) +type Signin = { + id: ID; + createdAt: DateString; + ip: string; + headers: Record; + success: boolean; +}; + +// @public (undocumented) +type Stats = { + notesCount: number; + originalNotesCount: number; + usersCount: number; + originalUsersCount: number; + instances: number; + driveUsageLocal: number; + driveUsageRemote: number; +}; + +// Warning: (ae-forgotten-export) The symbol "StreamEvents" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class Stream extends EventEmitter { + constructor(origin: string, user: { + token: string; + } | null, options?: { + WebSocket?: any; + }); + // (undocumented) + close(): void; + // Warning: (ae-forgotten-export) The symbol "NonSharedConnection" needs to be exported by the entry point index.d.ts + // + // (undocumented) + disconnectToChannel(connection: NonSharedConnection): void; + // Warning: (ae-forgotten-export) The symbol "SharedConnection" needs to be exported by the entry point index.d.ts + // + // (undocumented) + removeSharedConnection(connection: SharedConnection): void; + // Warning: (ae-forgotten-export) The symbol "Pool" needs to be exported by the entry point index.d.ts + // + // (undocumented) + removeSharedConnectionPool(pool: Pool): void; + // (undocumented) + send(typeOrPayload: any, payload?: any): void; + // (undocumented) + state: 'initializing' | 'reconnecting' | 'connected'; + // (undocumented) + useChannel(channel: C, params?: Channels[C]['params'], name?: string): ChannelConnection; +} + +// @public (undocumented) +type User = UserLite | UserDetailed; + +// @public (undocumented) +type UserDetailed = UserLite & { + bannerBlurhash: string | null; + bannerColor: string | null; + bannerUrl: string | null; + birthday: string | null; + createdAt: DateString; + description: string | null; + ffVisibility: 'public' | 'followers' | 'private'; + fields: { + name: string; + value: string; + }[]; + followersCount: number; + followingCount: number; + hasPendingFollowRequestFromYou: boolean; + hasPendingFollowRequestToYou: boolean; + isAdmin: boolean; + isBlocked: boolean; + isBlocking: boolean; + isBot: boolean; + isCat: boolean; + isFollowed: boolean; + isFollowing: boolean; + isLocked: boolean; + isModerator: boolean; + isMuted: boolean; + isSilenced: boolean; + isSuspended: boolean; + lang: string | null; + lastFetchedAt?: DateString; + location: string | null; + notesCount: number; + pinnedNoteIds: ID[]; + pinnedNotes: Note[]; + pinnedPage: Page | null; + pinnedPageId: string | null; + publicReactions: boolean; + securityKeys: boolean; + twoFactorEnabled: boolean; + updatedAt: DateString | null; + uri: string | null; + url: string | null; +}; + +// @public (undocumented) +type UserGroup = TODO_2; + +// @public (undocumented) +type UserList = { + id: ID; + createdAt: DateString; + name: string; + userIds: User['id'][]; +}; + +// @public (undocumented) +type UserLite = { + id: ID; + username: string; + host: string | null; + name: string; + onlineStatus: 'online' | 'active' | 'offline' | 'unknown'; + avatarUrl: string; + avatarBlurhash: string; + emojis: { + name: string; + url: string; + }[]; + instance?: { + name: Instance['name']; + softwareName: Instance['softwareName']; + softwareVersion: Instance['softwareVersion']; + iconUrl: Instance['iconUrl']; + faviconUrl: Instance['faviconUrl']; + themeColor: Instance['themeColor']; + }; +}; + +// @public (undocumented) +type UserSorting = '+follower' | '-follower' | '+createdAt' | '-createdAt' | '+updatedAt' | '-updatedAt'; + +// Warnings were encountered during analysis: +// +// src/api.types.ts:16:32 - (ae-forgotten-export) The symbol "TODO" needs to be exported by the entry point index.d.ts +// src/api.types.ts:18:25 - (ae-forgotten-export) The symbol "NoParams" needs to be exported by the entry point index.d.ts +// src/api.types.ts:595:18 - (ae-forgotten-export) The symbol "ShowUserReq" needs to be exported by the entry point index.d.ts +// src/streaming.types.ts:35:4 - (ae-forgotten-export) The symbol "FIXME" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/calckey-js/jest.config.ts b/packages/calckey-js/jest.config.ts new file mode 100644 index 0000000000..f26a77c278 --- /dev/null +++ b/packages/calckey-js/jest.config.ts @@ -0,0 +1,195 @@ +/* + * For a detailed explanation regarding each configuration property and type check, visit: + * https://jestjs.io/docs/en/configuration.html + */ + +export default { + // All imported modules in your tests should be mocked automatically + // automock: false, + + // Stop running tests after `n` failures + // bail: 0, + + // The directory where Jest should store its cached dependency information + // cacheDirectory: "C:\\Users\\ai\\AppData\\Local\\Temp\\jest", + + // Automatically clear mock calls and instances between every test + // clearMocks: false, + + // Indicates whether the coverage information should be collected while executing the test + // collectCoverage: false, + + // An array of glob patterns indicating a set of files for which coverage information should be collected + // collectCoverageFrom: undefined, + + // The directory where Jest should output its coverage files + coverageDirectory: "coverage", + + // An array of regexp pattern strings used to skip coverage collection + // coveragePathIgnorePatterns: [ + // "\\\\node_modules\\\\" + // ], + + // Indicates which provider should be used to instrument code for coverage + coverageProvider: "v8", + + // A list of reporter names that Jest uses when writing coverage reports + // coverageReporters: [ + // "json", + // "text", + // "lcov", + // "clover" + // ], + + // An object that configures minimum threshold enforcement for coverage results + // coverageThreshold: undefined, + + // A path to a custom dependency extractor + // dependencyExtractor: undefined, + + // Make calling deprecated APIs throw helpful error messages + // errorOnDeprecated: false, + + // Force coverage collection from ignored files using an array of glob patterns + // forceCoverageMatch: [], + + // A path to a module which exports an async function that is triggered once before all test suites + // globalSetup: undefined, + + // A path to a module which exports an async function that is triggered once after all test suites + // globalTeardown: undefined, + + // A set of global variables that need to be available in all test environments + // globals: {}, + + // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers. + // maxWorkers: "50%", + + // An array of directory names to be searched recursively up from the requiring module's location + // moduleDirectories: [ + // "node_modules" + // ], + + // An array of file extensions your modules use + // moduleFileExtensions: [ + // "js", + // "json", + // "jsx", + // "ts", + // "tsx", + // "node" + // ], + + // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module + // moduleNameMapper: {}, + + // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader + // modulePathIgnorePatterns: [], + + // Activates notifications for test results + // notify: false, + + // An enum that specifies notification mode. Requires { notify: true } + // notifyMode: "failure-change", + + // A preset that is used as a base for Jest's configuration + // preset: undefined, + + // Run tests from one or more projects + // projects: undefined, + + // Use this configuration option to add custom reporters to Jest + // reporters: undefined, + + // Automatically reset mock state between every test + // resetMocks: false, + + // Reset the module registry before running each individual test + // resetModules: false, + + // A path to a custom resolver + // resolver: undefined, + + // Automatically restore mock state between every test + // restoreMocks: false, + + // The root directory that Jest should scan for tests and modules within + // rootDir: undefined, + + // A list of paths to directories that Jest should use to search for files in + roots: [""], + + // Allows you to use a custom runner instead of Jest's default test runner + // runner: "jest-runner", + + // The paths to modules that run some code to configure or set up the testing environment before each test + // setupFiles: [], + + // A list of paths to modules that run some code to configure or set up the testing framework before each test + // setupFilesAfterEnv: [], + + // The number of seconds after which a test is considered as slow and reported as such in the results. + // slowTestThreshold: 5, + + // A list of paths to snapshot serializer modules Jest should use for snapshot testing + // snapshotSerializers: [], + + // The test environment that will be used for testing + testEnvironment: "node", + + // Options that will be passed to the testEnvironment + // testEnvironmentOptions: {}, + + // Adds a location field to test results + // testLocationInResults: false, + + // The glob patterns Jest uses to detect test files + testMatch: [ + "**/__tests__/**/*.[jt]s?(x)", + "**/?(*.)+(spec|test).[tj]s?(x)", + "/test/**/*", + ], + + // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped + // testPathIgnorePatterns: [ + // "\\\\node_modules\\\\" + // ], + + // The regexp pattern or array of patterns that Jest uses to detect test files + // testRegex: [], + + // This option allows the use of a custom results processor + // testResultsProcessor: undefined, + + // This option allows use of a custom test runner + // testRunner: "jasmine2", + + // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href + // testURL: "http://localhost", + + // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout" + // timers: "real", + + // A map from regular expressions to paths to transformers + transform: { + "^.+\\.(ts|tsx)$": "ts-jest", + }, + + // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation + // transformIgnorePatterns: [ + // "\\\\node_modules\\\\", + // "\\.pnp\\.[^\\\\]+$" + // ], + + // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them + // unmockedModulePathPatterns: undefined, + + // Indicates whether each individual test should be reported during the run + // verbose: undefined, + + // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode + // watchPathIgnorePatterns: [], + + // Whether to use watchman for file crawling + // watchman: true, +}; diff --git a/packages/calckey-js/package-lock.json b/packages/calckey-js/package-lock.json new file mode 100644 index 0000000000..774fcd5fa6 --- /dev/null +++ b/packages/calckey-js/package-lock.json @@ -0,0 +1,10662 @@ +{ + "name": "calckey-js", + "version": "0.0.16", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "calckey-js", + "version": "0.0.16", + "dependencies": { + "autobind-decorator": "^2.4.0", + "eventemitter3": "^4.0.7", + "reconnecting-websocket": "^4.4.0", + "semver": "^7.3.8" + }, + "devDependencies": { + "@microsoft/api-extractor": "^7.19.3", + "@types/jest": "^27.4.0", + "@types/node": "17.0.5", + "@typescript-eslint/eslint-plugin": "5.8.1", + "@typescript-eslint/parser": "5.8.1", + "eslint": "8.6.0", + "jest": "^27.4.5", + "jest-fetch-mock": "^3.0.3", + "jest-websocket-mock": "^2.2.1", + "mock-socket": "^9.0.8", + "ts-jest": "^27.1.2", + "ts-node": "10.4.0", + "tsd": "^0.19.1", + "typescript": "4.5.4" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz", + "integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.7.tgz", + "integrity": "sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.7", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helpers": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.1.2", + "semver": "^6.3.0", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/core/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.7.tgz", + "integrity": "sha512-/ST3Sg8MLGY5HVYmrjOgL60ENux/HfO/CsUh7y4MalThufhE/Ff/6EibFDHi4jiDCaWfJKoqbE6oTh21c5hrRg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/generator/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.16.4", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.17.5", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-get-function-arity": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", + "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", + "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", + "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz", + "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/parser": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.7.tgz", + "integrity": "sha512-sR4eaSrnM7BV7QPzGfEX5paG/6wrZM3I0HDzfIAK06ESvo9oy3xBuVBxE3MbQaKNhvg8g/ixjMWo2CGpzpHsDA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz", + "integrity": "sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.7.tgz", + "integrity": "sha512-8KWJPIb8c2VvY8AJrydh6+fVRo2ODx1wYBU2398xJVq0JomuLBZmVQzLPBblJgHIGYG4znCpUZUZ0Pt2vdmVYQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/types": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.7.tgz", + "integrity": "sha512-E8HuV7FO9qLpx6OtoGfUQ2cjIYnbFwvZWYBS+87EwtdMvmUPJSwykpovFB+8insbpF0uJcpr8KMUi64XZntZcg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-consumer": "0.8.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.2.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", + "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.4.2.tgz", + "integrity": "sha512-xknHThRsPB/To1FUbi6pCe43y58qFC03zfb6R7fDb/FfC7k2R3i1l+izRBJf8DI46KhYGRaF14Eo9A3qbBoixg==", + "dev": true, + "dependencies": { + "@jest/types": "^27.4.2", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^27.4.2", + "jest-util": "^27.4.2", + "slash": "^3.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/core": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-27.4.5.tgz", + "integrity": "sha512-3tm/Pevmi8bDsgvo73nX8p/WPng6KWlCyScW10FPEoN1HU4pwI83tJ3TsFvi1FfzsjwUlMNEPowgb/rPau/LTQ==", + "dev": true, + "dependencies": { + "@jest/console": "^27.4.2", + "@jest/reporters": "^27.4.5", + "@jest/test-result": "^27.4.2", + "@jest/transform": "^27.4.5", + "@jest/types": "^27.4.2", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.8.1", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-changed-files": "^27.4.2", + "jest-config": "^27.4.5", + "jest-haste-map": "^27.4.5", + "jest-message-util": "^27.4.2", + "jest-regex-util": "^27.4.0", + "jest-resolve": "^27.4.5", + "jest-resolve-dependencies": "^27.4.5", + "jest-runner": "^27.4.5", + "jest-runtime": "^27.4.5", + "jest-snapshot": "^27.4.5", + "jest-util": "^27.4.2", + "jest-validate": "^27.4.2", + "jest-watcher": "^27.4.2", + "micromatch": "^4.0.4", + "rimraf": "^3.0.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/environment": { + "version": "27.4.4", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-27.4.4.tgz", + "integrity": "sha512-q+niMx7cJgt/t/b6dzLOh4W8Ef/8VyKG7hxASK39jakijJzbFBGpptx3RXz13FFV7OishQ9lTbv+dQ5K3EhfDQ==", + "dev": true, + "dependencies": { + "@jest/fake-timers": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/node": "*", + "jest-mock": "^27.4.2" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-27.4.2.tgz", + "integrity": "sha512-f/Xpzn5YQk5adtqBgvw1V6bF8Nx3hY0OIRRpCvWcfPl0EAjdqWPdhH3t/3XpiWZqtjIEHDyMKP9ajpva1l4Zmg==", + "dev": true, + "dependencies": { + "@jest/types": "^27.4.2", + "@sinonjs/fake-timers": "^8.0.1", + "@types/node": "*", + "jest-message-util": "^27.4.2", + "jest-mock": "^27.4.2", + "jest-util": "^27.4.2" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "27.4.4", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-27.4.4.tgz", + "integrity": "sha512-bqpqQhW30BOreXM8bA8t8JbOQzsq/WnPTnBl+It3UxAD9J8yxEAaBEylHx1dtBapAr/UBk8GidXbzmqnee8tYQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^27.4.4", + "@jest/types": "^27.4.2", + "expect": "^27.4.2" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-27.4.5.tgz", + "integrity": "sha512-3orsG4vi8zXuBqEoy2LbnC1kuvkg1KQUgqNxmxpQgIOQEPeV0onvZu+qDQnEoX8qTQErtqn/xzcnbpeTuOLSiA==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^27.4.2", + "@jest/test-result": "^27.4.2", + "@jest/transform": "^27.4.5", + "@jest/types": "^27.4.2", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.2", + "graceful-fs": "^4.2.4", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^4.0.3", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "jest-haste-map": "^27.4.5", + "jest-resolve": "^27.4.5", + "jest-util": "^27.4.2", + "jest-worker": "^27.4.5", + "slash": "^3.0.0", + "source-map": "^0.6.0", + "string-length": "^4.0.1", + "terminal-link": "^2.0.0", + "v8-to-istanbul": "^8.1.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/source-map": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-27.4.0.tgz", + "integrity": "sha512-Ntjx9jzP26Bvhbm93z/AKcPRj/9wrkI88/gK60glXDx1q+IeI0rf7Lw2c89Ch6ofonB0On/iRDreQuQ6te9pgQ==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0", + "graceful-fs": "^4.2.4", + "source-map": "^0.6.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.4.2.tgz", + "integrity": "sha512-kr+bCrra9jfTgxHXHa2UwoQjxvQk3Am6QbpAiJ5x/50LW8llOYrxILkqY0lZRW/hu8FXesnudbql263+EW9iNA==", + "dev": true, + "dependencies": { + "@jest/console": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-27.4.5.tgz", + "integrity": "sha512-n5woIn/1v+FT+9hniymHPARA9upYUmfi5Pw9ewVwXCDlK4F5/Gkees9v8vdjGdAIJ2MPHLHodiajLpZZanWzEQ==", + "dev": true, + "dependencies": { + "@jest/test-result": "^27.4.2", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.4.5", + "jest-runtime": "^27.4.5" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-27.4.5.tgz", + "integrity": "sha512-PuMet2UlZtlGzwc6L+aZmR3I7CEBpqadO03pU40l2RNY2fFJ191b9/ITB44LNOhVtsyykx0OZvj0PCyuLm7Eew==", + "dev": true, + "dependencies": { + "@babel/core": "^7.1.0", + "@jest/types": "^27.4.2", + "babel-plugin-istanbul": "^6.0.0", + "chalk": "^4.0.0", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.4.5", + "jest-regex-util": "^27.4.0", + "jest-util": "^27.4.2", + "micromatch": "^4.0.4", + "pirates": "^4.0.1", + "slash": "^3.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "^3.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@jest/types": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.4.2.tgz", + "integrity": "sha512-j35yw0PMTPpZsUoOBiuHzr1zTYoad1cVIE0ajEjcrJONxxrko/IRGKkXx3os0Nsi4Hu3+5VmDbVfq5WhG/pWAg==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@microsoft/api-extractor": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.19.3.tgz", + "integrity": "sha512-GZe+R3K4kh2X425iOHkPbByysB7FN0592mPPA6vNj5IhyhlPHgdZS6m6AmOZOIxMS4euM+SBKzEJEp3oC+WsOQ==", + "dev": true, + "dependencies": { + "@microsoft/api-extractor-model": "7.15.2", + "@microsoft/tsdoc": "0.13.2", + "@microsoft/tsdoc-config": "~0.15.2", + "@rushstack/node-core-library": "3.44.3", + "@rushstack/rig-package": "0.3.7", + "@rushstack/ts-command-line": "4.10.6", + "colors": "~1.2.1", + "lodash": "~4.17.15", + "resolve": "~1.17.0", + "semver": "~7.3.0", + "source-map": "~0.6.1", + "typescript": "~4.5.2" + }, + "bin": { + "api-extractor": "bin/api-extractor" + } + }, + "node_modules/@microsoft/api-extractor-model": { + "version": "7.15.2", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.15.2.tgz", + "integrity": "sha512-qgxKX/s6vo3nCVLhP0Ds7555QrErhcYHEok5/KyEZ7iR8J5M5oldD1eJJQmtEdVF5IzmnPPbxx1nRvfgA674LQ==", + "dev": true, + "dependencies": { + "@microsoft/tsdoc": "0.13.2", + "@microsoft/tsdoc-config": "~0.15.2", + "@rushstack/node-core-library": "3.44.3" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "dependencies": { + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/@microsoft/tsdoc": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.13.2.tgz", + "integrity": "sha512-WrHvO8PDL8wd8T2+zBGKrMwVL5IyzR3ryWUsl0PXgEV0QHup4mTLi0QcATefGI6Gx9Anu7vthPyyyLpY0EpiQg==", + "dev": true + }, + "node_modules/@microsoft/tsdoc-config": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.15.2.tgz", + "integrity": "sha512-mK19b2wJHSdNf8znXSMYVShAHktVr/ib0Ck2FA3lsVBSEhSI/TfXT7DJQkAYgcztTuwazGcg58ZjYdk0hTCVrA==", + "dev": true, + "dependencies": { + "@microsoft/tsdoc": "0.13.2", + "ajv": "~6.12.6", + "jju": "~1.4.0", + "resolve": "~1.19.0" + } + }, + "node_modules/@microsoft/tsdoc-config/node_modules/resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "dependencies": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@rushstack/node-core-library": { + "version": "3.44.3", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.44.3.tgz", + "integrity": "sha512-Bt+R5LAnVr2BImTJqPpton5rvhJ2Wq8x4BaTqaCHQMmfxqtz5lb4nLYT9kneMJTCDuRMBvvLpSuz4MBj50PV3w==", + "dev": true, + "dependencies": { + "@types/node": "12.20.24", + "colors": "~1.2.1", + "fs-extra": "~7.0.1", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.17.0", + "semver": "~7.3.0", + "timsort": "~0.3.0", + "z-schema": "~5.0.2" + } + }, + "node_modules/@rushstack/node-core-library/node_modules/@types/node": { + "version": "12.20.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.24.tgz", + "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==", + "dev": true + }, + "node_modules/@rushstack/node-core-library/node_modules/resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "dependencies": { + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/@rushstack/rig-package": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.3.7.tgz", + "integrity": "sha512-pzMsTSeTC8IiZ6EJLr53gGMvhT4oLWH+hxD7907cHyWuIUlEXFtu/2pK25vUQT13nKp5DJCWxXyYoGRk/h6rtA==", + "dev": true, + "dependencies": { + "resolve": "~1.17.0", + "strip-json-comments": "~3.1.1" + } + }, + "node_modules/@rushstack/rig-package/node_modules/resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "dependencies": { + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/@rushstack/ts-command-line": { + "version": "4.10.6", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.10.6.tgz", + "integrity": "sha512-Y3GkUag39sTIlukDg9mUp8MCHrrlJ27POrBNRQGc/uF+VVgX8M7zMzHch5zP6O1QVquWgD7Engdpn2piPYaS/g==", + "dev": true, + "dependencies": { + "@types/argparse": "1.0.38", + "argparse": "~1.0.9", + "colors": "~1.2.1", + "string-argv": "~0.3.1" + } + }, + "node_modules/@sinonjs/commons": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", + "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz", + "integrity": "sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.7.0" + } + }, + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true + }, + "node_modules/@tsd/typescript": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/@tsd/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-iDlLkdg3sCjUSNdoUCsYM/SXheHrdxHsR6msIkbFDW4pV6gHTMwg/8te/paLtywDjGL4S4ByDdUKA3RbfdBX0g==", + "dev": true, + "bin": { + "tsc": "typescript/bin/tsc", + "tsserver": "typescript/bin/tsserver" + } + }, + "node_modules/@types/argparse": { + "version": "1.0.38", + "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", + "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", + "dev": true + }, + "node_modules/@types/babel__core": { + "version": "7.1.18", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.18.tgz", + "integrity": "sha512-S7unDjm/C7z2A2R9NzfKCK1I+BAALDtxEmsJBwlB3EzNfb929ykjL++1CK9LO++EIp2fQrC8O+BwjKvz6UeDyQ==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", + "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", + "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz", + "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.3.0" + } + }, + "node_modules/@types/eslint": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.29.0.tgz", + "integrity": "sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==", + "dev": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/estree": { + "version": "0.0.50", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", + "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", + "dev": true + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", + "integrity": "sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", + "dev": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz", + "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.4.0.tgz", + "integrity": "sha512-gHl8XuC1RZ8H2j5sHv/JqsaxXkDDM9iDOgu0Wp8sjs4u/snb2PVehyWXJPr+ORA0RPpgw231mnutWI1+0hgjIQ==", + "dev": true, + "dependencies": { + "jest-diff": "^27.0.0", + "pretty-format": "^27.0.0" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true + }, + "node_modules/@types/minimist": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz", + "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==", + "dev": true + }, + "node_modules/@types/node": { + "version": "17.0.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.5.tgz", + "integrity": "sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw==", + "dev": true + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true + }, + "node_modules/@types/prettier": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.2.tgz", + "integrity": "sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA==", + "dev": true + }, + "node_modules/@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "node_modules/@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "20.2.1", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", + "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.1.tgz", + "integrity": "sha512-wTZ5oEKrKj/8/366qTM366zqhIKAp6NCMweoRONtfuC07OAU9nVI2GZZdqQ1qD30WAAtcPdkH+npDwtRFdp4Rw==", + "dev": true, + "dependencies": { + "@typescript-eslint/experimental-utils": "5.8.1", + "@typescript-eslint/scope-manager": "5.8.1", + "debug": "^4.3.2", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/experimental-utils": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.1.tgz", + "integrity": "sha512-fbodVnjIDU4JpeXWRDsG5IfIjYBxEvs8EBO8W1+YVdtrc2B9ppfof5sZhVEDOtgTfFHnYQJDI8+qdqLYO4ceww==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.8.1", + "@typescript-eslint/types": "5.8.1", + "@typescript-eslint/typescript-estree": "5.8.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.8.1.tgz", + "integrity": "sha512-K1giKHAjHuyB421SoXMXFHHVI4NdNY603uKw92++D3qyxSeYvC10CBJ/GE5Thpo4WTUvu1mmJI2/FFkz38F2Gw==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.8.1", + "@typescript-eslint/types": "5.8.1", + "@typescript-eslint/typescript-estree": "5.8.1", + "debug": "^4.3.2" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.8.1.tgz", + "integrity": "sha512-DGxJkNyYruFH3NIZc3PwrzwOQAg7vvgsHsHCILOLvUpupgkwDZdNq/cXU3BjF4LNrCsVg0qxEyWasys5AiJ85Q==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.8.1", + "@typescript-eslint/visitor-keys": "5.8.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.8.1.tgz", + "integrity": "sha512-L/FlWCCgnjKOLefdok90/pqInkomLnAcF9UAzNr+DSqMC3IffzumHTQTrINXhP1gVp9zlHiYYjvozVZDPleLcA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.1.tgz", + "integrity": "sha512-26lQ8l8tTbG7ri7xEcCFT9ijU5Fk+sx/KRRyyzCv7MQ+rZZlqiDPtMKWLC8P7o+dtCnby4c+OlxuX1tp8WfafQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.8.1", + "@typescript-eslint/visitor-keys": "5.8.1", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.1.tgz", + "integrity": "sha512-SWgiWIwocK6NralrJarPZlWdr0hZnj5GXHIgfdm8hNkyKvpeQuFyLP6YjSIe9kf3YBIfU6OHSZLYkQ+smZwtNg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.8.1", + "eslint-visitor-keys": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/abab": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", + "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-globals": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "dev": true, + "dependencies": { + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" + } + }, + "node_modules/acorn-globals/node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "node_modules/autobind-decorator": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/autobind-decorator/-/autobind-decorator-2.4.0.tgz", + "integrity": "sha512-OGYhWUO72V6DafbF8PM8rm3EPbfuyMZcJhtm5/n26IDwO18pohE4eNazLoCGhPiXOCD0gEGmrbU3849QvM8bbw==", + "engines": { + "node": ">=8.10", + "npm": ">=6.4.1" + } + }, + "node_modules/babel-jest": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.4.5.tgz", + "integrity": "sha512-3uuUTjXbgtODmSv/DXO9nZfD52IyC2OYTFaXGRzL0kpykzroaquCrD5+lZNafTvZlnNqZHt5pb0M08qVBZnsnA==", + "dev": true, + "dependencies": { + "@jest/transform": "^27.4.5", + "@jest/types": "^27.4.2", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.0.0", + "babel-preset-jest": "^27.4.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "slash": "^3.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz", + "integrity": "sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.4.0.tgz", + "integrity": "sha512-Jcu7qS4OX5kTWBc45Hz7BMmgXuJqRnhatqpUhnzGC3OBYpOmf2tv6jFNwZpwM7wU7MUuv2r9IPS/ZlYOuburVw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.0.0", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-27.4.0.tgz", + "integrity": "sha512-NK4jGYpnBvNxcGo7/ZpZJr51jCGT+3bwwpVIDY2oNfTxJJldRtB4VAcYdgp1loDE50ODuTu+yBjpMAswv5tlpg==", + "dev": true, + "dependencies": { + "babel-plugin-jest-hoist": "^27.4.0", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-process-hrtime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", + "dev": true + }, + "node_modules/browserslist": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", + "dev": true, + "dependencies": { + "caniuse-lite": "^1.0.30001286", + "electron-to-chromium": "^1.4.17", + "escalade": "^3.1.1", + "node-releases": "^2.0.1", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + } + }, + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001294", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001294.tgz", + "integrity": "sha512-LiMlrs1nSKZ8qkNhpUf5KD0Al1KCBE3zaT7OLOwEkagXMEDij98SiOovn9wxVGQpklk9vVC/pUSqgYmkmKOS8g==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + } + }, + "node_modules/chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ci-info": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.2.0.tgz", + "integrity": "sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A==", + "dev": true + }, + "node_modules/cjs-module-lexer": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", + "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", + "dev": true + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", + "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "dev": true + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/colors": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz", + "integrity": "sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "optional": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/cross-fetch": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", + "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", + "dev": true, + "dependencies": { + "node-fetch": "2.6.1" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cssom": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", + "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", + "dev": true + }, + "node_modules/cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "dependencies": { + "cssom": "~0.3.6" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cssstyle/node_modules/cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + }, + "node_modules/data-urls": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", + "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "dev": true, + "dependencies": { + "abab": "^2.0.3", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decimal.js": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", + "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", + "dev": true + }, + "node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/diff-sequences": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.4.0.tgz", + "integrity": "sha512-YqiQzkrsmHMH5uuh8OdQFU9/ZpADnwzml8z0O5HvRNda+5UZsaX/xN+AAxfR2hWq1Y7HZnAzO9J5lJXOuDz2Ww==", + "dev": true, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/domexception": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", + "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "dev": true, + "dependencies": { + "webidl-conversions": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/domexception/node_modules/webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", + "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.31", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.31.tgz", + "integrity": "sha512-t3XVQtk+Frkv6aTD4RRk0OqosU+VLe1dQFW83MDer78ZD6a52frgXuYOIsLYTQiH2Lm+JB2OKYcn7zrX+YGAiQ==", + "dev": true + }, + "node_modules/emittery": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", + "integrity": "sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/escodegen": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/escodegen/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/escodegen/node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/eslint": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.6.0.tgz", + "integrity": "sha512-UvxdOJ7mXFlw7iuHZA4jmzPaUqIw54mZrv+XPYKNbKdLR0et4rf60lIZUU9kiNtnzzMzGWxMV+tQ7uG7JG8DPw==", + "dev": true, + "dependencies": { + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.1.0", + "espree": "^9.3.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.2.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-formatter-pretty": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-formatter-pretty/-/eslint-formatter-pretty-4.1.0.tgz", + "integrity": "sha512-IsUTtGxF1hrH6lMWiSl1WbGaiP01eT6kzywdY1U+zLc0MP+nwEnUiS9UI8IaOTUhTeQJLlCEWIbXINBH4YJbBQ==", + "dev": true, + "dependencies": { + "@types/eslint": "^7.2.13", + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.0", + "eslint-rule-docs": "^1.1.5", + "log-symbols": "^4.0.0", + "plur": "^4.0.0", + "string-width": "^4.2.0", + "supports-hyperlinks": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-rule-docs": { + "version": "1.1.231", + "resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.231.tgz", + "integrity": "sha512-egHz9A1WG7b8CS0x1P6P/Rj5FqZOjray/VjpJa14tMZalfRKvpE2ONJ3plCM7+PcinmU4tcmbPLv0VtwzSdLVA==", + "dev": true + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/espree": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", + "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", + "dev": true, + "dependencies": { + "acorn": "^8.7.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.1.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-27.4.2.tgz", + "integrity": "sha512-BjAXIDC6ZOW+WBFNg96J22D27Nq5ohn+oGcuP2rtOtcjuxNoV9McpQ60PcQWhdFOSBIQdR72e+4HdnbZTFSTyg==", + "dev": true, + "dependencies": { + "@jest/types": "^27.4.2", + "ansi-styles": "^5.0.0", + "jest-get-type": "^27.4.0", + "jest-matcher-utils": "^27.4.2", + "jest-message-util": "^27.4.2", + "jest-regex-util": "^27.4.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/expect/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "node_modules/fastq": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", + "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", + "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "dev": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", + "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", + "dev": true + }, + "node_modules/form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "dev": true + }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hosted-git-info": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", + "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/html-encoding-sniffer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", + "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "dev": true, + "dependencies": { + "whatwg-encoding": "^1.0.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.3.tgz", + "integrity": "sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/irregular-plurals": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.3.0.tgz", + "integrity": "sha512-MVBLKUTangM3EfRPFROhmWQQKRDsrgI83J8GS3jXy+OwYqiR2/aoWndYQ5416jLE3uaGgLH7ncme3X9y09gZ3g==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "node_modules/is-core-module": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", + "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "dependencies": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.3.tgz", + "integrity": "sha512-x9LtDVtfm/t1GFiLl3NffC7hz+I1ragvgX1P/Lg1NlIagifZDKUkuuaAxH/qpwj2IuEfD8G2Bs/UKp+sZ/pKkg==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest/-/jest-27.4.5.tgz", + "integrity": "sha512-uT5MiVN3Jppt314kidCk47MYIRilJjA/l2mxwiuzzxGUeJIvA8/pDaJOAX5KWvjAo7SCydcW0/4WEtgbLMiJkg==", + "dev": true, + "dependencies": { + "@jest/core": "^27.4.5", + "import-local": "^3.0.2", + "jest-cli": "^27.4.5" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-27.4.2.tgz", + "integrity": "sha512-/9x8MjekuzUQoPjDHbBiXbNEBauhrPU2ct7m8TfCg69ywt1y/N+yYwGh3gCpnqUS3klYWDU/lSNgv+JhoD2k1A==", + "dev": true, + "dependencies": { + "@jest/types": "^27.4.2", + "execa": "^5.0.0", + "throat": "^6.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-circus": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-27.4.5.tgz", + "integrity": "sha512-eTNWa9wsvBwPykhMMShheafbwyakcdHZaEYh5iRrQ0PFJxkDP/e3U/FvzGuKWu2WpwUA3C3hPlfpuzvOdTVqnw==", + "dev": true, + "dependencies": { + "@jest/environment": "^27.4.4", + "@jest/test-result": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^0.7.0", + "expect": "^27.4.2", + "is-generator-fn": "^2.0.0", + "jest-each": "^27.4.2", + "jest-matcher-utils": "^27.4.2", + "jest-message-util": "^27.4.2", + "jest-runtime": "^27.4.5", + "jest-snapshot": "^27.4.5", + "jest-util": "^27.4.2", + "pretty-format": "^27.4.2", + "slash": "^3.0.0", + "stack-utils": "^2.0.3", + "throat": "^6.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-cli": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-27.4.5.tgz", + "integrity": "sha512-hrky3DSgE0u7sQxaCL7bdebEPHx5QzYmrGuUjaPLmPE8jx5adtvGuOlRspvMoVLTTDOHRnZDoRLYJuA+VCI7Hg==", + "dev": true, + "dependencies": { + "@jest/core": "^27.4.5", + "@jest/test-result": "^27.4.2", + "@jest/types": "^27.4.2", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "import-local": "^3.0.2", + "jest-config": "^27.4.5", + "jest-util": "^27.4.2", + "jest-validate": "^27.4.2", + "prompts": "^2.0.1", + "yargs": "^16.2.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-config": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-27.4.5.tgz", + "integrity": "sha512-t+STVJtPt+fpqQ8GBw850NtSQbnDOw/UzdPfzDaHQ48/AylQlW7LHj3dH+ndxhC1UxJ0Q3qkq7IH+nM1skwTwA==", + "dev": true, + "dependencies": { + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^27.4.5", + "@jest/types": "^27.4.2", + "babel-jest": "^27.4.5", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.1", + "graceful-fs": "^4.2.4", + "jest-circus": "^27.4.5", + "jest-environment-jsdom": "^27.4.4", + "jest-environment-node": "^27.4.4", + "jest-get-type": "^27.4.0", + "jest-jasmine2": "^27.4.5", + "jest-regex-util": "^27.4.0", + "jest-resolve": "^27.4.5", + "jest-runner": "^27.4.5", + "jest-util": "^27.4.2", + "jest-validate": "^27.4.2", + "micromatch": "^4.0.4", + "pretty-format": "^27.4.2", + "slash": "^3.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-diff": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.4.2.tgz", + "integrity": "sha512-ujc9ToyUZDh9KcqvQDkk/gkbf6zSaeEg9AiBxtttXW59H/AcqEYp1ciXAtJp+jXWva5nAf/ePtSsgWwE5mqp4Q==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^27.4.0", + "jest-get-type": "^27.4.0", + "pretty-format": "^27.4.2" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-27.4.0.tgz", + "integrity": "sha512-7TBazUdCKGV7svZ+gh7C8esAnweJoG+SvcF6Cjqj4l17zA2q1cMwx2JObSioubk317H+cjcHgP+7fTs60paulg==", + "dev": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-each": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-27.4.2.tgz", + "integrity": "sha512-53V2MNyW28CTruB3lXaHNk6PkiIFuzdOC9gR3C6j8YE/ACfrPnz+slB0s17AgU1TtxNzLuHyvNlLJ+8QYw9nBg==", + "dev": true, + "dependencies": { + "@jest/types": "^27.4.2", + "chalk": "^4.0.0", + "jest-get-type": "^27.4.0", + "jest-util": "^27.4.2", + "pretty-format": "^27.4.2" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-environment-jsdom": { + "version": "27.4.4", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-27.4.4.tgz", + "integrity": "sha512-cYR3ndNfHBqQgFvS1RL7dNqSvD//K56j/q1s2ygNHcfTCAp12zfIromO1w3COmXrxS8hWAh7+CmZmGCIoqGcGA==", + "dev": true, + "dependencies": { + "@jest/environment": "^27.4.4", + "@jest/fake-timers": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/node": "*", + "jest-mock": "^27.4.2", + "jest-util": "^27.4.2", + "jsdom": "^16.6.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-environment-node": { + "version": "27.4.4", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-27.4.4.tgz", + "integrity": "sha512-D+v3lbJ2GjQTQR23TK0kY3vFVmSeea05giInI41HHOaJnAwOnmUHTZgUaZL+VxUB43pIzoa7PMwWtCVlIUoVoA==", + "dev": true, + "dependencies": { + "@jest/environment": "^27.4.4", + "@jest/fake-timers": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/node": "*", + "jest-mock": "^27.4.2", + "jest-util": "^27.4.2" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-fetch-mock": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/jest-fetch-mock/-/jest-fetch-mock-3.0.3.tgz", + "integrity": "sha512-Ux1nWprtLrdrH4XwE7O7InRY6psIi3GOsqNESJgMJ+M5cv4A8Lh7SN9d2V2kKRZ8ebAfcd1LNyZguAOb6JiDqw==", + "dev": true, + "dependencies": { + "cross-fetch": "^3.0.4", + "promise-polyfill": "^8.1.3" + } + }, + "node_modules/jest-get-type": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.4.0.tgz", + "integrity": "sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ==", + "dev": true, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-27.4.5.tgz", + "integrity": "sha512-oJm1b5qhhPs78K24EDGifWS0dELYxnoBiDhatT/FThgB9yxqUm5F6li3Pv+Q+apMBmmPNzOBnZ7ZxWMB1Leq1Q==", + "dev": true, + "dependencies": { + "@jest/types": "^27.4.2", + "@types/graceful-fs": "^4.1.2", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.4", + "jest-regex-util": "^27.4.0", + "jest-serializer": "^27.4.0", + "jest-util": "^27.4.2", + "jest-worker": "^27.4.5", + "micromatch": "^4.0.4", + "walker": "^1.0.7" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-jasmine2": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-27.4.5.tgz", + "integrity": "sha512-oUnvwhJDj2LhOiUB1kdnJjkx8C5PwgUZQb9urF77mELH9DGR4e2GqpWQKBOYXWs5+uTN9BGDqRz3Aeg5Wts7aw==", + "dev": true, + "dependencies": { + "@babel/traverse": "^7.1.0", + "@jest/environment": "^27.4.4", + "@jest/source-map": "^27.4.0", + "@jest/test-result": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "expect": "^27.4.2", + "is-generator-fn": "^2.0.0", + "jest-each": "^27.4.2", + "jest-matcher-utils": "^27.4.2", + "jest-message-util": "^27.4.2", + "jest-runtime": "^27.4.5", + "jest-snapshot": "^27.4.5", + "jest-util": "^27.4.2", + "pretty-format": "^27.4.2", + "throat": "^6.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-leak-detector": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-27.4.2.tgz", + "integrity": "sha512-ml0KvFYZllzPBJWDei3mDzUhyp/M4ubKebX++fPaudpe8OsxUE+m+P6ciVLboQsrzOCWDjE20/eXew9QMx/VGw==", + "dev": true, + "dependencies": { + "jest-get-type": "^27.4.0", + "pretty-format": "^27.4.2" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.4.2.tgz", + "integrity": "sha512-jyP28er3RRtMv+fmYC/PKG8wvAmfGcSNproVTW2Y0P/OY7/hWUOmsPfxN1jOhM+0u2xU984u2yEagGivz9OBGQ==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^27.4.2", + "jest-get-type": "^27.4.0", + "pretty-format": "^27.4.2" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.4.2.tgz", + "integrity": "sha512-OMRqRNd9E0DkBLZpFtZkAGYOXl6ZpoMtQJWTAREJKDOFa0M6ptB7L67tp+cszMBkvSgKOhNtQp2Vbcz3ZZKo/w==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.4.2", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.4", + "pretty-format": "^27.4.2", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-mock": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-27.4.2.tgz", + "integrity": "sha512-PDDPuyhoukk20JrQKeofK12hqtSka7mWH0QQuxSNgrdiPsrnYYLS6wbzu/HDlxZRzji5ylLRULeuI/vmZZDrYA==", + "dev": true, + "dependencies": { + "@jest/types": "^27.4.2", + "@types/node": "*" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", + "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "dev": true, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.4.0.tgz", + "integrity": "sha512-WeCpMpNnqJYMQoOjm1nTtsgbR4XHAk1u00qDoNBQoykM280+/TmgA5Qh5giC1ecy6a5d4hbSsHzpBtu5yvlbEg==", + "dev": true, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-27.4.5.tgz", + "integrity": "sha512-xU3z1BuOz/hUhVUL+918KqUgK+skqOuUsAi7A+iwoUldK6/+PW+utK8l8cxIWT9AW7IAhGNXjSAh1UYmjULZZw==", + "dev": true, + "dependencies": { + "@jest/types": "^27.4.2", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.4.5", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^27.4.2", + "jest-validate": "^27.4.2", + "resolve": "^1.20.0", + "resolve.exports": "^1.1.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.5.tgz", + "integrity": "sha512-elEVvkvRK51y037NshtEkEnukMBWvlPzZHiL847OrIljJ8yIsujD2GXRPqDXC4rEVKbcdsy7W0FxoZb4WmEs7w==", + "dev": true, + "dependencies": { + "@jest/types": "^27.4.2", + "jest-regex-util": "^27.4.0", + "jest-snapshot": "^27.4.5" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-runner": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-27.4.5.tgz", + "integrity": "sha512-/irauncTfmY1WkTaRQGRWcyQLzK1g98GYG/8QvIPviHgO1Fqz1JYeEIsSfF+9mc/UTA6S+IIHFgKyvUrtiBIZg==", + "dev": true, + "dependencies": { + "@jest/console": "^27.4.2", + "@jest/environment": "^27.4.4", + "@jest/test-result": "^27.4.2", + "@jest/transform": "^27.4.5", + "@jest/types": "^27.4.2", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.8.1", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-docblock": "^27.4.0", + "jest-environment-jsdom": "^27.4.4", + "jest-environment-node": "^27.4.4", + "jest-haste-map": "^27.4.5", + "jest-leak-detector": "^27.4.2", + "jest-message-util": "^27.4.2", + "jest-resolve": "^27.4.5", + "jest-runtime": "^27.4.5", + "jest-util": "^27.4.2", + "jest-worker": "^27.4.5", + "source-map-support": "^0.5.6", + "throat": "^6.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-runtime": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-27.4.5.tgz", + "integrity": "sha512-CIYqwuJQXHQtPd/idgrx4zgJ6iCb6uBjQq1RSAGQrw2S8XifDmoM1Ot8NRd80ooAm+ZNdHVwsktIMGlA1F1FAQ==", + "dev": true, + "dependencies": { + "@jest/console": "^27.4.2", + "@jest/environment": "^27.4.4", + "@jest/globals": "^27.4.4", + "@jest/source-map": "^27.4.0", + "@jest/test-result": "^27.4.2", + "@jest/transform": "^27.4.5", + "@jest/types": "^27.4.2", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "execa": "^5.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.4.5", + "jest-message-util": "^27.4.2", + "jest-mock": "^27.4.2", + "jest-regex-util": "^27.4.0", + "jest-resolve": "^27.4.5", + "jest-snapshot": "^27.4.5", + "jest-util": "^27.4.2", + "jest-validate": "^27.4.2", + "slash": "^3.0.0", + "strip-bom": "^4.0.0", + "yargs": "^16.2.0" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-serializer": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-27.4.0.tgz", + "integrity": "sha512-RDhpcn5f1JYTX2pvJAGDcnsNTnsV9bjYPU8xcV+xPwOXnUPOQwf4ZEuiU6G9H1UztH+OapMgu/ckEVwO87PwnQ==", + "dev": true, + "dependencies": { + "@types/node": "*", + "graceful-fs": "^4.2.4" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-snapshot": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-27.4.5.tgz", + "integrity": "sha512-eCi/iM1YJFrJWiT9de4+RpWWWBqsHiYxFG9V9o/n0WXs6GpW4lUt4FAHAgFPTLPqCUVzrMQmSmTZSgQzwqR7IQ==", + "dev": true, + "dependencies": { + "@babel/core": "^7.7.2", + "@babel/generator": "^7.7.2", + "@babel/parser": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/traverse": "^7.7.2", + "@babel/types": "^7.0.0", + "@jest/transform": "^27.4.5", + "@jest/types": "^27.4.2", + "@types/babel__traverse": "^7.0.4", + "@types/prettier": "^2.1.5", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^27.4.2", + "graceful-fs": "^4.2.4", + "jest-diff": "^27.4.2", + "jest-get-type": "^27.4.0", + "jest-haste-map": "^27.4.5", + "jest-matcher-utils": "^27.4.2", + "jest-message-util": "^27.4.2", + "jest-resolve": "^27.4.5", + "jest-util": "^27.4.2", + "natural-compare": "^1.4.0", + "pretty-format": "^27.4.2", + "semver": "^7.3.2" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-util": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.4.2.tgz", + "integrity": "sha512-YuxxpXU6nlMan9qyLuxHaMMOzXAl5aGZWCSzben5DhLHemYQxCc4YK+4L3ZrCutT8GPQ+ui9k5D8rUJoDioMnA==", + "dev": true, + "dependencies": { + "@jest/types": "^27.4.2", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.4", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-validate": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-27.4.2.tgz", + "integrity": "sha512-hWYsSUej+Fs8ZhOm5vhWzwSLmVaPAxRy+Mr+z5MzeaHm9AxUpXdoVMEW4R86y5gOobVfBsMFLk4Rb+QkiEpx1A==", + "dev": true, + "dependencies": { + "@jest/types": "^27.4.2", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^27.4.0", + "leven": "^3.1.0", + "pretty-format": "^27.4.2" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", + "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-27.4.2.tgz", + "integrity": "sha512-NJvMVyyBeXfDezhWzUOCOYZrUmkSCiatpjpm+nFUid74OZEHk6aMLrZAukIiFDwdbqp6mTM6Ui1w4oc+8EobQg==", + "dev": true, + "dependencies": { + "@jest/test-result": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "jest-util": "^27.4.2", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/jest-websocket-mock": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/jest-websocket-mock/-/jest-websocket-mock-2.2.1.tgz", + "integrity": "sha512-fhsGLXrPfs06PhHoxqOSA9yZ6Rb4qYrf4Wcm7/nfRzjlrf1gIeuhYUkzMRjjE0TMQ37SwkmeLanwrZY4ZaNp8g==", + "dev": true, + "dependencies": { + "jest-diff": "^27.0.2" + }, + "peerDependencies": { + "mock-socket": "^8||^9" + } + }, + "node_modules/jest-worker": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.4.5.tgz", + "integrity": "sha512-f2s8kEdy15cv9r7q4KkzGXvlY0JTcmCbMHZBfSQDwW77REr45IDWwd0lksDFeVHH2jJ5pqb90T77XscrjeGzzg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/js-yaml/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/jsdom": { + "version": "16.7.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", + "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", + "dev": true, + "dependencies": { + "abab": "^2.0.5", + "acorn": "^8.2.4", + "acorn-globals": "^6.0.0", + "cssom": "^0.4.4", + "cssstyle": "^2.3.0", + "data-urls": "^2.0.0", + "decimal.js": "^10.2.1", + "domexception": "^2.0.1", + "escodegen": "^2.0.0", + "form-data": "^3.0.0", + "html-encoding-sniffer": "^2.0.1", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.0", + "parse5": "6.0.1", + "saxes": "^5.0.1", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.0.0", + "w3c-hr-time": "^1.0.2", + "w3c-xmlserializer": "^2.0.0", + "webidl-conversions": "^6.1.0", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.5.0", + "ws": "^7.4.6", + "xml-name-validator": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", + "dev": true + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/map-obj": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.1.tgz", + "integrity": "sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz", + "integrity": "sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==", + "dev": true, + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize": "^1.2.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/type-fest": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "dependencies": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "dev": true, + "dependencies": { + "mime-db": "1.51.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/mock-socket": { + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/mock-socket/-/mock-socket-9.0.8.tgz", + "integrity": "sha512-8Syqkaaa2SzRqW68DEsnZkKQicHP7hVzfj3uCvigB5TL79H1ljKbwmOcRIENkx0ZTyu/5W6u+Pk9Qy6JCp38Ww==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node_modules/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "dev": true, + "engines": { + "node": "4.x || >=6.0.0" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node_modules/node-releases": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", + "dev": true + }, + "node_modules/normalize-package-data": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.2.tgz", + "integrity": "sha512-6CdZocmfGaKnIHPVFhJJZ3GuR8SsLKvDANFp47Jmy51aKIr8akjAWTSxtpI+MBgBFdSMRyo4hMpDlT6dTffgZg==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "resolve": "^1.20.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nwsapi": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", + "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", + "dev": true + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", + "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.4.tgz", + "integrity": "sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/plur": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/plur/-/plur-4.0.0.tgz", + "integrity": "sha512-4UGewrYgqDFw9vV6zNV+ADmPAUAfJPKtGvb/VdpQAx25X5f3xXdGdyOEVFwkl8Hl/tl7+xbeHqSEM+D5/TirUg==", + "dev": true, + "dependencies": { + "irregular-plurals": "^3.2.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/pretty-format": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.4.2.tgz", + "integrity": "sha512-p0wNtJ9oLuvgOQDEIZ9zQjZffK7KtyR6Si0jnXULIDwrlNF8Cuir3AZP0hHv0jmKuNN/edOnbMjnzd4uTcmWiw==", + "dev": true, + "dependencies": { + "@jest/types": "^27.4.2", + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/promise-polyfill": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.2.0.tgz", + "integrity": "sha512-k/TC0mIcPVF6yHhUvwAp7cvL6I2fFV7TzF1DuGPI8mBh4QQazf36xCKEHKTZKRysEoTQoQdKyP25J8MPJp7j5g==", + "dev": true + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + }, + "node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/read-pkg/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/reconnecting-websocket": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/reconnecting-websocket/-/reconnecting-websocket-4.4.0.tgz", + "integrity": "sha512-D2E33ceRPga0NvTDhJmphEgJ7FUYF0v4lr1ki0csq06OdlxKfugGzN0dSkxM/NfqCxYELK4KcaTOUOjTV6Dcng==" + }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "dependencies": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve.exports": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.0.tgz", + "integrity": "sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/saxes": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "dev": true, + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", + "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", + "dev": true + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", + "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", + "dev": true + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true, + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", + "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "node_modules/terminal-link": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", + "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.2.1", + "supports-hyperlinks": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "node_modules/throat": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/throat/-/throat-6.0.1.tgz", + "integrity": "sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w==", + "dev": true + }, + "node_modules/timsort": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", + "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", + "dev": true + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tough-cookie": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", + "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "dev": true, + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.1.2" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tr46": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", + "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "dev": true, + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-jest": { + "version": "27.1.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.2.tgz", + "integrity": "sha512-eSOiJOWq6Hhs6Khzk5wKC5sgWIXgXqOCiIl1+3lfnearu58Hj4QpE5tUhQcA3xtZrELbcvAGCsd6HB8OsaVaTA==", + "dev": true, + "dependencies": { + "bs-logger": "0.x", + "fast-json-stable-stringify": "2.x", + "jest-util": "^27.0.0", + "json5": "2.x", + "lodash.memoize": "4.x", + "make-error": "1.x", + "semver": "7.x", + "yargs-parser": "20.x" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@types/jest": "^27.0.0", + "babel-jest": ">=27.0.0 <28", + "esbuild": "~0.14.0", + "jest": "^27.0.0", + "typescript": ">=3.8 <5.0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@types/jest": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } + } + }, + "node_modules/ts-node": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", + "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/tsd": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/tsd/-/tsd-0.19.1.tgz", + "integrity": "sha512-pSwchclr+ADdxlahRUQXUrdAIOjXx1T1PQV+fLfVLuo/S4z+T00YU84fH8iPlZxyA2pWgJjo42BG1p9SDb4NOw==", + "dev": true, + "dependencies": { + "@tsd/typescript": "~4.5.2", + "eslint-formatter-pretty": "^4.1.0", + "globby": "^11.0.1", + "meow": "^9.0.0", + "path-exists": "^4.0.0", + "read-pkg-up": "^7.0.0" + }, + "bin": { + "tsd": "dist/cli.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/typescript": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "node_modules/v8-to-istanbul": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz", + "integrity": "sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/v8-to-istanbul/node_modules/source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/validator": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", + "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/w3c-hr-time": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", + "dev": true, + "dependencies": { + "browser-process-hrtime": "^1.0.0" + } + }, + "node_modules/w3c-xmlserializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", + "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "dev": true, + "dependencies": { + "xml-name-validator": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/webidl-conversions": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "dev": true, + "engines": { + "node": ">=10.4" + } + }, + "node_modules/whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "dev": true, + "dependencies": { + "iconv-lite": "0.4.24" + } + }, + "node_modules/whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "dev": true + }, + "node_modules/whatwg-url": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", + "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "dev": true, + "dependencies": { + "lodash": "^4.7.0", + "tr46": "^2.1.0", + "webidl-conversions": "^6.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/ws": { + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", + "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", + "dev": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.7", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", + "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/z-schema": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-5.0.2.tgz", + "integrity": "sha512-40TH47ukMHq5HrzkeVE40Ad7eIDKaRV2b+Qpi2prLc9X9eFJFzV7tMe5aH12e6avaSS/u5l653EQOv+J9PirPw==", + "dev": true, + "dependencies": { + "lodash.get": "^4.4.2", + "lodash.isequal": "^4.5.0", + "validator": "^13.7.0" + }, + "bin": { + "z-schema": "bin/z-schema" + }, + "engines": { + "node": ">=8.0.0" + }, + "optionalDependencies": { + "commander": "^2.7.1" + } + } + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.16.7" + } + }, + "@babel/compat-data": { + "version": "7.16.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz", + "integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==", + "dev": true + }, + "@babel/core": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.7.tgz", + "integrity": "sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.7", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helpers": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.1.2", + "semver": "^6.3.0", + "source-map": "^0.5.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.7.tgz", + "integrity": "sha512-/ST3Sg8MLGY5HVYmrjOgL60ENux/HfO/CsUh7y4MalThufhE/Ff/6EibFDHi4jiDCaWfJKoqbE6oTh21c5hrRg==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/helper-compilation-targets": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.16.4", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.17.5", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@babel/helper-environment-visitor": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-function-name": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-module-imports": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-module-transforms": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", + "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", + "dev": true, + "requires": { + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", + "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", + "dev": true + }, + "@babel/helper-simple-access": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "dev": true + }, + "@babel/helpers": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", + "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", + "dev": true, + "requires": { + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" + } + }, + "@babel/highlight": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz", + "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@babel/parser": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.7.tgz", + "integrity": "sha512-sR4eaSrnM7BV7QPzGfEX5paG/6wrZM3I0HDzfIAK06ESvo9oy3xBuVBxE3MbQaKNhvg8g/ixjMWo2CGpzpHsDA==", + "dev": true + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + } + }, + "@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-typescript": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz", + "integrity": "sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" + } + }, + "@babel/template": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" + } + }, + "@babel/traverse": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.7.tgz", + "integrity": "sha512-8KWJPIb8c2VvY8AJrydh6+fVRo2ODx1wYBU2398xJVq0JomuLBZmVQzLPBblJgHIGYG4znCpUZUZ0Pt2vdmVYQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "dependencies": { + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.7.tgz", + "integrity": "sha512-E8HuV7FO9qLpx6OtoGfUQ2cjIYnbFwvZWYBS+87EwtdMvmUPJSwykpovFB+8insbpF0uJcpr8KMUi64XZntZcg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + } + }, + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "dev": true + }, + "@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "dev": true, + "requires": { + "@cspotcode/source-map-consumer": "0.8.0" + } + }, + "@eslint/eslintrc": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.2.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } + } + }, + "@humanwhocodes/config-array": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", + "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, + "@jest/console": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.4.2.tgz", + "integrity": "sha512-xknHThRsPB/To1FUbi6pCe43y58qFC03zfb6R7fDb/FfC7k2R3i1l+izRBJf8DI46KhYGRaF14Eo9A3qbBoixg==", + "dev": true, + "requires": { + "@jest/types": "^27.4.2", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^27.4.2", + "jest-util": "^27.4.2", + "slash": "^3.0.0" + } + }, + "@jest/core": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-27.4.5.tgz", + "integrity": "sha512-3tm/Pevmi8bDsgvo73nX8p/WPng6KWlCyScW10FPEoN1HU4pwI83tJ3TsFvi1FfzsjwUlMNEPowgb/rPau/LTQ==", + "dev": true, + "requires": { + "@jest/console": "^27.4.2", + "@jest/reporters": "^27.4.5", + "@jest/test-result": "^27.4.2", + "@jest/transform": "^27.4.5", + "@jest/types": "^27.4.2", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.8.1", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-changed-files": "^27.4.2", + "jest-config": "^27.4.5", + "jest-haste-map": "^27.4.5", + "jest-message-util": "^27.4.2", + "jest-regex-util": "^27.4.0", + "jest-resolve": "^27.4.5", + "jest-resolve-dependencies": "^27.4.5", + "jest-runner": "^27.4.5", + "jest-runtime": "^27.4.5", + "jest-snapshot": "^27.4.5", + "jest-util": "^27.4.2", + "jest-validate": "^27.4.2", + "jest-watcher": "^27.4.2", + "micromatch": "^4.0.4", + "rimraf": "^3.0.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "@jest/environment": { + "version": "27.4.4", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-27.4.4.tgz", + "integrity": "sha512-q+niMx7cJgt/t/b6dzLOh4W8Ef/8VyKG7hxASK39jakijJzbFBGpptx3RXz13FFV7OishQ9lTbv+dQ5K3EhfDQ==", + "dev": true, + "requires": { + "@jest/fake-timers": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/node": "*", + "jest-mock": "^27.4.2" + } + }, + "@jest/fake-timers": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-27.4.2.tgz", + "integrity": "sha512-f/Xpzn5YQk5adtqBgvw1V6bF8Nx3hY0OIRRpCvWcfPl0EAjdqWPdhH3t/3XpiWZqtjIEHDyMKP9ajpva1l4Zmg==", + "dev": true, + "requires": { + "@jest/types": "^27.4.2", + "@sinonjs/fake-timers": "^8.0.1", + "@types/node": "*", + "jest-message-util": "^27.4.2", + "jest-mock": "^27.4.2", + "jest-util": "^27.4.2" + } + }, + "@jest/globals": { + "version": "27.4.4", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-27.4.4.tgz", + "integrity": "sha512-bqpqQhW30BOreXM8bA8t8JbOQzsq/WnPTnBl+It3UxAD9J8yxEAaBEylHx1dtBapAr/UBk8GidXbzmqnee8tYQ==", + "dev": true, + "requires": { + "@jest/environment": "^27.4.4", + "@jest/types": "^27.4.2", + "expect": "^27.4.2" + } + }, + "@jest/reporters": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-27.4.5.tgz", + "integrity": "sha512-3orsG4vi8zXuBqEoy2LbnC1kuvkg1KQUgqNxmxpQgIOQEPeV0onvZu+qDQnEoX8qTQErtqn/xzcnbpeTuOLSiA==", + "dev": true, + "requires": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^27.4.2", + "@jest/test-result": "^27.4.2", + "@jest/transform": "^27.4.5", + "@jest/types": "^27.4.2", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.2", + "graceful-fs": "^4.2.4", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^4.0.3", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "jest-haste-map": "^27.4.5", + "jest-resolve": "^27.4.5", + "jest-util": "^27.4.2", + "jest-worker": "^27.4.5", + "slash": "^3.0.0", + "source-map": "^0.6.0", + "string-length": "^4.0.1", + "terminal-link": "^2.0.0", + "v8-to-istanbul": "^8.1.0" + } + }, + "@jest/source-map": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-27.4.0.tgz", + "integrity": "sha512-Ntjx9jzP26Bvhbm93z/AKcPRj/9wrkI88/gK60glXDx1q+IeI0rf7Lw2c89Ch6ofonB0On/iRDreQuQ6te9pgQ==", + "dev": true, + "requires": { + "callsites": "^3.0.0", + "graceful-fs": "^4.2.4", + "source-map": "^0.6.0" + } + }, + "@jest/test-result": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.4.2.tgz", + "integrity": "sha512-kr+bCrra9jfTgxHXHa2UwoQjxvQk3Am6QbpAiJ5x/50LW8llOYrxILkqY0lZRW/hu8FXesnudbql263+EW9iNA==", + "dev": true, + "requires": { + "@jest/console": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + } + }, + "@jest/test-sequencer": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-27.4.5.tgz", + "integrity": "sha512-n5woIn/1v+FT+9hniymHPARA9upYUmfi5Pw9ewVwXCDlK4F5/Gkees9v8vdjGdAIJ2MPHLHodiajLpZZanWzEQ==", + "dev": true, + "requires": { + "@jest/test-result": "^27.4.2", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.4.5", + "jest-runtime": "^27.4.5" + } + }, + "@jest/transform": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-27.4.5.tgz", + "integrity": "sha512-PuMet2UlZtlGzwc6L+aZmR3I7CEBpqadO03pU40l2RNY2fFJ191b9/ITB44LNOhVtsyykx0OZvj0PCyuLm7Eew==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/types": "^27.4.2", + "babel-plugin-istanbul": "^6.0.0", + "chalk": "^4.0.0", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.4.5", + "jest-regex-util": "^27.4.0", + "jest-util": "^27.4.2", + "micromatch": "^4.0.4", + "pirates": "^4.0.1", + "slash": "^3.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "^3.0.0" + } + }, + "@jest/types": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.4.2.tgz", + "integrity": "sha512-j35yw0PMTPpZsUoOBiuHzr1zTYoad1cVIE0ajEjcrJONxxrko/IRGKkXx3os0Nsi4Hu3+5VmDbVfq5WhG/pWAg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0" + } + }, + "@microsoft/api-extractor": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.19.3.tgz", + "integrity": "sha512-GZe+R3K4kh2X425iOHkPbByysB7FN0592mPPA6vNj5IhyhlPHgdZS6m6AmOZOIxMS4euM+SBKzEJEp3oC+WsOQ==", + "dev": true, + "requires": { + "@microsoft/api-extractor-model": "7.15.2", + "@microsoft/tsdoc": "0.13.2", + "@microsoft/tsdoc-config": "~0.15.2", + "@rushstack/node-core-library": "3.44.3", + "@rushstack/rig-package": "0.3.7", + "@rushstack/ts-command-line": "4.10.6", + "colors": "~1.2.1", + "lodash": "~4.17.15", + "resolve": "~1.17.0", + "semver": "~7.3.0", + "source-map": "~0.6.1", + "typescript": "~4.5.2" + }, + "dependencies": { + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "@microsoft/api-extractor-model": { + "version": "7.15.2", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.15.2.tgz", + "integrity": "sha512-qgxKX/s6vo3nCVLhP0Ds7555QrErhcYHEok5/KyEZ7iR8J5M5oldD1eJJQmtEdVF5IzmnPPbxx1nRvfgA674LQ==", + "dev": true, + "requires": { + "@microsoft/tsdoc": "0.13.2", + "@microsoft/tsdoc-config": "~0.15.2", + "@rushstack/node-core-library": "3.44.3" + } + }, + "@microsoft/tsdoc": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.13.2.tgz", + "integrity": "sha512-WrHvO8PDL8wd8T2+zBGKrMwVL5IyzR3ryWUsl0PXgEV0QHup4mTLi0QcATefGI6Gx9Anu7vthPyyyLpY0EpiQg==", + "dev": true + }, + "@microsoft/tsdoc-config": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.15.2.tgz", + "integrity": "sha512-mK19b2wJHSdNf8znXSMYVShAHktVr/ib0Ck2FA3lsVBSEhSI/TfXT7DJQkAYgcztTuwazGcg58ZjYdk0hTCVrA==", + "dev": true, + "requires": { + "@microsoft/tsdoc": "0.13.2", + "ajv": "~6.12.6", + "jju": "~1.4.0", + "resolve": "~1.19.0" + }, + "dependencies": { + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + } + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + } + }, + "@rushstack/node-core-library": { + "version": "3.44.3", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.44.3.tgz", + "integrity": "sha512-Bt+R5LAnVr2BImTJqPpton5rvhJ2Wq8x4BaTqaCHQMmfxqtz5lb4nLYT9kneMJTCDuRMBvvLpSuz4MBj50PV3w==", + "dev": true, + "requires": { + "@types/node": "12.20.24", + "colors": "~1.2.1", + "fs-extra": "~7.0.1", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.17.0", + "semver": "~7.3.0", + "timsort": "~0.3.0", + "z-schema": "~5.0.2" + }, + "dependencies": { + "@types/node": { + "version": "12.20.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.24.tgz", + "integrity": "sha512-yxDeaQIAJlMav7fH5AQqPH1u8YIuhYJXYBzxaQ4PifsU0GDO38MSdmEDeRlIxrKbC6NbEaaEHDanWb+y30U8SQ==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "@rushstack/rig-package": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.3.7.tgz", + "integrity": "sha512-pzMsTSeTC8IiZ6EJLr53gGMvhT4oLWH+hxD7907cHyWuIUlEXFtu/2pK25vUQT13nKp5DJCWxXyYoGRk/h6rtA==", + "dev": true, + "requires": { + "resolve": "~1.17.0", + "strip-json-comments": "~3.1.1" + }, + "dependencies": { + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "@rushstack/ts-command-line": { + "version": "4.10.6", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.10.6.tgz", + "integrity": "sha512-Y3GkUag39sTIlukDg9mUp8MCHrrlJ27POrBNRQGc/uF+VVgX8M7zMzHch5zP6O1QVquWgD7Engdpn2piPYaS/g==", + "dev": true, + "requires": { + "@types/argparse": "1.0.38", + "argparse": "~1.0.9", + "colors": "~1.2.1", + "string-argv": "~0.3.1" + } + }, + "@sinonjs/commons": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", + "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz", + "integrity": "sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true + }, + "@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true + }, + "@tsd/typescript": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/@tsd/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-iDlLkdg3sCjUSNdoUCsYM/SXheHrdxHsR6msIkbFDW4pV6gHTMwg/8te/paLtywDjGL4S4ByDdUKA3RbfdBX0g==", + "dev": true + }, + "@types/argparse": { + "version": "1.0.38", + "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", + "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", + "dev": true + }, + "@types/babel__core": { + "version": "7.1.18", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.18.tgz", + "integrity": "sha512-S7unDjm/C7z2A2R9NzfKCK1I+BAALDtxEmsJBwlB3EzNfb929ykjL++1CK9LO++EIp2fQrC8O+BwjKvz6UeDyQ==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "@types/babel__generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", + "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@types/babel__template": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", + "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz", + "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==", + "dev": true, + "requires": { + "@babel/types": "^7.3.0" + } + }, + "@types/eslint": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.29.0.tgz", + "integrity": "sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/estree": { + "version": "0.0.50", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", + "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", + "dev": true + }, + "@types/graceful-fs": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", + "integrity": "sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", + "dev": true + }, + "@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz", + "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/jest": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.4.0.tgz", + "integrity": "sha512-gHl8XuC1RZ8H2j5sHv/JqsaxXkDDM9iDOgu0Wp8sjs4u/snb2PVehyWXJPr+ORA0RPpgw231mnutWI1+0hgjIQ==", + "dev": true, + "requires": { + "jest-diff": "^27.0.0", + "pretty-format": "^27.0.0" + } + }, + "@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true + }, + "@types/minimist": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz", + "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==", + "dev": true + }, + "@types/node": { + "version": "17.0.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.5.tgz", + "integrity": "sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw==", + "dev": true + }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true + }, + "@types/prettier": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.2.tgz", + "integrity": "sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA==", + "dev": true + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/yargs": { + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", + "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "20.2.1", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", + "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", + "dev": true + }, + "@typescript-eslint/eslint-plugin": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.1.tgz", + "integrity": "sha512-wTZ5oEKrKj/8/366qTM366zqhIKAp6NCMweoRONtfuC07OAU9nVI2GZZdqQ1qD30WAAtcPdkH+npDwtRFdp4Rw==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "5.8.1", + "@typescript-eslint/scope-manager": "5.8.1", + "debug": "^4.3.2", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", + "regexpp": "^3.2.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.1.tgz", + "integrity": "sha512-fbodVnjIDU4JpeXWRDsG5IfIjYBxEvs8EBO8W1+YVdtrc2B9ppfof5sZhVEDOtgTfFHnYQJDI8+qdqLYO4ceww==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.8.1", + "@typescript-eslint/types": "5.8.1", + "@typescript-eslint/typescript-estree": "5.8.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.8.1.tgz", + "integrity": "sha512-K1giKHAjHuyB421SoXMXFHHVI4NdNY603uKw92++D3qyxSeYvC10CBJ/GE5Thpo4WTUvu1mmJI2/FFkz38F2Gw==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.8.1", + "@typescript-eslint/types": "5.8.1", + "@typescript-eslint/typescript-estree": "5.8.1", + "debug": "^4.3.2" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.8.1.tgz", + "integrity": "sha512-DGxJkNyYruFH3NIZc3PwrzwOQAg7vvgsHsHCILOLvUpupgkwDZdNq/cXU3BjF4LNrCsVg0qxEyWasys5AiJ85Q==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.8.1", + "@typescript-eslint/visitor-keys": "5.8.1" + } + }, + "@typescript-eslint/types": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.8.1.tgz", + "integrity": "sha512-L/FlWCCgnjKOLefdok90/pqInkomLnAcF9UAzNr+DSqMC3IffzumHTQTrINXhP1gVp9zlHiYYjvozVZDPleLcA==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.1.tgz", + "integrity": "sha512-26lQ8l8tTbG7ri7xEcCFT9ijU5Fk+sx/KRRyyzCv7MQ+rZZlqiDPtMKWLC8P7o+dtCnby4c+OlxuX1tp8WfafQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.8.1", + "@typescript-eslint/visitor-keys": "5.8.1", + "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": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.1.tgz", + "integrity": "sha512-SWgiWIwocK6NralrJarPZlWdr0hZnj5GXHIgfdm8hNkyKvpeQuFyLP6YjSIe9kf3YBIfU6OHSZLYkQ+smZwtNg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.8.1", + "eslint-visitor-keys": "^3.0.0" + } + }, + "abab": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", + "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "dev": true + }, + "acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "dev": true + }, + "acorn-globals": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" + }, + "dependencies": { + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + } + } + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "requires": {} + }, + "acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "dev": true + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "requires": { + "debug": "4" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "requires": { + "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true + } + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "autobind-decorator": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/autobind-decorator/-/autobind-decorator-2.4.0.tgz", + "integrity": "sha512-OGYhWUO72V6DafbF8PM8rm3EPbfuyMZcJhtm5/n26IDwO18pohE4eNazLoCGhPiXOCD0gEGmrbU3849QvM8bbw==" + }, + "babel-jest": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.4.5.tgz", + "integrity": "sha512-3uuUTjXbgtODmSv/DXO9nZfD52IyC2OYTFaXGRzL0kpykzroaquCrD5+lZNafTvZlnNqZHt5pb0M08qVBZnsnA==", + "dev": true, + "requires": { + "@jest/transform": "^27.4.5", + "@jest/types": "^27.4.2", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.0.0", + "babel-preset-jest": "^27.4.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "slash": "^3.0.0" + } + }, + "babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "dependencies": { + "istanbul-lib-instrument": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz", + "integrity": "sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q==", + "dev": true, + "requires": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "babel-plugin-jest-hoist": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.4.0.tgz", + "integrity": "sha512-Jcu7qS4OX5kTWBc45Hz7BMmgXuJqRnhatqpUhnzGC3OBYpOmf2tv6jFNwZpwM7wU7MUuv2r9IPS/ZlYOuburVw==", + "dev": true, + "requires": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.0.0", + "@types/babel__traverse": "^7.0.6" + } + }, + "babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "requires": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + } + }, + "babel-preset-jest": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-27.4.0.tgz", + "integrity": "sha512-NK4jGYpnBvNxcGo7/ZpZJr51jCGT+3bwwpVIDY2oNfTxJJldRtB4VAcYdgp1loDE50ODuTu+yBjpMAswv5tlpg==", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^27.4.0", + "babel-preset-current-node-syntax": "^1.0.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "browser-process-hrtime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", + "dev": true + }, + "browserslist": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001286", + "electron-to-chromium": "^1.4.17", + "escalade": "^3.1.1", + "node-releases": "^2.0.1", + "picocolors": "^1.0.0" + } + }, + "bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "requires": { + "fast-json-stable-stringify": "2.x" + } + }, + "bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "requires": { + "node-int64": "^0.4.0" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + } + }, + "caniuse-lite": { + "version": "1.0.30001294", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001294.tgz", + "integrity": "sha512-LiMlrs1nSKZ8qkNhpUf5KD0Al1KCBE3zaT7OLOwEkagXMEDij98SiOovn9wxVGQpklk9vVC/pUSqgYmkmKOS8g==", + "dev": true + }, + "chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true + }, + "ci-info": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.2.0.tgz", + "integrity": "sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A==", + "dev": true + }, + "cjs-module-lexer": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", + "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", + "dev": true + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "collect-v8-coverage": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", + "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "colors": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz", + "integrity": "sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "cross-fetch": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", + "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", + "dev": true, + "requires": { + "node-fetch": "2.6.1" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "cssom": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", + "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", + "dev": true + }, + "cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "requires": { + "cssom": "~0.3.6" + }, + "dependencies": { + "cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + } + } + }, + "data-urls": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", + "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "dev": true, + "requires": { + "abab": "^2.0.3", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0" + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, + "decimal.js": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", + "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", + "dev": true + }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "diff-sequences": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.4.0.tgz", + "integrity": "sha512-YqiQzkrsmHMH5uuh8OdQFU9/ZpADnwzml8z0O5HvRNda+5UZsaX/xN+AAxfR2hWq1Y7HZnAzO9J5lJXOuDz2Ww==", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "domexception": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", + "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "dev": true, + "requires": { + "webidl-conversions": "^5.0.0" + }, + "dependencies": { + "webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", + "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "dev": true + } + } + }, + "electron-to-chromium": { + "version": "1.4.31", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.31.tgz", + "integrity": "sha512-t3XVQtk+Frkv6aTD4RRk0OqosU+VLe1dQFW83MDer78ZD6a52frgXuYOIsLYTQiH2Lm+JB2OKYcn7zrX+YGAiQ==", + "dev": true + }, + "emittery": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", + "integrity": "sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "escodegen": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + } + } + }, + "eslint": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.6.0.tgz", + "integrity": "sha512-UvxdOJ7mXFlw7iuHZA4jmzPaUqIw54mZrv+XPYKNbKdLR0et4rf60lIZUU9kiNtnzzMzGWxMV+tQ7uG7JG8DPw==", + "dev": true, + "requires": { + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.0", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.1.0", + "espree": "^9.3.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.2.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "eslint-scope": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } + } + }, + "eslint-formatter-pretty": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-formatter-pretty/-/eslint-formatter-pretty-4.1.0.tgz", + "integrity": "sha512-IsUTtGxF1hrH6lMWiSl1WbGaiP01eT6kzywdY1U+zLc0MP+nwEnUiS9UI8IaOTUhTeQJLlCEWIbXINBH4YJbBQ==", + "dev": true, + "requires": { + "@types/eslint": "^7.2.13", + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.0", + "eslint-rule-docs": "^1.1.5", + "log-symbols": "^4.0.0", + "plur": "^4.0.0", + "string-width": "^4.2.0", + "supports-hyperlinks": "^2.0.0" + } + }, + "eslint-rule-docs": { + "version": "1.1.231", + "resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.231.tgz", + "integrity": "sha512-egHz9A1WG7b8CS0x1P6P/Rj5FqZOjray/VjpJa14tMZalfRKvpE2ONJ3plCM7+PcinmU4tcmbPLv0VtwzSdLVA==", + "dev": true + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", + "dev": true + }, + "espree": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.0.tgz", + "integrity": "sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==", + "dev": true, + "requires": { + "acorn": "^8.7.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.1.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" + }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "expect": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-27.4.2.tgz", + "integrity": "sha512-BjAXIDC6ZOW+WBFNg96J22D27Nq5ohn+oGcuP2rtOtcjuxNoV9McpQ60PcQWhdFOSBIQdR72e+4HdnbZTFSTyg==", + "dev": true, + "requires": { + "@jest/types": "^27.4.2", + "ansi-styles": "^5.0.0", + "jest-get-type": "^27.4.0", + "jest-matcher-utils": "^27.4.2", + "jest-message-util": "^27.4.2", + "jest-regex-util": "^27.4.0" + }, + "dependencies": { + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true + } + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fastq": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", + "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "fb-watchman": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", + "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "dev": true, + "requires": { + "bser": "2.1.1" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.4.tgz", + "integrity": "sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==", + "dev": true + }, + "form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "dev": true + }, + "hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "hosted-git-info": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", + "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "html-encoding-sniffer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", + "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.5" + } + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + } + }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "dev": true + }, + "import-local": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.3.tgz", + "integrity": "sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "irregular-plurals": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.3.0.tgz", + "integrity": "sha512-MVBLKUTangM3EfRPFROhmWQQKRDsrgI83J8GS3jXy+OwYqiR2/aoWndYQ5416jLE3uaGgLH7ncme3X9y09gZ3g==", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-core-module": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", + "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + } + }, + "istanbul-reports": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.3.tgz", + "integrity": "sha512-x9LtDVtfm/t1GFiLl3NffC7hz+I1ragvgX1P/Lg1NlIagifZDKUkuuaAxH/qpwj2IuEfD8G2Bs/UKp+sZ/pKkg==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jest": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest/-/jest-27.4.5.tgz", + "integrity": "sha512-uT5MiVN3Jppt314kidCk47MYIRilJjA/l2mxwiuzzxGUeJIvA8/pDaJOAX5KWvjAo7SCydcW0/4WEtgbLMiJkg==", + "dev": true, + "requires": { + "@jest/core": "^27.4.5", + "import-local": "^3.0.2", + "jest-cli": "^27.4.5" + } + }, + "jest-changed-files": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-27.4.2.tgz", + "integrity": "sha512-/9x8MjekuzUQoPjDHbBiXbNEBauhrPU2ct7m8TfCg69ywt1y/N+yYwGh3gCpnqUS3klYWDU/lSNgv+JhoD2k1A==", + "dev": true, + "requires": { + "@jest/types": "^27.4.2", + "execa": "^5.0.0", + "throat": "^6.0.1" + } + }, + "jest-circus": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-27.4.5.tgz", + "integrity": "sha512-eTNWa9wsvBwPykhMMShheafbwyakcdHZaEYh5iRrQ0PFJxkDP/e3U/FvzGuKWu2WpwUA3C3hPlfpuzvOdTVqnw==", + "dev": true, + "requires": { + "@jest/environment": "^27.4.4", + "@jest/test-result": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^0.7.0", + "expect": "^27.4.2", + "is-generator-fn": "^2.0.0", + "jest-each": "^27.4.2", + "jest-matcher-utils": "^27.4.2", + "jest-message-util": "^27.4.2", + "jest-runtime": "^27.4.5", + "jest-snapshot": "^27.4.5", + "jest-util": "^27.4.2", + "pretty-format": "^27.4.2", + "slash": "^3.0.0", + "stack-utils": "^2.0.3", + "throat": "^6.0.1" + } + }, + "jest-cli": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-27.4.5.tgz", + "integrity": "sha512-hrky3DSgE0u7sQxaCL7bdebEPHx5QzYmrGuUjaPLmPE8jx5adtvGuOlRspvMoVLTTDOHRnZDoRLYJuA+VCI7Hg==", + "dev": true, + "requires": { + "@jest/core": "^27.4.5", + "@jest/test-result": "^27.4.2", + "@jest/types": "^27.4.2", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "import-local": "^3.0.2", + "jest-config": "^27.4.5", + "jest-util": "^27.4.2", + "jest-validate": "^27.4.2", + "prompts": "^2.0.1", + "yargs": "^16.2.0" + } + }, + "jest-config": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-27.4.5.tgz", + "integrity": "sha512-t+STVJtPt+fpqQ8GBw850NtSQbnDOw/UzdPfzDaHQ48/AylQlW7LHj3dH+ndxhC1UxJ0Q3qkq7IH+nM1skwTwA==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^27.4.5", + "@jest/types": "^27.4.2", + "babel-jest": "^27.4.5", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.1", + "graceful-fs": "^4.2.4", + "jest-circus": "^27.4.5", + "jest-environment-jsdom": "^27.4.4", + "jest-environment-node": "^27.4.4", + "jest-get-type": "^27.4.0", + "jest-jasmine2": "^27.4.5", + "jest-regex-util": "^27.4.0", + "jest-resolve": "^27.4.5", + "jest-runner": "^27.4.5", + "jest-util": "^27.4.2", + "jest-validate": "^27.4.2", + "micromatch": "^4.0.4", + "pretty-format": "^27.4.2", + "slash": "^3.0.0" + } + }, + "jest-diff": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.4.2.tgz", + "integrity": "sha512-ujc9ToyUZDh9KcqvQDkk/gkbf6zSaeEg9AiBxtttXW59H/AcqEYp1ciXAtJp+jXWva5nAf/ePtSsgWwE5mqp4Q==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "diff-sequences": "^27.4.0", + "jest-get-type": "^27.4.0", + "pretty-format": "^27.4.2" + } + }, + "jest-docblock": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-27.4.0.tgz", + "integrity": "sha512-7TBazUdCKGV7svZ+gh7C8esAnweJoG+SvcF6Cjqj4l17zA2q1cMwx2JObSioubk317H+cjcHgP+7fTs60paulg==", + "dev": true, + "requires": { + "detect-newline": "^3.0.0" + } + }, + "jest-each": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-27.4.2.tgz", + "integrity": "sha512-53V2MNyW28CTruB3lXaHNk6PkiIFuzdOC9gR3C6j8YE/ACfrPnz+slB0s17AgU1TtxNzLuHyvNlLJ+8QYw9nBg==", + "dev": true, + "requires": { + "@jest/types": "^27.4.2", + "chalk": "^4.0.0", + "jest-get-type": "^27.4.0", + "jest-util": "^27.4.2", + "pretty-format": "^27.4.2" + } + }, + "jest-environment-jsdom": { + "version": "27.4.4", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-27.4.4.tgz", + "integrity": "sha512-cYR3ndNfHBqQgFvS1RL7dNqSvD//K56j/q1s2ygNHcfTCAp12zfIromO1w3COmXrxS8hWAh7+CmZmGCIoqGcGA==", + "dev": true, + "requires": { + "@jest/environment": "^27.4.4", + "@jest/fake-timers": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/node": "*", + "jest-mock": "^27.4.2", + "jest-util": "^27.4.2", + "jsdom": "^16.6.0" + } + }, + "jest-environment-node": { + "version": "27.4.4", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-27.4.4.tgz", + "integrity": "sha512-D+v3lbJ2GjQTQR23TK0kY3vFVmSeea05giInI41HHOaJnAwOnmUHTZgUaZL+VxUB43pIzoa7PMwWtCVlIUoVoA==", + "dev": true, + "requires": { + "@jest/environment": "^27.4.4", + "@jest/fake-timers": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/node": "*", + "jest-mock": "^27.4.2", + "jest-util": "^27.4.2" + } + }, + "jest-fetch-mock": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/jest-fetch-mock/-/jest-fetch-mock-3.0.3.tgz", + "integrity": "sha512-Ux1nWprtLrdrH4XwE7O7InRY6psIi3GOsqNESJgMJ+M5cv4A8Lh7SN9d2V2kKRZ8ebAfcd1LNyZguAOb6JiDqw==", + "dev": true, + "requires": { + "cross-fetch": "^3.0.4", + "promise-polyfill": "^8.1.3" + } + }, + "jest-get-type": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.4.0.tgz", + "integrity": "sha512-tk9o+ld5TWq41DkK14L4wox4s2D9MtTpKaAVzXfr5CUKm5ZK2ExcaFE0qls2W71zE/6R2TxxrK9w2r6svAFDBQ==", + "dev": true + }, + "jest-haste-map": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-27.4.5.tgz", + "integrity": "sha512-oJm1b5qhhPs78K24EDGifWS0dELYxnoBiDhatT/FThgB9yxqUm5F6li3Pv+Q+apMBmmPNzOBnZ7ZxWMB1Leq1Q==", + "dev": true, + "requires": { + "@jest/types": "^27.4.2", + "@types/graceful-fs": "^4.1.2", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "fsevents": "^2.3.2", + "graceful-fs": "^4.2.4", + "jest-regex-util": "^27.4.0", + "jest-serializer": "^27.4.0", + "jest-util": "^27.4.2", + "jest-worker": "^27.4.5", + "micromatch": "^4.0.4", + "walker": "^1.0.7" + } + }, + "jest-jasmine2": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-27.4.5.tgz", + "integrity": "sha512-oUnvwhJDj2LhOiUB1kdnJjkx8C5PwgUZQb9urF77mELH9DGR4e2GqpWQKBOYXWs5+uTN9BGDqRz3Aeg5Wts7aw==", + "dev": true, + "requires": { + "@babel/traverse": "^7.1.0", + "@jest/environment": "^27.4.4", + "@jest/source-map": "^27.4.0", + "@jest/test-result": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "expect": "^27.4.2", + "is-generator-fn": "^2.0.0", + "jest-each": "^27.4.2", + "jest-matcher-utils": "^27.4.2", + "jest-message-util": "^27.4.2", + "jest-runtime": "^27.4.5", + "jest-snapshot": "^27.4.5", + "jest-util": "^27.4.2", + "pretty-format": "^27.4.2", + "throat": "^6.0.1" + } + }, + "jest-leak-detector": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-27.4.2.tgz", + "integrity": "sha512-ml0KvFYZllzPBJWDei3mDzUhyp/M4ubKebX++fPaudpe8OsxUE+m+P6ciVLboQsrzOCWDjE20/eXew9QMx/VGw==", + "dev": true, + "requires": { + "jest-get-type": "^27.4.0", + "pretty-format": "^27.4.2" + } + }, + "jest-matcher-utils": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.4.2.tgz", + "integrity": "sha512-jyP28er3RRtMv+fmYC/PKG8wvAmfGcSNproVTW2Y0P/OY7/hWUOmsPfxN1jOhM+0u2xU984u2yEagGivz9OBGQ==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "jest-diff": "^27.4.2", + "jest-get-type": "^27.4.0", + "pretty-format": "^27.4.2" + } + }, + "jest-message-util": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.4.2.tgz", + "integrity": "sha512-OMRqRNd9E0DkBLZpFtZkAGYOXl6ZpoMtQJWTAREJKDOFa0M6ptB7L67tp+cszMBkvSgKOhNtQp2Vbcz3ZZKo/w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^27.4.2", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.4", + "pretty-format": "^27.4.2", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "jest-mock": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-27.4.2.tgz", + "integrity": "sha512-PDDPuyhoukk20JrQKeofK12hqtSka7mWH0QQuxSNgrdiPsrnYYLS6wbzu/HDlxZRzji5ylLRULeuI/vmZZDrYA==", + "dev": true, + "requires": { + "@jest/types": "^27.4.2", + "@types/node": "*" + } + }, + "jest-pnp-resolver": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", + "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "dev": true, + "requires": {} + }, + "jest-regex-util": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.4.0.tgz", + "integrity": "sha512-WeCpMpNnqJYMQoOjm1nTtsgbR4XHAk1u00qDoNBQoykM280+/TmgA5Qh5giC1ecy6a5d4hbSsHzpBtu5yvlbEg==", + "dev": true + }, + "jest-resolve": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-27.4.5.tgz", + "integrity": "sha512-xU3z1BuOz/hUhVUL+918KqUgK+skqOuUsAi7A+iwoUldK6/+PW+utK8l8cxIWT9AW7IAhGNXjSAh1UYmjULZZw==", + "dev": true, + "requires": { + "@jest/types": "^27.4.2", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.4.5", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^27.4.2", + "jest-validate": "^27.4.2", + "resolve": "^1.20.0", + "resolve.exports": "^1.1.0", + "slash": "^3.0.0" + } + }, + "jest-resolve-dependencies": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-27.4.5.tgz", + "integrity": "sha512-elEVvkvRK51y037NshtEkEnukMBWvlPzZHiL847OrIljJ8yIsujD2GXRPqDXC4rEVKbcdsy7W0FxoZb4WmEs7w==", + "dev": true, + "requires": { + "@jest/types": "^27.4.2", + "jest-regex-util": "^27.4.0", + "jest-snapshot": "^27.4.5" + } + }, + "jest-runner": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-27.4.5.tgz", + "integrity": "sha512-/irauncTfmY1WkTaRQGRWcyQLzK1g98GYG/8QvIPviHgO1Fqz1JYeEIsSfF+9mc/UTA6S+IIHFgKyvUrtiBIZg==", + "dev": true, + "requires": { + "@jest/console": "^27.4.2", + "@jest/environment": "^27.4.4", + "@jest/test-result": "^27.4.2", + "@jest/transform": "^27.4.5", + "@jest/types": "^27.4.2", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.8.1", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-docblock": "^27.4.0", + "jest-environment-jsdom": "^27.4.4", + "jest-environment-node": "^27.4.4", + "jest-haste-map": "^27.4.5", + "jest-leak-detector": "^27.4.2", + "jest-message-util": "^27.4.2", + "jest-resolve": "^27.4.5", + "jest-runtime": "^27.4.5", + "jest-util": "^27.4.2", + "jest-worker": "^27.4.5", + "source-map-support": "^0.5.6", + "throat": "^6.0.1" + } + }, + "jest-runtime": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-27.4.5.tgz", + "integrity": "sha512-CIYqwuJQXHQtPd/idgrx4zgJ6iCb6uBjQq1RSAGQrw2S8XifDmoM1Ot8NRd80ooAm+ZNdHVwsktIMGlA1F1FAQ==", + "dev": true, + "requires": { + "@jest/console": "^27.4.2", + "@jest/environment": "^27.4.4", + "@jest/globals": "^27.4.4", + "@jest/source-map": "^27.4.0", + "@jest/test-result": "^27.4.2", + "@jest/transform": "^27.4.5", + "@jest/types": "^27.4.2", + "@types/yargs": "^16.0.0", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "execa": "^5.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^27.4.5", + "jest-message-util": "^27.4.2", + "jest-mock": "^27.4.2", + "jest-regex-util": "^27.4.0", + "jest-resolve": "^27.4.5", + "jest-snapshot": "^27.4.5", + "jest-util": "^27.4.2", + "jest-validate": "^27.4.2", + "slash": "^3.0.0", + "strip-bom": "^4.0.0", + "yargs": "^16.2.0" + } + }, + "jest-serializer": { + "version": "27.4.0", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-27.4.0.tgz", + "integrity": "sha512-RDhpcn5f1JYTX2pvJAGDcnsNTnsV9bjYPU8xcV+xPwOXnUPOQwf4ZEuiU6G9H1UztH+OapMgu/ckEVwO87PwnQ==", + "dev": true, + "requires": { + "@types/node": "*", + "graceful-fs": "^4.2.4" + } + }, + "jest-snapshot": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-27.4.5.tgz", + "integrity": "sha512-eCi/iM1YJFrJWiT9de4+RpWWWBqsHiYxFG9V9o/n0WXs6GpW4lUt4FAHAgFPTLPqCUVzrMQmSmTZSgQzwqR7IQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.2", + "@babel/generator": "^7.7.2", + "@babel/parser": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/traverse": "^7.7.2", + "@babel/types": "^7.0.0", + "@jest/transform": "^27.4.5", + "@jest/types": "^27.4.2", + "@types/babel__traverse": "^7.0.4", + "@types/prettier": "^2.1.5", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^27.4.2", + "graceful-fs": "^4.2.4", + "jest-diff": "^27.4.2", + "jest-get-type": "^27.4.0", + "jest-haste-map": "^27.4.5", + "jest-matcher-utils": "^27.4.2", + "jest-message-util": "^27.4.2", + "jest-resolve": "^27.4.5", + "jest-util": "^27.4.2", + "natural-compare": "^1.4.0", + "pretty-format": "^27.4.2", + "semver": "^7.3.2" + } + }, + "jest-util": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.4.2.tgz", + "integrity": "sha512-YuxxpXU6nlMan9qyLuxHaMMOzXAl5aGZWCSzben5DhLHemYQxCc4YK+4L3ZrCutT8GPQ+ui9k5D8rUJoDioMnA==", + "dev": true, + "requires": { + "@jest/types": "^27.4.2", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.4", + "picomatch": "^2.2.3" + } + }, + "jest-validate": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-27.4.2.tgz", + "integrity": "sha512-hWYsSUej+Fs8ZhOm5vhWzwSLmVaPAxRy+Mr+z5MzeaHm9AxUpXdoVMEW4R86y5gOobVfBsMFLk4Rb+QkiEpx1A==", + "dev": true, + "requires": { + "@jest/types": "^27.4.2", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^27.4.0", + "leven": "^3.1.0", + "pretty-format": "^27.4.2" + }, + "dependencies": { + "camelcase": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.1.tgz", + "integrity": "sha512-tVI4q5jjFV5CavAU8DXfza/TJcZutVKo/5Foskmsqcm0MsL91moHvwiGNnqaa2o6PF/7yT5ikDRcVcl8Rj6LCA==", + "dev": true + } + } + }, + "jest-watcher": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-27.4.2.tgz", + "integrity": "sha512-NJvMVyyBeXfDezhWzUOCOYZrUmkSCiatpjpm+nFUid74OZEHk6aMLrZAukIiFDwdbqp6mTM6Ui1w4oc+8EobQg==", + "dev": true, + "requires": { + "@jest/test-result": "^27.4.2", + "@jest/types": "^27.4.2", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "jest-util": "^27.4.2", + "string-length": "^4.0.1" + } + }, + "jest-websocket-mock": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/jest-websocket-mock/-/jest-websocket-mock-2.2.1.tgz", + "integrity": "sha512-fhsGLXrPfs06PhHoxqOSA9yZ6Rb4qYrf4Wcm7/nfRzjlrf1gIeuhYUkzMRjjE0TMQ37SwkmeLanwrZY4ZaNp8g==", + "dev": true, + "requires": { + "jest-diff": "^27.0.2" + } + }, + "jest-worker": { + "version": "27.4.5", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.4.5.tgz", + "integrity": "sha512-f2s8kEdy15cv9r7q4KkzGXvlY0JTcmCbMHZBfSQDwW77REr45IDWwd0lksDFeVHH2jJ5pqb90T77XscrjeGzzg==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "dependencies": { + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + } + } + }, + "jsdom": { + "version": "16.7.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", + "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", + "dev": true, + "requires": { + "abab": "^2.0.5", + "acorn": "^8.2.4", + "acorn-globals": "^6.0.0", + "cssom": "^0.4.4", + "cssstyle": "^2.3.0", + "data-urls": "^2.0.0", + "decimal.js": "^10.2.1", + "domexception": "^2.0.1", + "escodegen": "^2.0.0", + "form-data": "^3.0.0", + "html-encoding-sniffer": "^2.0.1", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.0", + "parse5": "6.0.1", + "saxes": "^5.0.1", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.0.0", + "w3c-hr-time": "^1.0.2", + "w3c-xmlserializer": "^2.0.0", + "webidl-conversions": "^6.1.0", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.5.0", + "ws": "^7.4.6", + "xml-name-validator": "^3.0.0" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true + }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", + "dev": true + }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "requires": { + "tmpl": "1.0.5" + } + }, + "map-obj": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.1.tgz", + "integrity": "sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ==", + "dev": true + }, + "meow": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz", + "integrity": "sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==", + "dev": true, + "requires": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize": "^1.2.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" + }, + "dependencies": { + "type-fest": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "dev": true + } + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "mime-db": { + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "dev": true + }, + "mime-types": { + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "dev": true, + "requires": { + "mime-db": "1.51.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + } + }, + "mock-socket": { + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/mock-socket/-/mock-socket-9.0.8.tgz", + "integrity": "sha512-8Syqkaaa2SzRqW68DEsnZkKQicHP7hVzfj3uCvigB5TL79H1ljKbwmOcRIENkx0ZTyu/5W6u+Pk9Qy6JCp38Ww==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "dev": true + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node-releases": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", + "dev": true + }, + "normalize-package-data": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.2.tgz", + "integrity": "sha512-6CdZocmfGaKnIHPVFhJJZ3GuR8SsLKvDANFp47Jmy51aKIr8akjAWTSxtpI+MBgBFdSMRyo4hMpDlT6dTffgZg==", + "dev": true, + "requires": { + "hosted-git-info": "^4.0.1", + "resolve": "^1.20.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "nwsapi": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", + "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "picomatch": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", + "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "dev": true + }, + "pirates": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.4.tgz", + "integrity": "sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "plur": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/plur/-/plur-4.0.0.tgz", + "integrity": "sha512-4UGewrYgqDFw9vV6zNV+ADmPAUAfJPKtGvb/VdpQAx25X5f3xXdGdyOEVFwkl8Hl/tl7+xbeHqSEM+D5/TirUg==", + "dev": true, + "requires": { + "irregular-plurals": "^3.2.0" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "pretty-format": { + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.4.2.tgz", + "integrity": "sha512-p0wNtJ9oLuvgOQDEIZ9zQjZffK7KtyR6Si0jnXULIDwrlNF8Cuir3AZP0hHv0jmKuNN/edOnbMjnzd4uTcmWiw==", + "dev": true, + "requires": { + "@jest/types": "^27.4.2", + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true + } + } + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "promise-polyfill": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.2.0.tgz", + "integrity": "sha512-k/TC0mIcPVF6yHhUvwAp7cvL6I2fFV7TzF1DuGPI8mBh4QQazf36xCKEHKTZKRysEoTQoQdKyP25J8MPJp7j5g==", + "dev": true + }, + "prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + } + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true + }, + "react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "reconnecting-websocket": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/reconnecting-websocket/-/reconnecting-websocket-4.4.0.tgz", + "integrity": "sha512-D2E33ceRPga0NvTDhJmphEgJ7FUYF0v4lr1ki0csq06OdlxKfugGzN0dSkxM/NfqCxYELK4KcaTOUOjTV6Dcng==" + }, + "redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "requires": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + } + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "resolve.exports": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.0.tgz", + "integrity": "sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "saxes": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "dev": true, + "requires": { + "xmlchars": "^2.2.0" + } + }, + "semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", + "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", + "dev": true + }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", + "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stack-utils": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + } + } + }, + "string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true + }, + "string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "requires": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "requires": { + "min-indent": "^1.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-hyperlinks": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", + "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", + "dev": true, + "requires": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + } + }, + "symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "terminal-link": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", + "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "supports-hyperlinks": "^2.0.0" + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "throat": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/throat/-/throat-6.0.1.tgz", + "integrity": "sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w==", + "dev": true + }, + "timsort": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", + "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", + "dev": true + }, + "tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "tough-cookie": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", + "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "dev": true, + "requires": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.1.2" + } + }, + "tr46": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", + "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "dev": true, + "requires": { + "punycode": "^2.1.1" + } + }, + "trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "dev": true + }, + "ts-jest": { + "version": "27.1.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-27.1.2.tgz", + "integrity": "sha512-eSOiJOWq6Hhs6Khzk5wKC5sgWIXgXqOCiIl1+3lfnearu58Hj4QpE5tUhQcA3xtZrELbcvAGCsd6HB8OsaVaTA==", + "dev": true, + "requires": { + "bs-logger": "0.x", + "fast-json-stable-stringify": "2.x", + "jest-util": "^27.0.0", + "json5": "2.x", + "lodash.memoize": "4.x", + "make-error": "1.x", + "semver": "7.x", + "yargs-parser": "20.x" + } + }, + "ts-node": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", + "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", + "dev": true, + "requires": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "yn": "3.1.1" + }, + "dependencies": { + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + } + } + }, + "tsd": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/tsd/-/tsd-0.19.1.tgz", + "integrity": "sha512-pSwchclr+ADdxlahRUQXUrdAIOjXx1T1PQV+fLfVLuo/S4z+T00YU84fH8iPlZxyA2pWgJjo42BG1p9SDb4NOw==", + "dev": true, + "requires": { + "@tsd/typescript": "~4.5.2", + "eslint-formatter-pretty": "^4.1.0", + "globby": "^11.0.1", + "meow": "^9.0.0", + "path-exists": "^4.0.0", + "read-pkg-up": "^7.0.0" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "typescript": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", + "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "v8-to-istanbul": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz", + "integrity": "sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "validator": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", + "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==", + "dev": true + }, + "w3c-hr-time": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", + "dev": true, + "requires": { + "browser-process-hrtime": "^1.0.0" + } + }, + "w3c-xmlserializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", + "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "dev": true, + "requires": { + "xml-name-validator": "^3.0.0" + } + }, + "walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "requires": { + "makeerror": "1.0.12" + } + }, + "webidl-conversions": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "dev": true + }, + "whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "dev": true, + "requires": { + "iconv-lite": "0.4.24" + } + }, + "whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "dev": true + }, + "whatwg-url": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", + "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "dev": true, + "requires": { + "lodash": "^4.7.0", + "tr46": "^2.1.0", + "webidl-conversions": "^6.1.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "ws": { + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", + "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", + "dev": true, + "requires": {} + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.7", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", + "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", + "dev": true + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true + }, + "z-schema": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-5.0.2.tgz", + "integrity": "sha512-40TH47ukMHq5HrzkeVE40Ad7eIDKaRV2b+Qpi2prLc9X9eFJFzV7tMe5aH12e6avaSS/u5l653EQOv+J9PirPw==", + "dev": true, + "requires": { + "commander": "^2.7.1", + "lodash.get": "^4.4.2", + "lodash.isequal": "^4.5.0", + "validator": "^13.7.0" + } + } + } +} diff --git a/packages/calckey-js/package.json b/packages/calckey-js/package.json new file mode 100644 index 0000000000..d68f241752 --- /dev/null +++ b/packages/calckey-js/package.json @@ -0,0 +1,47 @@ +{ + "name": "calckey-js", + "version": "0.0.22", + "description": "Calckey SDK for JavaScript", + "main": "./built/index.js", + "types": "./built/index.d.ts", + "scripts": { + "build": "tsc", + "tsd": "tsd", + "api": "pnpm api-extractor run --local --verbose", + "api-prod": "pnpm api-extractor run --verbose", + "eslint": "eslint . --ext .js,.jsx,.ts,.tsx", + "typecheck": "tsc --noEmit", + "lint": "pnpm typecheck && pnpm eslint", + "jest": "jest --coverage --detectOpenHandles", + "test": "pnpm jest && pnpm tsd" + }, + "repository": { + "type": "git", + "url": "https://codeberg.org/calckey/calckey.js" + }, + "devDependencies": { + "@microsoft/api-extractor": "^7.19.3", + "@types/jest": "^27.4.0", + "@types/node": "17.0.5", + "@typescript-eslint/eslint-plugin": "5.8.1", + "@typescript-eslint/parser": "5.8.1", + "eslint": "8.6.0", + "jest": "^27.4.5", + "jest-fetch-mock": "^3.0.3", + "jest-websocket-mock": "^2.2.1", + "mock-socket": "^9.0.8", + "ts-jest": "^27.1.2", + "ts-node": "10.4.0", + "tsd": "^0.19.1", + "typescript": "4.5.4" + }, + "files": [ + "built" + ], + "dependencies": { + "autobind-decorator": "^2.4.0", + "eventemitter3": "^4.0.7", + "reconnecting-websocket": "^4.4.0", + "semver": "^7.3.8" + } +} diff --git a/packages/calckey-js/src/acct.ts b/packages/calckey-js/src/acct.ts new file mode 100644 index 0000000000..5b7767a106 --- /dev/null +++ b/packages/calckey-js/src/acct.ts @@ -0,0 +1,14 @@ +export type Acct = { + username: string; + host: string | null; +}; + +export function parse(acct: string): Acct { + if (acct.startsWith("@")) acct = acct.substr(1); + const split = acct.split("@", 2); + return { username: split[0], host: split[1] || null }; +} + +export function toString(acct: Acct): string { + return acct.host == null ? acct.username : `${acct.username}@${acct.host}`; +} diff --git a/packages/calckey-js/src/api.ts b/packages/calckey-js/src/api.ts new file mode 100644 index 0000000000..141aa4b858 --- /dev/null +++ b/packages/calckey-js/src/api.ts @@ -0,0 +1,127 @@ +import { Endpoints } from "./api.types"; + +const MK_API_ERROR = Symbol(); + +export type APIError = { + id: string; + code: string; + message: string; + kind: "client" | "server"; + info: Record; +}; + +export function isAPIError(reason: any): reason is APIError { + return reason[MK_API_ERROR] === true; +} + +export type FetchLike = ( + input: string, + init?: { + method?: string; + body?: string; + credentials?: RequestCredentials; + cache?: RequestCache; + }, +) => Promise<{ + status: number; + json(): Promise; +}>; + +type IsNeverType = [T] extends [never] ? true : false; + +type StrictExtract = Cond extends Union ? Union : never; + +type IsCaseMatched< + E extends keyof Endpoints, + P extends Endpoints[E]["req"], + C extends number, +> = IsNeverType< + StrictExtract +> extends false + ? true + : false; + +type GetCaseResult< + E extends keyof Endpoints, + P extends Endpoints[E]["req"], + C extends number, +> = StrictExtract[1]; + +export class APIClient { + public origin: string; + public credential: string | null | undefined; + public fetch: FetchLike; + + constructor(opts: { + origin: APIClient["origin"]; + credential?: APIClient["credential"]; + fetch?: APIClient["fetch"] | null | undefined; + }) { + this.origin = opts.origin; + this.credential = opts.credential; + // ネイティブ関数をそのまま変数に代入して使おうとするとChromiumではIllegal invocationエラーが発生するため、 + // 環境で実装されているfetchを使う場合は無名関数でラップして使用する + this.fetch = opts.fetch || ((...args) => fetch(...args)); + } + + public request( + endpoint: E, + params: P = {} as P, + credential?: string | null | undefined, + ): Promise< + Endpoints[E]["res"] extends { + $switch: { $cases: [any, any][]; $default: any }; + } + ? IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : IsCaseMatched extends true + ? GetCaseResult + : Endpoints[E]["res"]["$switch"]["$default"] + : Endpoints[E]["res"] + > { + const promise = new Promise((resolve, reject) => { + this.fetch(`${this.origin}/api/${endpoint}`, { + method: "POST", + body: JSON.stringify({ + ...params, + i: credential !== undefined ? credential : this.credential, + }), + credentials: "omit", + cache: "no-cache", + }) + .then(async (res) => { + const body = res.status === 204 ? null : await res.json(); + + if (res.status === 200) { + resolve(body); + } else if (res.status === 204) { + resolve(null); + } else { + reject({ + [MK_API_ERROR]: true, + ...body.error, + }); + } + }) + .catch(reject); + }); + + return promise as any; + } +} diff --git a/packages/calckey-js/src/api.types.ts b/packages/calckey-js/src/api.types.ts new file mode 100644 index 0000000000..bef00da4ea --- /dev/null +++ b/packages/calckey-js/src/api.types.ts @@ -0,0 +1,1084 @@ +import { + Ad, + Announcement, + Antenna, + App, + AuthSession, + Blocking, + Channel, + Clip, + DateString, + DetailedInstanceMetadata, + DriveFile, + DriveFolder, + Following, + FollowingFolloweePopulated, + FollowingFollowerPopulated, + FollowRequest, + GalleryPost, + Instance, + InstanceMetadata, + LiteInstanceMetadata, + MeDetailed, + Note, + NoteFavorite, + OriginType, + Page, + ServerInfo, + Stats, + User, + UserDetailed, + UserGroup, + UserList, + UserSorting, + Notification, + NoteReaction, + Signin, + MessagingMessage, +} from "./entities"; + +type TODO = Record | null; + +type NoParams = Record; + +type ShowUserReq = { username: string; host?: string } | { userId: User["id"] }; + +export type Endpoints = { + // admin + "admin/abuse-user-reports": { req: TODO; res: TODO }; + "admin/delete-all-files-of-a-user": { + req: { userId: User["id"] }; + res: null; + }; + "admin/delete-logs": { req: NoParams; res: null }; + "admin/get-index-stats": { req: TODO; res: TODO }; + "admin/get-table-stats": { req: TODO; res: TODO }; + "admin/invite": { req: TODO; res: TODO }; + "admin/logs": { req: TODO; res: TODO }; + "admin/reset-password": { req: TODO; res: TODO }; + "admin/resolve-abuse-user-report": { req: TODO; res: TODO }; + "admin/resync-chart": { req: TODO; res: TODO }; + "admin/send-email": { req: TODO; res: TODO }; + "admin/server-info": { req: TODO; res: TODO }; + "admin/show-moderation-logs": { req: TODO; res: TODO }; + "admin/show-user": { req: TODO; res: TODO }; + "admin/show-users": { req: TODO; res: TODO }; + "admin/silence-user": { req: TODO; res: TODO }; + "admin/suspend-user": { req: TODO; res: TODO }; + "admin/unsilence-user": { req: TODO; res: TODO }; + "admin/unsuspend-user": { req: TODO; res: TODO }; + "admin/update-meta": { req: TODO; res: TODO }; + "admin/vacuum": { req: TODO; res: TODO }; + "admin/accounts/create": { req: TODO; res: TODO }; + "admin/ad/create": { req: TODO; res: TODO }; + "admin/ad/delete": { req: { id: Ad["id"] }; res: null }; + "admin/ad/list": { req: TODO; res: TODO }; + "admin/ad/update": { req: TODO; res: TODO }; + "admin/announcements/create": { req: TODO; res: TODO }; + "admin/announcements/delete": { req: { id: Announcement["id"] }; res: null }; + "admin/announcements/list": { req: TODO; res: TODO }; + "admin/announcements/update": { req: TODO; res: TODO }; + "admin/drive/clean-remote-files": { req: TODO; res: TODO }; + "admin/drive/cleanup": { req: TODO; res: TODO }; + "admin/drive/files": { req: TODO; res: TODO }; + "admin/drive/show-file": { req: TODO; res: TODO }; + "admin/emoji/add": { req: TODO; res: TODO }; + "admin/emoji/copy": { req: TODO; res: TODO }; + "admin/emoji/list-remote": { req: TODO; res: TODO }; + "admin/emoji/list": { req: TODO; res: TODO }; + "admin/emoji/remove": { req: TODO; res: TODO }; + "admin/emoji/update": { req: TODO; res: TODO }; + "admin/federation/delete-all-files": { req: { host: string }; res: null }; + "admin/federation/refresh-remote-instance-metadata": { req: TODO; res: TODO }; + "admin/federation/remove-all-following": { req: TODO; res: TODO }; + "admin/federation/update-instance": { req: TODO; res: TODO }; + "admin/moderators/add": { req: TODO; res: TODO }; + "admin/moderators/remove": { req: TODO; res: TODO }; + "admin/promo/create": { req: TODO; res: TODO }; + "admin/queue/clear": { req: TODO; res: TODO }; + "admin/queue/deliver-delayed": { req: TODO; res: TODO }; + "admin/queue/inbox-delayed": { req: TODO; res: TODO }; + "admin/queue/jobs": { req: TODO; res: TODO }; + "admin/queue/stats": { req: TODO; res: TODO }; + "admin/relays/add": { req: TODO; res: TODO }; + "admin/relays/list": { req: TODO; res: TODO }; + "admin/relays/remove": { req: TODO; res: TODO }; + + // announcements + announcements: { + req: { + limit?: number; + withUnreads?: boolean; + sinceId?: Announcement["id"]; + untilId?: Announcement["id"]; + }; + res: Announcement[]; + }; + + // antennas + "antennas/create": { req: TODO; res: Antenna }; + "antennas/delete": { req: { antennaId: Antenna["id"] }; res: null }; + "antennas/list": { req: NoParams; res: Antenna[] }; + "antennas/notes": { + req: { + antennaId: Antenna["id"]; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + }; + res: Note[]; + }; + "antennas/show": { req: { antennaId: Antenna["id"] }; res: Antenna }; + "antennas/update": { req: TODO; res: Antenna }; + "antennas/mark-read": { req: TODO; res: Antenna }; + + // ap + "ap/get": { req: { uri: string }; res: Record }; + "ap/show": { + req: { uri: string }; + res: + | { + type: "Note"; + object: Note; + } + | { + type: "User"; + object: UserDetailed; + }; + }; + + // app + "app/create": { req: TODO; res: App }; + "app/show": { req: { appId: App["id"] }; res: App }; + + // auth + "auth/accept": { req: { token: string }; res: null }; + "auth/session/generate": { + req: { appSecret: string }; + res: { token: string; url: string }; + }; + "auth/session/show": { req: { token: string }; res: AuthSession }; + "auth/session/userkey": { + req: { appSecret: string; token: string }; + res: { accessToken: string; user: User }; + }; + + // blocking + "blocking/create": { req: { userId: User["id"] }; res: UserDetailed }; + "blocking/delete": { req: { userId: User["id"] }; res: UserDetailed }; + "blocking/list": { + req: { limit?: number; sinceId?: Blocking["id"]; untilId?: Blocking["id"] }; + res: Blocking[]; + }; + + // channels + "channels/create": { req: TODO; res: TODO }; + "channels/featured": { req: TODO; res: TODO }; + "channels/follow": { req: TODO; res: TODO }; + "channels/followed": { req: TODO; res: TODO }; + "channels/owned": { req: TODO; res: TODO }; + "channels/pin-note": { req: TODO; res: TODO }; + "channels/show": { req: TODO; res: TODO }; + "channels/timeline": { req: TODO; res: TODO }; + "channels/unfollow": { req: TODO; res: TODO }; + "channels/update": { req: TODO; res: TODO }; + + // charts + "charts/active-users": { + req: { span: "day" | "hour"; limit?: number; offset?: number | null }; + res: { + local: { + users: number[]; + }; + remote: { + users: number[]; + }; + }; + }; + "charts/drive": { + req: { span: "day" | "hour"; limit?: number; offset?: number | null }; + res: { + local: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + remote: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + }; + }; + "charts/federation": { + req: { span: "day" | "hour"; limit?: number; offset?: number | null }; + res: { + instance: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + "charts/hashtag": { + req: { span: "day" | "hour"; limit?: number; offset?: number | null }; + res: TODO; + }; + "charts/instance": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + host: string; + }; + res: { + drive: { + decFiles: number[]; + decUsage: number[]; + incFiles: number[]; + incUsage: number[]; + totalFiles: number[]; + totalUsage: number[]; + }; + followers: { + dec: number[]; + inc: number[]; + total: number[]; + }; + following: { + dec: number[]; + inc: number[]; + total: number[]; + }; + notes: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + requests: { + failed: number[]; + received: number[]; + succeeded: number[]; + }; + users: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + "charts/network": { + req: { span: "day" | "hour"; limit?: number; offset?: number | null }; + res: TODO; + }; + "charts/notes": { + req: { span: "day" | "hour"; limit?: number; offset?: number | null }; + res: { + local: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + remote: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + }; + }; + "charts/user/drive": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + userId: User["id"]; + }; + res: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + }; + "charts/user/following": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + userId: User["id"]; + }; + res: TODO; + }; + "charts/user/notes": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + userId: User["id"]; + }; + res: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + }; + "charts/user/reactions": { + req: { + span: "day" | "hour"; + limit?: number; + offset?: number | null; + userId: User["id"]; + }; + res: TODO; + }; + "charts/users": { + req: { span: "day" | "hour"; limit?: number; offset?: number | null }; + res: { + local: { + dec: number[]; + inc: number[]; + total: number[]; + }; + remote: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + + // clips + "clips/add-note": { req: TODO; res: TODO }; + "clips/create": { req: TODO; res: TODO }; + "clips/delete": { req: { clipId: Clip["id"] }; res: null }; + "clips/list": { req: TODO; res: TODO }; + "clips/notes": { req: TODO; res: TODO }; + "clips/show": { req: TODO; res: TODO }; + "clips/update": { req: TODO; res: TODO }; + + // drive + drive: { req: NoParams; res: { capacity: number; usage: number } }; + "drive/files": { + req: { + folderId?: DriveFolder["id"] | null; + type?: DriveFile["type"] | null; + limit?: number; + sinceId?: DriveFile["id"]; + untilId?: DriveFile["id"]; + }; + res: DriveFile[]; + }; + "drive/files/attached-notes": { req: TODO; res: TODO }; + "drive/files/check-existence": { req: TODO; res: TODO }; + "drive/files/create": { req: TODO; res: TODO }; + "drive/files/delete": { req: { fileId: DriveFile["id"] }; res: null }; + "drive/files/find-by-hash": { req: TODO; res: TODO }; + "drive/files/find": { + req: { name: string; folderId?: DriveFolder["id"] | null }; + res: DriveFile[]; + }; + "drive/files/show": { + req: { fileId?: DriveFile["id"]; url?: string }; + res: DriveFile; + }; + "drive/files/update": { + req: { + fileId: DriveFile["id"]; + folderId?: DriveFolder["id"] | null; + name?: string; + isSensitive?: boolean; + comment?: string | null; + }; + res: DriveFile; + }; + "drive/files/upload-from-url": { + req: { + url: string; + folderId?: DriveFolder["id"] | null; + isSensitive?: boolean; + comment?: string | null; + marker?: string | null; + force?: boolean; + }; + res: null; + }; + "drive/folders": { + req: { + folderId?: DriveFolder["id"] | null; + limit?: number; + sinceId?: DriveFile["id"]; + untilId?: DriveFile["id"]; + }; + res: DriveFolder[]; + }; + "drive/folders/create": { + req: { name?: string; parentId?: DriveFolder["id"] | null }; + res: DriveFolder; + }; + "drive/folders/delete": { req: { folderId: DriveFolder["id"] }; res: null }; + "drive/folders/find": { + req: { name: string; parentId?: DriveFolder["id"] | null }; + res: DriveFolder[]; + }; + "drive/folders/show": { + req: { folderId: DriveFolder["id"] }; + res: DriveFolder; + }; + "drive/folders/update": { + req: { + folderId: DriveFolder["id"]; + name?: string; + parentId?: DriveFolder["id"] | null; + }; + res: DriveFolder; + }; + "drive/stream": { + req: { + type?: DriveFile["type"] | null; + limit?: number; + sinceId?: DriveFile["id"]; + untilId?: DriveFile["id"]; + }; + res: DriveFile[]; + }; + + // endpoint + endpoint: { + req: { endpoint: string }; + res: { params: { name: string; type: string }[] }; + }; + + // endpoints + endpoints: { req: NoParams; res: string[] }; + + // federation + "federation/dns": { + req: { host: string }; + res: { + a: string[]; + aaaa: string[]; + cname: string[]; + txt: string[]; + }; + }; + "federation/followers": { + req: { + host: string; + limit?: number; + sinceId?: Following["id"]; + untilId?: Following["id"]; + }; + res: FollowingFolloweePopulated[]; + }; + "federation/following": { + req: { + host: string; + limit?: number; + sinceId?: Following["id"]; + untilId?: Following["id"]; + }; + res: FollowingFolloweePopulated[]; + }; + "federation/instances": { + req: { + host?: string | null; + blocked?: boolean | null; + notResponding?: boolean | null; + suspended?: boolean | null; + federating?: boolean | null; + subscribing?: boolean | null; + publishing?: boolean | null; + limit?: number; + offset?: number; + sort?: + | "+pubSub" + | "-pubSub" + | "+notes" + | "-notes" + | "+users" + | "-users" + | "+following" + | "-following" + | "+followers" + | "-followers" + | "+caughtAt" + | "-caughtAt" + | "+lastCommunicatedAt" + | "-lastCommunicatedAt" + | "+driveUsage" + | "-driveUsage" + | "+driveFiles" + | "-driveFiles"; + }; + res: Instance[]; + }; + "federation/show-instance": { req: { host: string }; res: Instance }; + "federation/update-remote-user": { req: { userId: User["id"] }; res: null }; + "federation/users": { + req: { + host: string; + limit?: number; + sinceId?: User["id"]; + untilId?: User["id"]; + }; + res: UserDetailed[]; + }; + + // following + "following/create": { req: { userId: User["id"] }; res: User }; + "following/delete": { req: { userId: User["id"] }; res: User }; + "following/requests/accept": { req: { userId: User["id"] }; res: null }; + "following/requests/cancel": { req: { userId: User["id"] }; res: User }; + "following/requests/list": { req: NoParams; res: FollowRequest[] }; + "following/requests/reject": { req: { userId: User["id"] }; res: null }; + + // gallery + "gallery/featured": { req: TODO; res: TODO }; + "gallery/popular": { req: TODO; res: TODO }; + "gallery/posts": { req: TODO; res: TODO }; + "gallery/posts/create": { req: TODO; res: TODO }; + "gallery/posts/delete": { req: { postId: GalleryPost["id"] }; res: null }; + "gallery/posts/like": { req: TODO; res: TODO }; + "gallery/posts/show": { req: TODO; res: TODO }; + "gallery/posts/unlike": { req: TODO; res: TODO }; + "gallery/posts/update": { req: TODO; res: TODO }; + + // games + "games/reversi/games": { req: TODO; res: TODO }; + "games/reversi/games/show": { req: TODO; res: TODO }; + "games/reversi/games/surrender": { req: TODO; res: TODO }; + "games/reversi/invitations": { req: TODO; res: TODO }; + "games/reversi/match": { req: TODO; res: TODO }; + "games/reversi/match/cancel": { req: TODO; res: TODO }; + + // get-online-users-count + "get-online-users-count": { req: NoParams; res: { count: number } }; + + // hashtags + "hashtags/list": { req: TODO; res: TODO }; + "hashtags/search": { req: TODO; res: TODO }; + "hashtags/show": { req: TODO; res: TODO }; + "hashtags/trend": { req: TODO; res: TODO }; + "hashtags/users": { req: TODO; res: TODO }; + + // i + i: { req: NoParams; res: User }; + "i/apps": { req: TODO; res: TODO }; + "i/authorized-apps": { req: TODO; res: TODO }; + "i/change-password": { req: TODO; res: TODO }; + "i/delete-account": { req: { password: string }; res: null }; + "i/export-blocking": { req: TODO; res: TODO }; + "i/export-following": { req: TODO; res: TODO }; + "i/export-mute": { req: TODO; res: TODO }; + "i/export-notes": { req: TODO; res: TODO }; + "i/export-user-lists": { req: TODO; res: TODO }; + "i/favorites": { + req: { + limit?: number; + sinceId?: NoteFavorite["id"]; + untilId?: NoteFavorite["id"]; + }; + res: NoteFavorite[]; + }; + "i/gallery/likes": { req: TODO; res: TODO }; + "i/gallery/posts": { req: TODO; res: TODO }; + "i/get-word-muted-notes-count": { req: TODO; res: TODO }; + "i/import-following": { req: TODO; res: TODO }; + "i/import-user-lists": { req: TODO; res: TODO }; + "i/move": { req: TODO; res: TODO }; + "i/known-as": { req: TODO; res: TODO }; + "i/notifications": { + req: { + limit?: number; + sinceId?: Notification["id"]; + untilId?: Notification["id"]; + following?: boolean; + markAsRead?: boolean; + includeTypes?: Notification["type"][]; + excludeTypes?: Notification["type"][]; + }; + res: Notification[]; + }; + "i/page-likes": { req: TODO; res: TODO }; + "i/pages": { req: TODO; res: TODO }; + "i/pin": { req: { noteId: Note["id"] }; res: MeDetailed }; + "i/read-all-messaging-messages": { req: TODO; res: TODO }; + "i/read-all-unread-notes": { req: TODO; res: TODO }; + "i/read-announcement": { req: TODO; res: TODO }; + "i/regenerate-token": { req: { password: string }; res: null }; + "i/registry/get-all": { req: { scope?: string[] }; res: Record }; + "i/registry/get-detail": { + req: { key: string; scope?: string[] }; + res: { updatedAt: DateString; value: any }; + }; + "i/registry/get": { req: { key: string; scope?: string[] }; res: any }; + "i/registry/keys-with-type": { + req: { scope?: string[] }; + res: Record< + string, + "null" | "array" | "number" | "string" | "boolean" | "object" + >; + }; + "i/registry/keys": { req: { scope?: string[] }; res: string[] }; + "i/registry/remove": { req: { key: string; scope?: string[] }; res: null }; + "i/registry/scopes": { req: NoParams; res: string[][] }; + "i/registry/set": { + req: { key: string; value: any; scope?: string[] }; + res: null; + }; + "i/revoke-token": { req: TODO; res: TODO }; + "i/signin-history": { + req: { limit?: number; sinceId?: Signin["id"]; untilId?: Signin["id"] }; + res: Signin[]; + }; + "i/unpin": { req: { noteId: Note["id"] }; res: MeDetailed }; + "i/update-email": { + req: { + password: string; + email?: string | null; + }; + res: MeDetailed; + }; + "i/update": { + req: { + name?: string | null; + description?: string | null; + lang?: string | null; + location?: string | null; + birthday?: string | null; + avatarId?: DriveFile["id"] | null; + bannerId?: DriveFile["id"] | null; + fields?: { + name: string; + value: string; + }[]; + isLocked?: boolean; + isExplorable?: boolean; + hideOnlineStatus?: boolean; + carefulBot?: boolean; + autoAcceptFollowed?: boolean; + noCrawle?: boolean; + isBot?: boolean; + isCat?: boolean; + injectFeaturedNote?: boolean; + receiveAnnouncementEmail?: boolean; + alwaysMarkNsfw?: boolean; + mutedWords?: string[][]; + mutingNotificationTypes?: Notification["type"][]; + emailNotificationTypes?: string[]; + }; + res: MeDetailed; + }; + "i/user-group-invites": { req: TODO; res: TODO }; + "i/2fa/done": { req: TODO; res: TODO }; + "i/2fa/key-done": { req: TODO; res: TODO }; + "i/2fa/password-less": { req: TODO; res: TODO }; + "i/2fa/register-key": { req: TODO; res: TODO }; + "i/2fa/register": { req: TODO; res: TODO }; + "i/2fa/remove-key": { req: TODO; res: TODO }; + "i/2fa/unregister": { req: TODO; res: TODO }; + + // messaging + "messaging/history": { + req: { limit?: number; group?: boolean }; + res: MessagingMessage[]; + }; + "messaging/messages": { + req: { + userId?: User["id"]; + groupId?: UserGroup["id"]; + limit?: number; + sinceId?: MessagingMessage["id"]; + untilId?: MessagingMessage["id"]; + markAsRead?: boolean; + }; + res: MessagingMessage[]; + }; + "messaging/messages/create": { + req: { + userId?: User["id"]; + groupId?: UserGroup["id"]; + text?: string; + fileId?: DriveFile["id"]; + }; + res: MessagingMessage; + }; + "messaging/messages/delete": { + req: { messageId: MessagingMessage["id"] }; + res: null; + }; + "messaging/messages/read": { + req: { messageId: MessagingMessage["id"] }; + res: null; + }; + + // meta + meta: { + req: { detail?: boolean }; + res: { + $switch: { + $cases: [ + [{ detail: true }, DetailedInstanceMetadata], + [{ detail: false }, LiteInstanceMetadata], + [ + { detail: boolean }, + LiteInstanceMetadata | DetailedInstanceMetadata, + ], + ]; + $default: LiteInstanceMetadata; + }; + }; + }; + + // miauth + "miauth/gen-token": { req: TODO; res: TODO }; + + // mute + "mute/create": { req: TODO; res: TODO }; + "mute/delete": { req: { userId: User["id"] }; res: null }; + "mute/list": { req: TODO; res: TODO }; + "renote-mute/create": { req: TODO; res: TODO }; + "renote-mute/delete": { req: { userId: User["id"] }; res: null }; + "renote-mute/list": { req: TODO; res: TODO }; + + // my + "my/apps": { req: TODO; res: TODO }; + + // notes + notes: { + req: { limit?: number; sinceId?: Note["id"]; untilId?: Note["id"] }; + res: Note[]; + }; + "notes/children": { + req: { + noteId: Note["id"]; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + }; + res: Note[]; + }; + "notes/clips": { req: TODO; res: TODO }; + "notes/conversation": { req: TODO; res: TODO }; + "notes/create": { + req: { + visibility?: "public" | "home" | "followers" | "specified"; + visibleUserIds?: User["id"][]; + text?: null | string; + cw?: null | string; + viaMobile?: boolean; + localOnly?: boolean; + fileIds?: DriveFile["id"][]; + replyId?: null | Note["id"]; + renoteId?: null | Note["id"]; + channelId?: null | Channel["id"]; + poll?: null | { + choices: string[]; + multiple?: boolean; + expiresAt?: null | number; + expiredAfter?: null | number; + }; + }; + res: { createdNote: Note }; + }; + "notes/delete": { req: { noteId: Note["id"] }; res: null }; + "notes/favorites/create": { req: { noteId: Note["id"] }; res: null }; + "notes/favorites/delete": { req: { noteId: Note["id"] }; res: null }; + "notes/featured": { req: TODO; res: Note[] }; + "notes/global-timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/recommended-timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/hybrid-timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/local-timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/mentions": { + req: { + following?: boolean; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + }; + res: Note[]; + }; + "notes/polls/recommendation": { req: TODO; res: TODO }; + "notes/polls/vote": { + req: { noteId: Note["id"]; choice: number }; + res: null; + }; + "notes/reactions": { + req: { noteId: Note["id"]; type?: string | null; limit?: number }; + res: NoteReaction[]; + }; + "notes/reactions/create": { + req: { noteId: Note["id"]; reaction: string }; + res: null; + }; + "notes/reactions/delete": { req: { noteId: Note["id"] }; res: null }; + "notes/renotes": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + noteId: Note["id"]; + }; + res: Note[]; + }; + "notes/replies": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + noteId: Note["id"]; + }; + res: Note[]; + }; + "notes/search-by-tag": { req: TODO; res: TODO }; + "notes/search": { req: TODO; res: TODO }; + "notes/show": { req: { noteId: Note["id"] }; res: Note }; + "notes/state": { req: TODO; res: TODO }; + "notes/timeline": { + req: { + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/unrenote": { req: { noteId: Note["id"] }; res: null }; + "notes/user-list-timeline": { + req: { + listId: UserList["id"]; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "notes/watching/create": { req: TODO; res: TODO }; + "notes/watching/delete": { req: { noteId: Note["id"] }; res: null }; + + // notifications + "notifications/create": { + req: { body: string; header?: string | null; icon?: string | null }; + res: null; + }; + "notifications/mark-all-as-read": { req: NoParams; res: null }; + "notifications/read": { + req: { notificationId: Notification["id"] }; + res: null; + }; + + // page-push + "page-push": { + req: { pageId: Page["id"]; event: string; var?: any }; + res: null; + }; + + // pages + "pages/create": { req: TODO; res: Page }; + "pages/delete": { req: { pageId: Page["id"] }; res: null }; + "pages/featured": { req: NoParams; res: Page[] }; + "pages/like": { req: { pageId: Page["id"] }; res: null }; + "pages/show": { + req: { pageId?: Page["id"]; name?: string; username?: string }; + res: Page; + }; + "pages/unlike": { req: { pageId: Page["id"] }; res: null }; + "pages/update": { req: TODO; res: null }; + + // ping + ping: { req: NoParams; res: { pong: number } }; + + // pinned-users + "pinned-users": { req: TODO; res: TODO }; + + // promo + "promo/read": { req: TODO; res: TODO }; + + // request-reset-password + "request-reset-password": { + req: { username: string; email: string }; + res: null; + }; + + // reset-password + "reset-password": { req: { token: string; password: string }; res: null }; + + // room + "room/show": { req: TODO; res: TODO }; + "room/update": { req: TODO; res: TODO }; + + // stats + stats: { req: NoParams; res: Stats }; + + // server-info + "server-info": { req: NoParams; res: ServerInfo }; + + // ck specific + "latest-version": { req: NoParams; res: TODO }; + + // sw + "sw/register": { req: TODO; res: TODO }; + + // username + "username/available": { + req: { username: string }; + res: { available: boolean }; + }; + + // users + users: { + req: { + limit?: number; + offset?: number; + sort?: UserSorting; + origin?: OriginType; + }; + res: User[]; + }; + "users/clips": { req: TODO; res: TODO }; + "users/followers": { + req: { + userId?: User["id"]; + username?: User["username"]; + host?: User["host"] | null; + limit?: number; + sinceId?: Following["id"]; + untilId?: Following["id"]; + }; + res: FollowingFollowerPopulated[]; + }; + "users/following": { + req: { + userId?: User["id"]; + username?: User["username"]; + host?: User["host"] | null; + limit?: number; + sinceId?: Following["id"]; + untilId?: Following["id"]; + }; + res: FollowingFolloweePopulated[]; + }; + "users/gallery/posts": { req: TODO; res: TODO }; + "users/get-frequently-replied-users": { req: TODO; res: TODO }; + "users/groups/create": { req: TODO; res: TODO }; + "users/groups/delete": { req: { groupId: UserGroup["id"] }; res: null }; + "users/groups/invitations/accept": { req: TODO; res: TODO }; + "users/groups/invitations/reject": { req: TODO; res: TODO }; + "users/groups/invite": { req: TODO; res: TODO }; + "users/groups/joined": { req: TODO; res: TODO }; + "users/groups/owned": { req: TODO; res: TODO }; + "users/groups/pull": { req: TODO; res: TODO }; + "users/groups/show": { req: TODO; res: TODO }; + "users/groups/transfer": { req: TODO; res: TODO }; + "users/groups/update": { req: TODO; res: TODO }; + "users/lists/create": { req: { name: string }; res: UserList }; + "users/lists/delete": { req: { listId: UserList["id"] }; res: null }; + "users/lists/list": { req: NoParams; res: UserList[] }; + "users/lists/pull": { + req: { listId: UserList["id"]; userId: User["id"] }; + res: null; + }; + "users/lists/push": { + req: { listId: UserList["id"]; userId: User["id"] }; + res: null; + }; + "users/lists/show": { req: { listId: UserList["id"] }; res: UserList }; + "users/lists/update": { + req: { listId: UserList["id"]; name: string }; + res: UserList; + }; + "users/notes": { + req: { + userId: User["id"]; + limit?: number; + sinceId?: Note["id"]; + untilId?: Note["id"]; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + "users/pages": { req: TODO; res: TODO }; + "users/recommendation": { req: TODO; res: TODO }; + "users/relation": { req: TODO; res: TODO }; + "users/report-abuse": { req: TODO; res: TODO }; + "users/search-by-username-and-host": { req: TODO; res: TODO }; + "users/search": { req: TODO; res: TODO }; + "users/show": { + req: ShowUserReq | { userIds: User["id"][] }; + res: { + $switch: { + $cases: [[{ userIds: User["id"][] }, UserDetailed[]]]; + $default: UserDetailed; + }; + }; + }; + "users/stats": { req: TODO; res: TODO }; +}; diff --git a/packages/calckey-js/src/consts.ts b/packages/calckey-js/src/consts.ts new file mode 100644 index 0000000000..be33c0d3e3 --- /dev/null +++ b/packages/calckey-js/src/consts.ts @@ -0,0 +1,60 @@ +export const notificationTypes = [ + "follow", + "mention", + "reply", + "renote", + "quote", + "reaction", + "pollVote", + "pollEnded", + "receiveFollowRequest", + "followRequestAccepted", + "groupInvited", + "app", +] as const; + +export const noteVisibilities = [ + "public", + "home", + "followers", + "specified", +] as const; + +export const mutedNoteReasons = ["word", "manual", "spam", "other"] as const; + +export const ffVisibility = ["public", "followers", "private"] as const; + +export const permissions = [ + "read:account", + "write:account", + "read:blocks", + "write:blocks", + "read:drive", + "write:drive", + "read:favorites", + "write:favorites", + "read:following", + "write:following", + "read:messaging", + "write:messaging", + "read:mutes", + "write:mutes", + "write:notes", + "read:notifications", + "write:notifications", + "read:reactions", + "write:reactions", + "write:votes", + "read:pages", + "write:pages", + "write:page-likes", + "read:page-likes", + "read:user-groups", + "write:user-groups", + "read:channels", + "write:channels", + "read:gallery", + "write:gallery", + "read:gallery-likes", + "write:gallery-likes", +]; diff --git a/packages/calckey-js/src/entities.ts b/packages/calckey-js/src/entities.ts new file mode 100644 index 0000000000..bf881df2f3 --- /dev/null +++ b/packages/calckey-js/src/entities.ts @@ -0,0 +1,491 @@ +export type ID = string; +export type DateString = string; + +type TODO = Record; + +// NOTE: 極力この型を使うのは避け、UserLite か UserDetailed か明示するように +export type User = UserLite | UserDetailed; + +export type UserLite = { + id: ID; + username: string; + host: string | null; + name: string; + onlineStatus: "online" | "active" | "offline" | "unknown"; + avatarUrl: string; + avatarBlurhash: string; + alsoKnownAs: string[]; + movedToUri: any; + emojis: { + name: string; + url: string; + }[]; + instance?: { + name: Instance["name"]; + softwareName: Instance["softwareName"]; + softwareVersion: Instance["softwareVersion"]; + iconUrl: Instance["iconUrl"]; + faviconUrl: Instance["faviconUrl"]; + themeColor: Instance["themeColor"]; + }; +}; + +export type UserDetailed = UserLite & { + bannerBlurhash: string | null; + bannerColor: string | null; + bannerUrl: string | null; + birthday: string | null; + createdAt: DateString; + description: string | null; + ffVisibility: "public" | "followers" | "private"; + fields: { name: string; value: string }[]; + followersCount: number; + followingCount: number; + hasPendingFollowRequestFromYou: boolean; + hasPendingFollowRequestToYou: boolean; + isAdmin: boolean; + isBlocked: boolean; + isBlocking: boolean; + isBot: boolean; + isCat: boolean; + isFollowed: boolean; + isFollowing: boolean; + isLocked: boolean; + isModerator: boolean; + isMuted: boolean; + isRenoteMuted: boolean; + isSilenced: boolean; + isSuspended: boolean; + lang: string | null; + lastFetchedAt?: DateString; + location: string | null; + notesCount: number; + pinnedNoteIds: ID[]; + pinnedNotes: Note[]; + pinnedPage: Page | null; + pinnedPageId: string | null; + publicReactions: boolean; + securityKeys: boolean; + twoFactorEnabled: boolean; + updatedAt: DateString | null; + uri: string | null; + url: string | null; +}; + +export type UserGroup = TODO; + +export type UserList = { + id: ID; + createdAt: DateString; + name: string; + userIds: User["id"][]; +}; + +export type MeDetailed = UserDetailed & { + avatarId: DriveFile["id"]; + bannerId: DriveFile["id"]; + autoAcceptFollowed: boolean; + alwaysMarkNsfw: boolean; + carefulBot: boolean; + emailNotificationTypes: string[]; + hasPendingReceivedFollowRequest: boolean; + hasUnreadAnnouncement: boolean; + hasUnreadAntenna: boolean; + hasUnreadChannel: boolean; + hasUnreadMentions: boolean; + hasUnreadMessagingMessage: boolean; + hasUnreadNotification: boolean; + hasUnreadSpecifiedNotes: boolean; + hideOnlineStatus: boolean; + injectFeaturedNote: boolean; + integrations: Record; + isDeleted: boolean; + isExplorable: boolean; + mutedWords: string[][]; + mutingNotificationTypes: string[]; + noCrawle: boolean; + receiveAnnouncementEmail: boolean; + usePasswordLessLogin: boolean; + [other: string]: any; +}; + +export type DriveFile = { + id: ID; + createdAt: DateString; + isSensitive: boolean; + name: string; + thumbnailUrl: string; + url: string; + type: string; + size: number; + md5: string; + blurhash: string; + comment: string | null; + properties: Record; +}; + +export type DriveFolder = TODO; + +export type GalleryPost = TODO; + +export type Note = { + id: ID; + createdAt: DateString; + text: string | null; + cw: string | null; + user: User; + userId: User["id"]; + reply?: Note; + replyId: Note["id"]; + renote?: Note; + renoteId: Note["id"]; + files: DriveFile[]; + fileIds: DriveFile["id"][]; + visibility: "public" | "home" | "followers" | "specified"; + visibleUserIds?: User["id"][]; + localOnly?: boolean; + myReaction?: string; + reactions: Record; + renoteCount: number; + repliesCount: number; + poll?: { + expiresAt: DateString | null; + multiple: boolean; + choices: { + isVoted: boolean; + text: string; + votes: number; + }[]; + }; + emojis: { + name: string; + url: string; + }[]; + uri?: string; + url?: string; + isHidden?: boolean; +}; + +export type NoteReaction = { + id: ID; + createdAt: DateString; + user: UserLite; + type: string; +}; + +export type Notification = { + id: ID; + createdAt: DateString; + isRead: boolean; +} & ( + | { + type: "reaction"; + reaction: string; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "reply"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "renote"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "quote"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "mention"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "pollVote"; + user: User; + userId: User["id"]; + note: Note; + } + | { + type: "follow"; + user: User; + userId: User["id"]; + } + | { + type: "followRequestAccepted"; + user: User; + userId: User["id"]; + } + | { + type: "receiveFollowRequest"; + user: User; + userId: User["id"]; + } + | { + type: "groupInvited"; + invitation: UserGroup; + user: User; + userId: User["id"]; + } + | { + type: "app"; + header?: string | null; + body: string; + icon?: string | null; + } +); + +export type MessagingMessage = { + id: ID; + createdAt: DateString; + file: DriveFile | null; + fileId: DriveFile["id"] | null; + isRead: boolean; + reads: User["id"][]; + text: string | null; + user: User; + userId: User["id"]; + recipient?: User | null; + recipientId: User["id"] | null; + group?: UserGroup | null; + groupId: UserGroup["id"] | null; +}; + +export type CustomEmoji = { + id: string; + name: string; + url: string; + category: string; + aliases: string[]; +}; + +export type LiteInstanceMetadata = { + maintainerName: string | null; + maintainerEmail: string | null; + version: string; + name: string | null; + uri: string; + description: string | null; + tosUrl: string | null; + disableRegistration: boolean; + disableLocalTimeline: boolean; + disableRecommendedTimeline: boolean; + disableGlobalTimeline: boolean; + driveCapacityPerLocalUserMb: number; + driveCapacityPerRemoteUserMb: number; + enableHcaptcha: boolean; + hcaptchaSiteKey: string | null; + enableRecaptcha: boolean; + recaptchaSiteKey: string | null; + swPublickey: string | null; + maxNoteTextLength: number; + enableEmail: boolean; + enableTwitterIntegration: boolean; + enableGithubIntegration: boolean; + enableDiscordIntegration: boolean; + enableServiceWorker: boolean; + emojis: CustomEmoji[]; + ads: { + id: ID; + ratio: number; + place: string; + url: string; + imageUrl: string; + }[]; +}; + +export type DetailedInstanceMetadata = LiteInstanceMetadata & { + features: Record; +}; + +export type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata; + +export type ServerInfo = { + machine: string; + cpu: { + model: string; + cores: number; + }; + mem: { + total: number; + }; + fs: { + total: number; + used: number; + }; +}; + +export type Stats = { + notesCount: number; + originalNotesCount: number; + usersCount: number; + originalUsersCount: number; + instances: number; + driveUsageLocal: number; + driveUsageRemote: number; +}; + +export type Page = { + id: ID; + createdAt: DateString; + updatedAt: DateString; + userId: User["id"]; + user: User; + content: Record[]; + variables: Record[]; + title: string; + name: string; + summary: string | null; + hideTitleWhenPinned: boolean; + alignCenter: boolean; + font: string; + script: string; + eyeCatchingImageId: DriveFile["id"] | null; + eyeCatchingImage: DriveFile | null; + attachedFiles: any; + likedCount: number; + isLiked?: boolean; +}; + +export type PageEvent = { + pageId: Page["id"]; + event: string; + var: any; + userId: User["id"]; + user: User; +}; + +export type Announcement = { + id: ID; + createdAt: DateString; + updatedAt: DateString | null; + text: string; + title: string; + imageUrl: string | null; + isRead?: boolean; +}; + +export type Antenna = { + id: ID; + createdAt: DateString; + name: string; + keywords: string[][]; // TODO + excludeKeywords: string[][]; // TODO + src: "home" | "all" | "users" | "list" | "group" | "instances"; + userListId: ID | null; // TODO + userGroupId: ID | null; // TODO + users: string[]; // TODO + instances: string[]; + caseSensitive: boolean; + notify: boolean; + withReplies: boolean; + withFile: boolean; + hasUnreadNote: boolean; +}; + +export type App = TODO; + +export type AuthSession = { + id: ID; + app: App; + token: string; +}; + +export type Ad = TODO; + +export type Clip = TODO; + +export type NoteFavorite = { + id: ID; + createdAt: DateString; + noteId: Note["id"]; + note: Note; +}; + +export type FollowRequest = { + id: ID; + follower: User; + followee: User; +}; + +export type Channel = { + id: ID; + // TODO +}; + +export type Following = { + id: ID; + createdAt: DateString; + followerId: User["id"]; + followeeId: User["id"]; +}; + +export type FollowingFolloweePopulated = Following & { + followee: UserDetailed; +}; + +export type FollowingFollowerPopulated = Following & { + follower: UserDetailed; +}; + +export type Blocking = { + id: ID; + createdAt: DateString; + blockeeId: User["id"]; + blockee: UserDetailed; +}; + +export type Instance = { + id: ID; + caughtAt: DateString; + host: string; + usersCount: number; + notesCount: number; + followingCount: number; + followersCount: number; + driveUsage: number; + driveFiles: number; + latestRequestSentAt: DateString | null; + latestStatus: number | null; + latestRequestReceivedAt: DateString | null; + lastCommunicatedAt: DateString; + isNotResponding: boolean; + isSuspended: boolean; + softwareName: string | null; + softwareVersion: string | null; + openRegistrations: boolean | null; + name: string | null; + description: string | null; + maintainerName: string | null; + maintainerEmail: string | null; + iconUrl: string | null; + faviconUrl: string | null; + themeColor: string | null; + infoUpdatedAt: DateString | null; +}; + +export type Signin = { + id: ID; + createdAt: DateString; + ip: string; + headers: Record; + success: boolean; +}; + +export type UserSorting = + | "+follower" + | "-follower" + | "+createdAt" + | "-createdAt" + | "+updatedAt" + | "-updatedAt"; +export type OriginType = "combined" | "local" | "remote"; diff --git a/packages/calckey-js/src/index.ts b/packages/calckey-js/src/index.ts new file mode 100644 index 0000000000..128ed8c535 --- /dev/null +++ b/packages/calckey-js/src/index.ts @@ -0,0 +1,20 @@ +import { Endpoints } from "./api.types"; +import Stream, { Connection } from "./streaming"; +import { Channels } from "./streaming.types"; +import { Acct } from "./acct"; +import * as consts from "./consts"; + +export { Endpoints, Stream, Connection as ChannelConnection, Channels, Acct }; + +export const permissions = consts.permissions; +export const notificationTypes = consts.notificationTypes; +export const noteVisibilities = consts.noteVisibilities; +export const mutedNoteReasons = consts.mutedNoteReasons; +export const ffVisibility = consts.ffVisibility; + +// api extractor not supported yet +//export * as api from './api'; +//export * as entities from './entities'; +import * as api from "./api"; +import * as entities from "./entities"; +export { api, entities }; diff --git a/packages/calckey-js/src/streaming.ts b/packages/calckey-js/src/streaming.ts new file mode 100644 index 0000000000..80a3d6e8c3 --- /dev/null +++ b/packages/calckey-js/src/streaming.ts @@ -0,0 +1,393 @@ +import autobind from "autobind-decorator"; +import { EventEmitter } from "eventemitter3"; +import ReconnectingWebsocket from "reconnecting-websocket"; +import { BroadcastEvents, Channels } from "./streaming.types"; + +export function urlQuery( + obj: Record, +): string { + const params = Object.entries(obj) + .filter(([, v]) => (Array.isArray(v) ? v.length : v !== undefined)) + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + .reduce( + (a, [k, v]) => ((a[k] = v!), a), + {} as Record, + ); + + return Object.entries(params) + .map((e) => `${e[0]}=${encodeURIComponent(e[1])}`) + .join("&"); +} + +type AnyOf> = T[keyof T]; + +type StreamEvents = { + _connected_: void; + _disconnected_: void; +} & BroadcastEvents; + +/** + * Misskey stream connection + */ +export default class Stream extends EventEmitter { + private stream: ReconnectingWebsocket; + public state: "initializing" | "reconnecting" | "connected" = "initializing"; + private sharedConnectionPools: Pool[] = []; + private sharedConnections: SharedConnection[] = []; + private nonSharedConnections: NonSharedConnection[] = []; + private idCounter = 0; + + constructor( + origin: string, + user: { token: string } | null, + options?: { + WebSocket?: any; + }, + ) { + super(); + options = options || {}; + + const query = urlQuery({ + i: user?.token, + + // To prevent cache of an HTML such as error screen + _t: Date.now(), + }); + + const wsOrigin = origin + .replace("http://", "ws://") + .replace("https://", "wss://"); + + this.stream = new ReconnectingWebsocket( + `${wsOrigin}/streaming?${query}`, + "", + { + minReconnectionDelay: 1, // https://github.com/pladaria/reconnecting-websocket/issues/91 + WebSocket: options.WebSocket, + }, + ); + this.stream.addEventListener("open", this.onOpen); + this.stream.addEventListener("close", this.onClose); + this.stream.addEventListener("message", this.onMessage); + } + + @autobind + private genId(): string { + return (++this.idCounter).toString(); + } + + @autobind + public useChannel( + channel: C, + params?: Channels[C]["params"], + name?: string, + ): Connection { + if (params) { + return this.connectToChannel(channel, params); + } else { + return this.useSharedConnection(channel, name); + } + } + + @autobind + private useSharedConnection( + channel: C, + name?: string, + ): SharedConnection { + let pool = this.sharedConnectionPools.find((p) => p.channel === channel); + + if (pool == null) { + pool = new Pool(this, channel, this.genId()); + this.sharedConnectionPools.push(pool); + } + + const connection = new SharedConnection(this, channel, pool, name); + this.sharedConnections.push(connection); + return connection; + } + + @autobind + public removeSharedConnection(connection: SharedConnection): void { + this.sharedConnections = this.sharedConnections.filter( + (c) => c !== connection, + ); + } + + @autobind + public removeSharedConnectionPool(pool: Pool): void { + this.sharedConnectionPools = this.sharedConnectionPools.filter( + (p) => p !== pool, + ); + } + + @autobind + private connectToChannel( + channel: C, + params: Channels[C]["params"], + ): NonSharedConnection { + const connection = new NonSharedConnection( + this, + channel, + this.genId(), + params, + ); + this.nonSharedConnections.push(connection); + return connection; + } + + @autobind + public disconnectToChannel(connection: NonSharedConnection): void { + this.nonSharedConnections = this.nonSharedConnections.filter( + (c) => c !== connection, + ); + } + + /** + * Callback of when open connection + */ + @autobind + private onOpen(): void { + const isReconnect = this.state === "reconnecting"; + + this.state = "connected"; + this.emit("_connected_"); + + // チャンネル再接続 + if (isReconnect) { + for (const p of this.sharedConnectionPools) p.connect(); + for (const c of this.nonSharedConnections) c.connect(); + } + } + + /** + * Callback of when close connection + */ + @autobind + private onClose(): void { + if (this.state === "connected") { + this.state = "reconnecting"; + this.emit("_disconnected_"); + } + } + + /** + * Callback of when received a message from connection + */ + @autobind + private onMessage(message: { data: string }): void { + const { type, body } = JSON.parse(message.data); + + if (type === "channel") { + const id = body.id; + + let connections: Connection[]; + + connections = this.sharedConnections.filter((c) => c.id === id); + + if (connections.length === 0) { + const found = this.nonSharedConnections.find((c) => c.id === id); + if (found) { + connections = [found]; + } + } + + for (const c of connections) { + c.emit(body.type, body.body); + c.inCount++; + } + } else { + this.emit(type, body); + } + } + + /** + * Send a message to connection + */ + @autobind + public send(typeOrPayload: any, payload?: any): void { + const data = + payload === undefined + ? typeOrPayload + : { + type: typeOrPayload, + body: payload, + }; + + this.stream.send(JSON.stringify(data)); + } + + /** + * Close this connection + */ + @autobind + public close(): void { + this.stream.close(); + } +} + +// TODO: これらのクラスを Stream クラスの内部クラスにすれば余計なメンバをpublicにしないで済むかも? +// もしくは @internal を使う? https://www.typescriptlang.org/tsconfig#stripInternal +class Pool { + public channel: string; + public id: string; + protected stream: Stream; + public users = 0; + private disposeTimerId: any; + private isConnected = false; + + constructor(stream: Stream, channel: string, id: string) { + this.channel = channel; + this.stream = stream; + this.id = id; + + this.stream.on("_disconnected_", this.onStreamDisconnected); + } + + @autobind + private onStreamDisconnected(): void { + this.isConnected = false; + } + + @autobind + public inc(): void { + if (this.users === 0 && !this.isConnected) { + this.connect(); + } + + this.users++; + + // タイマー解除 + if (this.disposeTimerId) { + clearTimeout(this.disposeTimerId); + this.disposeTimerId = null; + } + } + + @autobind + public dec(): void { + this.users--; + + // そのコネクションの利用者が誰もいなくなったら + if (this.users === 0) { + // また直ぐに再利用される可能性があるので、一定時間待ち、 + // 新たな利用者が現れなければコネクションを切断する + this.disposeTimerId = setTimeout(() => { + this.disconnect(); + }, 3000); + } + } + + @autobind + public connect(): void { + if (this.isConnected) return; + this.isConnected = true; + this.stream.send("connect", { + channel: this.channel, + id: this.id, + }); + } + + @autobind + private disconnect(): void { + this.stream.off("_disconnected_", this.onStreamDisconnected); + this.stream.send("disconnect", { id: this.id }); + this.stream.removeSharedConnectionPool(this); + } +} + +export abstract class Connection< + Channel extends AnyOf = any, +> extends EventEmitter { + public channel: string; + protected stream: Stream; + public abstract id: string; + + public name?: string; // for debug + public inCount = 0; // for debug + public outCount = 0; // for debug + + constructor(stream: Stream, channel: string, name?: string) { + super(); + + this.stream = stream; + this.channel = channel; + this.name = name; + } + + @autobind + public send( + type: T, + body: Channel["receives"][T], + ): void { + this.stream.send("ch", { + id: this.id, + type: type, + body: body, + }); + + this.outCount++; + } + + public abstract dispose(): void; +} + +class SharedConnection< + Channel extends AnyOf = any, +> extends Connection { + private pool: Pool; + + public get id(): string { + return this.pool.id; + } + + constructor(stream: Stream, channel: string, pool: Pool, name?: string) { + super(stream, channel, name); + + this.pool = pool; + this.pool.inc(); + } + + @autobind + public dispose(): void { + this.pool.dec(); + this.removeAllListeners(); + this.stream.removeSharedConnection(this); + } +} + +class NonSharedConnection< + Channel extends AnyOf = any, +> extends Connection { + public id: string; + protected params: Channel["params"]; + + constructor( + stream: Stream, + channel: string, + id: string, + params: Channel["params"], + ) { + super(stream, channel); + + this.params = params; + this.id = id; + + this.connect(); + } + + @autobind + public connect(): void { + this.stream.send("connect", { + channel: this.channel, + id: this.id, + params: this.params, + }); + } + + @autobind + public dispose(): void { + this.removeAllListeners(); + this.stream.send("disconnect", { id: this.id }); + this.stream.disconnectToChannel(this); + } +} diff --git a/packages/calckey-js/src/streaming.types.ts b/packages/calckey-js/src/streaming.types.ts new file mode 100644 index 0000000000..44ef647bcc --- /dev/null +++ b/packages/calckey-js/src/streaming.types.ts @@ -0,0 +1,181 @@ +import { + Antenna, + CustomEmoji, + DriveFile, + MeDetailed, + MessagingMessage, + Note, + Notification, + PageEvent, + User, + UserGroup, +} from "./entities"; + +type FIXME = any; + +export type Channels = { + main: { + params: null; + events: { + notification: (payload: Notification) => void; + mention: (payload: Note) => void; + reply: (payload: Note) => void; + renote: (payload: Note) => void; + follow: (payload: User) => void; // 自分が他人をフォローしたとき + followed: (payload: User) => void; // 他人が自分をフォローしたとき + unfollow: (payload: User) => void; // 自分が他人をフォロー解除したとき + meUpdated: (payload: MeDetailed) => void; + pageEvent: (payload: PageEvent) => void; + urlUploadFinished: (payload: { marker: string; file: DriveFile }) => void; + readAllNotifications: () => void; + unreadNotification: (payload: Notification) => void; + unreadMention: (payload: Note["id"]) => void; + readAllUnreadMentions: () => void; + unreadSpecifiedNote: (payload: Note["id"]) => void; + readAllUnreadSpecifiedNotes: () => void; + readAllMessagingMessages: () => void; + messagingMessage: (payload: MessagingMessage) => void; + unreadMessagingMessage: (payload: MessagingMessage) => void; + readAllAntennas: () => void; + unreadAntenna: (payload: Antenna) => void; + readAllAnnouncements: () => void; + readAllChannels: () => void; + unreadChannel: (payload: Note["id"]) => void; + myTokenRegenerated: () => void; + reversiNoInvites: () => void; + reversiInvited: (payload: FIXME) => void; + signin: (payload: FIXME) => void; + registryUpdated: (payload: { + scope?: string[]; + key: string; + value: any | null; + }) => void; + driveFileCreated: (payload: DriveFile) => void; + readAntenna: (payload: Antenna) => void; + }; + receives: null; + }; + homeTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + localTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + hybridTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + recommendedTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + globalTimeline: { + params: null; + events: { + note: (payload: Note) => void; + }; + receives: null; + }; + messaging: { + params: { + otherparty?: User["id"] | null; + group?: UserGroup["id"] | null; + }; + events: { + message: (payload: MessagingMessage) => void; + deleted: (payload: MessagingMessage["id"]) => void; + read: (payload: MessagingMessage["id"][]) => void; + typers: (payload: User[]) => void; + }; + receives: { + read: { + id: MessagingMessage["id"]; + }; + }; + }; + serverStats: { + params: null; + events: { + stats: (payload: FIXME) => void; + }; + receives: { + requestLog: { + id: string | number; + length: number; + }; + }; + }; + queueStats: { + params: null; + events: { + stats: (payload: FIXME) => void; + }; + receives: { + requestLog: { + id: string | number; + length: number; + }; + }; + }; +}; + +export type NoteUpdatedEvent = + | { + id: Note["id"]; + type: "reacted"; + body: { + reaction: string; + userId: User["id"]; + }; + } + | { + id: Note["id"]; + type: "unreacted"; + body: { + reaction: string; + userId: User["id"]; + }; + } + | { + id: Note["id"]; + type: "deleted"; + body: { + deletedAt: string; + }; + } + | { + id: Note["id"]; + type: "pollVoted"; + body: { + choice: number; + userId: User["id"]; + }; + } + | { + id: Note["id"]; + type: "replied"; + body: { + id: Note["id"]; + }; + }; + +export type BroadcastEvents = { + noteUpdated: (payload: NoteUpdatedEvent) => void; + emojiAdded: (payload: { + emoji: CustomEmoji; + }) => void; +}; diff --git a/packages/calckey-js/test-d/api.ts b/packages/calckey-js/test-d/api.ts new file mode 100644 index 0000000000..c5018177c9 --- /dev/null +++ b/packages/calckey-js/test-d/api.ts @@ -0,0 +1,48 @@ +import { expectType } from "tsd"; +import * as Misskey from "../src"; + +describe("API", () => { + test("success", async () => { + const cli = new Misskey.api.APIClient({ + origin: "https://misskey.test", + credential: "TOKEN", + }); + const res = await cli.request("meta", { detail: true }); + expectType(res); + }); + + test("conditional respose type (meta)", async () => { + const cli = new Misskey.api.APIClient({ + origin: "https://misskey.test", + credential: "TOKEN", + }); + + const res = await cli.request("meta", { detail: true }); + expectType(res); + + const res2 = await cli.request("meta", { detail: false }); + expectType(res2); + + const res3 = await cli.request("meta", {}); + expectType(res3); + + const res4 = await cli.request("meta", { detail: true as boolean }); + expectType< + | Misskey.entities.LiteInstanceMetadata + | Misskey.entities.DetailedInstanceMetadata + >(res4); + }); + + test("conditional respose type (users/show)", async () => { + const cli = new Misskey.api.APIClient({ + origin: "https://misskey.test", + credential: "TOKEN", + }); + + const res = await cli.request("users/show", { userId: "xxxxxxxx" }); + expectType(res); + + const res2 = await cli.request("users/show", { userIds: ["xxxxxxxx"] }); + expectType(res2); + }); +}); diff --git a/packages/calckey-js/test-d/streaming.ts b/packages/calckey-js/test-d/streaming.ts new file mode 100644 index 0000000000..c49795dcc2 --- /dev/null +++ b/packages/calckey-js/test-d/streaming.ts @@ -0,0 +1,32 @@ +import { expectType } from "tsd"; +import * as Misskey from "../src"; + +describe("Streaming", () => { + test("emit type", async () => { + const stream = new Misskey.Stream("https://misskey.test", { + token: "TOKEN", + }); + const mainChannel = stream.useChannel("main"); + mainChannel.on("notification", (notification) => { + expectType(notification); + }); + }); + + test("params type", async () => { + const stream = new Misskey.Stream("https://misskey.test", { + token: "TOKEN", + }); + // TODO: 「stream.useChannel の第二引数として受け入れる型が + // { + // otherparty?: User['id'] | null; + // group?: UserGroup['id'] | null; + // } + // になっている」というテストを行いたいけどtsdでの書き方がわからない + const messagingChannel = stream.useChannel("messaging", { + otherparty: "aaa", + }); + messagingChannel.on("message", (message) => { + expectType(message); + }); + }); +}); diff --git a/packages/calckey-js/test/api.ts b/packages/calckey-js/test/api.ts new file mode 100644 index 0000000000..a8a1fc0e6f --- /dev/null +++ b/packages/calckey-js/test/api.ts @@ -0,0 +1,222 @@ +import { APIClient, isAPIError } from "../src/api"; +import { enableFetchMocks } from "jest-fetch-mock"; + +enableFetchMocks(); + +function getFetchCall(call: any[]) { + const { body, method } = call[1]; + if (body != null && typeof body != "string") { + throw new Error("invalid body"); + } + return { + url: call[0], + method: method, + body: JSON.parse(body as any), + }; +} + +describe("API", () => { + test("success", async () => { + fetchMock.resetMocks(); + fetchMock.mockResponse(async (req) => { + const body = await req.json(); + if (req.method == "POST" && req.url == "https://misskey.test/api/i") { + if (body.i === "TOKEN") { + return JSON.stringify({ id: "foo" }); + } else { + return { status: 400 }; + } + } else { + return { status: 404 }; + } + }); + + const cli = new APIClient({ + origin: "https://misskey.test", + credential: "TOKEN", + }); + + const res = await cli.request("i"); + + expect(res).toEqual({ + id: "foo", + }); + + expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({ + url: "https://misskey.test/api/i", + method: "POST", + body: { i: "TOKEN" }, + }); + }); + + test("with params", async () => { + fetchMock.resetMocks(); + fetchMock.mockResponse(async (req) => { + const body = await req.json(); + if ( + req.method == "POST" && + req.url == "https://misskey.test/api/notes/show" + ) { + if (body.i === "TOKEN" && body.noteId === "aaaaa") { + return JSON.stringify({ id: "foo" }); + } else { + return { status: 400 }; + } + } else { + return { status: 404 }; + } + }); + + const cli = new APIClient({ + origin: "https://misskey.test", + credential: "TOKEN", + }); + + const res = await cli.request("notes/show", { noteId: "aaaaa" }); + + expect(res).toEqual({ + id: "foo", + }); + + expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({ + url: "https://misskey.test/api/notes/show", + method: "POST", + body: { i: "TOKEN", noteId: "aaaaa" }, + }); + }); + + test("204 No Content で null が返る", async () => { + fetchMock.resetMocks(); + fetchMock.mockResponse(async (req) => { + if ( + req.method == "POST" && + req.url == "https://misskey.test/api/reset-password" + ) { + return { status: 204 }; + } else { + return { status: 404 }; + } + }); + + const cli = new APIClient({ + origin: "https://misskey.test", + credential: "TOKEN", + }); + + const res = await cli.request("reset-password", { + token: "aaa", + password: "aaa", + }); + + expect(res).toEqual(null); + + expect(getFetchCall(fetchMock.mock.calls[0])).toEqual({ + url: "https://misskey.test/api/reset-password", + method: "POST", + body: { i: "TOKEN", token: "aaa", password: "aaa" }, + }); + }); + + test("インスタンスの credential が指定されていても引数で credential が null ならば null としてリクエストされる", async () => { + fetchMock.resetMocks(); + fetchMock.mockResponse(async (req) => { + const body = await req.json(); + if (req.method == "POST" && req.url == "https://misskey.test/api/i") { + if (typeof body.i === "string") { + return JSON.stringify({ id: "foo" }); + } else { + return { + status: 401, + body: JSON.stringify({ + error: { + message: "Credential required.", + code: "CREDENTIAL_REQUIRED", + id: "1384574d-a912-4b81-8601-c7b1c4085df1", + }, + }), + }; + } + } else { + return { status: 404 }; + } + }); + + try { + const cli = new APIClient({ + origin: "https://misskey.test", + credential: "TOKEN", + }); + + await cli.request("i", {}, null); + } catch (e) { + expect(isAPIError(e)).toEqual(true); + } + }); + + test("api error", async () => { + fetchMock.resetMocks(); + fetchMock.mockResponse(async (req) => { + return { + status: 500, + body: JSON.stringify({ + error: { + message: + "Internal error occurred. Please contact us if the error persists.", + code: "INTERNAL_ERROR", + id: "5d37dbcb-891e-41ca-a3d6-e690c97775ac", + kind: "server", + }, + }), + }; + }); + + try { + const cli = new APIClient({ + origin: "https://misskey.test", + credential: "TOKEN", + }); + + await cli.request("i"); + } catch (e: any) { + expect(isAPIError(e)).toEqual(true); + expect(e.id).toEqual("5d37dbcb-891e-41ca-a3d6-e690c97775ac"); + } + }); + + test("network error", async () => { + fetchMock.resetMocks(); + fetchMock.mockAbort(); + + try { + const cli = new APIClient({ + origin: "https://misskey.test", + credential: "TOKEN", + }); + + await cli.request("i"); + } catch (e) { + expect(isAPIError(e)).toEqual(false); + } + }); + + test("json parse error", async () => { + fetchMock.resetMocks(); + fetchMock.mockResponse(async (req) => { + return { + status: 500, + body: "I AM NOT JSON", + }; + }); + + try { + const cli = new APIClient({ + origin: "https://misskey.test", + credential: "TOKEN", + }); + + await cli.request("i"); + } catch (e) { + expect(isAPIError(e)).toEqual(false); + } + }); +}); diff --git a/packages/calckey-js/test/streaming.ts b/packages/calckey-js/test/streaming.ts new file mode 100644 index 0000000000..920a9102b8 --- /dev/null +++ b/packages/calckey-js/test/streaming.ts @@ -0,0 +1,181 @@ +import WS from "jest-websocket-mock"; +import Stream from "../src/streaming"; + +describe("Streaming", () => { + test("useChannel", async () => { + const server = new WS("wss://misskey.test/streaming"); + const stream = new Stream("https://misskey.test", { token: "TOKEN" }); + const mainChannelReceived: any[] = []; + const main = stream.useChannel("main"); + main.on("meUpdated", (payload) => { + mainChannelReceived.push(payload); + }); + + const ws = await server.connected; + expect(new URLSearchParams(new URL(ws.url).search).get("i")).toEqual( + "TOKEN", + ); + + const msg = JSON.parse((await server.nextMessage) as string); + const mainChannelId = msg.body.id; + expect(msg.type).toEqual("connect"); + expect(msg.body.channel).toEqual("main"); + expect(mainChannelId != null).toEqual(true); + + server.send( + JSON.stringify({ + type: "channel", + body: { + id: mainChannelId, + type: "meUpdated", + body: { + id: "foo", + }, + }, + }), + ); + + expect(mainChannelReceived[0]).toEqual({ + id: "foo", + }); + + stream.close(); + server.close(); + }); + + test("useChannel with parameters", async () => { + const server = new WS("wss://misskey.test/streaming"); + const stream = new Stream("https://misskey.test", { token: "TOKEN" }); + const messagingChannelReceived: any[] = []; + const messaging = stream.useChannel("messaging", { otherparty: "aaa" }); + messaging.on("message", (payload) => { + messagingChannelReceived.push(payload); + }); + + const ws = await server.connected; + expect(new URLSearchParams(new URL(ws.url).search).get("i")).toEqual( + "TOKEN", + ); + + const msg = JSON.parse((await server.nextMessage) as string); + const messagingChannelId = msg.body.id; + expect(msg.type).toEqual("connect"); + expect(msg.body.channel).toEqual("messaging"); + expect(msg.body.params).toEqual({ otherparty: "aaa" }); + expect(messagingChannelId != null).toEqual(true); + + server.send( + JSON.stringify({ + type: "channel", + body: { + id: messagingChannelId, + type: "message", + body: { + id: "foo", + }, + }, + }), + ); + + expect(messagingChannelReceived[0]).toEqual({ + id: "foo", + }); + + stream.close(); + server.close(); + }); + + test("ちゃんとチャンネルごとにidが異なる", async () => { + const server = new WS("wss://misskey.test/streaming"); + const stream = new Stream("https://misskey.test", { token: "TOKEN" }); + + stream.useChannel("messaging", { otherparty: "aaa" }); + stream.useChannel("messaging", { otherparty: "bbb" }); + + const ws = await server.connected; + expect(new URLSearchParams(new URL(ws.url).search).get("i")).toEqual( + "TOKEN", + ); + + const msg = JSON.parse((await server.nextMessage) as string); + const messagingChannelId = msg.body.id; + const msg2 = JSON.parse((await server.nextMessage) as string); + const messagingChannelId2 = msg2.body.id; + + expect(messagingChannelId != null).toEqual(true); + expect(messagingChannelId2 != null).toEqual(true); + expect(messagingChannelId).not.toEqual(messagingChannelId2); + + stream.close(); + server.close(); + }); + + test("Connection#send", async () => { + const server = new WS("wss://misskey.test/streaming"); + const stream = new Stream("https://misskey.test", { token: "TOKEN" }); + + const messaging = stream.useChannel("messaging", { otherparty: "aaa" }); + messaging.send("read", { id: "aaa" }); + + const ws = await server.connected; + expect(new URLSearchParams(new URL(ws.url).search).get("i")).toEqual( + "TOKEN", + ); + + const connectMsg = JSON.parse((await server.nextMessage) as string); + const channelId = connectMsg.body.id; + const msg = JSON.parse((await server.nextMessage) as string); + + expect(msg.type).toEqual("ch"); + expect(msg.body.id).toEqual(channelId); + expect(msg.body.type).toEqual("read"); + expect(msg.body.body).toEqual({ id: "aaa" }); + + stream.close(); + server.close(); + }); + + test("Connection#dispose", async () => { + const server = new WS("wss://misskey.test/streaming"); + const stream = new Stream("https://misskey.test", { token: "TOKEN" }); + const mainChannelReceived: any[] = []; + const main = stream.useChannel("main"); + main.on("meUpdated", (payload) => { + mainChannelReceived.push(payload); + }); + + const ws = await server.connected; + expect(new URLSearchParams(new URL(ws.url).search).get("i")).toEqual( + "TOKEN", + ); + + const msg = JSON.parse((await server.nextMessage) as string); + const mainChannelId = msg.body.id; + expect(msg.type).toEqual("connect"); + expect(msg.body.channel).toEqual("main"); + expect(mainChannelId != null).toEqual(true); + main.dispose(); + + server.send( + JSON.stringify({ + type: "channel", + body: { + id: mainChannelId, + type: "meUpdated", + body: { + id: "foo", + }, + }, + }), + ); + + expect(mainChannelReceived.length).toEqual(0); + + stream.close(); + server.close(); + }); + + // TODO: SharedConnection#dispose して一定時間経ったら disconnect メッセージがサーバーに送られてくるかのテスト + + // TODO: チャンネル接続が使いまわされるかのテスト +}); diff --git a/packages/calckey-js/tsconfig.json b/packages/calckey-js/tsconfig.json new file mode 100644 index 0000000000..a03a242628 --- /dev/null +++ b/packages/calckey-js/tsconfig.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json.schemastore.org/tsconfig", + "compilerOptions": { + "target": "es2020", + "module": "commonjs", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./built/", + "removeComments": true, + "strict": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "experimentalDecorators": true, + "noImplicitReturns": true, + "esModuleInterop": true + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "node_modules", + "test/**/*" + ] +} diff --git a/packages/client/.prettierrc b/packages/client/.prettierrc new file mode 100644 index 0000000000..77a5016a4d --- /dev/null +++ b/packages/client/.prettierrc @@ -0,0 +1,15 @@ +{ + "tabWidth": 4, + "useTabs": true, + "singleQuote": false, + "vueIndentScriptAndStyle": false, + "plugins": ["vue"], + "overrides": [ + { + "files": "*.vue", + "options": { + "parser": "vue" + } + } + ] +} diff --git a/packages/client/@types/theme.d.ts b/packages/client/@types/theme.d.ts index 67f724a9aa..5f1b81603d 100644 --- a/packages/client/@types/theme.d.ts +++ b/packages/client/@types/theme.d.ts @@ -1,4 +1,4 @@ -declare module '@/themes/*.json5' { +declare module "@/themes/*.json5" { import { Theme } from "@/scripts/theme"; const theme: Theme; diff --git a/packages/client/@types/vue.d.ts b/packages/client/@types/vue.d.ts index f6b66228f6..2cd2e39718 100644 --- a/packages/client/@types/vue.d.ts +++ b/packages/client/@types/vue.d.ts @@ -1,7 +1,7 @@ /// -declare module '*.vue' { - import type { DefineComponent } from 'vue'; +declare module "*.vue" { + import type { DefineComponent } from "vue"; const component: DefineComponent<{}, {}, any>; export default component; } diff --git a/packages/client/assets/tagcanvas.min.js b/packages/client/assets/tagcanvas.min.js index bcee46e682..562fe02cd8 100644 --- a/packages/client/assets/tagcanvas.min.js +++ b/packages/client/assets/tagcanvas.min.js @@ -10,7 +10,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ @@ -18,4 +18,2536 @@ * TagCanvas 2.11 * For more information, please contact */ - (function(){"use strict";var r,C,p=Math.abs,o=Math.sin,l=Math.cos,g=Math.max,h=Math.min,af=Math.ceil,E=Math.sqrt,w=Math.pow,I={},D={},R={0:"0,",1:"17,",2:"34,",3:"51,",4:"68,",5:"85,",6:"102,",7:"119,",8:"136,",9:"153,",a:"170,",A:"170,",b:"187,",B:"187,",c:"204,",C:"204,",d:"221,",D:"221,",e:"238,",E:"238,",f:"255,",F:"255,"},f,d,b,T,z,F,M,c=document,v,e,P,j={};for(r=0;r<256;++r)C=r.toString(16),r<16&&(C='0'+C),D[C]=D[C.toUpperCase()]=r.toString()+',';function n(a){return typeof a!='undefined'}function B(a){return typeof a=='object'&&a!=null}function G(a,c,b){return isNaN(a)?b:h(b,g(c,a))}function x(){return!1}function q(){return(new Date).valueOf()}function ak(c,d){var b=[],e=c.length,a;for(a=0;a=1)?0:a<=-1?Math.PI:Math.acos(a)},z.unit=function(){var a=this.length();return new s(this.x/a,this.y/a,this.z/a)};function ay(b,a){a=a*Math.PI/180,b=b*Math.PI/180;var c=o(b)*l(a),d=-o(a),e=-l(b)*l(a);return new s(c,d,e)}function m(a){this[1]={1:a[0],2:a[1],3:a[2]},this[2]={1:a[3],2:a[4],3:a[5]},this[3]={1:a[6],2:a[7],3:a[8]}}T=m.prototype,m.Identity=function(){return new m([1,0,0,0,1,0,0,0,1])},m.Rotation=function(e,a){var c=o(e),d=l(e),b=1-d;return new m([d+w(a.x,2)*b,a.x*a.y*b-a.z*c,a.x*a.z*b+a.y*c,a.y*a.x*b+a.z*c,d+w(a.y,2)*b,a.y*a.z*b-a.x*c,a.z*a.x*b-a.y*c,a.z*a.y*b+a.x*c,d+w(a.z,2)*b])},T.mul=function(c){var d=[],a,b,e=c.xform?1:0;for(a=1;a<=3;++a)for(b=1;b<=3;++b)e?d.push(this[a][1]*c[1][b]+this[a][2]*c[2][b]+this[a][3]*c[3][b]):d.push(this[a][b]*c);return new m(d)},T.xform=function(b){var a={},c=b.x,d=b.y,e=b.z;return a.x=c*this[1][1]+d*this[2][1]+e*this[3][1],a.y=c*this[1][2]+d*this[2][2]+e*this[3][2],a.z=c*this[1][3]+d*this[2][3]+e*this[3][3],a};function aB(g,j,k,m,f){var a,b,c,d,e=[],h=2/g,i;i=Math.PI*(3-E(5)+(parseFloat(f)?parseFloat(f):0));for(a=0;a0)}function aC(a,c,f,d){var e=a.createLinearGradient(0,0,c,0),b;for(b in d)e.addColorStop(1-b,d[b]);a.fillStyle=e,a.fillRect(0,f,c,1)}function L(a,m,j){var l=1024,d=1,e=a.weightGradient,i,f,b,c;if(a.gCanvas)f=a.gCanvas.getContext('2d'),d=a.gCanvas.height;else{if(B(e[0])?d=e.length:e=[e],a.gCanvas=i=k(l,d),!i)return null;f=i.getContext('2d');for(b=0;b0?b=i*b/100:b=b*j,a=e.getContext('2d'),a.globalCompositeOperation='source-over',a.fillStyle='#fff',b>=i/2?(b=h(c,d)/2,a.beginPath(),a.moveTo(c/2,d/2),a.arc(c/2,d/2,b,0,2*Math.PI,!1),a.fill(),a.closePath()):(b=h(c/2,d/2,b),y(a,0,0,c,d,b,!0),a.fill()),a.globalCompositeOperation='source-in',a.drawImage(l,0,0,c,d),e)}function ao(q,m,i,b,h,a,c){var g=p(c[0]),f=p(c[1]),j=m+(g>a?g+a:a*2)*b,l=i+(f>a?f+a:a*2)*b,n=b*((a||0)+(c[0]<0?g:0)),o=b*((a||0)+(c[1]<0?f:0)),e,d;return e=k(j,l),!e?null:(d=e.getContext('2d'),h&&(d.shadowColor=h),a&&(d.shadowBlur=a*b),c&&(d.shadowOffsetX=c[0]*b,d.shadowOffsetY=c[1]*b),d.drawImage(q,n,o,m,i),{image:e,width:j/b,height:l/b})}function ae(m,o,l){var c=parseInt(m.toString().length*l),h=parseInt(l*2*m.length),j=k(c,h),g,i,e,f,b,d,n,a;if(!j)return null;g=j.getContext('2d'),g.fillStyle='#000',g.fillRect(0,0,c,h),Y(g,l+'px '+o,'#fff',m,0,0,0,0,[],'centre'),i=g.getImageData(0,0,c,h),e=i.width,f=i.height,a={min:{x:e,y:f},max:{x:-1,y:-1}};for(d=0;d0&&(ba.max.x&&(a.max.x=b),da.max.y&&(a.max.y=d));return e!=c&&(a.min.x*=c/e,a.max.x*=c/e),f!=h&&(a.min.y*=c/f,a.max.y*=c/f),j=null,a}function Q(a){return"'"+a.replace(/(\'|\")/g,'').replace(/\s*,\s*/g,"', '")+"'"}function t(b,d,a){a=a||c,a.addEventListener?a.addEventListener(b,d,!1):a.attachEvent('on'+b,d)}function am(b,d,a){a=a||c,a.removeEventListener?a.removeEventListener(b,d):a.detachEvent('on'+b,d)}function A(g,e,j,a,b){var l=b.imageScale,h,c,k,m,f,d;if(!e.complete)return t('load',function(){A(g,e,j,a,b)},e);if(!g.complete)return t('load',function(){A(g,e,j,a,b)},g);if(j&&!j.complete)return t('load',function(){A(g,e,j,a,b)},j);e.width=e.width,e.height=e.height,l&&(g.width=e.width*l,g.height=e.height*l),a.iw=g.width,a.ih=g.height,b.txtOpt&&(c=g,h=b.zoomMax*b.txtScale,f=a.iw*h,d=a.ih*h,f0?(a.iw+=2*b.outlineIncrease,a.ih+=2*b.outlineIncrease,f=h*a.iw,d=h*a.ih,c=S(a.fimage,f,d),a.oimage=c,a.fimage=H(a.fimage,a.oimage.width,a.oimage.height)):(f=h*(a.iw+2*b.outlineIncrease),d=h*(a.ih+2*b.outlineIncrease),c=S(a.fimage,f,d),a.oimage=H(c,a.fimage.width,a.fimage.height))))),a.alt=j,a.Init()}function i(a,d){var b=c.defaultView,e=d.replace(/\-([a-z])/g,function(a){return a.charAt(1).toUpperCase()});return b&&b.getComputedStyle&&b.getComputedStyle(a,null).getPropertyValue(d)||a.currentStyle&&a.currentStyle[e]}function aj(c,d,e){var b=1,a;return d?b=1*(c.getAttribute(d)||e):(a=i(c,'font-size'))&&(b=a.indexOf('px')>-1&&a.replace('px','')*1||a.indexOf('pt')>-1&&a.replace('pt','')*1.25||a*3.3),b}function u(a){return a.target&&n(a.target.id)?a.target.id:a.srcElement.parentNode.id}function K(a,c){var b,d,e=parseInt(i(c,'width'))/c.width,f=parseInt(i(c,'height'))/c.height;return n(a.offsetX)?b={x:a.offsetX,y:a.offsetY}:(d=X(c.id),n(a.changedTouches)&&(a=a.changedTouches[0]),a.pageX&&(b={x:a.pageX-d.x,y:a.pageY-d.y})),b&&e&&f&&(b.x/=e,b.y/=f),b}function an(c){var d=c.target||c.fromElement.parentNode,b=a.tc[d.id];b&&(b.mx=b.my=-1,b.UnFreeze(),b.EndDrag())}function ad(e){var g,c=a,b,d,f=u(e);for(g in c.tc)b=c.tc[g],b.tttimer&&(clearTimeout(b.tttimer),b.tttimer=null);f&&c.tc[f]&&(b=c.tc[f],(d=K(e,b.canvas))&&(b.mx=d.x,b.my=d.y,b.Drag(e,d)),b.drawn=0)}function ap(b){var e=a,f=c.addEventListener?0:1,d=u(b);d&&b.button==f&&e.tc[d]&&e.tc[d].BeginDrag(b)}function aq(b){var f=a,g=c.addEventListener?0:1,e=u(b),d;e&&b.button==g&&f.tc[e]&&(d=f.tc[e],ad(b),!d.EndDrag()&&!d.touchState&&d.Clicked(b))}function ar(c){var e=u(c),b=e&&a.tc[e],d;b&&c.changedTouches&&(c.touches.length==1&&b.touchState==0?(b.touchState=1,b.BeginDrag(c),(d=K(c,b.canvas))&&(b.mx=d.x,b.my=d.y,b.drawn=0)):c.targetTouches.length==2&&b.pinchZoom?(b.touchState=3,b.EndDrag(),b.BeginPinch(c)):(b.EndDrag(),b.EndPinch(),b.touchState=0))}function ac(c){var d=u(c),b=d&&a.tc[d];if(b&&c.changedTouches){switch(b.touchState){case 1:b.Draw(),b.Clicked();break;break;case 2:b.EndDrag();break;case 3:b.EndPinch()}b.touchState=0}}function au(c){var f,e=a,b,d,g=u(c);for(f in e.tc)b=e.tc[f],b.tttimer&&(clearTimeout(b.tttimer),b.tttimer=null);if(b=g&&e.tc[g],b&&c.changedTouches&&b.touchState){switch(b.touchState){case 1:case 2:(d=K(c,b.canvas))&&(b.mx=d.x,b.my=d.y,b.Drag(c,d)&&(b.touchState=2));break;case 3:b.Pinch(c)}b.drawn=0}}function ab(b){var d=a,c=u(b);c&&d.tc[c]&&(b.cancelBubble=!0,b.returnValue=!1,b.preventDefault&&b.preventDefault(),d.tc[c].Wheel((b.wheelDelta||b.detail)>0))}function aw(d){var c,b=a;clearTimeout(b.scrollTimer);for(c in b.tc)b.tc[c].Pause();b.scrollTimer=setTimeout(function(){var b,c=a;for(b in c.tc)c.tc[b].Resume()},b.scrollPause)}function al(){Z(q())}function Z(b){var c=a.tc,d;a.NextFrame(a.interval),b=b||q();for(d in c)c[d].Draw(b)}function az(){requestAnimationFrame(Z)}function aA(a){setTimeout(al,a)}function X(f){var g=c.getElementById(f),b=g.getBoundingClientRect(),a=c.documentElement,d=c.body,e=window,h=e.pageXOffset||a.scrollLeft,i=e.pageYOffset||a.scrollTop,j=a.clientLeft||d.clientLeft,k=a.clientTop||d.clientTop;return{x:b.left+h-j,y:b.top+i-k}}function aI(a,b,d,e){var c=a.radius*a.z1/(a.z1+a.z2+b.z);return{x:b.x*c*d,y:b.y*c*e,z:b.z,w:(a.z1-b.z)/a.z2}}function V(a){this.e=a,this.br=0,this.line=[],this.text=[],this.original=a.innerText||a.textContent}F=V.prototype,F.Empty=function(){for(var a=0;ah?(d.push(this.line.join(' ')),this.line=[a[b]]):this.line.push(a[b]);d.push(this.line.join(' '))}return this.text=d};function _(a,b){this.ts=null,this.tc=a,this.tag=b,this.x=this.y=this.w=this.h=this.sc=1,this.z=0,this.pulse=1,this.pulsate=a.pulsateTo<1,this.colour=a.outlineColour,this.adash=~~a.outlineDash,this.agap=~~a.outlineDashSpace||this.adash,this.aspeed=a.outlineDashSpeed*1,this.colour=='tag'?this.colour=i(b.a,'color'):this.colour=='tagbg'&&(this.colour=i(b.a,'background-color')),this.Draw=this.pulsate?this.DrawPulsate:this.DrawSimple,this.radius=a.outlineRadius|0,this.SetMethod(a.outlineMethod,a.altImage)}f=_.prototype,f.SetMethod=function(a,d){var b={block:['PreDraw','DrawBlock'],colour:['PreDraw','DrawColour'],outline:['PostDraw','DrawOutline'],classic:['LastDraw','DrawOutline'],size:['PreDraw','DrawSize'],none:['LastDraw']},c=b[a]||b.outline;a=='none'?this.Draw=function(){return 1}:this.drawFunc=this[c[1]],this[c[0]]=this.Draw,d&&(this.RealPreDraw=this.PreDraw,this.PreDraw=this.DrawAlt)},f.Update=function(d,e,i,j,a,f,g,h){var b=this.tc.outlineOffset,c=2*b;this.x=a*d+g-b,this.y=a*e+h-b,this.w=a*i+c,this.h=a*j+c,this.sc=a,this.z=f},f.Ants=function(k){if(!this.adash)return;var b=this.adash,c=this.agap,a=this.aspeed,j=b+c,h=0,g=b,f=c,i=0,d=0,e;a&&(d=p(a)*(q()-this.ts)/50,a<0&&(d=864e4-d),a=~~d%j),a?(b>=a?(h=b-a,g=a):(f=j-a,i=c-f),e=[h,f,g,i]):e=[b,c],k.setLineDash(e)},f.DrawOutline=function(a,d,e,b,c,f){var g=h(this.radius,c/2,b/2);a.strokeStyle=f,this.Ants(a),y(a,d,e,b,c,g,!0)},f.DrawSize=function(i,n,m,l,k,j,a,h,g){var f=a.w,e=a.h,c,b,d;return this.pulsate?(a.image?d=(a.image.height+this.tc.outlineIncrease)/a.image.height:d=a.oscale,b=a.fimage||a.image,c=1+(d-1)*(1-this.pulse),a.h*=c,a.w*=c):b=a.oimage,a.alpha=1,a.Draw(i,h,g,b),a.h=e,a.w=f,1},f.DrawColour=function(d,h,i,e,f,g,a,b,c){return a.oimage?(this.pulse<1?(a.alpha=1-w(this.pulse,2),a.Draw(d,b,c,a.fimage),a.alpha=this.pulse):a.alpha=1,a.Draw(d,b,c,a.oimage),1):this[a.image?'DrawColourImage':'DrawColourText'](d,h,i,e,f,g,a,b,c)},f.DrawColourText=function(f,h,i,j,g,e,a,b,c){var d=a.colour;return a.colour=e,a.alpha=1,a.Draw(f,b,c),a.colour=d,1},f.DrawColourImage=function(a,q,p,o,n,m,i,r,l){var f=a.canvas,e=~~g(q,0),d=~~g(p,0),c=h(f.width-e,o)+.5|0,b=h(f.height-d,n)+.5|0,j;return v?(v.width=c,v.height=b):v=k(c,b),!v?this.SetMethod('outline'):(j=v.getContext('2d'),j.drawImage(f,e,d,c,b,0,0,c,b),a.clearRect(e,d,c,b),this.pulsate?i.alpha=1-w(this.pulse,2):i.alpha=1,i.Draw(a,r,l),a.setTransform(1,0,0,1,0,0),a.save(),a.beginPath(),a.rect(e,d,c,b),a.clip(),a.globalCompositeOperation='source-in',a.fillStyle=m,a.fillRect(e,d,c,b),a.restore(),a.globalAlpha=1,a.globalCompositeOperation='destination-over',a.drawImage(v,0,0,c,b,e,d,c,b),a.globalCompositeOperation='source-over',1)},f.DrawAlt=function(b,a,c,d,f,g){var e=this.RealPreDraw(b,a,c,d,f,g);return a.alt&&(a.DrawImage(b,c,d,a.alt),e=1),e},f.DrawBlock=function(a,d,e,b,c,f){var g=h(this.radius,c/2,b/2);a.fillStyle=f,y(a,d,e,b,c,g)},f.DrawSimple=function(a,b,c,d,e,f){var g=this.tc;return a.setTransform(1,0,0,1,0,0),a.strokeStyle=this.colour,a.lineWidth=g.outlineThickness,a.shadowBlur=a.shadowOffsetX=a.shadowOffsetY=0,a.globalAlpha=f?e:1,this.drawFunc(a,this.x,this.y,this.w,this.h,this.colour,b,c,d)},f.DrawPulsate=function(h,d,e,f){var g=q()-this.ts,c=this.tc,b=c.pulsateTo+(1-c.pulsateTo)*(.5+l(2*Math.PI*g/(1e3*c.pulsateTime))/2);return this.pulse=b=a.Smooth(1,b),this.DrawSimple(h,d,e,f,b,1)},f.Active=function(d,a,b){var c=a>=this.x&&b>=this.y&&a<=this.x+this.w&&b<=this.y+this.h;return c?this.ts=this.ts||q():this.ts=null,c},f.PreDraw=f.PostDraw=f.LastDraw=x;function J(a,h,c,b,e,f,g,d,i,j,k,l,m,n){this.tc=a,this.image=null,this.text=h,this.text_original=n,this.line_widths=[],this.title=c.title||null,this.a=c,this.position=new s(b[0],b[1],b[2]),this.x=this.y=this.z=0,this.w=e,this.h=f,this.colour=g||a.textColour,this.bgColour=d||a.bgColour,this.bgRadius=i|0,this.bgOutline=j||this.colour,this.bgOutlineThickness=k|0,this.textFont=l||a.textFont,this.padding=m|0,this.sc=this.alpha=1,this.weighted=!a.weight,this.outline=new _(a,this),this.audio=null}d=J.prototype,d.Init=function(b){var a=this.tc;this.textHeight=a.textHeight,this.HasText()?this.Measure(a.ctxt,a):(this.w=this.iw,this.h=this.ih),this.SetShadowColour=a.shadowAlpha?this.SetShadowColourAlpha:this.SetShadowColourFixed,this.SetDraw(a)},d.Draw=x,d.HasText=function(){return this.text&&this.text[0].length>0},d.EqualTo=function(a){var b=a.getElementsByTagName('img');return this.a.href!=a.href?0:b.length?this.image.src==b[0].src:(a.innerText||a.textContent)==this.text_original},d.SetImage=function(a){this.image=this.fimage=a},d.SetAudio=function(a){this.audio=a,this.audio.load()},d.SetDraw=function(a){this.Draw=this.fimage?a.ie>7?this.DrawImageIE:this.DrawImage:this.DrawText,a.noSelect&&(this.CheckActive=x)},d.MeasureText=function(d){var a,e=this.text.length,b=0,c;for(a=0;a0?c=H(c,this.oimage.width,this.oimage.height):this.oimage=H(this.oimage,c.width,c.height)),c&&(this.fimage=c,l=this.fimage.width/b,j=this.fimage.height/b),this.SetDraw(a),a.txtOpt=!!this.fimage),this.h=j,this.w=l},d.SetFont=function(a,b,c,d){this.textFont=a,this.colour=b,this.bgColour=c,this.bgOutline=d,this.Measure(this.tc.ctxt,this.tc)},d.SetWeight=function(c){var b=this.tc,e=b.weightMode.split(/[, ]/),d,a,f=c.length;if(!this.HasText())return;this.weighted=!0;for(a=0;a0&&a.weightSizeMax>a.weightSizeMin?this.textHeight=a.weightSize*(a.weightSizeMin+(a.weightSizeMax-a.weightSizeMin)*c):this.textHeight=g(1,b*a.weightSize))},d.SetShadowColourFixed=function(a,b,c){a.shadowColor=b},d.SetShadowColourAlpha=function(a,b,c){a.shadowColor=aE(b,c)},d.DrawText=function(a,h,i){var e=this.tc,g=this.x,f=this.y,c=this.sc,b,d;a.globalAlpha=this.alpha,a.fillStyle=this.colour,e.shadow&&this.SetShadowColour(a,e.shadow,this.alpha),a.font=this.font,g+=h/c,f+=i/c-this.h/2;for(b=0;b{this.stopped?this.audio.pause():this.playing=1}),1}};function a(f,o,k){var d,i,b=c.getElementById(f),l=['id','class','innerHTML'];if(!b)throw 0;if(n(window.G_vmlCanvasManager)&&(b=window.G_vmlCanvasManager.initElement(b),this.ie=parseFloat(navigator.appVersion.split('MSIE')[1])),b&&(!b.getContext||!b.getContext('2d').fillText)){i=c.createElement('DIV');for(d=0;d0?a.scrollPause=~~this.scrollPause:this.scrollPause=0,this.minTags>0&&this.repeatTags<1&&(d=this.GetTags().length)&&(this.repeatTags=af(this.minTags/d)-1),this.transform=m.Identity(),this.startTime=this.time=q(),this.mx=this.my=-1,this.centreImage&&av(this),this.Animate=this.dragControl?this.AnimateDrag:this.AnimatePosition,this.animTiming=typeof a[this.animTiming]=='function'?a[this.animTiming]:a.Smooth,this.shadowBlur||this.shadowOffset[0]||this.shadowOffset[1]?(this.ctxt.shadowColor=this.shadow,this.shadow=this.ctxt.shadowColor,this.shadowAlpha=aD()):delete this.shadow,this.activeAudio===!1?e='off':this.activeAudio&&this.LoadAudio(),this.Load(),o&&this.hideTags&&function(b){a.loaded?b.HideTags():t('load',function(){b.HideTags()},window)}(this),this.yaw=this.initial?this.initial[0]*this.maxSpeed:0,this.pitch=this.initial?this.initial[1]*this.maxSpeed:0,this.tooltip?(this.ctitle=b.title,b.title='',this.tooltip=='native'?this.Tooltip=this.TooltipNative:(this.Tooltip=this.TooltipDiv,this.ttdiv||(this.ttdiv=c.createElement('div'),this.ttdiv.className=this.tooltipClass,this.ttdiv.style.position='absolute',this.ttdiv.style.zIndex=b.style.zIndex+1,t('mouseover',function(a){a.target.style.display='none'},this.ttdiv),c.body.appendChild(this.ttdiv)))):this.Tooltip=this.TooltipNone,!this.noMouse&&!j[f]){j[f]=[['mousemove',ad],['mouseout',an],['mouseup',aq],['touchstart',ar],['touchend',ac],['touchcancel',ac],['touchmove',au]],this.dragControl&&(j[f].push(['mousedown',ap]),j[f].push(['selectstart',x])),this.wheelZoom&&(j[f].push(['mousewheel',ab]),j[f].push(['DOMMouseScroll',ab])),this.scrollPause&&j[f].push(['scroll',aw,window]);for(d=0;dthis.max_weight[a])&&(this.max_weight[a]=c),(!this.min_weight[a]||cthis.min_weight[a]&&(g=1);if(g)for(b=0;b=d&&this.my>=e)return!0},b.ToggleAudio=function(){var a=this.audioOff||e&&e.state==='suspended';a||this.currentAudio&&this.currentAudio.StopAudio(),this.audioOff=!a},b.Draw=function(s){if(this.paused)return;var l=this.canvas,i=l.width,j=l.height,q=0,p=(s-this.time)*a.interval/1e3,h=i/2+this.offsetX,g=j/2+this.offsetY,d=this.ctxt,b,f,c,o=-1,e=this.taglist,k=e.length,t=this.active&&this.active.tag,m='',u=this.frontSelect,r=this.centreFunc==x,n;if(this.time=s,this.frozen&&this.drawn)return this.Animate(i,j,p);n=this.AnimateFixed(),d.setTransform(1,0,0,1,0,0);for(c=0;c=0&&this.my>=0&&this.taglist[c].CheckActive(d,h,g),f&&f.sc>q&&(!u||f.z<=0)&&(b=f,o=c,b.tag=this.taglist[c],q=f.sc);this.active=b}this.txtOpt||this.shadow&&this.SetShadow(d),d.clearRect(0,0,i,j);for(c=0;c=this.fadeIn?(this.fadeIn=0,this.fixedAlpha=1):this.fixedAlpha=b/this.fadeIn),this.fixedAnim)&&(this.fixedAnim.transform||(this.fixedAnim.transform=this.transform),a=this.fixedAnim,b=q()-a.t0,c=a.angle,d,e=this.animTiming(a.t,b),this.transform=a.transform,b>=a.t?(this.fixedCallbackTag=a.tag,this.fixedCallback=a.cb,this.fixedAnim=this.yaw=this.pitch=0):c*=e,d=m.Rotation(c,a.axis),this.transform=this.transform.mul(d),this.fixedAnim!=0)},b.AnimatePosition=function(g,h,f){var a=this,d=a.mx,e=a.my,b,c;!a.frozen&&d>=0&&e>=0&&db&&(a.yaw=c>a.z0?a.yaw*a.decel:0),!a.ly&&d>b&&(a.pitch=d>a.z0?a.pitch*a.decel:0)},b.Zoom=function(a){this.z2=this.z1*(1/a),this.drawn=0},b.Clicked=function(b){if(this.CheckAudioIcon()){this.ToggleAudio();return}var a=this.active;try{a&&a.tag&&(this.clickToFront===!1||this.clickToFront===null?a.tag.Clicked(b):this.TagToFront(a.tag,this.clickToFront,function(){a.tag.Clicked(b)},!0))}catch(a){}},b.Wheel=function(a){var b=this.zoom+this.zoomStep*(a?1:-1);this.zoom=h(this.zoomMax,g(this.zoomMin,b)),this.Zoom(this.zoom)},b.BeginDrag=function(a){this.down=K(a,this.canvas),a.cancelBubble=!0,a.returnValue=!1,a.preventDefault&&a.preventDefault()},b.Drag=function(e,a){if(this.dragControl&&this.down){var d=this.dragThreshold*this.dragThreshold,b=a.x-this.down.x,c=a.y-this.down.y;(this.dragging||b*b+c*c>d)&&(this.dx=b,this.dy=c,this.dragging=1,this.down=a)}return this.dragging},b.EndDrag=function(){var a=this.dragging;return this.dragging=this.down=null,a};function ah(a){var b=a.targetTouches[0],c=a.targetTouches[1];return E(w(c.pageX-b.pageX,2)+w(c.pageY-b.pageY,2))}b.BeginPinch=function(a){this.pinched=[ah(a),this.zoom],a.preventDefault&&a.preventDefault()},b.Pinch=function(d){var b,c,a=this.pinched;if(!a)return;c=ah(d),b=a[1]*c/a[0],this.zoom=h(this.zoomMax,g(this.zoomMin,b)),this.Zoom(this.zoom)},b.EndPinch=function(a){this.pinched=null},b.Pause=function(){this.paused=!0},b.Resume=function(){this.paused=!1},b.SetSpeed=function(a){this.initial=a,this.yaw=a[0]*this.maxSpeed,this.pitch=a[1]*this.maxSpeed},b.FindTag=function(a){if(!n(a))return null;if(n(a.index)&&(a=a.index),!B(a))return this.taglist[a];var c,d,b;n(a.id)?(c='id',d=a.id):n(a.text)&&(c='innerText',d=a.text);for(b=0;b= 1) + ? 0 + : a <= -1 + ? Math.PI + : Math.acos(a); + }), + (z.unit = function () { + var a = this.length(); + return new s(this.x / a, this.y / a, this.z / a); + }); + function ay(b, a) { + (a = (a * Math.PI) / 180), (b = (b * Math.PI) / 180); + var c = o(b) * l(a), + d = -o(a), + e = -l(b) * l(a); + return new s(c, d, e); + } + function m(a) { + (this[1] = { 1: a[0], 2: a[1], 3: a[2] }), + (this[2] = { 1: a[3], 2: a[4], 3: a[5] }), + (this[3] = { 1: a[6], 2: a[7], 3: a[8] }); + } + (T = m.prototype), + (m.Identity = function () { + return new m([1, 0, 0, 0, 1, 0, 0, 0, 1]); + }), + (m.Rotation = function (e, a) { + var c = o(e), + d = l(e), + b = 1 - d; + return new m([ + d + w(a.x, 2) * b, + a.x * a.y * b - a.z * c, + a.x * a.z * b + a.y * c, + a.y * a.x * b + a.z * c, + d + w(a.y, 2) * b, + a.y * a.z * b - a.x * c, + a.z * a.x * b - a.y * c, + a.z * a.y * b + a.x * c, + d + w(a.z, 2) * b, + ]); + }), + (T.mul = function (c) { + var d = [], + a, + b, + e = c.xform ? 1 : 0; + for (a = 1; a <= 3; ++a) + for (b = 1; b <= 3; ++b) + e + ? d.push( + this[a][1] * c[1][b] + + this[a][2] * c[2][b] + + this[a][3] * c[3][b], + ) + : d.push(this[a][b] * c); + return new m(d); + }), + (T.xform = function (b) { + var a = {}, + c = b.x, + d = b.y, + e = b.z; + return ( + (a.x = c * this[1][1] + d * this[2][1] + e * this[3][1]), + (a.y = c * this[1][2] + d * this[2][2] + e * this[3][2]), + (a.z = c * this[1][3] + d * this[2][3] + e * this[3][3]), + a + ); + }); + function aB(g, j, k, m, f) { + var a, + b, + c, + d, + e = [], + h = 2 / g, + i; + i = Math.PI * (3 - E(5) + (parseFloat(f) ? parseFloat(f) : 0)); + for (a = 0; a < g; ++a) + (b = a * h - 1 + h / 2), + (c = E(1 - b * b)), + (d = a * i), + e.push([l(d) * c * j, b * k, o(d) * c * m]); + return e; + } + function U(n, p, m, k, h, g) { + var b, + f = [], + i = 2 / n, + j, + a, + d, + c, + e; + j = Math.PI * (3 - E(5) + (parseFloat(g) ? parseFloat(g) : 0)); + for (a = 0; a < n; ++a) + (d = a * i - 1 + i / 2), + (b = a * j), + (c = l(b)), + (e = o(b)), + f.push(p ? [d * m, c * k, e * h] : [c * m, d * k, e * h]); + return f; + } + function aa(k, e, f, h, i, j) { + var b, + g = [], + m = (Math.PI * 2) / e, + a, + c, + d; + for (a = 0; a < e; ++a) + (b = a * m), + (c = l(b)), + (d = o(b)), + g.push(k ? [j * f, c * h, d * i] : [c * f, j * h, d * i]); + return g; + } + function ax(a, b, c, d, e) { + return U(a, 0, b, c, d, e); + } + function aH(a, b, c, d, e) { + return U(a, 1, b, c, d, e); + } + function aG(b, c, d, e, a) { + return (a = isNaN(a) ? 0 : a * 1), aa(0, b, c, d, e, a); + } + function aF(b, c, d, e, a) { + return (a = isNaN(a) ? 0 : a * 1), aa(1, b, c, d, e, a); + } + function av(b) { + var a = new Image(); + (a.onload = function () { + var c = a.width / 2, + d = a.height / 2; + b.centreFunc = function (b, g, h, e, f) { + b.setTransform(1, 0, 0, 1, 0, 0), + (b.globalAlpha = 1), + b.drawImage(a, e - c, f - d); + }; + }), + (a.src = b.centreImage); + } + function aE(a, c) { + var b = a, + d, + e, + f = (c * 1).toPrecision(3) + ")"; + return ( + a[0] === "#" + ? (I[a] || + (a.length === 4 + ? (I[a] = "rgba(" + R[a[1]] + R[a[2]] + R[a[3]]) + : (I[a] = + "rgba(" + + D[a.substr(1, 2)] + + D[a.substr(3, 2)] + + D[a.substr(5, 2)])), + (b = I[a] + f)) + : a.substr(0, 4) === "rgb(" || a.substr(0, 4) === "hsl(" + ? (b = a.replace("(", "a(").replace(")", "," + f)) + : (a.substr(0, 5) === "rgba(" || a.substr(0, 5) === "hsla(") && + ((d = a.lastIndexOf(",") + 1), + (e = a.indexOf(")")), + (c *= parseFloat(a.substring(d, e))), + (b = a.substr(0, d) + c.toPrecision(3) + ")")), + b + ); + } + function k(b, d) { + if (window.G_vmlCanvasManager) return null; + var a = c.createElement("canvas"); + return (a.width = b), (a.height = d), a; + } + function aD() { + var b = k(3, 3), + a, + c; + return ( + !!b && + ((a = b.getContext("2d")), + (a.strokeStyle = "#000"), + (a.shadowColor = "#fff"), + (a.shadowBlur = 3), + (a.globalAlpha = 0), + a.strokeRect(2, 2, 2, 2), + (a.globalAlpha = 1), + (c = a.getImageData(2, 2, 1, 1)), + (b = null), + c.data[0] > 0) + ); + } + function aC(a, c, f, d) { + var e = a.createLinearGradient(0, 0, c, 0), + b; + for (b in d) e.addColorStop(1 - b, d[b]); + (a.fillStyle = e), a.fillRect(0, f, c, 1); + } + function L(a, m, j) { + var l = 1024, + d = 1, + e = a.weightGradient, + i, + f, + b, + c; + if (a.gCanvas) (f = a.gCanvas.getContext("2d")), (d = a.gCanvas.height); + else { + if ((B(e[0]) ? (d = e.length) : (e = [e]), (a.gCanvas = i = k(l, d)), !i)) + return null; + f = i.getContext("2d"); + for (b = 0; b < d; ++b) aC(f, l, b, e[b]); + } + return ( + (j = g(h(j || 0, d - 1), 0)), + (c = f.getImageData(~~((l - 1) * m), j, 1, 1).data), + "rgba(" + c[0] + "," + c[1] + "," + c[2] + "," + c[3] / 255 + ")" + ); + } + function Y(b, i, q, k, o, n, h, d, a, g, f, l) { + var m = o + (d || 0) + (a.length && a[0] < 0 ? p(a[0]) : 0), + j = n + (d || 0) + (a.length && a[1] < 0 ? p(a[1]) : 0), + c, + e; + (b.font = i), + (b.textBaseline = "top"), + (b.fillStyle = q), + h && (b.shadowColor = h), + d && (b.shadowBlur = d), + a.length && ((b.shadowOffsetX = a[0]), (b.shadowOffsetY = a[1])); + for (c = 0; c < k.length; ++c) + (e = 0), + f && + ("right" == l + ? (e = g - f[c]) + : "centre" == l && (e = (g - f[c]) / 2)), + b.fillText(k[c], m + e, j), + (j += parseInt(i)); + } + function y(d, a, b, f, e, c, g) { + c + ? (d.beginPath(), + d.moveTo(a, b + e - c), + d.arcTo(a, b, a + c, b, c), + d.arcTo(a + f, b, a + f, b + c, c), + d.arcTo(a + f, b + e, a + f - c, b + e, c), + d.arcTo(a, b + e, a, b + e - c, c), + d.closePath(), + d[g ? "stroke" : "fill"]()) + : d[g ? "strokeRect" : "fillRect"](a, b, f, e); + } + function O(a, b, c, d, e, f, g, h, i) { + (this.strings = a), + (this.font = b), + (this.width = c), + (this.height = d), + (this.maxWidth = e), + (this.stringWidths = f), + (this.align = g), + (this.valign = h), + (this.scale = i); + } + (M = O.prototype), + (M.SetImage = function (a, b, c, d, e, f, g, h) { + (this.image = a), + (this.iwidth = b * this.scale), + (this.iheight = c * this.scale), + (this.ipos = d), + (this.ipad = e * this.scale), + (this.iscale = h), + (this.ialign = f), + (this.ivalign = g); + }), + (M.Align = function (c, d, a) { + var b = 0; + return ( + a == "right" || a == "bottom" + ? (b = d - c) + : a != "left" && a != "top" && (b = (d - c) / 2), + b + ); + }), + (M.Create = function (G, D, F, b, A, m, q, j, E) { + var o, + e, + f, + a, + l, + s, + i, + u, + v, + r, + w, + n, + c, + d, + x, + B = p(q[0]), + C = p(q[1]), + t, + z; + return ( + (j = g(j, B + m, C + m)), + (l = 2 * (j + b)), + (i = 2 * (j + b)), + (e = this.width + l), + (f = this.height + i), + (v = r = j + b), + this.image && + ((w = n = j + b), + (c = this.iwidth), + (d = this.iheight), + this.ipos == "top" || this.ipos == "bottom" + ? (c < this.width + ? (w += this.Align(c, this.width, this.ialign)) + : (v += this.Align(this.width, c, this.align)), + this.ipos == "top" + ? (r += d + this.ipad) + : (n += this.height + this.ipad), + (e = g(e, c + l)), + (f += d + this.ipad)) + : (d < this.height + ? (n += this.Align(d, this.height, this.ivalign)) + : (r += this.Align(this.height, d, this.valign)), + this.ipos == "right" + ? (w += this.width + this.ipad) + : (v += c + this.ipad), + (e += c + this.ipad), + (f = g(f, d + i)))), + (o = k(e, f)), + !o + ? null + : ((l = i = b / 2), + (s = e - b), + (u = f - b), + (x = h(E, s / 2, u / 2)), + (a = o.getContext("2d")), + D && ((a.fillStyle = D), y(a, l, i, s, u, x)), + b && + ((a.strokeStyle = F), (a.lineWidth = b), y(a, l, i, s, u, x, !0)), + (m || B || C) && + ((t = k(e, f)), t && ((z = a), (a = t.getContext("2d")))), + Y( + a, + this.font, + G, + this.strings, + v, + r, + 0, + 0, + [], + this.maxWidth, + this.stringWidths, + this.align, + ), + this.image && a.drawImage(this.image, w, n, c, d), + z && + ((a = z), + A && (a.shadowColor = A), + m && (a.shadowBlur = m), + (a.shadowOffsetX = q[0]), + (a.shadowOffsetY = q[1]), + a.drawImage(t, 0, 0)), + o) + ); + }); + function H(a, c, d) { + var b = k(c, d), + e; + return b + ? ((e = b.getContext("2d")), + e.drawImage(a, (c - a.width) / 2, (d - a.height) / 2), + b) + : null; + } + function S(e, b, c) { + var a = k(b, c), + d; + return a ? ((d = a.getContext("2d")), d.drawImage(e, 0, 0, b, c), a) : null; + } + function W(n, u, t, e, s, c, v, d, r, w) { + var g = u + (2 * d + c) * e, + f = t + (2 * d + c) * e, + l = k(g, f), + b, + i, + q, + m, + j, + o, + a, + p; + return l + ? ((c *= e), + (r *= e), + (i = q = c / 2), + (m = g - c), + (j = f - c), + (d = d * e + i), + (b = l.getContext("2d")), + (p = h(r, m / 2, j / 2)), + s && ((b.fillStyle = s), y(b, i, q, m, j, p)), + c && ((b.strokeStyle = v), (b.lineWidth = c), y(b, i, q, m, j, p, !0)), + w + ? ((o = k(g, f)), + (a = o.getContext("2d")), + a.drawImage(n, d, d, u, t), + (a.globalCompositeOperation = "source-in"), + (a.fillStyle = v), + a.fillRect(0, 0, g, f), + (a.globalCompositeOperation = "destination-over"), + a.drawImage(l, 0, 0), + (a.globalCompositeOperation = "source-over"), + b.drawImage(o, 0, 0)) + : b.drawImage(n, d, d, n.width, n.height), + { image: l, width: g / e, height: f / e }) + : null; + } + function at(l, f, c, d, j) { + var e, + a, + b = parseFloat(f), + i = g(c, d); + return ( + (e = k(c, d)), + !e + ? null + : (f.indexOf("%") > 0 ? (b = (i * b) / 100) : (b = b * j), + (a = e.getContext("2d")), + (a.globalCompositeOperation = "source-over"), + (a.fillStyle = "#fff"), + b >= i / 2 + ? ((b = h(c, d) / 2), + a.beginPath(), + a.moveTo(c / 2, d / 2), + a.arc(c / 2, d / 2, b, 0, 2 * Math.PI, !1), + a.fill(), + a.closePath()) + : ((b = h(c / 2, d / 2, b)), y(a, 0, 0, c, d, b, !0), a.fill()), + (a.globalCompositeOperation = "source-in"), + a.drawImage(l, 0, 0, c, d), + e) + ); + } + function ao(q, m, i, b, h, a, c) { + var g = p(c[0]), + f = p(c[1]), + j = m + (g > a ? g + a : a * 2) * b, + l = i + (f > a ? f + a : a * 2) * b, + n = b * ((a || 0) + (c[0] < 0 ? g : 0)), + o = b * ((a || 0) + (c[1] < 0 ? f : 0)), + e, + d; + return ( + (e = k(j, l)), + !e + ? null + : ((d = e.getContext("2d")), + h && (d.shadowColor = h), + a && (d.shadowBlur = a * b), + c && ((d.shadowOffsetX = c[0] * b), (d.shadowOffsetY = c[1] * b)), + d.drawImage(q, n, o, m, i), + { image: e, width: j / b, height: l / b }) + ); + } + function ae(m, o, l) { + var c = parseInt(m.toString().length * l), + h = parseInt(l * 2 * m.length), + j = k(c, h), + g, + i, + e, + f, + b, + d, + n, + a; + if (!j) return null; + (g = j.getContext("2d")), + (g.fillStyle = "#000"), + g.fillRect(0, 0, c, h), + Y(g, l + "px " + o, "#fff", m, 0, 0, 0, 0, [], "centre"), + (i = g.getImageData(0, 0, c, h)), + (e = i.width), + (f = i.height), + (a = { min: { x: e, y: f }, max: { x: -1, y: -1 } }); + for (d = 0; d < f; ++d) + for (b = 0; b < e; ++b) + (n = (d * e + b) * 4), + i.data[n + 1] > 0 && + (b < a.min.x && (a.min.x = b), + b > a.max.x && (a.max.x = b), + d < a.min.y && (a.min.y = d), + d > a.max.y && (a.max.y = d)); + return ( + e != c && ((a.min.x *= c / e), (a.max.x *= c / e)), + f != h && ((a.min.y *= c / f), (a.max.y *= c / f)), + (j = null), + a + ); + } + function Q(a) { + return "'" + a.replace(/(\'|\")/g, "").replace(/\s*,\s*/g, "', '") + "'"; + } + function t(b, d, a) { + (a = a || c), + a.addEventListener + ? a.addEventListener(b, d, !1) + : a.attachEvent("on" + b, d); + } + function am(b, d, a) { + (a = a || c), + a.removeEventListener + ? a.removeEventListener(b, d) + : a.detachEvent("on" + b, d); + } + function A(g, e, j, a, b) { + var l = b.imageScale, + h, + c, + k, + m, + f, + d; + if (!e.complete) + return t( + "load", + function () { + A(g, e, j, a, b); + }, + e, + ); + if (!g.complete) + return t( + "load", + function () { + A(g, e, j, a, b); + }, + g, + ); + if (j && !j.complete) + return t( + "load", + function () { + A(g, e, j, a, b); + }, + j, + ); + (e.width = e.width), + (e.height = e.height), + l && ((g.width = e.width * l), (g.height = e.height * l)), + (a.iw = g.width), + (a.ih = g.height), + b.txtOpt && + ((c = g), + (h = b.zoomMax * b.txtScale), + (f = a.iw * h), + (d = a.ih * h), + f < e.naturalWidth || d < e.naturalHeight + ? ((c = S(g, f, d)), c && (a.fimage = c)) + : ((f = a.iw), (d = a.ih), (h = 1)), + parseFloat(b.imageRadius) && + (a.image = a.fimage = g = at(a.image, b.imageRadius, f, d, h)), + a.HasText() || + (b.shadow && + ((c = ao(a.image, f, d, h, b.shadow, b.shadowBlur, b.shadowOffset)), + c && ((a.fimage = c.image), (a.w = c.width), (a.h = c.height))), + (b.bgColour || b.bgOutlineThickness) && + ((k = + b.bgColour == "tag" ? i(a.a, "background-color") : b.bgColour), + (m = + b.bgOutline == "tag" + ? i(a.a, "color") + : b.bgOutline || b.textColour), + (f = a.fimage.width), + (d = a.fimage.height), + b.outlineMethod == "colour" && + ((c = W( + a.fimage, + f, + d, + h, + k, + b.bgOutlineThickness, + a.outline.colour, + b.padding, + b.bgRadius, + 1, + )), + c && (a.oimage = c.image)), + (c = W( + a.fimage, + f, + d, + h, + k, + b.bgOutlineThickness, + m, + b.padding, + b.bgRadius, + )), + c && ((a.fimage = c.image), (a.w = c.width), (a.h = c.height))), + b.outlineMethod == "size" && + (b.outlineIncrease > 0 + ? ((a.iw += 2 * b.outlineIncrease), + (a.ih += 2 * b.outlineIncrease), + (f = h * a.iw), + (d = h * a.ih), + (c = S(a.fimage, f, d)), + (a.oimage = c), + (a.fimage = H(a.fimage, a.oimage.width, a.oimage.height))) + : ((f = h * (a.iw + 2 * b.outlineIncrease)), + (d = h * (a.ih + 2 * b.outlineIncrease)), + (c = S(a.fimage, f, d)), + (a.oimage = H(c, a.fimage.width, a.fimage.height)))))), + (a.alt = j), + a.Init(); + } + function i(a, d) { + var b = c.defaultView, + e = d.replace(/\-([a-z])/g, function (a) { + return a.charAt(1).toUpperCase(); + }); + return ( + (b && + b.getComputedStyle && + b.getComputedStyle(a, null).getPropertyValue(d)) || + (a.currentStyle && a.currentStyle[e]) + ); + } + function aj(c, d, e) { + var b = 1, + a; + return ( + d + ? (b = 1 * (c.getAttribute(d) || e)) + : (a = i(c, "font-size")) && + (b = + (a.indexOf("px") > -1 && a.replace("px", "") * 1) || + (a.indexOf("pt") > -1 && a.replace("pt", "") * 1.25) || + a * 3.3), + b + ); + } + function u(a) { + return a.target && n(a.target.id) + ? a.target.id + : a.srcElement.parentNode.id; + } + function K(a, c) { + var b, + d, + e = parseInt(i(c, "width")) / c.width, + f = parseInt(i(c, "height")) / c.height; + return ( + n(a.offsetX) + ? (b = { x: a.offsetX, y: a.offsetY }) + : ((d = X(c.id)), + n(a.changedTouches) && (a = a.changedTouches[0]), + a.pageX && (b = { x: a.pageX - d.x, y: a.pageY - d.y })), + b && e && f && ((b.x /= e), (b.y /= f)), + b + ); + } + function an(c) { + var d = c.target || c.fromElement.parentNode, + b = a.tc[d.id]; + b && ((b.mx = b.my = -1), b.UnFreeze(), b.EndDrag()); + } + function ad(e) { + var g, + c = a, + b, + d, + f = u(e); + for (g in c.tc) + (b = c.tc[g]), b.tttimer && (clearTimeout(b.tttimer), (b.tttimer = null)); + f && + c.tc[f] && + ((b = c.tc[f]), + (d = K(e, b.canvas)) && ((b.mx = d.x), (b.my = d.y), b.Drag(e, d)), + (b.drawn = 0)); + } + function ap(b) { + var e = a, + f = c.addEventListener ? 0 : 1, + d = u(b); + d && b.button == f && e.tc[d] && e.tc[d].BeginDrag(b); + } + function aq(b) { + var f = a, + g = c.addEventListener ? 0 : 1, + e = u(b), + d; + e && + b.button == g && + f.tc[e] && + ((d = f.tc[e]), ad(b), !d.EndDrag() && !d.touchState && d.Clicked(b)); + } + function ar(c) { + var e = u(c), + b = e && a.tc[e], + d; + b && + c.changedTouches && + (c.touches.length == 1 && b.touchState == 0 + ? ((b.touchState = 1), + b.BeginDrag(c), + (d = K(c, b.canvas)) && ((b.mx = d.x), (b.my = d.y), (b.drawn = 0))) + : c.targetTouches.length == 2 && b.pinchZoom + ? ((b.touchState = 3), b.EndDrag(), b.BeginPinch(c)) + : (b.EndDrag(), b.EndPinch(), (b.touchState = 0))); + } + function ac(c) { + var d = u(c), + b = d && a.tc[d]; + if (b && c.changedTouches) { + switch (b.touchState) { + case 1: + b.Draw(), b.Clicked(); + break; + break; + case 2: + b.EndDrag(); + break; + case 3: + b.EndPinch(); + } + b.touchState = 0; + } + } + function au(c) { + var f, + e = a, + b, + d, + g = u(c); + for (f in e.tc) + (b = e.tc[f]), b.tttimer && (clearTimeout(b.tttimer), (b.tttimer = null)); + if (((b = g && e.tc[g]), b && c.changedTouches && b.touchState)) { + switch (b.touchState) { + case 1: + case 2: + (d = K(c, b.canvas)) && + ((b.mx = d.x), (b.my = d.y), b.Drag(c, d) && (b.touchState = 2)); + break; + case 3: + b.Pinch(c); + } + b.drawn = 0; + } + } + function ab(b) { + var d = a, + c = u(b); + c && + d.tc[c] && + ((b.cancelBubble = !0), + (b.returnValue = !1), + b.preventDefault && b.preventDefault(), + d.tc[c].Wheel((b.wheelDelta || b.detail) > 0)); + } + function aw(d) { + var c, + b = a; + clearTimeout(b.scrollTimer); + for (c in b.tc) b.tc[c].Pause(); + b.scrollTimer = setTimeout(function () { + var b, + c = a; + for (b in c.tc) c.tc[b].Resume(); + }, b.scrollPause); + } + function al() { + Z(q()); + } + function Z(b) { + var c = a.tc, + d; + a.NextFrame(a.interval), (b = b || q()); + for (d in c) c[d].Draw(b); + } + function az() { + requestAnimationFrame(Z); + } + function aA(a) { + setTimeout(al, a); + } + function X(f) { + var g = c.getElementById(f), + b = g.getBoundingClientRect(), + a = c.documentElement, + d = c.body, + e = window, + h = e.pageXOffset || a.scrollLeft, + i = e.pageYOffset || a.scrollTop, + j = a.clientLeft || d.clientLeft, + k = a.clientTop || d.clientTop; + return { x: b.left + h - j, y: b.top + i - k }; + } + function aI(a, b, d, e) { + var c = (a.radius * a.z1) / (a.z1 + a.z2 + b.z); + return { x: b.x * c * d, y: b.y * c * e, z: b.z, w: (a.z1 - b.z) / a.z2 }; + } + function V(a) { + (this.e = a), + (this.br = 0), + (this.line = []), + (this.text = []), + (this.original = a.innerText || a.textContent); + } + (F = V.prototype), + (F.Empty = function () { + for (var a = 0; a < this.text.length; ++a) + if (this.text[a].length) return !1; + return !0; + }), + (F.Lines = function (c) { + var e = c ? 1 : 0, + b, + d, + a; + (c = c || this.e), (b = c.childNodes), (d = b.length); + for (a = 0; a < d; ++a) + b[a].nodeName == "BR" + ? (this.text.push(this.line.join(" ")), (this.br = 1)) + : b[a].nodeType == 3 + ? this.br + ? ((this.line = [b[a].nodeValue]), (this.br = 0)) + : this.line.push(b[a].nodeValue) + : this.Lines(b[a]); + return e || this.br || this.text.push(this.line.join(" ")), this.text; + }), + (F.SplitWidth = function (h, e, f, g) { + var c, + b, + a, + d = []; + e.font = g + "px " + f; + for (c = 0; c < this.text.length; ++c) { + (a = this.text[c].split(/\s+/)), (this.line = [a[0]]); + for (b = 1; b < a.length; ++b) + e.measureText(this.line.join(" ") + " " + a[b]).width > h + ? (d.push(this.line.join(" ")), (this.line = [a[b]])) + : this.line.push(a[b]); + d.push(this.line.join(" ")); + } + return (this.text = d); + }); + function _(a, b) { + (this.ts = null), + (this.tc = a), + (this.tag = b), + (this.x = this.y = this.w = this.h = this.sc = 1), + (this.z = 0), + (this.pulse = 1), + (this.pulsate = a.pulsateTo < 1), + (this.colour = a.outlineColour), + (this.adash = ~~a.outlineDash), + (this.agap = ~~a.outlineDashSpace || this.adash), + (this.aspeed = a.outlineDashSpeed * 1), + this.colour == "tag" + ? (this.colour = i(b.a, "color")) + : this.colour == "tagbg" && (this.colour = i(b.a, "background-color")), + (this.Draw = this.pulsate ? this.DrawPulsate : this.DrawSimple), + (this.radius = a.outlineRadius | 0), + this.SetMethod(a.outlineMethod, a.altImage); + } + (f = _.prototype), + (f.SetMethod = function (a, d) { + var b = { + block: ["PreDraw", "DrawBlock"], + colour: ["PreDraw", "DrawColour"], + outline: ["PostDraw", "DrawOutline"], + classic: ["LastDraw", "DrawOutline"], + size: ["PreDraw", "DrawSize"], + none: ["LastDraw"], + }, + c = b[a] || b.outline; + a == "none" + ? (this.Draw = function () { + return 1; + }) + : (this.drawFunc = this[c[1]]), + (this[c[0]] = this.Draw), + d && ((this.RealPreDraw = this.PreDraw), (this.PreDraw = this.DrawAlt)); + }), + (f.Update = function (d, e, i, j, a, f, g, h) { + var b = this.tc.outlineOffset, + c = 2 * b; + (this.x = a * d + g - b), + (this.y = a * e + h - b), + (this.w = a * i + c), + (this.h = a * j + c), + (this.sc = a), + (this.z = f); + }), + (f.Ants = function (k) { + if (!this.adash) return; + var b = this.adash, + c = this.agap, + a = this.aspeed, + j = b + c, + h = 0, + g = b, + f = c, + i = 0, + d = 0, + e; + a && + ((d = (p(a) * (q() - this.ts)) / 50), + a < 0 && (d = 864e4 - d), + (a = ~~d % j)), + a + ? (b >= a ? ((h = b - a), (g = a)) : ((f = j - a), (i = c - f)), + (e = [h, f, g, i])) + : (e = [b, c]), + k.setLineDash(e); + }), + (f.DrawOutline = function (a, d, e, b, c, f) { + var g = h(this.radius, c / 2, b / 2); + (a.strokeStyle = f), this.Ants(a), y(a, d, e, b, c, g, !0); + }), + (f.DrawSize = function (i, n, m, l, k, j, a, h, g) { + var f = a.w, + e = a.h, + c, + b, + d; + return ( + this.pulsate + ? (a.image + ? (d = + (a.image.height + this.tc.outlineIncrease) / a.image.height) + : (d = a.oscale), + (b = a.fimage || a.image), + (c = 1 + (d - 1) * (1 - this.pulse)), + (a.h *= c), + (a.w *= c)) + : (b = a.oimage), + (a.alpha = 1), + a.Draw(i, h, g, b), + (a.h = e), + (a.w = f), + 1 + ); + }), + (f.DrawColour = function (d, h, i, e, f, g, a, b, c) { + return a.oimage + ? (this.pulse < 1 + ? ((a.alpha = 1 - w(this.pulse, 2)), + a.Draw(d, b, c, a.fimage), + (a.alpha = this.pulse)) + : (a.alpha = 1), + a.Draw(d, b, c, a.oimage), + 1) + : this[a.image ? "DrawColourImage" : "DrawColourText"]( + d, + h, + i, + e, + f, + g, + a, + b, + c, + ); + }), + (f.DrawColourText = function (f, h, i, j, g, e, a, b, c) { + var d = a.colour; + return (a.colour = e), (a.alpha = 1), a.Draw(f, b, c), (a.colour = d), 1; + }), + (f.DrawColourImage = function (a, q, p, o, n, m, i, r, l) { + var f = a.canvas, + e = ~~g(q, 0), + d = ~~g(p, 0), + c = (h(f.width - e, o) + 0.5) | 0, + b = (h(f.height - d, n) + 0.5) | 0, + j; + return ( + v ? ((v.width = c), (v.height = b)) : (v = k(c, b)), + !v + ? this.SetMethod("outline") + : ((j = v.getContext("2d")), + j.drawImage(f, e, d, c, b, 0, 0, c, b), + a.clearRect(e, d, c, b), + this.pulsate ? (i.alpha = 1 - w(this.pulse, 2)) : (i.alpha = 1), + i.Draw(a, r, l), + a.setTransform(1, 0, 0, 1, 0, 0), + a.save(), + a.beginPath(), + a.rect(e, d, c, b), + a.clip(), + (a.globalCompositeOperation = "source-in"), + (a.fillStyle = m), + a.fillRect(e, d, c, b), + a.restore(), + (a.globalAlpha = 1), + (a.globalCompositeOperation = "destination-over"), + a.drawImage(v, 0, 0, c, b, e, d, c, b), + (a.globalCompositeOperation = "source-over"), + 1) + ); + }), + (f.DrawAlt = function (b, a, c, d, f, g) { + var e = this.RealPreDraw(b, a, c, d, f, g); + return a.alt && (a.DrawImage(b, c, d, a.alt), (e = 1)), e; + }), + (f.DrawBlock = function (a, d, e, b, c, f) { + var g = h(this.radius, c / 2, b / 2); + (a.fillStyle = f), y(a, d, e, b, c, g); + }), + (f.DrawSimple = function (a, b, c, d, e, f) { + var g = this.tc; + return ( + a.setTransform(1, 0, 0, 1, 0, 0), + (a.strokeStyle = this.colour), + (a.lineWidth = g.outlineThickness), + (a.shadowBlur = a.shadowOffsetX = a.shadowOffsetY = 0), + (a.globalAlpha = f ? e : 1), + this.drawFunc(a, this.x, this.y, this.w, this.h, this.colour, b, c, d) + ); + }), + (f.DrawPulsate = function (h, d, e, f) { + var g = q() - this.ts, + c = this.tc, + b = + c.pulsateTo + + (1 - c.pulsateTo) * + (0.5 + l((2 * Math.PI * g) / (1e3 * c.pulsateTime)) / 2); + return ( + (this.pulse = b = a.Smooth(1, b)), this.DrawSimple(h, d, e, f, b, 1) + ); + }), + (f.Active = function (d, a, b) { + var c = + a >= this.x && + b >= this.y && + a <= this.x + this.w && + b <= this.y + this.h; + return c ? (this.ts = this.ts || q()) : (this.ts = null), c; + }), + (f.PreDraw = f.PostDraw = f.LastDraw = x); + function J(a, h, c, b, e, f, g, d, i, j, k, l, m, n) { + (this.tc = a), + (this.image = null), + (this.text = h), + (this.text_original = n), + (this.line_widths = []), + (this.title = c.title || null), + (this.a = c), + (this.position = new s(b[0], b[1], b[2])), + (this.x = this.y = this.z = 0), + (this.w = e), + (this.h = f), + (this.colour = g || a.textColour), + (this.bgColour = d || a.bgColour), + (this.bgRadius = i | 0), + (this.bgOutline = j || this.colour), + (this.bgOutlineThickness = k | 0), + (this.textFont = l || a.textFont), + (this.padding = m | 0), + (this.sc = this.alpha = 1), + (this.weighted = !a.weight), + (this.outline = new _(a, this)), + (this.audio = null); + } + (d = J.prototype), + (d.Init = function (b) { + var a = this.tc; + (this.textHeight = a.textHeight), + this.HasText() + ? this.Measure(a.ctxt, a) + : ((this.w = this.iw), (this.h = this.ih)), + (this.SetShadowColour = a.shadowAlpha + ? this.SetShadowColourAlpha + : this.SetShadowColourFixed), + this.SetDraw(a); + }), + (d.Draw = x), + (d.HasText = function () { + return this.text && this.text[0].length > 0; + }), + (d.EqualTo = function (a) { + var b = a.getElementsByTagName("img"); + return this.a.href != a.href + ? 0 + : b.length + ? this.image.src == b[0].src + : (a.innerText || a.textContent) == this.text_original; + }), + (d.SetImage = function (a) { + this.image = this.fimage = a; + }), + (d.SetAudio = function (a) { + (this.audio = a), this.audio.load(); + }), + (d.SetDraw = function (a) { + (this.Draw = this.fimage + ? a.ie > 7 + ? this.DrawImageIE + : this.DrawImage + : this.DrawText), + a.noSelect && (this.CheckActive = x); + }), + (d.MeasureText = function (d) { + var a, + e = this.text.length, + b = 0, + c; + for (a = 0; a < e; ++a) + (this.line_widths[a] = c = d.measureText(this.text[a]).width), + (b = g(b, c)); + return b; + }), + (d.Measure = function (e, a) { + var f = ae(this.text, this.textFont, this.textHeight), + b, + k, + h, + i, + g, + l, + j, + c, + d; + (j = f ? f.max.y + f.min.y : this.textHeight), + (e.font = this.font = this.textHeight + "px " + this.textFont), + (l = this.MeasureText(e)), + a.txtOpt && + ((b = a.txtScale), + (k = b * this.textHeight), + (h = k + "px " + this.textFont), + (i = [b * a.shadowOffset[0], b * a.shadowOffset[1]]), + (e.font = h), + (g = this.MeasureText(e)), + (d = new O( + this.text, + h, + g + b, + b * j + b, + g, + this.line_widths, + a.textAlign, + a.textVAlign, + b, + )), + this.image && + d.SetImage( + this.image, + this.iw, + this.ih, + a.imagePosition, + a.imagePadding, + a.imageAlign, + a.imageVAlign, + a.imageScale, + ), + (c = d.Create( + this.colour, + this.bgColour, + this.bgOutline, + b * this.bgOutlineThickness, + a.shadow, + b * a.shadowBlur, + i, + b * this.padding, + b * this.bgRadius, + )), + a.outlineMethod == "colour" + ? (this.oimage = d.Create( + this.outline.colour, + this.bgColour, + this.outline.colour, + b * this.bgOutlineThickness, + a.shadow, + b * a.shadowBlur, + i, + b * this.padding, + b * this.bgRadius, + )) + : a.outlineMethod == "size" && + ((f = ae( + this.text, + this.textFont, + this.textHeight + a.outlineIncrease, + )), + (k = f.max.y + f.min.y), + (h = + b * (this.textHeight + a.outlineIncrease) + + "px " + + this.textFont), + (e.font = h), + (g = this.MeasureText(e)), + (d = new O( + this.text, + h, + g + b, + b * k + b, + g, + this.line_widths, + a.textAlign, + a.textVAlign, + b, + )), + this.image && + d.SetImage( + this.image, + this.iw + a.outlineIncrease, + this.ih + a.outlineIncrease, + a.imagePosition, + a.imagePadding, + a.imageAlign, + a.imageVAlign, + a.imageScale, + ), + (this.oimage = d.Create( + this.colour, + this.bgColour, + this.bgOutline, + b * this.bgOutlineThickness, + a.shadow, + b * a.shadowBlur, + i, + b * this.padding, + b * this.bgRadius, + )), + (this.oscale = this.oimage.width / c.width), + a.outlineIncrease > 0 + ? (c = H(c, this.oimage.width, this.oimage.height)) + : (this.oimage = H(this.oimage, c.width, c.height))), + c && + ((this.fimage = c), + (l = this.fimage.width / b), + (j = this.fimage.height / b)), + this.SetDraw(a), + (a.txtOpt = !!this.fimage)), + (this.h = j), + (this.w = l); + }), + (d.SetFont = function (a, b, c, d) { + (this.textFont = a), + (this.colour = b), + (this.bgColour = c), + (this.bgOutline = d), + this.Measure(this.tc.ctxt, this.tc); + }), + (d.SetWeight = function (c) { + var b = this.tc, + e = b.weightMode.split(/[, ]/), + d, + a, + f = c.length; + if (!this.HasText()) return; + this.weighted = !0; + for (a = 0; a < f; ++a) + (d = e[a] || "size"), + "both" == d + ? (this.Weight( + c[a], + b.ctxt, + b, + "size", + b.min_weight[a], + b.max_weight[a], + a, + ), + this.Weight( + c[a], + b.ctxt, + b, + "colour", + b.min_weight[a], + b.max_weight[a], + a, + )) + : this.Weight( + c[a], + b.ctxt, + b, + d, + b.min_weight[a], + b.max_weight[a], + a, + ); + this.Measure(b.ctxt, b); + }), + (d.Weight = function (b, i, a, d, f, h, e) { + b = isNaN(b) ? 1 : b; + var c = (b - f) / (h - f); + "colour" == d + ? (this.colour = L(a, c, e)) + : "bgcolour" == d + ? (this.bgColour = L(a, c, e)) + : "bgoutline" == d + ? (this.bgOutline = L(a, c, e)) + : "outline" == d + ? (this.outline.colour = L(a, c, e)) + : "size" == d && + (a.weightSizeMin > 0 && a.weightSizeMax > a.weightSizeMin + ? (this.textHeight = + a.weightSize * + (a.weightSizeMin + (a.weightSizeMax - a.weightSizeMin) * c)) + : (this.textHeight = g(1, b * a.weightSize))); + }), + (d.SetShadowColourFixed = function (a, b, c) { + a.shadowColor = b; + }), + (d.SetShadowColourAlpha = function (a, b, c) { + a.shadowColor = aE(b, c); + }), + (d.DrawText = function (a, h, i) { + var e = this.tc, + g = this.x, + f = this.y, + c = this.sc, + b, + d; + (a.globalAlpha = this.alpha), + (a.fillStyle = this.colour), + e.shadow && this.SetShadowColour(a, e.shadow, this.alpha), + (a.font = this.font), + (g += h / c), + (f += i / c - this.h / 2); + for (b = 0; b < this.text.length; ++b) + (d = g), + "right" == e.textAlign + ? (d += this.w / 2 - this.line_widths[b]) + : "centre" == e.textAlign + ? (d -= this.line_widths[b] / 2) + : (d -= this.w / 2), + a.setTransform(c, 0, 0, c, c * d, c * f), + a.fillText(this.text[b], 0, 0), + (f += this.textHeight); + }), + (d.DrawImage = function (b, i, k, l) { + var e = this.x, + f = this.y, + a = this.sc, + j = l || this.fimage, + c = this.w, + d = this.h, + g = this.alpha, + h = this.shadow; + (b.globalAlpha = g), + h && this.SetShadowColour(b, h, g), + (e += i / a - c / 2), + (f += k / a - d / 2), + b.setTransform(a, 0, 0, a, a * e, a * f), + b.drawImage(j, 0, 0, c, d); + }), + (d.DrawImageIE = function (b, d, e) { + var c = this.fimage, + a = this.sc, + f = (c.width = this.w * a), + g = (c.height = this.h * a), + h = this.x * a + d - f / 2, + i = this.y * a + e - g / 2; + b.setTransform(1, 0, 0, 1, 0, 0), + (b.globalAlpha = this.alpha), + b.drawImage(c, h, i); + }), + (d.Calc = function (g, e) { + var a, + b = this.tc, + d = b.minBrightness, + f = b.maxBrightness, + c = b.max_radius; + return ( + (a = g.xform(this.position)), + (this.xformed = a), + (a = aI(b, a, b.stretchX, b.stretchY)), + (this.x = a.x), + (this.y = a.y), + (this.z = a.z), + (this.sc = a.w), + (this.alpha = e * G(d + ((f - d) * (c - this.z)) / (2 * c), 0, 1)), + this.xformed + ); + }), + (d.UpdateActive = function (h, e, f) { + var a = this.outline, + b = this.w, + c = this.h, + d = this.x - b / 2, + g = this.y - c / 2; + return a.Update(d, g, b, c, this.sc, this.z, e, f), a; + }), + (d.CheckActive = function (a, d, e) { + var b = this.tc, + c = this.UpdateActive(a, d, e); + return c.Active(a, b.mx, b.my) ? c : null; + }), + (d.Clicked = function (f) { + var b = this.a, + a = b.target, + d = b.href, + e; + if (a != "" && a != "_self") { + if (self.frames[a]) self.frames[a].document.location = d; + else { + try { + if (top.frames[a]) { + top.frames[a].document.location = d; + return; + } + } catch (a) {} + window.open(d, a); + } + return; + } + if (c.createEvent) { + if ( + ((e = c.createEvent("MouseEvents")), + e.initMouseEvent( + "click", + 1, + 1, + window, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + null, + ), + !b.dispatchEvent(e)) + ) + return; + } else if (b.fireEvent) if (!b.fireEvent("onclick")) return; + c.location = d; + }), + (d.StopAudio = function () { + this.audio && this.playing && this.audio.pause(), + (this.stopped = 1), + (this.playing = 0); + }), + (d.PlayAudio = function () { + if (e === "off" || this.tc.audioOff) return; + if (!e && !ag()) return; + var a = this.tc.audio, + c = this.tc.gain, + d = "suspended", + b; + if (this.audio) + if ( + (this.track || + ((this.track = e.createMediaElementSource(this.audio)), + (this.gain = e.createGain()), + this.track.connect(this.gain), + this.gain.connect(e.destination)), + (a = this.audio), + (c = this.gain), + !a.paused) + ) + return 1; + if (a) { + if ((e.state == d && e.resume(), e.state == d)) return; + return ( + (c.gain.value = h(2, g(0, this.tc.audioVolume * 1))), + (a.currentTime = 0), + (this.stopped = 0), + (b = a.play()), + b !== void 0 && + b.then((a) => { + this.stopped ? this.audio.pause() : (this.playing = 1); + }), + 1 + ); + } + }); + function a(f, o, k) { + var d, + i, + b = c.getElementById(f), + l = ["id", "class", "innerHTML"]; + if (!b) throw 0; + if ( + (n(window.G_vmlCanvasManager) && + ((b = window.G_vmlCanvasManager.initElement(b)), + (this.ie = parseFloat(navigator.appVersion.split("MSIE")[1]))), + b && (!b.getContext || !b.getContext("2d").fillText)) + ) { + i = c.createElement("DIV"); + for (d = 0; d < l.length; ++d) i[l[d]] = b[l[d]]; + throw (b.parentNode.insertBefore(i, b), b.parentNode.removeChild(b), 0); + } + for (d in a.options) + this[d] = k && n(k[d]) ? k[d] : n(a[d]) ? a[d] : a.options[d]; + if ( + ((this.canvas = b), + (this.ctxt = b.getContext("2d")), + (this.z1 = 250 / g(this.depth, 0.001)), + (this.z2 = this.z1 / this.zoom), + (this.radius = h(b.height, b.width) * 0.0075), + (this.max_radius = 100), + (this.max_weight = []), + (this.min_weight = []), + (this.textFont = this.textFont && Q(this.textFont)), + (this.textHeight *= 1), + (this.imageRadius = this.imageRadius.toString()), + (this.pulsateTo = G(this.pulsateTo, 0, 1)), + (this.minBrightness = G(this.minBrightness, 0, 1)), + (this.maxBrightness = G(this.maxBrightness, this.minBrightness, 1)), + (this.ctxt.textBaseline = "top"), + (this.lx = (this.lock + "").indexOf("x") + 1), + (this.ly = (this.lock + "").indexOf("y") + 1), + (this.frozen = this.dx = this.dy = this.fixedAnim = this.touchState = 0), + (this.fixedAlpha = 1), + (this.source = o || f), + (this.repeatTags = h(64, ~~this.repeatTags)), + (this.minTags = h(200, ~~this.minTags)), + ~~this.scrollPause > 0 + ? (a.scrollPause = ~~this.scrollPause) + : (this.scrollPause = 0), + this.minTags > 0 && + this.repeatTags < 1 && + (d = this.GetTags().length) && + (this.repeatTags = af(this.minTags / d) - 1), + (this.transform = m.Identity()), + (this.startTime = this.time = q()), + (this.mx = this.my = -1), + this.centreImage && av(this), + (this.Animate = this.dragControl + ? this.AnimateDrag + : this.AnimatePosition), + (this.animTiming = + typeof a[this.animTiming] == "function" + ? a[this.animTiming] + : a.Smooth), + this.shadowBlur || this.shadowOffset[0] || this.shadowOffset[1] + ? ((this.ctxt.shadowColor = this.shadow), + (this.shadow = this.ctxt.shadowColor), + (this.shadowAlpha = aD())) + : delete this.shadow, + this.activeAudio === !1 + ? (e = "off") + : this.activeAudio && this.LoadAudio(), + this.Load(), + o && + this.hideTags && + (function (b) { + a.loaded + ? b.HideTags() + : t( + "load", + function () { + b.HideTags(); + }, + window, + ); + })(this), + (this.yaw = this.initial ? this.initial[0] * this.maxSpeed : 0), + (this.pitch = this.initial ? this.initial[1] * this.maxSpeed : 0), + this.tooltip + ? ((this.ctitle = b.title), + (b.title = ""), + this.tooltip == "native" + ? (this.Tooltip = this.TooltipNative) + : ((this.Tooltip = this.TooltipDiv), + this.ttdiv || + ((this.ttdiv = c.createElement("div")), + (this.ttdiv.className = this.tooltipClass), + (this.ttdiv.style.position = "absolute"), + (this.ttdiv.style.zIndex = b.style.zIndex + 1), + t( + "mouseover", + function (a) { + a.target.style.display = "none"; + }, + this.ttdiv, + ), + c.body.appendChild(this.ttdiv)))) + : (this.Tooltip = this.TooltipNone), + !this.noMouse && !j[f]) + ) { + (j[f] = [ + ["mousemove", ad], + ["mouseout", an], + ["mouseup", aq], + ["touchstart", ar], + ["touchend", ac], + ["touchcancel", ac], + ["touchmove", au], + ]), + this.dragControl && + (j[f].push(["mousedown", ap]), j[f].push(["selectstart", x])), + this.wheelZoom && + (j[f].push(["mousewheel", ab]), j[f].push(["DOMMouseScroll", ab])), + this.scrollPause && j[f].push(["scroll", aw, window]); + for (d = 0; d < j[f].length; ++d) + (i = j[f][d]), t(i[0], i[1], i[2] ? i[2] : b); + } + a.started || + ((a.NextFrame = window.requestAnimationFrame ? az : aA), + (a.interval = this.interval), + a.NextFrame(this.interval), + (a.started = 1)); + } + (b = a.prototype), + (b.SourceElements = function () { + return c.querySelectorAll + ? c.querySelectorAll("#" + this.source) + : [c.getElementById(this.source)]; + }), + (b.HideTags = function () { + var b = this.SourceElements(), + a; + for (a = 0; a < b.length; ++a) b[a].style.display = "none"; + }), + (b.GetTags = function () { + var e = this.SourceElements(), + c, + f = [], + a, + b, + d; + for (d = 0; d <= this.repeatTags; ++d) + for (a = 0; a < e.length; ++a) { + c = e[a].getElementsByTagName("a"); + for (b = 0; b < c.length; ++b) f.push(c[b]); + } + return f; + }), + (b.Message = function (j) { + var g = [], + a, + f, + b = j.split(""), + d, + e, + h, + i; + for (a = 0; a < b.length; ++a) + b[a] != " " && + ((f = a - b.length / 2), + (d = c.createElement("A")), + (d.href = "#"), + (d.innerText = b[a]), + (h = 100 * o(f / 9)), + (i = -100 * l(f / 9)), + (e = new J( + this, + b[a], + d, + [h, 0, i], + 2, + 18, + "#000", + "#fff", + 0, + 0, + 0, + "monospace", + 2, + b[a], + )), + e.Init(), + g.push(e)); + return g; + }), + (b.AddAudio = function (b, c) { + if (e === "off") return; + var a = b.getElementsByTagName("audio"); + a.length && (c.SetAudio(a[0]), (this.hasAudio = 1)); + }), + (b.CreateTag = function (b) { + var e, + c, + a, + f, + d, + g, + h, + j, + k = [0, 0, 0], + l; + if ("text" != this.imageMode) + if (((e = b.getElementsByTagName("img")), e.length)) + if (((c = new Image()), (c.src = e[0].src), !this.imageMode)) + return ( + (a = new J(this, "", b, k, 0, 0)), + a.SetImage(c), + A(c, e[0], e[1], a, this), + this.AddAudio(b, a), + a + ); + if ( + ("image" != this.imageMode && + ((d = new V(b)), + (f = d.Lines()), + d.Empty() + ? (d = null) + : ((g = this.textFont || Q(i(b, "font-family"))), + this.splitWidth && + (f = d.SplitWidth( + this.splitWidth, + this.ctxt, + g, + this.textHeight, + )), + (h = + this.bgColour == "tag" + ? i(b, "background-color") + : this.bgColour), + (j = this.bgOutline == "tag" ? i(b, "color") : this.bgOutline))), + d || c) + ) + return ( + (a = new J( + this, + f, + b, + k, + 2, + this.textHeight + 2, + this.textColour || i(b, "color"), + h, + this.bgRadius, + j, + this.bgOutlineThickness, + g, + this.padding, + d && d.original, + )), + c ? (a.SetImage(c), A(c, e[0], e[1], a, this)) : a.Init(), + this.AddAudio(b, a), + a + ); + }), + (b.UpdateTag = function (a, b) { + var c = this.textColour || i(b, "color"), + d = this.textFont || Q(i(b, "font-family")), + e = this.bgColour == "tag" ? i(b, "background-color") : this.bgColour, + f = this.bgOutline == "tag" ? i(b, "color") : this.bgOutline; + (a.a = b), + (a.title = b.title), + (a.colour != c || + a.textFont != d || + a.bgColour != e || + a.bgOutline != f) && + a.SetFont(d, c, e, f); + }), + (b.Weight = function (d) { + var f = d.length, + c, + b, + a, + e = [], + g, + h = this.weightFrom ? this.weightFrom.split(/[, ]/) : [null], + i = h.length; + for (b = 0; b < f; ++b) { + e[b] = []; + for (a = 0; a < i; ++a) + (c = aj(d[b].a, h[a], this.textHeight)), + (!this.max_weight[a] || c > this.max_weight[a]) && + (this.max_weight[a] = c), + (!this.min_weight[a] || c < this.min_weight[a]) && + (this.min_weight[a] = c), + (e[b][a] = c); + } + for (a = 0; a < i; ++a) + this.max_weight[a] > this.min_weight[a] && (g = 1); + if (g) for (b = 0; b < f; ++b) d[b].SetWeight(e[b]); + }), + (b.Load = function () { + var c = this.GetTags(), + b = [], + d, + k, + l, + h, + i, + j, + f, + a, + e = [], + m = { sphere: aB, vcylinder: ax, hcylinder: aH, vring: aG, hring: aF }; + if (c.length) { + e.length = c.length; + for (a = 0; a < c.length; ++a) e[a] = a; + this.shuffleTags && ai(e), + (h = 100 * this.radiusX), + (i = 100 * this.radiusY), + (j = 100 * this.radiusZ), + (this.max_radius = g(h, g(i, j))); + for (a = 0; a < c.length; ++a) + (k = this.CreateTag(c[e[a]])), k && b.push(k); + this.weight && this.Weight(b, !0), + this.shapeArgs + ? (this.shapeArgs[0] = b.length) + : ((l = this.shape.toString().split(/[(),]/)), + (d = l.shift()), + typeof window[d] == "function" + ? (this.shape = window[d]) + : (this.shape = m[d] || m.sphere), + (this.shapeArgs = [b.length, h, i, j].concat(l))), + (f = this.shape.apply(this, this.shapeArgs)), + (this.listLength = b.length); + for (a = 0; a < b.length; ++a) + b[a].position = new s(f[a][0], f[a][1], f[a][2]); + } + this.noTagsMessage && + !b.length && + ((a = + this.imageMode && this.imageMode != "both" + ? this.imageMode + " " + : ""), + (b = this.Message("No " + a + "tags"))), + (this.taglist = b); + }), + (b.Update = function () { + var e = this.GetTags(), + d = [], + j = this.taglist, + k, + f = [], + c = [], + h, + i, + g, + a, + b; + if (!this.shapeArgs) return this.Load(); + if (e.length) { + (g = this.listLength = e.length), (i = j.length); + for (a = 0; a < i; ++a) d.push(j[a]), c.push(a); + for (a = 0; a < g; ++a) { + for (b = 0, k = 0; b < i; ++b) + j[b].EqualTo(e[a]) && (this.UpdateTag(d[b], e[a]), (k = c[b] = -1)); + k || f.push(a); + } + for (a = 0, b = 0; a < i; ++a) c[b] == -1 ? c.splice(b, 1) : ++b; + if (c.length) { + for (ai(c); c.length && f.length; ) + (a = c.shift()), (b = f.shift()), (d[a] = this.CreateTag(e[b])); + for ( + c.sort(function (a, b) { + return a - b; + }); + c.length; + ) + d.splice(c.pop(), 1); + } + for (b = d.length / (f.length + 1), a = 0; f.length; ) + d.splice(af(++a * b), 0, this.CreateTag(e[f.shift()])); + (this.shapeArgs[0] = g = d.length), + (h = this.shape.apply(this, this.shapeArgs)); + for (a = 0; a < g; ++a) + d[a].position = new s(h[a][0], h[a][1], h[a][2]); + this.weight && this.Weight(d); + } + this.taglist = d; + }), + (b.SetShadow = function (a) { + (a.shadowBlur = this.shadowBlur), + (a.shadowOffsetX = this.shadowOffset[0]), + (a.shadowOffsetY = this.shadowOffset[1]); + }), + (b.LoadAudio = function () { + if (!e && !ag()) return; + (this.audio = c.createElement("audio")), + (this.audio.src = this.activeAudio), + (this.track = e.createMediaElementSource(this.audio)), + (this.gain = e.createGain()), + this.track.connect(this.gain), + this.gain.connect(e.destination), + (this.hasAudio = 1), + (P = function (a) { + e.resume(), c.removeEventListener("click", P); + }), + c.addEventListener("click", P); + }), + (b.ShowAudioIcon = function () { + var a = this.audioIconSize, + c = this.canvas, + d = this.ctxt, + k = c.width - a - 3, + f = c.height - a - 3, + g = this.audioIconThickness, + h = "#000", + i = "#fff", + j = this.audioIconDark, + b = this.audioOff, + l = "suspended"; + if (!e) return; + b || (b = e.state === l), + this.audioIcon && + this.hasAudio && + ($(b, d, a, k, f, g + 1, j ? i : h), $(b, d, a, k, f, g, j ? h : i)); + }), + (b.CheckAudioIcon = function () { + var a = this.audioIconSize, + b = this.canvas, + c = this.audioIconThickness / 2, + d = b.width - a - 3 - c, + e = b.height - a - 3 - c; + if (this.audioIcon && this.mx >= d && this.my >= e) return !0; + }), + (b.ToggleAudio = function () { + var a = this.audioOff || (e && e.state === "suspended"); + a || (this.currentAudio && this.currentAudio.StopAudio()), + (this.audioOff = !a); + }), + (b.Draw = function (s) { + if (this.paused) return; + var l = this.canvas, + i = l.width, + j = l.height, + q = 0, + p = ((s - this.time) * a.interval) / 1e3, + h = i / 2 + this.offsetX, + g = j / 2 + this.offsetY, + d = this.ctxt, + b, + f, + c, + o = -1, + e = this.taglist, + k = e.length, + t = this.active && this.active.tag, + m = "", + u = this.frontSelect, + r = this.centreFunc == x, + n; + if (((this.time = s), this.frozen && this.drawn)) + return this.Animate(i, j, p); + (n = this.AnimateFixed()), d.setTransform(1, 0, 0, 1, 0, 0); + for (c = 0; c < k; ++c) e[c].Calc(this.transform, this.fixedAlpha); + if ( + ((e = ak(e, function (a, b) { + return b.z - a.z; + })), + n && this.fixedAnim.active) + ) + b = this.fixedAnim.tag.UpdateActive(d, h, g); + else if (((this.active = null), this.CheckAudioIcon())) m = "pointer"; + else { + for (c = 0; c < k; ++c) + (f = + this.mx >= 0 && + this.my >= 0 && + this.taglist[c].CheckActive(d, h, g)), + f && + f.sc > q && + (!u || f.z <= 0) && + ((b = f), (o = c), (b.tag = this.taglist[c]), (q = f.sc)); + this.active = b; + } + this.txtOpt || (this.shadow && this.SetShadow(d)), + d.clearRect(0, 0, i, j); + for (c = 0; c < k; ++c) { + if (!r && e[c].z <= 0) { + try { + this.centreFunc(d, i, j, h, g); + } catch (a) { + alert(a), (this.centreFunc = x); + } + r = !0; + } + (b && b.tag == e[c] && b.PreDraw(d, e[c], h, g)) || e[c].Draw(d, h, g), + b && b.tag == e[c] && b.PostDraw(d); + } + this.freezeActive && b + ? this.Freeze() + : (this.UnFreeze(), (this.drawn = k == this.listLength)), + this.fixedCallback && + (this.fixedCallback(this, this.fixedCallbackTag), + (this.fixedCallback = null)), + n || this.Animate(i, j, p), + b && + (b.LastDraw(d), + b.tag != t && + (this.currentAudio && + this.currentAudio != b.tag && + this.currentAudio.StopAudio(), + b.tag.PlayAudio() && (this.currentAudio = b.tag)), + (m = this.activeCursor)), + (l.style.cursor = m), + this.Tooltip(b, this.taglist[o]), + this.audioIcon && this.ShowAudioIcon(); + }), + (b.TooltipNone = function () {}), + (b.TooltipNative = function (b, a) { + b + ? (this.canvas.title = a && a.title ? a.title : "") + : (this.canvas.title = this.ctitle); + }), + (b.SetTTDiv = function (c, d) { + var a = this, + b = a.ttdiv.style; + c != a.ttdiv.innerHTML && (b.display = "none"), + (a.ttdiv.innerHTML = c), + d && (d.title = a.ttdiv.innerHTML), + b.display == "none" && + !a.tttimer && + (a.tttimer = setTimeout(function () { + var c = X(a.canvas.id); + (b.display = "block"), + (b.left = c.x + a.mx + "px"), + (b.top = c.y + a.my + 24 + "px"), + (a.tttimer = null); + }, a.tooltipDelay)); + }), + (b.TooltipDiv = function (b, a) { + b && a && a.title + ? this.SetTTDiv(a.title, a) + : !b && this.mx != -1 && this.my != -1 && this.ctitle.length + ? this.SetTTDiv(this.ctitle) + : (this.ttdiv.style.display = "none"); + }), + (b.Transform = function (c, a, b) { + if (a || b) { + var d = o(a), + e = l(a), + f = o(b), + g = l(b), + h = new m([g, 0, f, 0, 1, 0, -f, 0, g]), + i = new m([1, 0, 0, 0, e, -d, 0, d, e]); + c.transform = c.transform.mul(h.mul(i)); + } + }), + (b.AnimateFixed = function () { + var a, b, c, d, e; + return ( + !!(this.fadeIn && + ((b = q() - this.startTime), + b >= this.fadeIn + ? ((this.fadeIn = 0), (this.fixedAlpha = 1)) + : (this.fixedAlpha = b / this.fadeIn)), + this.fixedAnim) && + (this.fixedAnim.transform || + (this.fixedAnim.transform = this.transform), + (a = this.fixedAnim), + (b = q() - a.t0), + (c = a.angle), + d, + (e = this.animTiming(a.t, b)), + (this.transform = a.transform), + b >= a.t + ? ((this.fixedCallbackTag = a.tag), + (this.fixedCallback = a.cb), + (this.fixedAnim = this.yaw = this.pitch = 0)) + : (c *= e), + (d = m.Rotation(c, a.axis)), + (this.transform = this.transform.mul(d)), + this.fixedAnim != 0) + ); + }), + (b.AnimatePosition = function (g, h, f) { + var a = this, + d = a.mx, + e = a.my, + b, + c; + !a.frozen && d >= 0 && e >= 0 && d < g && e < h + ? ((b = a.maxSpeed), + (c = a.reverse ? -1 : 1), + a.lx || (a.yaw = ((d * 2 * b) / g - b) * c * f), + a.ly || (a.pitch = ((e * 2 * b) / h - b) * -c * f), + (a.initial = null)) + : a.initial || + (a.frozen && !a.freezeDecel ? (a.yaw = a.pitch = 0) : a.Decel(a)), + this.Transform(a, a.pitch, a.yaw); + }), + (b.AnimateDrag = function (d, e, c) { + var a = this, + b = (100 * c * a.maxSpeed) / a.max_radius / a.zoom; + a.dx || a.dy + ? (a.lx || (a.yaw = (a.dx * b) / a.stretchX), + a.ly || (a.pitch = (a.dy * -b) / a.stretchY), + (a.dx = a.dy = 0), + (a.initial = null)) + : a.initial || a.Decel(a), + this.Transform(a, a.pitch, a.yaw); + }), + (b.Freeze = function () { + this.frozen || + ((this.preFreeze = [this.yaw, this.pitch]), + (this.frozen = 1), + (this.drawn = 0)); + }), + (b.UnFreeze = function () { + this.frozen && + ((this.yaw = this.preFreeze[0]), + (this.pitch = this.preFreeze[1]), + (this.frozen = 0)); + }), + (b.Decel = function (a) { + var b = a.minSpeed, + c = p(a.yaw), + d = p(a.pitch); + !a.lx && c > b && (a.yaw = c > a.z0 ? a.yaw * a.decel : 0), + !a.ly && d > b && (a.pitch = d > a.z0 ? a.pitch * a.decel : 0); + }), + (b.Zoom = function (a) { + (this.z2 = this.z1 * (1 / a)), (this.drawn = 0); + }), + (b.Clicked = function (b) { + if (this.CheckAudioIcon()) { + this.ToggleAudio(); + return; + } + var a = this.active; + try { + a && + a.tag && + (this.clickToFront === !1 || this.clickToFront === null + ? a.tag.Clicked(b) + : this.TagToFront( + a.tag, + this.clickToFront, + function () { + a.tag.Clicked(b); + }, + !0, + )); + } catch (a) {} + }), + (b.Wheel = function (a) { + var b = this.zoom + this.zoomStep * (a ? 1 : -1); + (this.zoom = h(this.zoomMax, g(this.zoomMin, b))), this.Zoom(this.zoom); + }), + (b.BeginDrag = function (a) { + (this.down = K(a, this.canvas)), + (a.cancelBubble = !0), + (a.returnValue = !1), + a.preventDefault && a.preventDefault(); + }), + (b.Drag = function (e, a) { + if (this.dragControl && this.down) { + var d = this.dragThreshold * this.dragThreshold, + b = a.x - this.down.x, + c = a.y - this.down.y; + (this.dragging || b * b + c * c > d) && + ((this.dx = b), (this.dy = c), (this.dragging = 1), (this.down = a)); + } + return this.dragging; + }), + (b.EndDrag = function () { + var a = this.dragging; + return (this.dragging = this.down = null), a; + }); + function ah(a) { + var b = a.targetTouches[0], + c = a.targetTouches[1]; + return E(w(c.pageX - b.pageX, 2) + w(c.pageY - b.pageY, 2)); + } + (b.BeginPinch = function (a) { + (this.pinched = [ah(a), this.zoom]), a.preventDefault && a.preventDefault(); + }), + (b.Pinch = function (d) { + var b, + c, + a = this.pinched; + if (!a) return; + (c = ah(d)), + (b = (a[1] * c) / a[0]), + (this.zoom = h(this.zoomMax, g(this.zoomMin, b))), + this.Zoom(this.zoom); + }), + (b.EndPinch = function (a) { + this.pinched = null; + }), + (b.Pause = function () { + this.paused = !0; + }), + (b.Resume = function () { + this.paused = !1; + }), + (b.SetSpeed = function (a) { + (this.initial = a), + (this.yaw = a[0] * this.maxSpeed), + (this.pitch = a[1] * this.maxSpeed); + }), + (b.FindTag = function (a) { + if (!n(a)) return null; + if ((n(a.index) && (a = a.index), !B(a))) return this.taglist[a]; + var c, d, b; + n(a.id) + ? ((c = "id"), (d = a.id)) + : n(a.text) && ((c = "innerText"), (d = a.text)); + for (b = 0; b < this.taglist.length; ++b) + if (this.taglist[b].a[c] == d) return this.taglist[b]; + }), + (b.RotateTag = function (a, h, i, j, f, g) { + var b = a.Calc(this.transform, 1), + c = new s(b.x, b.y, b.z), + d = ay(i, h), + e = c.angle(d), + k = c.cross(d).unit(); + e == 0 + ? ((this.fixedCallbackTag = a), (this.fixedCallback = f)) + : (this.fixedAnim = { + angle: -e, + axis: k, + t: j, + t0: q(), + cb: f, + tag: a, + active: g, + }); + }), + (b.TagToFront = function (a, b, c, d) { + this.RotateTag(a, 0, 0, b, c, d); + }), + (b.Volume = function (a) { + this.audioVolume = a * 1; + }), + (a.Start = function (b, c, d) { + a.Delete(b), (a.tc[b] = new a(b, c, d)); + }); + function N(c, b) { + a.tc[b] && a.tc[b][c](); + } + (a.Linear = function (a, b) { + return b / a; + }), + (a.Smooth = function (a, b) { + return 0.5 - l((b * Math.PI) / a) / 2; + }), + (a.Pause = function (a) { + N("Pause", a); + }), + (a.Resume = function (a) { + N("Resume", a); + }), + (a.Reload = function (a) { + N("Load", a); + }), + (a.Update = function (a) { + N("Update", a); + }), + (a.SetSpeed = function (c, b) { + return ( + !!(B(b) && a.tc[c] && !isNaN(b[0]) && !isNaN(b[1])) && + (a.tc[c].SetSpeed(b), !0) + ); + }), + (a.TagToFront = function (c, b) { + return !!B(b) && ((b.lat = b.lng = 0), a.RotateTag(c, b)); + }), + (a.RotateTag = function (c, b) { + if (B(b) && a.tc[c]) { + isNaN(b.time) && (b.time = 500); + var d = a.tc[c].FindTag(b); + if (d) + return ( + a.tc[c].RotateTag(d, b.lat, b.lng, b.time, b.callback, b.active), !0 + ); + } + return !1; + }), + (a.Delete = function (b) { + var d, e; + if (j[b]) + if (((e = c.getElementById(b)), e)) + for (d = 0; d < j[b].length; ++d) am(j[b][d][0], j[b][d][1], e); + delete j[b], delete a.tc[b]; + }), + (a.tc = {}), + (a.options = { + z1: 2e4, + z2: 2e4, + z0: 2e-4, + freezeActive: !1, + freezeDecel: !1, + activeCursor: "pointer", + pulsateTo: 1, + pulsateTime: 3, + reverse: !1, + depth: 0.5, + maxSpeed: 0.05, + minSpeed: 0, + decel: 0.95, + interval: 20, + minBrightness: 0.1, + maxBrightness: 1, + outlineColour: "#ffff99", + outlineThickness: 2, + outlineOffset: 5, + outlineMethod: "outline", + outlineRadius: 0, + textColour: "#ff99ff", + textHeight: 15, + textFont: "Helvetica, Arial, sans-serif", + shadow: "#000", + shadowBlur: 0, + shadowOffset: [0, 0], + initial: null, + hideTags: !0, + zoom: 1, + weight: !1, + weightMode: "size", + weightFrom: null, + weightSize: 1, + weightSizeMin: null, + weightSizeMax: null, + weightGradient: { 0: "#f00", 0.33: "#ff0", 0.66: "#0f0", 1: "#00f" }, + txtOpt: !0, + txtScale: 2, + frontSelect: !1, + wheelZoom: !0, + zoomMin: 0.3, + zoomMax: 3, + zoomStep: 0.05, + shape: "sphere", + lock: null, + tooltip: null, + tooltipDelay: 300, + tooltipClass: "tctooltip", + radiusX: 1, + radiusY: 1, + radiusZ: 1, + stretchX: 1, + stretchY: 1, + offsetX: 0, + offsetY: 0, + shuffleTags: !1, + noSelect: !1, + noMouse: !1, + imageScale: 1, + paused: !1, + dragControl: !1, + dragThreshold: 4, + centreFunc: x, + splitWidth: 0, + animTiming: "Smooth", + clickToFront: !1, + fadeIn: 0, + padding: 0, + bgColour: null, + bgRadius: 0, + bgOutline: null, + bgOutlineThickness: 0, + outlineIncrease: 4, + textAlign: "centre", + textVAlign: "middle", + imageMode: null, + imagePosition: null, + imagePadding: 2, + imageAlign: "centre", + imageVAlign: "middle", + noTagsMessage: !0, + centreImage: null, + pinchZoom: !1, + repeatTags: 0, + minTags: 0, + imageRadius: 0, + scrollPause: !1, + outlineDash: 0, + outlineDashSpace: 0, + outlineDashSpeed: 1, + activeAudio: "", + audioVolume: 1, + audioIcon: 1, + audioIconSize: 20, + audioIconThickness: 2, + audioIconDark: 0, + altImage: 0, + }); + for (r in a.options) a[r] = a.options[r]; + (window.TagCanvas = a), + t( + "load", + function () { + a.loaded = 1; + }, + window, + ); +})(); diff --git a/packages/client/package.json b/packages/client/package.json index be7538542f..49c175b15b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -4,7 +4,8 @@ "scripts": { "watch": "pnpm vite build --watch --mode development", "build": "pnpm vite build", - "lint": "pnpm rome check \"src/**/*.{ts,vue}\"" + "lint": "pnpm rome check \"src/**/*.{ts,vue}\"", + "format": "pnpm prettier --write '**/*.vue'" }, "devDependencies": { "@discordapp/twemoji": "14.0.2", @@ -32,7 +33,7 @@ "blurhash": "1.1.5", "broadcast-channel": "4.19.1", "browser-image-resizer": "https://github.com/misskey-dev/browser-image-resizer.git", - "calckey-js": "^0.0.22", + "calckey-js": "workspace:*", "chart.js": "4.1.1", "chartjs-adapter-date-fns": "2.0.1", "chartjs-chart-matrix": "^2.0.1", @@ -52,8 +53,10 @@ "json5": "2.2.3", "katex": "0.16.4", "matter-js": "0.18.0", - "mfm-js": "0.23.2", + "mfm-js": "0.23.3", "photoswipe": "5.3.4", + "prettier": "2.8.7", + "prettier-plugin-vue": "1.1.6", "prismjs": "1.29.0", "punycode": "2.1.1", "querystring": "0.2.1", diff --git a/packages/client/src/components/MkAbuseReport.vue b/packages/client/src/components/MkAbuseReport.vue index 9a3464b640..ccb85d7222 100644 --- a/packages/client/src/components/MkAbuseReport.vue +++ b/packages/client/src/components/MkAbuseReport.vue @@ -1,64 +1,93 @@ @@ -81,7 +110,16 @@ function resolve() { padding: 14px; border-radius: 8px; --c: rgb(255 196 0 / 15%); - background-image: linear-gradient(45deg, var(--c) 16.67%, transparent 16.67%, transparent 50%, var(--c) 50%, var(--c) 66.67%, transparent 66.67%, transparent 100%); + background-image: linear-gradient( + 45deg, + var(--c) 16.67%, + transparent 16.67%, + transparent 50%, + var(--c) 50%, + var(--c) 66.67%, + transparent 66.67%, + transparent 100% + ); background-size: 16px 16px; > .avatar { diff --git a/packages/client/src/components/MkAbuseReportWindow.vue b/packages/client/src/components/MkAbuseReportWindow.vue index f1b3ae4312..19b8ba5264 100644 --- a/packages/client/src/components/MkAbuseReportWindow.vue +++ b/packages/client/src/components/MkAbuseReportWindow.vue @@ -1,35 +1,52 @@ diff --git a/packages/client/src/components/MkAnalogClock.vue b/packages/client/src/components/MkAnalogClock.vue index 40ef626aed..43d81f2a96 100644 --- a/packages/client/src/components/MkAnalogClock.vue +++ b/packages/client/src/components/MkAnalogClock.vue @@ -1,32 +1,62 @@ @@ -214,11 +269,11 @@ onBeforeUnmount(() => { transform-origin: 50% 50%; &.animate.elastic { - transition: transform .2s cubic-bezier(.4,2.08,.55,.44); + transition: transform 0.2s cubic-bezier(0.4, 2.08, 0.55, 0.44); } &.animate.easeOut { - transition: transform .7s cubic-bezier(0,.7,.3,1); + transition: transform 0.7s cubic-bezier(0, 0.7, 0.3, 1); } } } diff --git a/packages/client/src/components/MkAutocomplete.vue b/packages/client/src/components/MkAutocomplete.vue index ae708026e0..0455bd9d54 100644 --- a/packages/client/src/components/MkAutocomplete.vue +++ b/packages/client/src/components/MkAutocomplete.vue @@ -1,49 +1,107 @@ @@ -399,7 +484,8 @@ onBeforeUnmount(() => { font-size: 0.9em; cursor: default; - &, * { + &, + * { user-select: none; } @@ -412,10 +498,11 @@ onBeforeUnmount(() => { background: var(--X3); } - &[data-selected='true'] { + &[data-selected="true"] { background: var(--accent); - &, * { + &, + * { color: #fff !important; } } @@ -423,7 +510,8 @@ onBeforeUnmount(() => { &:active { background: var(--accentDarken); - &, * { + &, + * { color: #fff !important; } } @@ -431,7 +519,6 @@ onBeforeUnmount(() => { } > .users > li { - .avatar { min-width: 28px; min-height: 28px; @@ -447,7 +534,6 @@ onBeforeUnmount(() => { } > .emojis > li { - .emoji { display: inline-block; margin: 0 4px 0 0; @@ -465,7 +551,6 @@ onBeforeUnmount(() => { } > .mfmTags > li { - .name { } } diff --git a/packages/client/src/components/MkAvatars.vue b/packages/client/src/components/MkAvatars.vue index 52fda8b1db..d92eee22c1 100644 --- a/packages/client/src/components/MkAvatars.vue +++ b/packages/client/src/components/MkAvatars.vue @@ -1,14 +1,14 @@ diff --git a/packages/client/src/components/MkButton.vue b/packages/client/src/components/MkButton.vue index 9042500b4e..5f1a5bdb7e 100644 --- a/packages/client/src/components/MkButton.vue +++ b/packages/client/src/components/MkButton.vue @@ -1,34 +1,36 @@ diff --git a/packages/client/src/components/MkChannelFollowButton.vue b/packages/client/src/components/MkChannelFollowButton.vue index 7c23b91ed7..b4cb1a87f7 100644 --- a/packages/client/src/components/MkChannelFollowButton.vue +++ b/packages/client/src/components/MkChannelFollowButton.vue @@ -1,34 +1,41 @@