diff --git a/package-lock.json b/package-lock.json index 962f79da..43730d8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "next-boilerplate", - "version": "3.6.0", + "version": "3.6.1-rec.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "next-boilerplate", - "version": "3.6.0", + "version": "3.6.1-rec.1", "hasInstallScript": true, "workspaces": [ "packages/scripts", @@ -7711,9 +7711,9 @@ "integrity": "sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==" }, "node_modules/@prisma/client": { - "version": "5.9.1", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.9.1.tgz", - "integrity": "sha512-caSOnG4kxcSkhqC/2ShV7rEoWwd3XrftokxJqOCMVvia4NYV/TPtJlS9C2os3Igxw/Qyxumj9GBQzcStzECvtQ==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.10.2.tgz", + "integrity": "sha512-ef49hzB2yJZCvM5gFHMxSFL9KYrIP9udpT5rYo0CsHD4P9IKj473MbhU1gjKKftiwWBTIyrt9jukprzZXazyag==", "hasInstallScript": true, "engines": { "node": ">=16.13" @@ -7728,43 +7728,43 @@ } }, "node_modules/@prisma/debug": { - "version": "5.9.1", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.9.1.tgz", - "integrity": "sha512-yAHFSFCg8KVoL0oRUno3m60GAjsUKYUDkQ+9BA2X2JfVR3kRVSJFc/GpQ2fSORi4pSHZR9orfM4UC9OVXIFFTA==" + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.10.2.tgz", + "integrity": "sha512-bkBOmH9dpEBbMKFJj8V+Zp8IZHIBjy3fSyhLhxj4FmKGb/UBSt9doyfA6k1UeUREsMJft7xgPYBbHSOYBr8XCA==" }, "node_modules/@prisma/engines": { - "version": "5.9.1", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.9.1.tgz", - "integrity": "sha512-gkdXmjxQ5jktxWNdDA5aZZ6R8rH74JkoKq6LD5mACSvxd2vbqWeWIOV0Py5wFC8vofOYShbt6XUeCIUmrOzOnQ==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.10.2.tgz", + "integrity": "sha512-HkSJvix6PW8YqEEt3zHfCYYJY69CXsNdhU+wna+4Y7EZ+AwzeupMnUThmvaDA7uqswiHkgm5/SZ6/4CStjaGmw==", "hasInstallScript": true, "dependencies": { - "@prisma/debug": "5.9.1", - "@prisma/engines-version": "5.9.0-32.23fdc5965b1e05fc54e5f26ed3de66776b93de64", - "@prisma/fetch-engine": "5.9.1", - "@prisma/get-platform": "5.9.1" + "@prisma/debug": "5.10.2", + "@prisma/engines-version": "5.10.0-34.5a9203d0590c951969e85a7d07215503f4672eb9", + "@prisma/fetch-engine": "5.10.2", + "@prisma/get-platform": "5.10.2" } }, "node_modules/@prisma/engines-version": { - "version": "5.9.0-32.23fdc5965b1e05fc54e5f26ed3de66776b93de64", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.9.0-32.23fdc5965b1e05fc54e5f26ed3de66776b93de64.tgz", - "integrity": "sha512-HFl7275yF0FWbdcNvcSRbbu9JCBSLMcurYwvWc8WGDnpu7APxQo2ONtZrUggU3WxLxUJ2uBX+0GOFIcJeVeOOQ==" + "version": "5.10.0-34.5a9203d0590c951969e85a7d07215503f4672eb9", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.10.0-34.5a9203d0590c951969e85a7d07215503f4672eb9.tgz", + "integrity": "sha512-uCy/++3Jx/O3ufM+qv2H1L4tOemTNqcP/gyEVOlZqTpBvYJUe0tWtW0y3o2Ueq04mll4aM5X3f6ugQftOSLdFQ==" }, "node_modules/@prisma/fetch-engine": { - "version": "5.9.1", - "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.9.1.tgz", - "integrity": "sha512-l0goQOMcNVOJs1kAcwqpKq3ylvkD9F04Ioe1oJoCqmz05mw22bNAKKGWuDd3zTUoUZr97va0c/UfLNru+PDmNA==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.10.2.tgz", + "integrity": "sha512-dSmXcqSt6DpTmMaLQ9K8ZKzVAMH3qwGCmYEZr/uVnzVhxRJ1EbT/w2MMwIdBNq1zT69Rvh0h75WMIi0mrIw7Hg==", "dependencies": { - "@prisma/debug": "5.9.1", - "@prisma/engines-version": "5.9.0-32.23fdc5965b1e05fc54e5f26ed3de66776b93de64", - "@prisma/get-platform": "5.9.1" + "@prisma/debug": "5.10.2", + "@prisma/engines-version": "5.10.0-34.5a9203d0590c951969e85a7d07215503f4672eb9", + "@prisma/get-platform": "5.10.2" } }, "node_modules/@prisma/get-platform": { - "version": "5.9.1", - "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.9.1.tgz", - "integrity": "sha512-6OQsNxTyhvG+T2Ksr8FPFpuPeL4r9u0JF0OZHUBI/Uy9SS43sPyAIutt4ZEAyqWQt104ERh70EZedkHZKsnNbg==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.10.2.tgz", + "integrity": "sha512-nqXP6vHiY2PIsebBAuDeWiUYg8h8mfjBckHh6Jezuwej0QJNnjDiOq30uesmg+JXxGk99nqyG3B7wpcOODzXvg==", "dependencies": { - "@prisma/debug": "5.9.1" + "@prisma/debug": "5.10.2" } }, "node_modules/@react-aria/breadcrumbs": { @@ -11152,9 +11152,9 @@ "integrity": "sha512-JkXTOdKs5MF086b/pt8C3+yVp3iDUwG635L7oCH6HvJvvr6lSUU5oe/gLXnPEfYRROHjJIPgCV6cuAg8gGkntQ==" }, "node_modules/@types/node": { - "version": "20.11.19", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", - "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", + "version": "20.11.20", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.20.tgz", + "integrity": "sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==", "dependencies": { "undici-types": "~5.26.4" } @@ -11207,9 +11207,9 @@ "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, "node_modules/@types/react": { - "version": "18.2.56", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.56.tgz", - "integrity": "sha512-NpwHDMkS/EFZF2dONFQHgkPRwhvgq/OAvIaGQzxGSBmaeR++kTg6njr15Vatz0/2VcCEwJQFi6Jf4Q0qBu0rLA==", + "version": "18.2.57", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.57.tgz", + "integrity": "sha512-ZvQsktJgSYrQiMirAN60y4O/LRevIV8hUzSOSNB6gfR3/o3wCBFQx3sPwIYtuDMeiVgsSS3UzCV26tEzgnfvQw==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -11378,15 +11378,15 @@ "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.0.1.tgz", - "integrity": "sha512-OLvgeBv3vXlnnJGIAgCLYKjgMEU+wBGj07MQ/nxAaON+3mLzX7mJbhRYrVGiVvFiXtwFlkcBa/TtmglHy0UbzQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.0.2.tgz", + "integrity": "sha512-/XtVZJtbaphtdrWjr+CJclaCVGPtOdBpFEnvtNf/jRV0IiEemRrL0qABex/nEt8isYcnFacm3nPHYQwL+Wb7qg==", "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "7.0.1", - "@typescript-eslint/type-utils": "7.0.1", - "@typescript-eslint/utils": "7.0.1", - "@typescript-eslint/visitor-keys": "7.0.1", + "@typescript-eslint/scope-manager": "7.0.2", + "@typescript-eslint/type-utils": "7.0.2", + "@typescript-eslint/utils": "7.0.2", + "@typescript-eslint/visitor-keys": "7.0.2", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -11572,14 +11572,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.0.1.tgz", - "integrity": "sha512-8GcRRZNzaHxKzBPU3tKtFNing571/GwPBeCvmAUw0yBtfE2XVd0zFKJIMSWkHJcPQi0ekxjIts6L/rrZq5cxGQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.0.2.tgz", + "integrity": "sha512-GdwfDglCxSmU+QTS9vhz2Sop46ebNCXpPPvsByK7hu0rFGRHL+AusKQJ7SoN+LbLh6APFpQwHKmDSwN35Z700Q==", "dependencies": { - "@typescript-eslint/scope-manager": "7.0.1", - "@typescript-eslint/types": "7.0.1", - "@typescript-eslint/typescript-estree": "7.0.1", - "@typescript-eslint/visitor-keys": "7.0.1", + "@typescript-eslint/scope-manager": "7.0.2", + "@typescript-eslint/types": "7.0.2", + "@typescript-eslint/typescript-estree": "7.0.2", + "@typescript-eslint/visitor-keys": "7.0.2", "debug": "^4.3.4" }, "engines": { @@ -11599,12 +11599,12 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.0.1.tgz", - "integrity": "sha512-v7/T7As10g3bcWOOPAcbnMDuvctHzCFYCG/8R4bK4iYzdFqsZTbXGln0cZNVcwQcwewsYU2BJLay8j0/4zOk4w==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.0.2.tgz", + "integrity": "sha512-l6sa2jF3h+qgN2qUMjVR3uCNGjWw4ahGfzIYsCtFrQJCjhbrDPdiihYT8FnnqFwsWX+20hK592yX9I2rxKTP4g==", "dependencies": { - "@typescript-eslint/types": "7.0.1", - "@typescript-eslint/visitor-keys": "7.0.1" + "@typescript-eslint/types": "7.0.2", + "@typescript-eslint/visitor-keys": "7.0.2" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -11615,12 +11615,12 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.0.1.tgz", - "integrity": "sha512-YtT9UcstTG5Yqy4xtLiClm1ZpM/pWVGFnkAa90UfdkkZsR1eP2mR/1jbHeYp8Ay1l1JHPyGvoUYR6o3On5Nhmw==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.0.2.tgz", + "integrity": "sha512-IKKDcFsKAYlk8Rs4wiFfEwJTQlHcdn8CLwLaxwd6zb8HNiMcQIFX9sWax2k4Cjj7l7mGS5N1zl7RCHOVwHq2VQ==", "dependencies": { - "@typescript-eslint/typescript-estree": "7.0.1", - "@typescript-eslint/utils": "7.0.1", + "@typescript-eslint/typescript-estree": "7.0.2", + "@typescript-eslint/utils": "7.0.2", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -11641,9 +11641,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.0.1.tgz", - "integrity": "sha512-uJDfmirz4FHib6ENju/7cz9SdMSkeVvJDK3VcMFvf/hAShg8C74FW+06MaQPODHfDJp/z/zHfgawIJRjlu0RLg==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.0.2.tgz", + "integrity": "sha512-ZzcCQHj4JaXFjdOql6adYV4B/oFOFjPOC9XYwCaZFRvqN8Llfvv4gSxrkQkd2u4Ci62i2c6W6gkDwQJDaRc4nA==", "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -11653,12 +11653,12 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.0.1.tgz", - "integrity": "sha512-SO9wHb6ph0/FN5OJxH4MiPscGah5wjOd0RRpaLvuBv9g8565Fgu0uMySFEPqwPHiQU90yzJ2FjRYKGrAhS1xig==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.0.2.tgz", + "integrity": "sha512-3AMc8khTcELFWcKcPc0xiLviEvvfzATpdPj/DXuOGIdQIIFybf4DMT1vKRbuAEOFMwhWt7NFLXRkbjsvKZQyvw==", "dependencies": { - "@typescript-eslint/types": "7.0.1", - "@typescript-eslint/visitor-keys": "7.0.1", + "@typescript-eslint/types": "7.0.2", + "@typescript-eslint/visitor-keys": "7.0.2", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -11729,16 +11729,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.0.1.tgz", - "integrity": "sha512-oe4his30JgPbnv+9Vef1h48jm0S6ft4mNwi9wj7bX10joGn07QRfqIqFHoMiajrtoU88cIhXf8ahwgrcbNLgPA==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.0.2.tgz", + "integrity": "sha512-PZPIONBIB/X684bhT1XlrkjNZJIEevwkKDsdwfiu1WeqBxYEEdIgVDgm8/bbKHVu+6YOpeRqcfImTdImx/4Bsw==", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "7.0.1", - "@typescript-eslint/types": "7.0.1", - "@typescript-eslint/typescript-estree": "7.0.1", + "@typescript-eslint/scope-manager": "7.0.2", + "@typescript-eslint/types": "7.0.2", + "@typescript-eslint/typescript-estree": "7.0.2", "semver": "^7.5.4" }, "engines": { @@ -11753,11 +11753,11 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.0.1.tgz", - "integrity": "sha512-hwAgrOyk++RTXrP4KzCg7zB2U0xt7RUU0ZdMSCsqF3eKUwkdXUMyTb0qdCuji7VIbcpG62kKTU9M1J1c9UpFBw==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.0.2.tgz", + "integrity": "sha512-8Y+YiBmqPighbm5xA2k4wKTxRzx9EkBu7Rlw+WHqMvRJ3RPz/BMBO9b2ru0LUNmXg120PHUXD5+SWFy2R8DqlQ==", "dependencies": { - "@typescript-eslint/types": "7.0.1", + "@typescript-eslint/types": "7.0.2", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -11774,13 +11774,13 @@ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" }, "node_modules/@vitest/expect": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.0.tgz", - "integrity": "sha512-7bWt0vBTZj08B+Ikv70AnLRicohYwFgzNjFqo9SxxqHHxSlUJGSXmCRORhOnRMisiUryKMdvsi1n27Bc6jL9DQ==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.1.tgz", + "integrity": "sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==", "dev": true, "dependencies": { - "@vitest/spy": "1.3.0", - "@vitest/utils": "1.3.0", + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", "chai": "^4.3.10" }, "funding": { @@ -11788,12 +11788,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.3.0.tgz", - "integrity": "sha512-1Jb15Vo/Oy7mwZ5bXi7zbgszsdIBNjc4IqP8Jpr/8RdBC4nF1CTzIAn2dxYvpF1nGSseeL39lfLQ2uvs5u1Y9A==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.3.1.tgz", + "integrity": "sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==", "dev": true, "dependencies": { - "@vitest/utils": "1.3.0", + "@vitest/utils": "1.3.1", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -11829,9 +11829,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.3.0.tgz", - "integrity": "sha512-swmktcviVVPYx9U4SEQXLV6AEY51Y6bZ14jA2yo6TgMxQ3h+ZYiO0YhAHGJNp0ohCFbPAis1R9kK0cvN6lDPQA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.3.1.tgz", + "integrity": "sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -11875,9 +11875,9 @@ "dev": true }, "node_modules/@vitest/spy": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.0.tgz", - "integrity": "sha512-AkCU0ThZunMvblDpPKgjIi025UxR8V7MZ/g/EwmAGpjIujLVV2X6rGYGmxE2D4FJbAy0/ijdROHMWa2M/6JVMw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz", + "integrity": "sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -11887,9 +11887,9 @@ } }, "node_modules/@vitest/utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.3.0.tgz", - "integrity": "sha512-/LibEY/fkaXQufi4GDlQZhikQsPO2entBKtfuyIpr1jV4DpaeasqkeHjhdOhU24vSHshcSuEyVlWdzvv2XmYCw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.3.1.tgz", + "integrity": "sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", @@ -16099,9 +16099,9 @@ } }, "node_modules/dotenv": { - "version": "16.4.4", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.4.tgz", - "integrity": "sha512-XvPXc8XAQThSjAbY6cQ/9PcBXmFoWuw1sQ3b8HqUCR6ziGXjkTi//kB9SWa2UwqlgdAIuRqAa/9hVljzPehbYg==", + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "engines": { "node": ">=12" }, @@ -17230,9 +17230,9 @@ } }, "node_modules/eslint-plugin-tailwindcss": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-tailwindcss/-/eslint-plugin-tailwindcss-3.14.2.tgz", - "integrity": "sha512-fNzdf4poZP2yQC0xC2prQxMuArMSb5mnellLQvwb9HC3NcLzxs+0IVKWIg1BqUqyui0c+bbjMmhWcKUWK67SLQ==", + "version": "3.14.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-tailwindcss/-/eslint-plugin-tailwindcss-3.14.3.tgz", + "integrity": "sha512-1MKT8CrVuqVJleHxb7ICHsF2QwO0G+VJ28athTtlcOkccp0qmwK7nCUa1C9paCZ+VVgQU4fonsjLz/wUxoMHJQ==", "dependencies": { "fast-glob": "^3.2.5", "postcss": "^8.4.4" @@ -20084,9 +20084,9 @@ "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==" }, "node_modules/inquirer": { - "version": "9.2.14", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.2.14.tgz", - "integrity": "sha512-4ByIMt677Iz5AvjyKrDpzaepIyMewNvDcvwpVVRZNmy9dLakVoVgdCHZXbK1SlVJra1db0JZ6XkJyHsanpdrdQ==", + "version": "9.2.15", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-9.2.15.tgz", + "integrity": "sha512-vI2w4zl/mDluHt9YEQ/543VTCwPKWiHzKtm9dM2V0NdFcqEexDAjUHzO1oA60HRNaVifGXXM1tRRNluLVHa0Kg==", "dependencies": { "@ljharb/through": "^2.3.12", "ansi-escapes": "^4.3.2", @@ -23770,9 +23770,9 @@ } }, "node_modules/lucide-react": { - "version": "0.331.0", - "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.331.0.tgz", - "integrity": "sha512-CHFJ0ve9vaZ7bB2VRAl27SlX1ELh6pfNC0jS96qGpPEEzLkLDGq4pDBFU8RhOoRMqsjXqTzLm9U6bZ1OcIHq7Q==", + "version": "0.336.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.336.0.tgz", + "integrity": "sha512-e06J4Qrdrk3BP/hf3MnkW3LnymdthfyEtVbdEg0xPQ/olTEKfOfTv03DYmdRm1+XpaNQdCpiHT7Vi6regbxDCQ==", "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0" } @@ -26478,17 +26478,17 @@ "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" }, "node_modules/nodemailer": { - "version": "6.9.9", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.9.tgz", - "integrity": "sha512-dexTll8zqQoVJEZPwQAKzxxtFn0qTnjdQTchoU6Re9BUUGBJiOy3YMn/0ShTW6J5M0dfQ1NeDeRTTl4oIWgQMA==", + "version": "6.9.10", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.10.tgz", + "integrity": "sha512-qtoKfGFhvIFW5kLfrkw2R6Nm6Ur4LNUMykyqu6n9BRKJuyQrqEGwdXXUAbwWEKt33dlWUGXb7rzmJP/p4+O+CA==", "engines": { "node": ">=6.0.0" } }, "node_modules/nodemon": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.3.tgz", - "integrity": "sha512-7jH/NXbFPxVaMwmBCC2B9F/V6X1VkEdNgx3iu9jji8WxWcvhMWkmhNWhI5077zknOnZnBzba9hZP6bCPJLSReQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.0.tgz", + "integrity": "sha512-xqlktYlDMCepBJd43ZQhjWwMw2obW/JRvkrLxq5RCNcuDDX1DbcPT+qT1IlIIdf+DhnWs90JpTMe+Y5KxOchvA==", "dependencies": { "chokidar": "^3.5.2", "debug": "^4", @@ -31587,12 +31587,12 @@ } }, "node_modules/prisma": { - "version": "5.9.1", - "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.9.1.tgz", - "integrity": "sha512-Hy/8KJZz0ELtkw4FnG9MS9rNWlXcJhf98Z2QMqi0QiVMoS8PzsBkpla0/Y5hTlob8F3HeECYphBjqmBxrluUrQ==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.10.2.tgz", + "integrity": "sha512-hqb/JMz9/kymRE25pMWCxkdyhbnIWrq+h7S6WysJpdnCvhstbJSNP/S6mScEcqiB8Qv2F+0R3yG+osRaWqZacQ==", "hasInstallScript": true, "dependencies": { - "@prisma/engines": "5.9.1" + "@prisma/engines": "5.10.2" }, "bin": { "prisma": "build/index.js" @@ -33754,11 +33754,6 @@ "node": ">= 0.8.0" } }, - "node_modules/server-only": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/server-only/-/server-only-0.0.1.tgz", - "integrity": "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==" - }, "node_modules/set-function-length": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", @@ -36474,9 +36469,9 @@ } }, "node_modules/vite-node": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.3.0.tgz", - "integrity": "sha512-D/oiDVBw75XMnjAXne/4feCkCEwcbr2SU1bjAhCcfI5Bq3VoOHji8/wCPAfUkDIeohJ5nSZ39fNxM3dNZ6OBOA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.3.1.tgz", + "integrity": "sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -36496,16 +36491,16 @@ } }, "node_modules/vitest": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.3.0.tgz", - "integrity": "sha512-V9qb276J1jjSx9xb75T2VoYXdO1UKi+qfflY7V7w93jzX7oA/+RtYE6TcifxksxsZvygSSMwu2Uw6di7yqDMwg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.3.1.tgz", + "integrity": "sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==", "dev": true, "dependencies": { - "@vitest/expect": "1.3.0", - "@vitest/runner": "1.3.0", - "@vitest/snapshot": "1.3.0", - "@vitest/spy": "1.3.0", - "@vitest/utils": "1.3.0", + "@vitest/expect": "1.3.1", + "@vitest/runner": "1.3.1", + "@vitest/snapshot": "1.3.1", + "@vitest/spy": "1.3.1", + "@vitest/utils": "1.3.1", "acorn-walk": "^8.3.2", "chai": "^4.3.10", "debug": "^4.3.4", @@ -36519,7 +36514,7 @@ "tinybench": "^2.5.1", "tinypool": "^0.8.2", "vite": "^5.0.0", - "vite-node": "1.3.0", + "vite-node": "1.3.1", "why-is-node-running": "^2.2.2" }, "bin": { @@ -36534,8 +36529,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.3.0", - "@vitest/ui": "1.3.0", + "@vitest/browser": "1.3.1", + "@vitest/ui": "1.3.1", "happy-dom": "*", "jsdom": "*" }, @@ -37507,7 +37502,7 @@ "@next-auth/prisma-adapter": "^1.0.7", "@nextui-org/react": "^2.2.9", "@prisma/client": "^5.6.0", - "@t3-oss/env-nextjs": "^0.9.0", + "@t3-oss/env-nextjs": "^0.9.2", "@tanstack/react-query": "^4.36.1", "@total-typescript/ts-reset": "^0.5.0", "@trpc/client": "^10.43.0", @@ -37543,7 +37538,7 @@ "eslint-plugin-unused-imports": "^3.0.0", "framer-motion": "^11.0.0", "ioredis": "^5.3.2", - "lucide-react": "^0.331.0", + "lucide-react": "^0.336.0", "negotiator": "^0.6.3", "next": "^14.0.0", "next-auth": "^4.24.5", @@ -37559,7 +37554,6 @@ "react-hook-form": "^7.45.4", "react-toastify": "^10.0.0", "request-ip": "^3.3.0", - "server-only": "^0.0.1", "sharp": "^0.33.0", "superjson": "^2.0.0", "tailwind-merge": "^2.0.0", @@ -37645,7 +37639,7 @@ "name": "@next-boilerplate/landing", "dependencies": { "@formatjs/intl-localematcher": "^0.5.0", - "@t3-oss/env-nextjs": "^0.9.0", + "@t3-oss/env-nextjs": "^0.9.2", "@total-typescript/ts-reset": "^0.5.0", "@types/negotiator": "^0.6.3", "@types/react-dom": "^18.2.7", diff --git a/package.json b/package.json index 9422f55a..80d8899c 100644 --- a/package.json +++ b/package.json @@ -39,5 +39,5 @@ "only-allow-many": "^1.2.2", "semantic-release": "^23.0.0" }, - "version": "3.6.0" + "version": "3.6.1-rec.1" } diff --git a/packages/app/.env.example b/packages/app/.env.example index d6965b80..04349290 100644 --- a/packages/app/.env.example +++ b/packages/app/.env.example @@ -4,9 +4,9 @@ ENV=development NEXT_PUBLIC_BASE_URL=http://localhost:3000 DATABASE_PRISMA_URL="postgresql://postgres:postgres@localhost:5432/postgres?schema=public" DATABASE_URL_NON_POOLING="postgresql://postgres:postgres@localhost:5432/postgres?schema=public" -PASSWORD_HASHER_SECRET=QltDSmVBMDhHKENWcjFgN3J1Vmw= +PASSWORD_HASHER_SECRET=secret NEXTAUTH_URL=http://localhost:3000 -NEXTAUTH_SECRET=PGJwbCE+WiJILGZ+K1ZqU24mIX5tVH0= +NEXTAUTH_SECRET=secret GITHUB_CLIENT_ID=secret GITHUB_CLIENT_SECRET=secret AUTH_ADMIN_EMAIL=test@mail.com diff --git a/packages/app/env.mjs b/packages/app/env.mjs index f3d661b2..cd5e490d 100644 --- a/packages/app/env.mjs +++ b/packages/app/env.mjs @@ -13,10 +13,10 @@ export const env = createEnv({ .enum(["true", "false"]) .optional() .transform((value) => value === "true"), - PASSWORD_HASHER_SECRET: z.string().min(16), + PASSWORD_HASHER_SECRET: z.string(), DATABASE_PRISMA_URL: z.string().min(1), DATABASE_URL_NON_POOLING: z.string().optional(), - NEXTAUTH_SECRET: z.string().min(16), + NEXTAUTH_SECRET: z.string(), NEXTAUTH_URL: z.string().optional(), GITHUB_CLIENT_ID: z.string().min(1), GITHUB_CLIENT_SECRET: z.string().min(1), diff --git a/packages/app/package.json b/packages/app/package.json index 9dcc69dc..19700a34 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -20,7 +20,7 @@ "@next-auth/prisma-adapter": "^1.0.7", "@nextui-org/react": "^2.2.9", "@prisma/client": "^5.6.0", - "@t3-oss/env-nextjs": "^0.9.0", + "@t3-oss/env-nextjs": "^0.9.2", "@tanstack/react-query": "^4.36.1", "@total-typescript/ts-reset": "^0.5.0", "@trpc/client": "^10.43.0", @@ -56,7 +56,7 @@ "eslint-plugin-unused-imports": "^3.0.0", "framer-motion": "^11.0.0", "ioredis": "^5.3.2", - "lucide-react": "^0.331.0", + "lucide-react": "^0.336.0", "negotiator": "^0.6.3", "next": "^14.0.0", "next-auth": "^4.24.5", @@ -72,7 +72,6 @@ "react-hook-form": "^7.45.4", "react-toastify": "^10.0.0", "request-ip": "^3.3.0", - "server-only": "^0.0.1", "sharp": "^0.33.0", "superjson": "^2.0.0", "tailwind-merge": "^2.0.0", diff --git a/packages/app/prisma/seed.ts b/packages/app/prisma/seed.ts index b5f2e066..0bfeb6cd 100644 --- a/packages/app/prisma/seed.ts +++ b/packages/app/prisma/seed.ts @@ -3,12 +3,11 @@ config() import chalk from "chalk" import { Spinner } from "cli-spinner" +import { rolesAsObject } from "@/constants" import { hash } from "@/lib/bcrypt" import { logger } from "@lib/logger" import { PrismaClient } from "@prisma/client" -import { rolesAsObject } from "../src/types/constants" - const env = { AUTH_ADMIN_EMAIL: process.env.AUTH_ADMIN_EMAIL, AUTH_ADMIN_PASSWORD: process.env.AUTH_ADMIN_PASSWORD, diff --git a/packages/app/src/api/auth/_router.ts b/packages/app/src/api/auth/_router.ts index 358c9039..ee6d1cff 100644 --- a/packages/app/src/api/auth/_router.ts +++ b/packages/app/src/api/auth/_router.ts @@ -8,7 +8,7 @@ import { signUpSchema, verifyTotpResponseSchema, verifyTotpSchema, -} from "@/lib/schemas/auth" +} from "@/api/auth/schemas" import { authenticatedProcedure, publicProcedure, router } from "@/lib/server/trpc" import { desactivateTotp, generateTotpSecret, recover2FA, register, verifyTotp } from "./mutations" diff --git a/packages/app/src/api/auth/mutations.ts b/packages/app/src/api/auth/mutations.ts index db5bb2cc..5d33b29a 100644 --- a/packages/app/src/api/auth/mutations.ts +++ b/packages/app/src/api/auth/mutations.ts @@ -4,21 +4,21 @@ import { env } from "env.mjs" import { authenticator } from "otplib" import { z } from "zod" -import { hash } from "@/lib/bcrypt" -import { sendMail } from "@/lib/mailer" -import { prisma } from "@/lib/prisma" -import { redis } from "@/lib/redis" import { desactivateTotpSchema, generateTotpSecretResponseSchema, recover2FASchema, signUpSchema, verifyTotpSchema, -} from "@/lib/schemas/auth" +} from "@/api/auth/schemas" +import { emailVerificationExpiration, rolesAsObject } from "@/constants" +import { hash } from "@/lib/bcrypt" +import { sendMail } from "@/lib/mailer" +import { prisma } from "@/lib/prisma" +import { redis } from "@/lib/redis" import { html, plainText, subject } from "@/lib/templates/mail/verify-email" import { ApiError, ensureLoggedIn, generateRandomSecret, handleApiError } from "@/lib/utils/server-utils" import { apiInputFromSchema } from "@/types" -import { emailVerificationExpiration, rolesAsObject } from "@/types/constants" import { logger } from "@lib/logger" import { Prisma } from "@prisma/client" diff --git a/packages/app/src/lib/schemas/auth.ts b/packages/app/src/api/auth/schemas.ts similarity index 95% rename from packages/app/src/lib/schemas/auth.ts rename to packages/app/src/api/auth/schemas.ts index 535f0c7d..51246ad9 100644 --- a/packages/app/src/lib/schemas/auth.ts +++ b/packages/app/src/api/auth/schemas.ts @@ -1,10 +1,9 @@ import * as z from "zod" +import { maxPasswordLength, minPasswordLength } from "@/lib/auth/constants" import { TDictionary } from "@/lib/langs" -import { maxPasswordLength, minPasswordLength } from "../auth/constants" - -import { userSchema } from "./user" +import { userSchema } from "../me/schemas" export const passwordSchema = (dictionary?: TDictionary) => z diff --git a/packages/app/src/api/me/_router.ts b/packages/app/src/api/me/_router.ts index 67d6f912..881221b5 100644 --- a/packages/app/src/api/me/_router.ts +++ b/packages/app/src/api/me/_router.ts @@ -15,7 +15,7 @@ import { updateUserSchema, verifyEmailResponseSchema, verifyEmailSchema, -} from "@/lib/schemas/user" +} from "@/api/me/schemas" import { authenticatedNoEmailVerificationProcedure, authenticatedProcedure, diff --git a/packages/app/src/api/me/email/mutations.ts b/packages/app/src/api/me/email/mutations.ts index 251161cd..5d151f37 100644 --- a/packages/app/src/api/me/email/mutations.ts +++ b/packages/app/src/api/me/email/mutations.ts @@ -2,13 +2,13 @@ import { randomUUID } from "crypto" import { env } from "env.mjs" import { i18n } from "i18n-config" +import { sendVerificationEmailSchema, verifyEmailSchema } from "@/api/me/schemas" +import { emailVerificationExpiration, resendEmailVerificationExpiration } from "@/constants" import { sendMail } from "@/lib/mailer" import { prisma } from "@/lib/prisma" -import { sendVerificationEmailSchema, verifyEmailSchema } from "@/lib/schemas/user" import { html, plainText, subject } from "@/lib/templates/mail/verify-email" import { ApiError, handleApiError } from "@/lib/utils/server-utils" import { apiInputFromSchema } from "@/types" -import { emailVerificationExpiration, resendEmailVerificationExpiration } from "@/types/constants" import { logger } from "@lib/logger" export const sendVerificationEmail = async ({ input }: apiInputFromSchema) => { diff --git a/packages/app/src/api/me/mutations.ts b/packages/app/src/api/me/mutations.ts index 10b37b39..2c801e4f 100644 --- a/packages/app/src/api/me/mutations.ts +++ b/packages/app/src/api/me/mutations.ts @@ -1,12 +1,12 @@ import { env } from "env.mjs" +import { updateUserSchema } from "@/api/me/schemas" +import { rolesAsObject } from "@/constants" import { prisma } from "@/lib/prisma" import { s3Client } from "@/lib/s3" -import { updateUserSchema } from "@/lib/schemas/user" import { ApiError } from "@/lib/utils/server-utils" import { ensureLoggedIn, handleApiError } from "@/lib/utils/server-utils" import { apiInputFromSchema } from "@/types" -import { rolesAsObject } from "@/types/constants" import { DeleteObjectCommand } from "@aws-sdk/client-s3" import { logger } from "@lib/logger" import { Prisma } from "@prisma/client" diff --git a/packages/app/src/api/me/password/mutations.ts b/packages/app/src/api/me/password/mutations.ts index ec0e6114..eb0e8064 100644 --- a/packages/app/src/api/me/password/mutations.ts +++ b/packages/app/src/api/me/password/mutations.ts @@ -2,14 +2,14 @@ import { randomUUID } from "crypto" import { env } from "env.mjs" import { i18n } from "i18n-config" +import { forgotPasswordSchema, resetPasswordSchema } from "@/api/me/schemas" +import { resendResetPasswordExpiration, resetPasswordExpiration, rolesAsObject } from "@/constants" import { hash } from "@/lib/bcrypt" import { sendMail } from "@/lib/mailer" import { prisma } from "@/lib/prisma" -import { forgotPasswordSchema, resetPasswordSchema } from "@/lib/schemas/user" import { html, plainText, subject } from "@/lib/templates/mail/reset-password" import { ApiError, handleApiError } from "@/lib/utils/server-utils" import { apiInputFromSchema } from "@/types" -import { resendResetPasswordExpiration, resetPasswordExpiration, rolesAsObject } from "@/types/constants" import { logger } from "@lib/logger" export const forgotPassword = async ({ input }: apiInputFromSchema) => { diff --git a/packages/app/src/lib/schemas/user.ts b/packages/app/src/api/me/schemas.ts similarity index 88% rename from packages/app/src/lib/schemas/user.ts rename to packages/app/src/api/me/schemas.ts index 9ad64868..4ba31142 100644 --- a/packages/app/src/lib/schemas/user.ts +++ b/packages/app/src/api/me/schemas.ts @@ -1,9 +1,9 @@ import { z } from "zod" -import { jsonApiQuerySchema, jsonApiResponseSchema } from "../json-api" -import { TDictionary } from "../langs" +import { queriesOptionPage, queriesOptionPerPage } from "@/lib/queries-options" -import { emailSchema, passwordSchemaWithRegex, usernameSchema } from "./auth" +import { TDictionary } from "../../lib/langs" +import { emailSchema, passwordSchemaWithRegex, usernameSchema } from "../auth/schemas" export const userSchema = (dictionary?: TDictionary) => z.object({ @@ -43,17 +43,20 @@ export const sessionsSchema = () => }) export const getActiveSessionsSchema = (dictionary?: TDictionary) => - jsonApiQuerySchema(dictionary) - .pick({ - page: true, - perPage: true, - sort: true, - }) - .optional() + z.object({ + page: queriesOptionPage(dictionary), + perPage: queriesOptionPerPage(dictionary), + }) export const getActiveSessionsResponseSchema = () => - jsonApiResponseSchema().extend({ + z.object({ data: z.array(sessionsSchema()).optional(), + meta: z.object({ + total: z.number(), + page: z.number(), + perPage: z.number(), + totalPages: z.number(), + }), }) export const deleteSessionSchema = () => diff --git a/packages/app/src/api/me/sessions/mutations.ts b/packages/app/src/api/me/sessions/mutations.ts index 322e7d08..b17ffa72 100644 --- a/packages/app/src/api/me/sessions/mutations.ts +++ b/packages/app/src/api/me/sessions/mutations.ts @@ -1,5 +1,5 @@ +import { deleteSessionSchema } from "@/api/me/schemas" import { redis } from "@/lib/redis" -import { deleteSessionSchema } from "@/lib/schemas/user" import { ensureLoggedIn, handleApiError } from "@/lib/utils/server-utils" import { apiInputFromSchema } from "@/types" diff --git a/packages/app/src/api/me/sessions/queries.ts b/packages/app/src/api/me/sessions/queries.ts index f1006d31..3c803075 100644 --- a/packages/app/src/api/me/sessions/queries.ts +++ b/packages/app/src/api/me/sessions/queries.ts @@ -1,8 +1,7 @@ import { z } from "zod" -import { getJsonApiSkip, getJsonApiTake } from "@/lib/json-api" +import { getActiveSessionsResponseSchema, getActiveSessionsSchema, sessionsSchema } from "@/api/me/schemas" import { redis } from "@/lib/redis" -import { getActiveSessionsResponseSchema, getActiveSessionsSchema, sessionsSchema } from "@/lib/schemas/user" import { ensureLoggedIn, handleApiError } from "@/lib/utils/server-utils" import { apiInputFromSchema } from "@/types" @@ -13,8 +12,10 @@ export const getActiveSessions = async ({ try { ensureLoggedIn(session) - const skip = getJsonApiSkip(input) - const take = getJsonApiTake(input) + const { page, perPage } = input + + const skip = (page - 1) * perPage + const take = perPage const allSessionsKeys = await redis.keys(`session:${session.user.id}:*`) const allSessions = await redis.mget(allSessionsKeys) const activeSessions = allSessions diff --git a/packages/app/src/api/upload/_router.ts b/packages/app/src/api/upload/_router.ts index d13d2785..cf691725 100644 --- a/packages/app/src/api/upload/_router.ts +++ b/packages/app/src/api/upload/_router.ts @@ -1,7 +1,7 @@ -import { presignedUrlResponseSchema, presignedUrlSchema } from "@/lib/schemas/upload" import { authenticatedProcedure, router } from "@/lib/server/trpc" import { presignedUrl } from "./mutations" +import { presignedUrlResponseSchema, presignedUrlSchema } from "./schemas" export const uploadRouter = router({ presignedUrl: authenticatedProcedure diff --git a/packages/app/src/api/upload/mutations.ts b/packages/app/src/api/upload/mutations.ts index 65c6c967..cc65504e 100644 --- a/packages/app/src/api/upload/mutations.ts +++ b/packages/app/src/api/upload/mutations.ts @@ -2,17 +2,18 @@ import { randomUUID } from "crypto" import { env } from "env.mjs" import { z } from "zod" +import { maxUploadSize } from "@/constants" import { prisma } from "@/lib/prisma" import { s3Client } from "@/lib/s3" -import { presignedUrlResponseSchema, presignedUrlSchema } from "@/lib/schemas/upload" import { stringToSlug } from "@/lib/utils" import { ApiError, ensureLoggedIn, handleApiError } from "@/lib/utils/server-utils" import { apiInputFromSchema } from "@/types" -import { maxUploadSize } from "@/types/constants" import { DeleteObjectCommand } from "@aws-sdk/client-s3" import { createPresignedPost } from "@aws-sdk/s3-presigned-post" import { logger } from "@lib/logger" +import { presignedUrlResponseSchema, presignedUrlSchema } from "./schemas" + export const presignedUrl = async ({ input, ctx: { session } }: apiInputFromSchema) => { ensureLoggedIn(session) try { diff --git a/packages/app/src/lib/schemas/upload.ts b/packages/app/src/api/upload/schemas.ts similarity index 100% rename from packages/app/src/lib/schemas/upload.ts rename to packages/app/src/api/upload/schemas.ts diff --git a/packages/app/src/app/[lang]/(protected)/examples/profile/page.tsx b/packages/app/src/app/[lang]/(protected)/examples/profile/page.tsx index 1671b2dd..ed770449 100644 --- a/packages/app/src/app/[lang]/(protected)/examples/profile/page.tsx +++ b/packages/app/src/app/[lang]/(protected)/examples/profile/page.tsx @@ -41,7 +41,7 @@ export default async function Profile({ {dictionary.signOut} - + diff --git a/packages/app/src/app/[lang]/(sys-auth)/forgot-password/form.tsx b/packages/app/src/app/[lang]/(sys-auth)/forgot-password/form.tsx index 42532a1a..a41057c5 100644 --- a/packages/app/src/app/[lang]/(sys-auth)/forgot-password/form.tsx +++ b/packages/app/src/app/[lang]/(sys-auth)/forgot-password/form.tsx @@ -6,12 +6,12 @@ import { useForm } from "react-hook-form" import { toast } from "react-toastify" import { z } from "zod" +import { forgotPasswordSchema } from "@/api/me/schemas" import AutoRefresh from "@/components/auto-refresh" import FormField from "@/components/ui/form" +import { resendResetPasswordExpiration } from "@/constants" import { useDictionary } from "@/contexts/dictionary/utils" -import { forgotPasswordSchema } from "@/lib/schemas/user" import { trpc } from "@/lib/trpc/client" -import { resendResetPasswordExpiration } from "@/types/constants" import { zodResolver } from "@hookform/resolvers/zod" import { Button, Tooltip } from "@nextui-org/react" diff --git a/packages/app/src/app/[lang]/(sys-auth)/recover-2fa/form.tsx b/packages/app/src/app/[lang]/(sys-auth)/recover-2fa/form.tsx index ad98c8da..cf8beec4 100644 --- a/packages/app/src/app/[lang]/(sys-auth)/recover-2fa/form.tsx +++ b/packages/app/src/app/[lang]/(sys-auth)/recover-2fa/form.tsx @@ -6,10 +6,10 @@ import { useForm } from "react-hook-form" import { toast } from "react-toastify" import { z } from "zod" +import { recover2FASchema } from "@/api/auth/schemas" import FormField from "@/components/ui/form" import { useDictionary } from "@/contexts/dictionary/utils" import { authRoutes } from "@/lib/auth/constants" -import { recover2FASchema } from "@/lib/schemas/auth" import { trpc } from "@/lib/trpc/client" import { cn } from "@/lib/utils" import { zodResolver } from "@hookform/resolvers/zod" diff --git a/packages/app/src/app/[lang]/(sys-auth)/reset-password/[token]/form.tsx b/packages/app/src/app/[lang]/(sys-auth)/reset-password/[token]/form.tsx index 8bd68cc9..2823843e 100644 --- a/packages/app/src/app/[lang]/(sys-auth)/reset-password/[token]/form.tsx +++ b/packages/app/src/app/[lang]/(sys-auth)/reset-password/[token]/form.tsx @@ -5,10 +5,10 @@ import { useForm } from "react-hook-form" import { toast } from "react-toastify" import { z } from "zod" +import { resetPasswordSchema } from "@/api/me/schemas" import FormField from "@/components/ui/form" import { useDictionary } from "@/contexts/dictionary/utils" import { authRoutes } from "@/lib/auth/constants" -import { resetPasswordSchema } from "@/lib/schemas/user" import { trpc } from "@/lib/trpc/client" import { zodResolver } from "@hookform/resolvers/zod" import { Button } from "@nextui-org/react" diff --git a/packages/app/src/components/auth/github-sign-in.tsx b/packages/app/src/components/auth/github-sign-in.tsx index fc79587f..2e898d44 100644 --- a/packages/app/src/components/auth/github-sign-in.tsx +++ b/packages/app/src/components/auth/github-sign-in.tsx @@ -28,7 +28,7 @@ export default function GithubSignIn({ isDisabled={isLoading} > {isLoading ? ( - + ) : ( )} diff --git a/packages/app/src/components/auth/login-user-auth-form.tsx b/packages/app/src/components/auth/login-user-auth-form.tsx index 2d8eac71..dc5df325 100644 --- a/packages/app/src/components/auth/login-user-auth-form.tsx +++ b/packages/app/src/components/auth/login-user-auth-form.tsx @@ -7,10 +7,10 @@ import { ArrowBigDown, BadgeInfo } from "lucide-react" import { useForm } from "react-hook-form" import * as z from "zod" +import { signInSchema } from "@/api/auth/schemas" import { useDictionary } from "@/contexts/dictionary/utils" import { authRoutes } from "@/lib/auth/constants" import { handleSignError, handleSignIn } from "@/lib/auth/handle-sign" -import { signInSchema } from "@/lib/schemas/auth" import { cn, ensureRelativeUrl } from "@/lib/utils" import { zodResolver } from "@hookform/resolvers/zod" import { Button, Card, CardBody, Link } from "@nextui-org/react" diff --git a/packages/app/src/components/auth/register-user-auth-form.tsx b/packages/app/src/components/auth/register-user-auth-form.tsx index b0a65a49..07bb83ba 100644 --- a/packages/app/src/components/auth/register-user-auth-form.tsx +++ b/packages/app/src/components/auth/register-user-auth-form.tsx @@ -6,11 +6,11 @@ import { useRouter } from "next/navigation" import { useForm } from "react-hook-form" import * as z from "zod" +import { signUpSchema } from "@/api/auth/schemas" import { useDictionary } from "@/contexts/dictionary/utils" import { authRoutes } from "@/lib/auth/constants" import { handleSignError, handleSignIn } from "@/lib/auth/handle-sign" import { TDictionary } from "@/lib/langs" -import { signUpSchema } from "@/lib/schemas/auth" import { trpc } from "@/lib/trpc/client" import { cn } from "@/lib/utils" import { handleMutationError } from "@/lib/utils/client-utils" diff --git a/packages/app/src/components/profile/avatar.tsx b/packages/app/src/components/profile/avatar.tsx index 8b453d80..1afcfe1b 100644 --- a/packages/app/src/components/profile/avatar.tsx +++ b/packages/app/src/components/profile/avatar.tsx @@ -4,12 +4,12 @@ import { useState } from "react" import { Camera } from "lucide-react" import { toast } from "react-toastify" +import { maxUploadSize } from "@/constants" import { useAccount } from "@/contexts/account" import { useDictionary } from "@/contexts/dictionary/utils" import { trpc } from "@/lib/trpc/client" import { cn } from "@/lib/utils" import { getImageUrl } from "@/lib/utils/client-utils" -import { maxUploadSize } from "@/types/constants" import { logger } from "@lib/logger" import { Avatar, Button, Modal, ModalBody, ModalContent, Skeleton, Spinner } from "@nextui-org/react" @@ -141,7 +141,7 @@ export default function UpdateAvatar({ account }: { account: ReturnType(null) const [currentPage, setCurrentPage] = useState(1) const callParams = { page: currentPage, + perPage: itemsPerPageInitial, } const activeSessions = useActiveSessions(callParams, { disabled: isDisabled, }) - const [meta, setMeta] = useState(activeSessions.data?.meta) - - useEffect(() => { - if (activeSessions.isLoading) return - setMeta(activeSessions.data?.meta) - }, [activeSessions]) + const meta = activeSessions.data?.meta const deleteSessionMutation = trpc.me.deleteSession.useMutation({ onSettled: () => { diff --git a/packages/app/src/components/profile/sessions/user-active-sessions.tsx b/packages/app/src/components/profile/sessions/user-active-sessions.tsx index 02bed261..4832dc2f 100644 --- a/packages/app/src/components/profile/sessions/user-active-sessions.tsx +++ b/packages/app/src/components/profile/sessions/user-active-sessions.tsx @@ -1,16 +1,8 @@ -import { Session } from "next-auth" - import { TDictionary } from "@/lib/langs" import SessionsTable from "./sessions-table" -export default async function UserActiveSessions({ - dictionary, - session, -}: { - dictionary: TDictionary - session: Session | null -}) { +export default async function UserActiveSessions({ dictionary }: { dictionary: TDictionary }) { return (
@@ -19,7 +11,7 @@ export default async function UserActiveSessions({ {dictionary.profilePage.profileDetails.loggedDevicesDescription}

- +
) } diff --git a/packages/app/src/components/profile/update-account.tsx b/packages/app/src/components/profile/update-account.tsx index e847791d..c867a1a1 100644 --- a/packages/app/src/components/profile/update-account.tsx +++ b/packages/app/src/components/profile/update-account.tsx @@ -6,9 +6,9 @@ import { env } from "env.mjs" import { useForm } from "react-hook-form" import * as z from "zod" +import { updateUserSchema } from "@/api/me/schemas" import { useAccount } from "@/contexts/account" import { useDictionary } from "@/contexts/dictionary/utils" -import { updateUserSchema } from "@/lib/schemas/user" import { trpc } from "@/lib/trpc/client" import { zodResolver } from "@hookform/resolvers/zod" import { logger } from "@lib/logger" diff --git a/packages/app/src/components/ui/image-crop.tsx b/packages/app/src/components/ui/image-crop.tsx index f2f3b0b5..3ee77b87 100644 --- a/packages/app/src/components/ui/image-crop.tsx +++ b/packages/app/src/components/ui/image-crop.tsx @@ -441,7 +441,7 @@ function CropContent({ {/* DOT1 | TOP-LEFT */}
["0"] = {}, + params: Parameters["0"], extendedOptions?: { initialData?: z.infer> disabled?: boolean diff --git a/packages/app/src/langs/en.json b/packages/app/src/langs/en.json index 22e91b34..275d56fe 100644 --- a/packages/app/src/langs/en.json +++ b/packages/app/src/langs/en.json @@ -114,10 +114,12 @@ "areYouAbsolutelySure": "Are you absolutely sure?", "error": "Error", "couldNotMessage": "Could not {action} {subject}. Please try again later.", - "fetch": "fetch", - "create": "create", - "update": "update", - "delete": "delete", + "fetch": "Fetch", + "create": "Create", + "update": "Update", + "delete": "Delete", + "yes": "Yes", + "no": "No", "needSavePopup": "Be careful, there are still unsaved changes!", "reset": "Reset", "saveChanges": "Save changes", diff --git a/packages/app/src/langs/fr.json b/packages/app/src/langs/fr.json index b94a666e..30074677 100644 --- a/packages/app/src/langs/fr.json +++ b/packages/app/src/langs/fr.json @@ -114,10 +114,12 @@ "areYouAbsolutelySure": "Êtes-vous absolument sûr ?", "error": "Erreur", "couldNotMessage": "Impossible de {action} {subject}. Veuillez ressayer plus tard.", - "fetch": "récupérer", - "create": "créer", - "update": "mettre à jour", - "delete": "supprimer", + "fetch": "Récupérer", + "create": "Créer", + "update": "Mettre à jour", + "delete": "Supprimer", + "yes": "Oui", + "no": "Non", "needSavePopup": "Vous avez des modifications non enregistrées !", "reset": "Réinitialiser", "saveChanges": "Sauvegarder", diff --git a/packages/app/src/lib/auth/constants.ts b/packages/app/src/lib/auth/constants.ts index 0bab629e..a85d60a7 100644 --- a/packages/app/src/lib/auth/constants.ts +++ b/packages/app/src/lib/auth/constants.ts @@ -5,7 +5,6 @@ export const authRoutes = { signUp: ["/sign-up", "/register", "/signup"], redirectAfterSignIn: "/examples/profile", redirectOnUnhauthorized: "/sign-in", - otp: ["/sign-in?withOtp=true"], } export const minPasswordLength = 8 diff --git a/packages/app/src/lib/auth/handle-sign.ts b/packages/app/src/lib/auth/handle-sign.ts index 55806dc2..dddfaf6e 100644 --- a/packages/app/src/lib/auth/handle-sign.ts +++ b/packages/app/src/lib/auth/handle-sign.ts @@ -7,8 +7,8 @@ import * as z from "zod" import { logger } from "@lib/logger" +import { signInSchema } from "../../api/auth/schemas" import { TDictionary } from "../langs" -import { signInSchema } from "../schemas/auth" export const handleSignError = (error: string, dictionary: TDictionary) => { if (error == "OAuthAccountNotLinked") { @@ -46,8 +46,10 @@ export const handleSignIn = async ({ if (!res?.error) { logger.debug("Sign in successful pushing to", callbackUrl) router.push(callbackUrl) + /* //? Refreshing the router is necessary due to next.js client cache, see: https://nextjs.org/docs/app/building-your-application/caching - router.refresh() + // router.refresh() + */ resolve() } else { if (res.error === "OTP_REQUIRED") { diff --git a/packages/app/src/lib/auth/index.ts b/packages/app/src/lib/auth/index.ts index 92cbd098..18878bf1 100644 --- a/packages/app/src/lib/auth/index.ts +++ b/packages/app/src/lib/auth/index.ts @@ -1,7 +1,7 @@ import { NextAuthOptions, Session } from "next-auth" -import { Provider } from "next-auth/providers" import Credentials from "next-auth/providers/credentials" import GithubProvider from "next-auth/providers/github" +import { Provider } from "next-auth/providers/index" import { randomUUID } from "crypto" import { env } from "env.mjs" import { i18n, Locale } from "i18n-config" @@ -14,12 +14,12 @@ import { isPossiblyUndefined, ITrpcContext } from "@/types" import { logger } from "@lib/logger" import { PrismaAdapter } from "@next-auth/prisma-adapter" +import { signInSchema } from "../../api/auth/schemas" +import { sessionsSchema } from "../../api/me/schemas" import { bcryptCompare } from "../bcrypt" import { getDictionary, TDictionary } from "../langs" import { prisma } from "../prisma" import { redis } from "../redis" -import { signInSchema } from "../schemas/auth" -import { sessionsSchema } from "../schemas/user" import { ensureRelativeUrl } from "../utils" import { authRoutes, JWT_MAX_AGE } from "./constants" diff --git a/packages/app/src/lib/json-api.ts b/packages/app/src/lib/json-api.ts deleted file mode 100644 index 9a864f04..00000000 --- a/packages/app/src/lib/json-api.ts +++ /dev/null @@ -1,178 +0,0 @@ -import { z } from "zod" - -import { defaultMaxPerPage } from "@/types/constants" -import { logger } from "@lib/logger" - -import { TDictionary } from "./langs" - -export type IMeta = { - total: number - page: number - perPage: number - totalPages: number -} - -export type ILinks = { - first: string - last: string - prev: string - next: string - self: string -} - -export type IJsonApiErrorSchema = { - status: string - title: string - detail: string -} - -export type IJsonApiResponse = { - errors?: IJsonApiErrorSchema[] - data?: T[] - meta: IMeta - links?: ILinks -} - -export const jsonApiResponseSchema = () => - z.object({ - errors: z - .array( - z.object({ - status: z.string(), - title: z.string(), - detail: z.string(), - }) - ) - .optional(), - data: z.array(z.unknown()).optional(), - meta: z.object({ - total: z.number(), - page: z.number(), - perPage: z.number(), - totalPages: z.number(), - }), - links: z - .object({ - first: z.string(), - last: z.string(), - prev: z.string(), - next: z.string(), - self: z.string(), - }) - .optional(), - }) - -export type IJsonApiQuery = { - page?: number - perPage?: number - sort?: { - field: string - direction: "asc" | "desc" - }[] - filter?: { - field: string - operator: string - value: string - }[] - include?: string[] - fields?: string[] -} - -export const jsonApiQuerySchema = ( - dictionary?: TDictionary, - { - maxPerPage = defaultMaxPerPage, - }: { - maxPerPage?: number - } = {} -) => - z.object({ - page: z - .number({ - invalid_type_error: dictionary?.errors.typeError.number.invalid, - required_error: dictionary?.errors.typeError.number.required, - }) - .positive() - .int() - .optional(), - perPage: z - .number({ - invalid_type_error: dictionary?.errors.typeError.number.invalid, - required_error: dictionary?.errors.typeError.number.required, - }) - .positive() - .int() - .transform((value) => { - if (value > maxPerPage) { - logger.warn(`perPage value ${value} is greater than maxPerPage ${maxPerPage}.`) - return maxPerPage - } - return value - }) - .optional(), - sort: z - .array( - z.object({ - field: z.string({ - invalid_type_error: dictionary?.errors.typeError.string.invalid, - required_error: dictionary?.errors.typeError.string.required, - }), - direction: z.enum(["asc", "desc"]), - }) - ) - .optional(), - filter: z - .object({ - field: z.string({ - invalid_type_error: dictionary?.errors.typeError.string.invalid, - required_error: dictionary?.errors.typeError.string.required, - }), - operator: z.string({ - invalid_type_error: dictionary?.errors.typeError.string.invalid, - required_error: dictionary?.errors.typeError.string.required, - }), - value: z - .string({ - invalid_type_error: dictionary?.errors.typeError.string.invalid, - required_error: dictionary?.errors.typeError.string.required, - }) - .optional(), - }) - .optional(), - include: z - .array( - z.string({ - invalid_type_error: dictionary?.errors.typeError.string.invalid, - required_error: dictionary?.errors.typeError.string.required, - }) - ) - .optional(), - fields: z - .array( - z.string({ - invalid_type_error: dictionary?.errors.typeError.string.invalid, - required_error: dictionary?.errors.typeError.string.required, - }) - ) - .optional(), - }) - -const defaultPerPage = 10 - -export const getJsonApiSkip = (opts?: Pick) => { - return (opts?.perPage ?? defaultPerPage) * ((opts?.page ?? 1) - 1) -} - -export const getJsonApiTake = (opts?: Pick) => { - return opts?.perPage ?? defaultPerPage -} - -export const getJsonApiSort = (opts?: Pick) => { - if (!opts?.sort) return undefined - - return opts.sort.map((sort) => { - const direction = sort.direction - const field = sort.field - return { [field]: direction } - }) -} diff --git a/packages/app/src/lib/mailer.ts b/packages/app/src/lib/mailer.ts index dfd0ddd3..b1077e45 100644 --- a/packages/app/src/lib/mailer.ts +++ b/packages/app/src/lib/mailer.ts @@ -5,8 +5,6 @@ import { logger } from "@lib/logger" import { ApiError } from "./utils/server-utils" -import "server-only" - export const configOptions = { port: env.SMTP_PORT, host: env.SMTP_HOST, diff --git a/packages/app/src/lib/queries-options.ts b/packages/app/src/lib/queries-options.ts new file mode 100644 index 00000000..fffd45ab --- /dev/null +++ b/packages/app/src/lib/queries-options.ts @@ -0,0 +1,42 @@ +import { z } from "zod" + +import { logger } from "@lib/logger" + +import { TDictionary } from "./langs" + +export const queriesOptionPage = (dictionary?: TDictionary) => + z + .number({ + invalid_type_error: dictionary?.errors.typeError.number.invalid, + required_error: dictionary?.errors.typeError.number.required, + }) + .positive() + .int() + +export const queriesOptionPerPage = (dictionary?: TDictionary) => + z + .number({ + invalid_type_error: dictionary?.errors.typeError.number.invalid, + required_error: dictionary?.errors.typeError.number.required, + }) + .positive() + .int() + .transform((value) => { + const maxPerPage = 20 + if (value > maxPerPage) { + logger.debug(`perPage value ${value} is greater than maxPerPage ${maxPerPage}.`) + return maxPerPage + } + return value + }) + +export const queriesOptionSort = (dictionary?: TDictionary) => + z.array( + z.object({ + field: z.string({ + invalid_type_error: dictionary?.errors.typeError.string.invalid, + required_error: dictionary?.errors.typeError.string.required, + }), + direction: z.enum(["asc", "desc"]), + }) + ) diff --git a/packages/app/src/lib/redis.ts b/packages/app/src/lib/redis.ts index 132ed5d4..0beb322f 100644 --- a/packages/app/src/lib/redis.ts +++ b/packages/app/src/lib/redis.ts @@ -1,6 +1,4 @@ -import Redis, { ChainableCommander, RedisOptions } from "ioredis" - -import { logger } from "@lib/logger" +import Redis, { RedisOptions } from "ioredis" const options: RedisOptions = { host: process.env.REDIS_HOST, @@ -11,69 +9,3 @@ const options: RedisOptions = { } export const redis = new Redis(options) - -export const redisKeyUtils = {} - -export const redisGetSert = async ( - keyInfo: { - key: string - groups?: string[] | ((value: Awaited) => string[]) - }, - callback: () => T, - options: { - expiration?: number - logWhenCached?: boolean - disableSWR?: boolean - } = { - expiration: undefined, - logWhenCached: false, - disableSWR: false, - } -): Promise => { - const value = await redis.get(keyInfo.key) - const executeCallback = async () => { - const callbackValue = typeof callback === "function" ? await callback() : callback - await redis.set(keyInfo.key, JSON.stringify(callbackValue), "EX", options.expiration ?? 60 * 5) - if (keyInfo.groups) { - if (typeof keyInfo.groups === "function") await redis.sadd("group_" + keyInfo.groups(callbackValue), keyInfo.key) - else - for (const group of keyInfo.groups) { - await redis.sadd("group_" + group, keyInfo.key) - } - } - return callbackValue - } - if (value) { - if (options.logWhenCached) logger.log("Redis value retrieved. key:", keyInfo.key, " value:", value) - if (!options.disableSWR) executeCallback() - return JSON.parse(value) as T - } - return executeCallback() -} - -export const redisDelete = async ( - groupOrKey: string | string[], - pipeline?: ChainableCommander, - { - forceExec, - }: { - forceExec?: boolean - } = {} -) => { - const redisPipeline = pipeline ?? redis.pipeline() - if (Array.isArray(groupOrKey)) { - await Promise.all( - groupOrKey.map(async (key) => - redisDelete(key, redisPipeline, { - forceExec: true, - }) - ) - ) - return - } - const keys = await redis.smembers("group_" + groupOrKey) - redisPipeline.del(...keys) - redisPipeline.del(groupOrKey) - - if (forceExec || !pipeline) await redisPipeline.exec() -} diff --git a/packages/app/src/lib/server/trpc.ts b/packages/app/src/lib/server/trpc.ts index 43cf1559..732d4f0d 100644 --- a/packages/app/src/lib/server/trpc.ts +++ b/packages/app/src/lib/server/trpc.ts @@ -7,7 +7,6 @@ import { getAuthApi } from "@/components/auth/require-auth" import { User } from "@prisma/client" import { initTRPC } from "@trpc/server" -import { prisma } from "../prisma" import { Context } from "../trpc/context" import { ApiError } from "../utils/server-utils" @@ -32,6 +31,7 @@ const t = initTRPC.context().create({ * Export reusable router and procedure helpers * that can be used throughout the router */ +export const createCallerFactory = t.createCallerFactory export const router = t.router export const middleware = t.middleware export const publicProcedure = t.procedure @@ -42,19 +42,10 @@ const isAuthenticated = middleware(async (opts) => { ApiError("unauthorized", "UNAUTHORIZED") } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { password, ...user } = await prisma.user.findFirstOrThrow({ - where: { - email: session.user.email, - }, - }) return opts.next({ ctx: { ...opts.ctx, - session: { - ...session, - user, - } as Session & { user: Omit }, + session, }, }) }) diff --git a/packages/app/src/lib/trpc/server.ts b/packages/app/src/lib/trpc/server.ts index 3de74cea..de3a9db8 100644 --- a/packages/app/src/lib/trpc/server.ts +++ b/packages/app/src/lib/trpc/server.ts @@ -1,8 +1,9 @@ import { appRouter } from "../../api/_app" +import { createCallerFactory } from "../server/trpc" import { createContext } from "./context" /** * This client invokes procedures directly on the server without fetching over HTTP. */ -export const serverTrpc = appRouter.createCaller(createContext()) +export const serverTrpc = createCallerFactory(appRouter)(createContext()) diff --git a/packages/app/src/lib/utils/index.ts b/packages/app/src/lib/utils/index.ts index 05f35d92..751895e8 100644 --- a/packages/app/src/lib/utils/index.ts +++ b/packages/app/src/lib/utils/index.ts @@ -2,11 +2,11 @@ import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.share import { type ClassValue, clsx } from "clsx" import { twMerge } from "tailwind-merge" +import { authRoutes } from "@/lib/auth/constants" import { logger } from "@lib/logger" import { TRPCClientErrorLike } from "@trpc/client" import { AppRouter } from "../../api/_app" -import { authRoutes } from "../auth/constants" import { TDictionary } from "../langs" import { TErrorMessage } from "./server-utils" diff --git a/packages/app/src/lib/utils/server-utils.ts b/packages/app/src/lib/utils/server-utils.ts index eb860d8e..aac12924 100644 --- a/packages/app/src/lib/utils/server-utils.ts +++ b/packages/app/src/lib/utils/server-utils.ts @@ -10,8 +10,6 @@ import { TRPC_ERROR_CODE_KEY } from "@trpc/server/rpc" import { TDictionary } from "../langs" -import "server-only" - export const parseRequestBody = async ( req: Request, schema: z.Schema diff --git a/packages/app/tailwind.config.js b/packages/app/tailwind.config.js index 8ef1fa12..8b349228 100644 --- a/packages/app/tailwind.config.js +++ b/packages/app/tailwind.config.js @@ -19,14 +19,14 @@ module.exports = { themes: { light: { colors: { - muted: "#f1f5f9", - "muted-foreground": "#64748b", + muted: "#f4f4f5", + "muted-foreground": "#71717a", }, }, dark: { colors: { - muted: "#1e293b", - "muted-foreground": "#94a3b8", + muted: "#27272a", + "muted-foreground": "#a1a1aa", }, }, }, diff --git a/packages/app/tsconfig.json b/packages/app/tsconfig.json index 6cdb00ee..c207b06e 100644 --- a/packages/app/tsconfig.json +++ b/packages/app/tsconfig.json @@ -11,7 +11,7 @@ "noEmit": true, "esModuleInterop": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "Bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", diff --git a/packages/landing/package.json b/packages/landing/package.json index ce579255..9ade6f4e 100644 --- a/packages/landing/package.json +++ b/packages/landing/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@formatjs/intl-localematcher": "^0.5.0", - "@t3-oss/env-nextjs": "^0.9.0", + "@t3-oss/env-nextjs": "^0.9.2", "@total-typescript/ts-reset": "^0.5.0", "@types/negotiator": "^0.6.3", "@types/react-dom": "^18.2.7", diff --git a/packages/landing/tsconfig.json b/packages/landing/tsconfig.json index 6cdb00ee..c207b06e 100644 --- a/packages/landing/tsconfig.json +++ b/packages/landing/tsconfig.json @@ -11,7 +11,7 @@ "noEmit": true, "esModuleInterop": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "Bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", diff --git a/packages/lib/logger.ts b/packages/lib/logger.ts index 37cccfc2..31197832 100644 --- a/packages/lib/logger.ts +++ b/packages/lib/logger.ts @@ -23,7 +23,7 @@ const printColor = // eslint-disable-next-line @typescript-eslint/no-explicit-any .map((arg: any) => { if (typeof arg === "object") { - return JSON.stringify(arg, null, 2) + return arg.toString() } return arg })