From 6575517e5001e57a032945229a597e8eb65ffd2e Mon Sep 17 00:00:00 2001 From: Divlo Date: Mon, 21 Mar 2022 16:08:33 +0100 Subject: [PATCH] chore: reset initial prisma/migration --- .nycrc.json | 5 + .vscode/settings.json | 1 + package-lock.json | 362 ++++++++++-------- package.json | 7 +- .../20211228152051_init_2/migration.sql | 68 ---- .../20211228190900_init_3/migration.sql | 14 - .../20211229101953_init_4/migration.sql | 5 - .../20220209214812_init_5/migration.sql | 41 -- .../20220209215000_init_5/migration.sql | 5 - .../migration.sql | 38 +- src/models/User.ts | 2 +- src/models/UserSettings.ts | 8 +- 12 files changed, 243 insertions(+), 313 deletions(-) create mode 100644 .nycrc.json delete mode 100644 prisma/migrations/20211228152051_init_2/migration.sql delete mode 100644 prisma/migrations/20211228190900_init_3/migration.sql delete mode 100644 prisma/migrations/20211229101953_init_4/migration.sql delete mode 100644 prisma/migrations/20220209214812_init_5/migration.sql delete mode 100644 prisma/migrations/20220209215000_init_5/migration.sql rename prisma/migrations/{20211009140143_init => 20220321085102_initial}/migration.sql (76%) diff --git a/.nycrc.json b/.nycrc.json new file mode 100644 index 0000000..937a14e --- /dev/null +++ b/.nycrc.json @@ -0,0 +1,5 @@ +{ + "reporter": ["text", "cobertura"], + "src": "./build", + "all": true +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 1f49caa..8753b9c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,6 +7,7 @@ "editor.codeActionsOnSave": { "source.fixAll": true }, + "eslint.options": { "ignorePath": ".gitignore" }, "[prisma]": { "editor.defaultFormatter": "Prisma.prisma" } diff --git a/package-lock.json b/package-lock.json index f2bb185..74d4600 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "http-errors": "2.0.0", "jsonwebtoken": "8.5.1", "ms": "2.1.3", - "nodemailer": "6.7.2", + "nodemailer": "6.7.3", "read-pkg": "7.1.0", "socket.io": "4.4.1" }, @@ -37,7 +37,7 @@ "@commitlint/cli": "16.2.3", "@commitlint/config-conventional": "16.2.1", "@saithodev/semantic-release-backmerge": "2.1.2", - "@swc/cli": "0.1.55", + "@swc/cli": "0.1.56", "@swc/core": "1.2.159", "@types/bcryptjs": "2.4.2", "@types/busboy": "1.3.0", @@ -50,6 +50,7 @@ "@types/sinon": "10.0.11", "@types/tap": "15.0.6", "@typescript-eslint/eslint-plugin": "5.15.0", + "c8": "7.11.0", "concurrently": "7.0.0", "cross-env": "7.0.3", "editorconfig-checker": "4.0.2", @@ -481,6 +482,12 @@ "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/@commitlint/cli": { "version": "16.2.3", "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-16.2.3.tgz", @@ -1361,9 +1368,9 @@ } }, "node_modules/@swc/cli": { - "version": "0.1.55", - "resolved": "https://registry.npmjs.org/@swc/cli/-/cli-0.1.55.tgz", - "integrity": "sha512-akkLuRexFq8XTi6JNZ27mXD4wcKXLDSLj4g7YMU+/upFM8IeD1IEp1Mxtre7MzCZn+QOQgPF8N8IReJoHuSn3g==", + "version": "0.1.56", + "resolved": "https://registry.npmjs.org/@swc/cli/-/cli-0.1.56.tgz", + "integrity": "sha512-CFQzS271l9LfLg8JwtN4l/ZNDbdcoS4xbgiRwh7Oxx2sRxWxE/6fJRTzXHw7Z2TDuyYtx+D0vwjyjulbePmTeg==", "dev": true, "dependencies": { "commander": "^7.1.0", @@ -1753,6 +1760,12 @@ "tslib": "^2.1.0" } }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, "node_modules/@types/json-schema": { "version": "7.0.10", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.10.tgz", @@ -2216,7 +2229,6 @@ "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" }, @@ -2647,6 +2659,79 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/c8": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-7.11.0.tgz", + "integrity": "sha512-XqPyj1uvlHMr+Y1IeRndC2X5P7iJzJlEJwBpCdBbq2JocXOgJfr+JVfJkyNMGROke5LfKrhSFXGFXnwnRJAUJw==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.2", + "find-up": "^5.0.0", + "foreground-child": "^2.0.0", + "istanbul-lib-coverage": "^3.0.1", + "istanbul-lib-report": "^3.0.0", + "istanbul-reports": "^3.0.2", + "rimraf": "^3.0.0", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^8.0.0", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.7" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/c8/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/c8/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/c8/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/c8/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/cacheable-request": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", @@ -2815,7 +2900,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3104,7 +3188,6 @@ "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" }, @@ -3115,8 +3198,7 @@ "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 + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/color-support": { "version": "1.1.3", @@ -5655,7 +5737,6 @@ "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" } @@ -6832,12 +6913,12 @@ } }, "node_modules/jake": { - "version": "10.8.3", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.3.tgz", - "integrity": "sha512-qeoeVK7eSYbs1r9zPLweN0KJfUPqUQyM/WtJC8kmUJoYzfkK/MqcJNNkrOY3CtoWyg8LytAAwyNMk3NGsDs3OQ==", + "version": "10.8.4", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.4.tgz", + "integrity": "sha512-MtWeTkl1qGsWUtbl/Jsca/8xSoK3x0UmS82sNbjqxxG/de/M/3b1DntdjHgPMC50enlTNwXOCRqPXLLt5cCfZA==", "dependencies": { "async": "0.9.x", - "chalk": "^2.4.2", + "chalk": "^4.0.2", "filelist": "^1.0.1", "minimatch": "^3.0.4" }, @@ -6845,71 +6926,7 @@ "jake": "bin/cli.js" }, "engines": { - "node": "*" - } - }, - "node_modules/jake/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==", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/jake/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==", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/jake/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==", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/jake/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "node_modules/jake/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=", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/jake/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "engines": { - "node": ">=4" - } - }, - "node_modules/jake/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==", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" + "node": ">=10" } }, "node_modules/java-properties": { @@ -8271,9 +8288,9 @@ "dev": true }, "node_modules/nodemailer": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.7.2.tgz", - "integrity": "sha512-Dz7zVwlef4k5R71fdmxwR8Q39fiboGbu3xgswkzGwczUfjp873rVxt1O46+Fh0j1ORnAC6L9+heI8uUpO6DT7Q==", + "version": "6.7.3", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.7.3.tgz", + "integrity": "sha512-KUdDsspqx89sD4UUyUKzdlUOper3hRkDVkrKh/89G+d9WKsU5ox51NWS4tB1XR5dPUdR4SP0E3molyEfOvSa3g==", "engines": { "node": ">=6.0.0" } @@ -13413,7 +13430,6 @@ "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" }, @@ -16052,6 +16068,20 @@ "integrity": "sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==", "dev": true }, + "node_modules/v8-to-istanbul": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz", + "integrity": "sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w==", + "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/v8flags": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-4.0.0.tgz", @@ -16717,6 +16747,12 @@ "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 + }, "@commitlint/cli": { "version": "16.2.3", "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-16.2.3.tgz", @@ -17437,9 +17473,9 @@ "integrity": "sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ==" }, "@swc/cli": { - "version": "0.1.55", - "resolved": "https://registry.npmjs.org/@swc/cli/-/cli-0.1.55.tgz", - "integrity": "sha512-akkLuRexFq8XTi6JNZ27mXD4wcKXLDSLj4g7YMU+/upFM8IeD1IEp1Mxtre7MzCZn+QOQgPF8N8IReJoHuSn3g==", + "version": "0.1.56", + "resolved": "https://registry.npmjs.org/@swc/cli/-/cli-0.1.56.tgz", + "integrity": "sha512-CFQzS271l9LfLg8JwtN4l/ZNDbdcoS4xbgiRwh7Oxx2sRxWxE/6fJRTzXHw7Z2TDuyYtx+D0vwjyjulbePmTeg==", "dev": true, "requires": { "commander": "^7.1.0", @@ -17676,6 +17712,12 @@ } } }, + "@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, "@types/json-schema": { "version": "7.0.10", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.10.tgz", @@ -18009,7 +18051,6 @@ "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" } @@ -18317,6 +18358,66 @@ "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", "dev": true }, + "c8": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-7.11.0.tgz", + "integrity": "sha512-XqPyj1uvlHMr+Y1IeRndC2X5P7iJzJlEJwBpCdBbq2JocXOgJfr+JVfJkyNMGROke5LfKrhSFXGFXnwnRJAUJw==", + "dev": true, + "requires": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.2", + "find-up": "^5.0.0", + "foreground-child": "^2.0.0", + "istanbul-lib-coverage": "^3.0.1", + "istanbul-lib-report": "^3.0.0", + "istanbul-reports": "^3.0.2", + "rimraf": "^3.0.0", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^8.0.0", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.7" + }, + "dependencies": { + "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 + }, + "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 + }, + "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" + } + }, + "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" + } + } + } + }, "cacheable-request": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", @@ -18441,7 +18542,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -18662,7 +18762,6 @@ "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" } @@ -18670,8 +18769,7 @@ "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 + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "color-support": { "version": "1.1.3", @@ -20666,8 +20764,7 @@ "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 + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "has-symbols": { "version": "1.0.3", @@ -21496,65 +21593,14 @@ } }, "jake": { - "version": "10.8.3", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.3.tgz", - "integrity": "sha512-qeoeVK7eSYbs1r9zPLweN0KJfUPqUQyM/WtJC8kmUJoYzfkK/MqcJNNkrOY3CtoWyg8LytAAwyNMk3NGsDs3OQ==", + "version": "10.8.4", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.4.tgz", + "integrity": "sha512-MtWeTkl1qGsWUtbl/Jsca/8xSoK3x0UmS82sNbjqxxG/de/M/3b1DntdjHgPMC50enlTNwXOCRqPXLLt5cCfZA==", "requires": { "async": "0.9.x", - "chalk": "^2.4.2", + "chalk": "^4.0.2", "filelist": "^1.0.1", "minimatch": "^3.0.4" - }, - "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==", - "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==", - "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==", - "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=" - }, - "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=" - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - } } }, "java-properties": { @@ -22610,9 +22656,9 @@ "dev": true }, "nodemailer": { - "version": "6.7.2", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.7.2.tgz", - "integrity": "sha512-Dz7zVwlef4k5R71fdmxwR8Q39fiboGbu3xgswkzGwczUfjp873rVxt1O46+Fh0j1ORnAC6L9+heI8uUpO6DT7Q==" + "version": "6.7.3", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.7.3.tgz", + "integrity": "sha512-KUdDsspqx89sD4UUyUKzdlUOper3hRkDVkrKh/89G+d9WKsU5ox51NWS4tB1XR5dPUdR4SP0E3molyEfOvSa3g==" }, "nodemon": { "version": "2.0.15", @@ -26373,7 +26419,6 @@ "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" } @@ -28182,6 +28227,17 @@ "integrity": "sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==", "dev": true }, + "v8-to-istanbul": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz", + "integrity": "sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + } + }, "v8flags": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-4.0.0.tgz", diff --git a/package.json b/package.json index a1f5f3e..0bc3f50 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "lint:typescript": "eslint \"**/*.{js,jsx,ts,tsx}\" --ignore-path \".gitignore\"", "lint:prettier": "prettier \".\" --check", "lint:staged": "lint-staged", - "test": "tap", + "test": "c8 tap", "prisma:generate": "prisma generate", "prisma:studio": "prisma studio", "prisma:migrate:dev": "prisma migrate dev", @@ -54,7 +54,7 @@ "http-errors": "2.0.0", "jsonwebtoken": "8.5.1", "ms": "2.1.3", - "nodemailer": "6.7.2", + "nodemailer": "6.7.3", "read-pkg": "7.1.0", "socket.io": "4.4.1" }, @@ -62,7 +62,7 @@ "@commitlint/cli": "16.2.3", "@commitlint/config-conventional": "16.2.1", "@saithodev/semantic-release-backmerge": "2.1.2", - "@swc/cli": "0.1.55", + "@swc/cli": "0.1.56", "@swc/core": "1.2.159", "@types/bcryptjs": "2.4.2", "@types/busboy": "1.3.0", @@ -75,6 +75,7 @@ "@types/sinon": "10.0.11", "@types/tap": "15.0.6", "@typescript-eslint/eslint-plugin": "5.15.0", + "c8": "7.11.0", "concurrently": "7.0.0", "cross-env": "7.0.3", "editorconfig-checker": "4.0.2", diff --git a/prisma/migrations/20211228152051_init_2/migration.sql b/prisma/migrations/20211228152051_init_2/migration.sql deleted file mode 100644 index 161d56a..0000000 --- a/prisma/migrations/20211228152051_init_2/migration.sql +++ /dev/null @@ -1,68 +0,0 @@ -/* - Warnings: - - - You are about to alter the column `name` on the `Channel` table. The data in that column could be lost. The data in that column will be cast from `VarChar(255)` to `VarChar(20)`. - - You are about to alter the column `name` on the `Guild` table. The data in that column could be lost. The data in that column will be cast from `VarChar(255)` to `VarChar(30)`. - - You are about to alter the column `type` on the `Message` table. The data in that column could be lost. The data in that column will be cast from `VarChar(255)` to `VarChar(10)`. - - You are about to alter the column `mimetype` on the `Message` table. The data in that column could be lost. The data in that column will be cast from `VarChar(255)` to `VarChar(127)`. - - You are about to alter the column `provider` on the `OAuth` table. The data in that column could be lost. The data in that column will be cast from `VarChar(255)` to `VarChar(20)`. - - You are about to alter the column `name` on the `User` table. The data in that column could be lost. The data in that column will be cast from `VarChar(255)` to `VarChar(30)`. - - You are about to alter the column `email` on the `User` table. The data in that column could be lost. The data in that column will be cast from `VarChar(255)` to `VarChar(254)`. - - You are about to alter the column `status` on the `User` table. The data in that column could be lost. The data in that column will be cast from `VarChar(255)` to `VarChar(50)`. - - You are about to alter the column `biography` on the `User` table. The data in that column could be lost. The data in that column will be cast from `Text` to `VarChar(160)`. - - You are about to alter the column `language` on the `UserSetting` table. The data in that column could be lost. The data in that column will be cast from `VarChar(255)` to `VarChar(10)`. - - You are about to alter the column `theme` on the `UserSetting` table. The data in that column could be lost. The data in that column will be cast from `VarChar(255)` to `VarChar(10)`. - - A unique constraint covering the columns `[guildId]` on the table `Channel` will be added. If there are existing duplicate values, this will fail. - - A unique constraint covering the columns `[userId]` on the table `Member` will be added. If there are existing duplicate values, this will fail. - - A unique constraint covering the columns `[guildId]` on the table `Member` will be added. If there are existing duplicate values, this will fail. - - A unique constraint covering the columns `[memberId]` on the table `Message` will be added. If there are existing duplicate values, this will fail. - - A unique constraint covering the columns `[channelId]` on the table `Message` will be added. If there are existing duplicate values, this will fail. - - A unique constraint covering the columns `[userId]` on the table `OAuth` will be added. If there are existing duplicate values, this will fail. - - A unique constraint covering the columns `[userId]` on the table `RefreshToken` will be added. If there are existing duplicate values, this will fail. - -*/ --- AlterTable -ALTER TABLE "Channel" ALTER COLUMN "name" SET DATA TYPE VARCHAR(20); - --- AlterTable -ALTER TABLE "Guild" ALTER COLUMN "name" SET DATA TYPE VARCHAR(30); - --- AlterTable -ALTER TABLE "Message" ALTER COLUMN "type" SET DATA TYPE VARCHAR(10), -ALTER COLUMN "mimetype" SET DATA TYPE VARCHAR(127); - --- AlterTable -ALTER TABLE "OAuth" ALTER COLUMN "provider" SET DATA TYPE VARCHAR(20); - --- AlterTable -ALTER TABLE "User" ALTER COLUMN "name" SET DATA TYPE VARCHAR(30), -ALTER COLUMN "email" SET DATA TYPE VARCHAR(254), -ALTER COLUMN "status" SET DATA TYPE VARCHAR(50), -ALTER COLUMN "biography" SET DATA TYPE VARCHAR(160); - --- AlterTable -ALTER TABLE "UserSetting" ALTER COLUMN "language" SET DEFAULT E'en', -ALTER COLUMN "language" SET DATA TYPE VARCHAR(10), -ALTER COLUMN "theme" SET DEFAULT E'dark', -ALTER COLUMN "theme" SET DATA TYPE VARCHAR(10); - --- CreateIndex -CREATE UNIQUE INDEX "Channel_guildId_key" ON "Channel"("guildId"); - --- CreateIndex -CREATE UNIQUE INDEX "Member_userId_key" ON "Member"("userId"); - --- CreateIndex -CREATE UNIQUE INDEX "Member_guildId_key" ON "Member"("guildId"); - --- CreateIndex -CREATE UNIQUE INDEX "Message_memberId_key" ON "Message"("memberId"); - --- CreateIndex -CREATE UNIQUE INDEX "Message_channelId_key" ON "Message"("channelId"); - --- CreateIndex -CREATE UNIQUE INDEX "OAuth_userId_key" ON "OAuth"("userId"); - --- CreateIndex -CREATE UNIQUE INDEX "RefreshToken_userId_key" ON "RefreshToken"("userId"); diff --git a/prisma/migrations/20211228190900_init_3/migration.sql b/prisma/migrations/20211228190900_init_3/migration.sql deleted file mode 100644 index 2e37be8..0000000 --- a/prisma/migrations/20211228190900_init_3/migration.sql +++ /dev/null @@ -1,14 +0,0 @@ --- DropIndex -DROP INDEX "Channel_guildId_key"; - --- DropIndex -DROP INDEX "Member_guildId_key"; - --- DropIndex -DROP INDEX "Member_userId_key"; - --- DropIndex -DROP INDEX "Message_channelId_key"; - --- DropIndex -DROP INDEX "Message_memberId_key"; diff --git a/prisma/migrations/20211229101953_init_4/migration.sql b/prisma/migrations/20211229101953_init_4/migration.sql deleted file mode 100644 index 5c695a0..0000000 --- a/prisma/migrations/20211229101953_init_4/migration.sql +++ /dev/null @@ -1,5 +0,0 @@ --- DropIndex -DROP INDEX "OAuth_userId_key"; - --- DropIndex -DROP INDEX "RefreshToken_userId_key"; diff --git a/prisma/migrations/20220209214812_init_5/migration.sql b/prisma/migrations/20220209214812_init_5/migration.sql deleted file mode 100644 index d7acc31..0000000 --- a/prisma/migrations/20220209214812_init_5/migration.sql +++ /dev/null @@ -1,41 +0,0 @@ --- DropForeignKey -ALTER TABLE "Member" DROP CONSTRAINT "Member_guildId_fkey"; - --- DropForeignKey -ALTER TABLE "Member" DROP CONSTRAINT "Member_userId_fkey"; - --- DropForeignKey -ALTER TABLE "Message" DROP CONSTRAINT "Message_channelId_fkey"; - --- DropForeignKey -ALTER TABLE "Message" DROP CONSTRAINT "Message_memberId_fkey"; - --- DropForeignKey -ALTER TABLE "OAuth" DROP CONSTRAINT "OAuth_userId_fkey"; - --- DropForeignKey -ALTER TABLE "RefreshToken" DROP CONSTRAINT "RefreshToken_userId_fkey"; - --- DropForeignKey -ALTER TABLE "UserSetting" DROP CONSTRAINT "UserSetting_userId_fkey"; - --- AddForeignKey -ALTER TABLE "UserSetting" ADD CONSTRAINT "UserSetting_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "RefreshToken" ADD CONSTRAINT "RefreshToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "OAuth" ADD CONSTRAINT "OAuth_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Member" ADD CONSTRAINT "Member_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Member" ADD CONSTRAINT "Member_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Message" ADD CONSTRAINT "Message_memberId_fkey" FOREIGN KEY ("memberId") REFERENCES "Member"("id") ON DELETE CASCADE ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Message" ADD CONSTRAINT "Message_channelId_fkey" FOREIGN KEY ("channelId") REFERENCES "Channel"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/migrations/20220209215000_init_5/migration.sql b/prisma/migrations/20220209215000_init_5/migration.sql deleted file mode 100644 index a18ef87..0000000 --- a/prisma/migrations/20220209215000_init_5/migration.sql +++ /dev/null @@ -1,5 +0,0 @@ --- DropForeignKey -ALTER TABLE "Channel" DROP CONSTRAINT "Channel_guildId_fkey"; - --- AddForeignKey -ALTER TABLE "Channel" ADD CONSTRAINT "Channel_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/migrations/20211009140143_init/migration.sql b/prisma/migrations/20220321085102_initial/migration.sql similarity index 76% rename from prisma/migrations/20211009140143_init/migration.sql rename to prisma/migrations/20220321085102_initial/migration.sql index 5f0a8f1..2a98c66 100644 --- a/prisma/migrations/20211009140143_init/migration.sql +++ b/prisma/migrations/20220321085102_initial/migration.sql @@ -1,12 +1,12 @@ -- CreateTable CREATE TABLE "User" ( "id" SERIAL NOT NULL, - "name" VARCHAR(255) NOT NULL, - "email" VARCHAR(255), + "name" VARCHAR(30) NOT NULL, + "email" VARCHAR(254), "password" TEXT, "logo" TEXT, - "status" VARCHAR(255), - "biography" TEXT, + "status" VARCHAR(50), + "biography" VARCHAR(160), "website" VARCHAR(255), "isConfirmed" BOOLEAN NOT NULL DEFAULT false, "temporaryToken" TEXT, @@ -20,8 +20,8 @@ CREATE TABLE "User" ( -- CreateTable CREATE TABLE "UserSetting" ( "id" SERIAL NOT NULL, - "language" VARCHAR(255) NOT NULL, - "theme" VARCHAR(255) NOT NULL, + "language" VARCHAR(10) NOT NULL DEFAULT E'en', + "theme" VARCHAR(10) NOT NULL DEFAULT E'dark', "isPublicEmail" BOOLEAN NOT NULL DEFAULT false, "isPublicGuilds" BOOLEAN NOT NULL DEFAULT false, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -46,7 +46,7 @@ CREATE TABLE "RefreshToken" ( CREATE TABLE "OAuth" ( "id" SERIAL NOT NULL, "providerId" TEXT NOT NULL, - "provider" VARCHAR(255) NOT NULL, + "provider" VARCHAR(20) NOT NULL, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "userId" INTEGER NOT NULL, @@ -69,7 +69,7 @@ CREATE TABLE "Member" ( -- CreateTable CREATE TABLE "Guild" ( "id" SERIAL NOT NULL, - "name" VARCHAR(255) NOT NULL, + "name" VARCHAR(30) NOT NULL, "icon" TEXT, "description" TEXT, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -81,7 +81,7 @@ CREATE TABLE "Guild" ( -- CreateTable CREATE TABLE "Channel" ( "id" SERIAL NOT NULL, - "name" VARCHAR(255) NOT NULL, + "name" VARCHAR(20) NOT NULL, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "guildId" INTEGER NOT NULL, @@ -93,8 +93,8 @@ CREATE TABLE "Channel" ( CREATE TABLE "Message" ( "id" SERIAL NOT NULL, "value" TEXT NOT NULL, - "type" VARCHAR(255) NOT NULL DEFAULT E'text', - "mimetype" VARCHAR(255) NOT NULL DEFAULT E'text/plain', + "type" VARCHAR(10) NOT NULL DEFAULT E'text', + "mimetype" VARCHAR(127) NOT NULL DEFAULT E'text/plain', "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "memberId" INTEGER NOT NULL, @@ -113,25 +113,25 @@ CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); CREATE UNIQUE INDEX "UserSetting_userId_key" ON "UserSetting"("userId"); -- AddForeignKey -ALTER TABLE "UserSetting" ADD CONSTRAINT "UserSetting_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE "UserSetting" ADD CONSTRAINT "UserSetting_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "RefreshToken" ADD CONSTRAINT "RefreshToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE "RefreshToken" ADD CONSTRAINT "RefreshToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "OAuth" ADD CONSTRAINT "OAuth_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE "OAuth" ADD CONSTRAINT "OAuth_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "Member" ADD CONSTRAINT "Member_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE "Member" ADD CONSTRAINT "Member_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "Member" ADD CONSTRAINT "Member_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild"("id") ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE "Member" ADD CONSTRAINT "Member_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "Channel" ADD CONSTRAINT "Channel_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild"("id") ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE "Channel" ADD CONSTRAINT "Channel_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "Message" ADD CONSTRAINT "Message_memberId_fkey" FOREIGN KEY ("memberId") REFERENCES "Member"("id") ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE "Message" ADD CONSTRAINT "Message_memberId_fkey" FOREIGN KEY ("memberId") REFERENCES "Member"("id") ON DELETE CASCADE ON UPDATE CASCADE; -- AddForeignKey -ALTER TABLE "Message" ADD CONSTRAINT "Message_channelId_fkey" FOREIGN KEY ("channelId") REFERENCES "Channel"("id") ON DELETE RESTRICT ON UPDATE CASCADE; +ALTER TABLE "Message" ADD CONSTRAINT "Message_channelId_fkey" FOREIGN KEY ("channelId") REFERENCES "Channel"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/src/models/User.ts b/src/models/User.ts index 91a0101..750ff21 100644 --- a/src/models/User.ts +++ b/src/models/User.ts @@ -20,7 +20,7 @@ export const userSchema = { id, name: Type.String({ minLength: 1, maxLength: 30 }), email: Type.String({ minLength: 1, maxLength: 254, format: 'email' }), - password: Type.String(), + password: Type.String({ minLength: 1 }), logo: Type.String({ minLength: 1, format: 'uri-reference' }), status: Type.String({ minLength: 1, maxLength: 50 }), biography: Type.String({ minLength: 1, maxLength: 160 }), diff --git a/src/models/UserSettings.ts b/src/models/UserSettings.ts index adc8d4a..173fee6 100644 --- a/src/models/UserSettings.ts +++ b/src/models/UserSettings.ts @@ -8,10 +8,10 @@ export const themes = [Type.Literal('light'), Type.Literal('dark')] export const userSettingsSchema = { id, - language: Type.Union(languages), - theme: Type.Union(themes), - isPublicEmail: Type.Boolean(), - isPublicGuilds: Type.Boolean(), + language: Type.Union(languages, { default: 'en' }), + theme: Type.Union(themes, { default: 'dark' }), + isPublicEmail: Type.Boolean({ default: false }), + isPublicGuilds: Type.Boolean({ default: false }), createdAt: date.createdAt, updatedAt: date.updatedAt, userId: id