diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 598842f9..2fba4b49 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -84,6 +84,31 @@ "fast-uri": "^2.0.0" } }, + "node_modules/@adminjs/fastify/node_modules/@fastify/formbody": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@fastify/formbody/-/formbody-7.4.0.tgz", + "integrity": "sha512-H3C6h1GN56/SMrZS8N2vCT2cZr7mIHzBHzOBa5OPpjfB/D6FzP9mMpE02ZzrFX0ANeh0BAJdoXKOF2e7IbV+Og==", + "dependencies": { + "fast-querystring": "^1.0.0", + "fastify-plugin": "^4.0.0" + } + }, + "node_modules/@adminjs/fastify/node_modules/@fastify/multipart": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/@fastify/multipart/-/multipart-7.7.3.tgz", + "integrity": "sha512-MG4Gd9FNEXc8qx0OgqoXM10EGO/dN/0iVQ8SrpFMU3d6F6KUfcqD2ZyoQhkm9LWrbiMgdHv5a43x78lASdn5GA==", + "dependencies": { + "@fastify/busboy": "^1.0.0", + "@fastify/deepmerge": "^1.0.0", + "@fastify/error": "^3.0.0", + "@fastify/swagger": "^8.3.1", + "@fastify/swagger-ui": "^1.8.0", + "end-of-stream": "^1.4.4", + "fastify-plugin": "^4.0.0", + "secure-json-parse": "^2.4.0", + "stream-wormhole": "^1.1.0" + } + }, "node_modules/@adminjs/fastify/node_modules/avvio": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/avvio/-/avvio-8.2.0.tgz", @@ -2170,6 +2195,14 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.47.tgz", "integrity": "sha512-OuJi8bIng4wYHHA3YpKauL58dZrPxro3d0tabPHyiNF8rKfGKuVfr83oFlPLmKri1cX+Z3cJP39GXmnqkP11Gw==" }, + "node_modules/@fastify/accept-negotiator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-1.1.0.tgz", + "integrity": "sha512-OIHZrb2ImZ7XG85HXOONLcJWGosv7sIvM2ifAPQVhg9Lv7qdmMBNVaai4QTdyuaqbKM5eO6sLSQOYI7wEQeCJQ==", + "engines": { + "node": ">=14" + } + }, "node_modules/@fastify/ajv-compiler": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-1.1.0.tgz", @@ -2264,14 +2297,29 @@ } }, "node_modules/@fastify/formbody": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@fastify/formbody/-/formbody-7.4.0.tgz", - "integrity": "sha512-H3C6h1GN56/SMrZS8N2vCT2cZr7mIHzBHzOBa5OPpjfB/D6FzP9mMpE02ZzrFX0ANeh0BAJdoXKOF2e7IbV+Og==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@fastify/formbody/-/formbody-8.0.2.tgz", + "integrity": "sha512-84v5J2KrkXzjgBpYnaNRPqwgMsmY7ZDjuj0YVuMR3NXCJRCgKEZy/taSP1wUYGn0onfxJpLyRGDLa+NMaDJtnA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], "dependencies": { - "fast-querystring": "^1.0.0", - "fastify-plugin": "^4.0.0" + "fast-querystring": "^1.1.2", + "fastify-plugin": "^5.0.0" } }, + "node_modules/@fastify/formbody/node_modules/fastify-plugin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-5.0.1.tgz", + "integrity": "sha512-HCxs+YnRaWzCl+cWRYFnHmeRFyR5GVnJTAaCJQiYzQSDwK9MgJdyAsuL3nh0EWRCYMgQ5MeziymvmAhUHYHDUQ==" + }, "node_modules/@fastify/jwt": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@fastify/jwt/-/jwt-6.5.0.tgz", @@ -2285,18 +2333,103 @@ } }, "node_modules/@fastify/multipart": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@fastify/multipart/-/multipart-7.3.0.tgz", - "integrity": "sha512-tbzQiRFxoADCn0G10CqiQ/nDWWcfegtwg826Pfz2h7+XvuqJhGnko0TbafrWIY7hnGD+sNCGMdiTVsxxs6zigA==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/@fastify/multipart/-/multipart-9.0.3.tgz", + "integrity": "sha512-pJogxQCrT12/6I5Fh6jr3narwcymA0pv4B0jbC7c6Bl9wnrxomEUnV0d26w6gUls7gSXmhG8JGRMmHFIPsxt1g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], "dependencies": { - "@fastify/busboy": "^1.0.0", - "@fastify/deepmerge": "^1.0.0", - "@fastify/error": "^3.0.0", - "end-of-stream": "^1.4.4", - "fastify-plugin": "^4.0.0", - "hexoid": "^1.0.0", - "secure-json-parse": "^2.4.0", - "stream-wormhole": "^1.1.0" + "@fastify/busboy": "^3.0.0", + "@fastify/deepmerge": "^2.0.0", + "@fastify/error": "^4.0.0", + "fastify-plugin": "^5.0.0", + "secure-json-parse": "^3.0.0" + } + }, + "node_modules/@fastify/multipart/node_modules/@fastify/busboy": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-3.2.0.tgz", + "integrity": "sha512-m9FVDXU3GT2ITSe0UaMA5rU3QkfC/UXtCU8y0gSN/GugTqtVldOBWIB5V6V3sbmenVZUIpU6f+mPEO2+m5iTaA==" + }, + "node_modules/@fastify/multipart/node_modules/@fastify/deepmerge": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-2.0.2.tgz", + "integrity": "sha512-3wuLdX5iiiYeZWP6bQrjqhrcvBIf0NHbQH1Ur1WbHvoiuTYUEItgygea3zs8aHpiitn0lOB8gX20u1qO+FDm7Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/@fastify/multipart/node_modules/@fastify/error": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-4.2.0.tgz", + "integrity": "sha512-RSo3sVDXfHskiBZKBPRgnQTtIqpi/7zhJOEmAxCiBcM7d0uwdGdxLlsCaLzGs8v8NnxIRlfG0N51p5yFaOentQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/@fastify/multipart/node_modules/fastify-plugin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-5.0.1.tgz", + "integrity": "sha512-HCxs+YnRaWzCl+cWRYFnHmeRFyR5GVnJTAaCJQiYzQSDwK9MgJdyAsuL3nh0EWRCYMgQ5MeziymvmAhUHYHDUQ==" + }, + "node_modules/@fastify/multipart/node_modules/secure-json-parse": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-3.0.2.tgz", + "integrity": "sha512-H6nS2o8bWfpFEV6U38sOSjS7bTbdgbCGU9wEM6W14P5H0QOsz94KCusifV44GpHDTu2nqZbuDNhTzu+mjDSw1w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/@fastify/send": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@fastify/send/-/send-2.1.0.tgz", + "integrity": "sha512-yNYiY6sDkexoJR0D8IDy3aRP3+L4wdqCpvx5WP+VtEU58sn7USmKynBzDQex5X42Zzvw2gNzzYgP90UfWShLFA==", + "dependencies": { + "@lukeed/ms": "^2.0.1", + "escape-html": "~1.0.3", + "fast-decode-uri-component": "^1.0.1", + "http-errors": "2.0.0", + "mime": "^3.0.0" + } + }, + "node_modules/@fastify/send/node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" } }, "node_modules/@fastify/session": { @@ -2315,6 +2448,129 @@ "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-3.0.1.tgz", "integrity": "sha512-qKcDXmuZadJqdTm6vlCqioEbyewF60b/0LOFCcYN1B6BIZGlYJumWWOYs70SFYLDAH4YqdE1cxH/RKMG7rFxgA==" }, + "node_modules/@fastify/static": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@fastify/static/-/static-6.12.0.tgz", + "integrity": "sha512-KK1B84E6QD/FcQWxDI2aiUCwHxMJBI1KeCUzm1BwYpPY1b742+jeKruGHP2uOluuM6OkBPI8CIANrXcCRtC2oQ==", + "dependencies": { + "@fastify/accept-negotiator": "^1.0.0", + "@fastify/send": "^2.0.0", + "content-disposition": "^0.5.3", + "fastify-plugin": "^4.0.0", + "glob": "^8.0.1", + "p-limit": "^3.1.0" + } + }, + "node_modules/@fastify/static/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@fastify/static/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@fastify/static/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@fastify/swagger": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@fastify/swagger/-/swagger-8.15.0.tgz", + "integrity": "sha512-zy+HEEKFqPMS2sFUsQU5X0MHplhKJvWeohBwTCkBAJA/GDYGLGUWQaETEhptiqxK7Hs0fQB9B4MDb3pbwIiCwA==", + "dependencies": { + "fastify-plugin": "^4.0.0", + "json-schema-resolver": "^2.0.0", + "openapi-types": "^12.0.0", + "rfdc": "^1.3.0", + "yaml": "^2.2.2" + } + }, + "node_modules/@fastify/swagger-ui": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@fastify/swagger-ui/-/swagger-ui-1.10.2.tgz", + "integrity": "sha512-f2mRqtblm6eRAFQ3e8zSngxVNEtiYY7rISKQVjPA++ZsWc5WYlPVTb6Bx0G/zy0BIoucNqDr/Q2Vb/kTYkOq1A==", + "dependencies": { + "@fastify/static": "^6.0.0", + "fastify-plugin": "^4.0.0", + "openapi-types": "^12.0.2", + "rfdc": "^1.3.0", + "yaml": "^2.2.2" + } + }, + "node_modules/@fastify/swagger-ui/node_modules/openapi-types": { + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==" + }, + "node_modules/@fastify/swagger-ui/node_modules/yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } + }, + "node_modules/@fastify/swagger/node_modules/json-schema-resolver": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/json-schema-resolver/-/json-schema-resolver-2.0.0.tgz", + "integrity": "sha512-pJ4XLQP4Q9HTxl6RVDLJ8Cyh1uitSs0CzDBAz1uoJ4sRD/Bk7cFSXL1FUXDW3zJ7YnfliJx6eu8Jn283bpZ4Yg==", + "dependencies": { + "debug": "^4.1.1", + "rfdc": "^1.1.4", + "uri-js": "^4.2.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/Eomm/json-schema-resolver?sponsor=1" + } + }, + "node_modules/@fastify/swagger/node_modules/openapi-types": { + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==" + }, + "node_modules/@fastify/swagger/node_modules/yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } + }, "node_modules/@fastify/view": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/@fastify/view/-/view-7.3.0.tgz", @@ -5727,9 +5983,9 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, "node_modules/fast-querystring": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.0.0.tgz", - "integrity": "sha512-3LQi62IhQoDlmt4ULCYmh17vRO2EtS7hTSsG4WwoKWgV7GLMKBOecEh+aiavASnLx8I2y89OD33AGLo0ccRhzA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz", + "integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==", "dependencies": { "fast-decode-uri-component": "^1.0.1" } @@ -6063,6 +6319,7 @@ "version": "5.4.0", "resolved": "https://registry.npmjs.org/fastify-multipart/-/fastify-multipart-5.4.0.tgz", "integrity": "sha512-Pafy4mtcuFUnFM/t0kgCdL854KIEoDymNVdv4nD7uBfV7lBCQq/NVEuNnaNXAbuCTpeXzYRzi50lSDa9ZM838A==", + "deprecated": "Please use @fastify/multipart@6.0.0 instead", "dependencies": { "fastify-multipart-deprecated": "npm:fastify-multipart@5.3.1", "process-warning": "^1.0.0" @@ -9093,9 +9350,10 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/multer": { - "version": "1.4.5-lts.1", - "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", - "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==", + "version": "1.4.5-lts.2", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz", + "integrity": "sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==", + "deprecated": "Multer 1.x is impacted by a number of vulnerabilities, which have been patched in 2.x. You should upgrade to the latest 2.x version.", "dependencies": { "append-field": "^1.0.0", "busboy": "^1.0.0", diff --git a/package-lock.json b/package-lock.json index e168fafe..76d1ef9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,9 @@ "@adminjs/fastify": "^3.0.1", "@adminjs/mongoose": "^3.0.1", "@fastify/env": "^3.0.0", + "@fastify/formbody": "^8.0.2", "@fastify/jwt": "^6.5.0", + "@fastify/multipart": "^9.0.3", "@fastify/view": "^7.1.2", "@google-cloud/storage": "^6.10.1", "adminjs": "^6.7.2", @@ -35,7 +37,7 @@ "fastify-file-upload": "^4.0.0", "fastify-formbody": "^5.3.0", "fastify-jwt": "^4.2.0", - "fastify-multer": "^2.0.2", + "fastify-multer": "^2.0.3", "fastify-multipart": "^5.4.0", "fastify-static": "^4.7.0", "fastify-swagger": "^5.2.0", @@ -149,6 +151,31 @@ "fast-uri": "^2.0.0" } }, + "node_modules/@adminjs/fastify/node_modules/@fastify/formbody": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@fastify/formbody/-/formbody-7.4.0.tgz", + "integrity": "sha512-H3C6h1GN56/SMrZS8N2vCT2cZr7mIHzBHzOBa5OPpjfB/D6FzP9mMpE02ZzrFX0ANeh0BAJdoXKOF2e7IbV+Og==", + "dependencies": { + "fast-querystring": "^1.0.0", + "fastify-plugin": "^4.0.0" + } + }, + "node_modules/@adminjs/fastify/node_modules/@fastify/multipart": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/@fastify/multipart/-/multipart-7.7.3.tgz", + "integrity": "sha512-MG4Gd9FNEXc8qx0OgqoXM10EGO/dN/0iVQ8SrpFMU3d6F6KUfcqD2ZyoQhkm9LWrbiMgdHv5a43x78lASdn5GA==", + "dependencies": { + "@fastify/busboy": "^1.0.0", + "@fastify/deepmerge": "^1.0.0", + "@fastify/error": "^3.0.0", + "@fastify/swagger": "^8.3.1", + "@fastify/swagger-ui": "^1.8.0", + "end-of-stream": "^1.4.4", + "fastify-plugin": "^4.0.0", + "secure-json-parse": "^2.4.0", + "stream-wormhole": "^1.1.0" + } + }, "node_modules/@adminjs/fastify/node_modules/avvio": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/avvio/-/avvio-8.2.0.tgz", @@ -2235,6 +2262,14 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.47.tgz", "integrity": "sha512-OuJi8bIng4wYHHA3YpKauL58dZrPxro3d0tabPHyiNF8rKfGKuVfr83oFlPLmKri1cX+Z3cJP39GXmnqkP11Gw==" }, + "node_modules/@fastify/accept-negotiator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-1.1.0.tgz", + "integrity": "sha512-OIHZrb2ImZ7XG85HXOONLcJWGosv7sIvM2ifAPQVhg9Lv7qdmMBNVaai4QTdyuaqbKM5eO6sLSQOYI7wEQeCJQ==", + "engines": { + "node": ">=14" + } + }, "node_modules/@fastify/ajv-compiler": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-1.1.0.tgz", @@ -2329,14 +2364,29 @@ } }, "node_modules/@fastify/formbody": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@fastify/formbody/-/formbody-7.4.0.tgz", - "integrity": "sha512-H3C6h1GN56/SMrZS8N2vCT2cZr7mIHzBHzOBa5OPpjfB/D6FzP9mMpE02ZzrFX0ANeh0BAJdoXKOF2e7IbV+Og==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@fastify/formbody/-/formbody-8.0.2.tgz", + "integrity": "sha512-84v5J2KrkXzjgBpYnaNRPqwgMsmY7ZDjuj0YVuMR3NXCJRCgKEZy/taSP1wUYGn0onfxJpLyRGDLa+NMaDJtnA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], "dependencies": { - "fast-querystring": "^1.0.0", - "fastify-plugin": "^4.0.0" + "fast-querystring": "^1.1.2", + "fastify-plugin": "^5.0.0" } }, + "node_modules/@fastify/formbody/node_modules/fastify-plugin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-5.0.1.tgz", + "integrity": "sha512-HCxs+YnRaWzCl+cWRYFnHmeRFyR5GVnJTAaCJQiYzQSDwK9MgJdyAsuL3nh0EWRCYMgQ5MeziymvmAhUHYHDUQ==" + }, "node_modules/@fastify/jwt": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@fastify/jwt/-/jwt-6.5.0.tgz", @@ -2350,18 +2400,103 @@ } }, "node_modules/@fastify/multipart": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@fastify/multipart/-/multipart-7.3.0.tgz", - "integrity": "sha512-tbzQiRFxoADCn0G10CqiQ/nDWWcfegtwg826Pfz2h7+XvuqJhGnko0TbafrWIY7hnGD+sNCGMdiTVsxxs6zigA==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/@fastify/multipart/-/multipart-9.0.3.tgz", + "integrity": "sha512-pJogxQCrT12/6I5Fh6jr3narwcymA0pv4B0jbC7c6Bl9wnrxomEUnV0d26w6gUls7gSXmhG8JGRMmHFIPsxt1g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], "dependencies": { - "@fastify/busboy": "^1.0.0", - "@fastify/deepmerge": "^1.0.0", - "@fastify/error": "^3.0.0", - "end-of-stream": "^1.4.4", - "fastify-plugin": "^4.0.0", - "hexoid": "^1.0.0", - "secure-json-parse": "^2.4.0", - "stream-wormhole": "^1.1.0" + "@fastify/busboy": "^3.0.0", + "@fastify/deepmerge": "^2.0.0", + "@fastify/error": "^4.0.0", + "fastify-plugin": "^5.0.0", + "secure-json-parse": "^3.0.0" + } + }, + "node_modules/@fastify/multipart/node_modules/@fastify/busboy": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-3.2.0.tgz", + "integrity": "sha512-m9FVDXU3GT2ITSe0UaMA5rU3QkfC/UXtCU8y0gSN/GugTqtVldOBWIB5V6V3sbmenVZUIpU6f+mPEO2+m5iTaA==" + }, + "node_modules/@fastify/multipart/node_modules/@fastify/deepmerge": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-2.0.2.tgz", + "integrity": "sha512-3wuLdX5iiiYeZWP6bQrjqhrcvBIf0NHbQH1Ur1WbHvoiuTYUEItgygea3zs8aHpiitn0lOB8gX20u1qO+FDm7Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/@fastify/multipart/node_modules/@fastify/error": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-4.2.0.tgz", + "integrity": "sha512-RSo3sVDXfHskiBZKBPRgnQTtIqpi/7zhJOEmAxCiBcM7d0uwdGdxLlsCaLzGs8v8NnxIRlfG0N51p5yFaOentQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/@fastify/multipart/node_modules/fastify-plugin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-5.0.1.tgz", + "integrity": "sha512-HCxs+YnRaWzCl+cWRYFnHmeRFyR5GVnJTAaCJQiYzQSDwK9MgJdyAsuL3nh0EWRCYMgQ5MeziymvmAhUHYHDUQ==" + }, + "node_modules/@fastify/multipart/node_modules/secure-json-parse": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-3.0.2.tgz", + "integrity": "sha512-H6nS2o8bWfpFEV6U38sOSjS7bTbdgbCGU9wEM6W14P5H0QOsz94KCusifV44GpHDTu2nqZbuDNhTzu+mjDSw1w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/@fastify/send": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@fastify/send/-/send-2.1.0.tgz", + "integrity": "sha512-yNYiY6sDkexoJR0D8IDy3aRP3+L4wdqCpvx5WP+VtEU58sn7USmKynBzDQex5X42Zzvw2gNzzYgP90UfWShLFA==", + "dependencies": { + "@lukeed/ms": "^2.0.1", + "escape-html": "~1.0.3", + "fast-decode-uri-component": "^1.0.1", + "http-errors": "2.0.0", + "mime": "^3.0.0" + } + }, + "node_modules/@fastify/send/node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" } }, "node_modules/@fastify/session": { @@ -2380,6 +2515,129 @@ "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-3.0.1.tgz", "integrity": "sha512-qKcDXmuZadJqdTm6vlCqioEbyewF60b/0LOFCcYN1B6BIZGlYJumWWOYs70SFYLDAH4YqdE1cxH/RKMG7rFxgA==" }, + "node_modules/@fastify/static": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@fastify/static/-/static-6.12.0.tgz", + "integrity": "sha512-KK1B84E6QD/FcQWxDI2aiUCwHxMJBI1KeCUzm1BwYpPY1b742+jeKruGHP2uOluuM6OkBPI8CIANrXcCRtC2oQ==", + "dependencies": { + "@fastify/accept-negotiator": "^1.0.0", + "@fastify/send": "^2.0.0", + "content-disposition": "^0.5.3", + "fastify-plugin": "^4.0.0", + "glob": "^8.0.1", + "p-limit": "^3.1.0" + } + }, + "node_modules/@fastify/static/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@fastify/static/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@fastify/static/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@fastify/swagger": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@fastify/swagger/-/swagger-8.15.0.tgz", + "integrity": "sha512-zy+HEEKFqPMS2sFUsQU5X0MHplhKJvWeohBwTCkBAJA/GDYGLGUWQaETEhptiqxK7Hs0fQB9B4MDb3pbwIiCwA==", + "dependencies": { + "fastify-plugin": "^4.0.0", + "json-schema-resolver": "^2.0.0", + "openapi-types": "^12.0.0", + "rfdc": "^1.3.0", + "yaml": "^2.2.2" + } + }, + "node_modules/@fastify/swagger-ui": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@fastify/swagger-ui/-/swagger-ui-1.10.2.tgz", + "integrity": "sha512-f2mRqtblm6eRAFQ3e8zSngxVNEtiYY7rISKQVjPA++ZsWc5WYlPVTb6Bx0G/zy0BIoucNqDr/Q2Vb/kTYkOq1A==", + "dependencies": { + "@fastify/static": "^6.0.0", + "fastify-plugin": "^4.0.0", + "openapi-types": "^12.0.2", + "rfdc": "^1.3.0", + "yaml": "^2.2.2" + } + }, + "node_modules/@fastify/swagger-ui/node_modules/openapi-types": { + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==" + }, + "node_modules/@fastify/swagger-ui/node_modules/yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } + }, + "node_modules/@fastify/swagger/node_modules/json-schema-resolver": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/json-schema-resolver/-/json-schema-resolver-2.0.0.tgz", + "integrity": "sha512-pJ4XLQP4Q9HTxl6RVDLJ8Cyh1uitSs0CzDBAz1uoJ4sRD/Bk7cFSXL1FUXDW3zJ7YnfliJx6eu8Jn283bpZ4Yg==", + "dependencies": { + "debug": "^4.1.1", + "rfdc": "^1.1.4", + "uri-js": "^4.2.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/Eomm/json-schema-resolver?sponsor=1" + } + }, + "node_modules/@fastify/swagger/node_modules/openapi-types": { + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==" + }, + "node_modules/@fastify/swagger/node_modules/yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } + }, "node_modules/@fastify/view": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/@fastify/view/-/view-7.3.0.tgz", @@ -5792,9 +6050,9 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, "node_modules/fast-querystring": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.0.0.tgz", - "integrity": "sha512-3LQi62IhQoDlmt4ULCYmh17vRO2EtS7hTSsG4WwoKWgV7GLMKBOecEh+aiavASnLx8I2y89OD33AGLo0ccRhzA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz", + "integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==", "dependencies": { "fast-decode-uri-component": "^1.0.1" } @@ -6128,6 +6386,7 @@ "version": "5.4.0", "resolved": "https://registry.npmjs.org/fastify-multipart/-/fastify-multipart-5.4.0.tgz", "integrity": "sha512-Pafy4mtcuFUnFM/t0kgCdL854KIEoDymNVdv4nD7uBfV7lBCQq/NVEuNnaNXAbuCTpeXzYRzi50lSDa9ZM838A==", + "deprecated": "Please use @fastify/multipart@6.0.0 instead", "dependencies": { "fastify-multipart-deprecated": "npm:fastify-multipart@5.3.1", "process-warning": "^1.0.0" @@ -9171,9 +9430,10 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/multer": { - "version": "1.4.5-lts.1", - "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", - "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==", + "version": "1.4.5-lts.2", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz", + "integrity": "sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==", + "deprecated": "Multer 1.x is impacted by a number of vulnerabilities, which have been patched in 2.x. You should upgrade to the latest 2.x version.", "dependencies": { "append-field": "^1.0.0", "busboy": "^1.0.0", @@ -12991,6 +13251,31 @@ "fast-uri": "^2.0.0" } }, + "@fastify/formbody": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@fastify/formbody/-/formbody-7.4.0.tgz", + "integrity": "sha512-H3C6h1GN56/SMrZS8N2vCT2cZr7mIHzBHzOBa5OPpjfB/D6FzP9mMpE02ZzrFX0ANeh0BAJdoXKOF2e7IbV+Og==", + "requires": { + "fast-querystring": "^1.0.0", + "fastify-plugin": "^4.0.0" + } + }, + "@fastify/multipart": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/@fastify/multipart/-/multipart-7.7.3.tgz", + "integrity": "sha512-MG4Gd9FNEXc8qx0OgqoXM10EGO/dN/0iVQ8SrpFMU3d6F6KUfcqD2ZyoQhkm9LWrbiMgdHv5a43x78lASdn5GA==", + "requires": { + "@fastify/busboy": "^1.0.0", + "@fastify/deepmerge": "^1.0.0", + "@fastify/error": "^3.0.0", + "@fastify/swagger": "^8.3.1", + "@fastify/swagger-ui": "^1.8.0", + "end-of-stream": "^1.4.4", + "fastify-plugin": "^4.0.0", + "secure-json-parse": "^2.4.0", + "stream-wormhole": "^1.1.0" + } + }, "avvio": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/avvio/-/avvio-8.2.0.tgz", @@ -14471,6 +14756,11 @@ } } }, + "@fastify/accept-negotiator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-1.1.0.tgz", + "integrity": "sha512-OIHZrb2ImZ7XG85HXOONLcJWGosv7sIvM2ifAPQVhg9Lv7qdmMBNVaai4QTdyuaqbKM5eO6sLSQOYI7wEQeCJQ==" + }, "@fastify/ajv-compiler": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-1.1.0.tgz", @@ -14564,12 +14854,19 @@ } }, "@fastify/formbody": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@fastify/formbody/-/formbody-7.4.0.tgz", - "integrity": "sha512-H3C6h1GN56/SMrZS8N2vCT2cZr7mIHzBHzOBa5OPpjfB/D6FzP9mMpE02ZzrFX0ANeh0BAJdoXKOF2e7IbV+Og==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@fastify/formbody/-/formbody-8.0.2.tgz", + "integrity": "sha512-84v5J2KrkXzjgBpYnaNRPqwgMsmY7ZDjuj0YVuMR3NXCJRCgKEZy/taSP1wUYGn0onfxJpLyRGDLa+NMaDJtnA==", "requires": { - "fast-querystring": "^1.0.0", - "fastify-plugin": "^4.0.0" + "fast-querystring": "^1.1.2", + "fastify-plugin": "^5.0.0" + }, + "dependencies": { + "fastify-plugin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-5.0.1.tgz", + "integrity": "sha512-HCxs+YnRaWzCl+cWRYFnHmeRFyR5GVnJTAaCJQiYzQSDwK9MgJdyAsuL3nh0EWRCYMgQ5MeziymvmAhUHYHDUQ==" + } } }, "@fastify/jwt": { @@ -14585,18 +14882,61 @@ } }, "@fastify/multipart": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@fastify/multipart/-/multipart-7.3.0.tgz", - "integrity": "sha512-tbzQiRFxoADCn0G10CqiQ/nDWWcfegtwg826Pfz2h7+XvuqJhGnko0TbafrWIY7hnGD+sNCGMdiTVsxxs6zigA==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/@fastify/multipart/-/multipart-9.0.3.tgz", + "integrity": "sha512-pJogxQCrT12/6I5Fh6jr3narwcymA0pv4B0jbC7c6Bl9wnrxomEUnV0d26w6gUls7gSXmhG8JGRMmHFIPsxt1g==", "requires": { - "@fastify/busboy": "^1.0.0", - "@fastify/deepmerge": "^1.0.0", - "@fastify/error": "^3.0.0", - "end-of-stream": "^1.4.4", - "fastify-plugin": "^4.0.0", - "hexoid": "^1.0.0", - "secure-json-parse": "^2.4.0", - "stream-wormhole": "^1.1.0" + "@fastify/busboy": "^3.0.0", + "@fastify/deepmerge": "^2.0.0", + "@fastify/error": "^4.0.0", + "fastify-plugin": "^5.0.0", + "secure-json-parse": "^3.0.0" + }, + "dependencies": { + "@fastify/busboy": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-3.2.0.tgz", + "integrity": "sha512-m9FVDXU3GT2ITSe0UaMA5rU3QkfC/UXtCU8y0gSN/GugTqtVldOBWIB5V6V3sbmenVZUIpU6f+mPEO2+m5iTaA==" + }, + "@fastify/deepmerge": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-2.0.2.tgz", + "integrity": "sha512-3wuLdX5iiiYeZWP6bQrjqhrcvBIf0NHbQH1Ur1WbHvoiuTYUEItgygea3zs8aHpiitn0lOB8gX20u1qO+FDm7Q==" + }, + "@fastify/error": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-4.2.0.tgz", + "integrity": "sha512-RSo3sVDXfHskiBZKBPRgnQTtIqpi/7zhJOEmAxCiBcM7d0uwdGdxLlsCaLzGs8v8NnxIRlfG0N51p5yFaOentQ==" + }, + "fastify-plugin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-5.0.1.tgz", + "integrity": "sha512-HCxs+YnRaWzCl+cWRYFnHmeRFyR5GVnJTAaCJQiYzQSDwK9MgJdyAsuL3nh0EWRCYMgQ5MeziymvmAhUHYHDUQ==" + }, + "secure-json-parse": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-3.0.2.tgz", + "integrity": "sha512-H6nS2o8bWfpFEV6U38sOSjS7bTbdgbCGU9wEM6W14P5H0QOsz94KCusifV44GpHDTu2nqZbuDNhTzu+mjDSw1w==" + } + } + }, + "@fastify/send": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@fastify/send/-/send-2.1.0.tgz", + "integrity": "sha512-yNYiY6sDkexoJR0D8IDy3aRP3+L4wdqCpvx5WP+VtEU58sn7USmKynBzDQex5X42Zzvw2gNzzYgP90UfWShLFA==", + "requires": { + "@lukeed/ms": "^2.0.1", + "escape-html": "~1.0.3", + "fast-decode-uri-component": "^1.0.1", + "http-errors": "2.0.0", + "mime": "^3.0.0" + }, + "dependencies": { + "mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==" + } } }, "@fastify/session": { @@ -14617,6 +14957,107 @@ } } }, + "@fastify/static": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@fastify/static/-/static-6.12.0.tgz", + "integrity": "sha512-KK1B84E6QD/FcQWxDI2aiUCwHxMJBI1KeCUzm1BwYpPY1b742+jeKruGHP2uOluuM6OkBPI8CIANrXcCRtC2oQ==", + "requires": { + "@fastify/accept-negotiator": "^1.0.0", + "@fastify/send": "^2.0.0", + "content-disposition": "^0.5.3", + "fastify-plugin": "^4.0.0", + "glob": "^8.0.1", + "p-limit": "^3.1.0" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + } + }, + "minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, + "@fastify/swagger": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/@fastify/swagger/-/swagger-8.15.0.tgz", + "integrity": "sha512-zy+HEEKFqPMS2sFUsQU5X0MHplhKJvWeohBwTCkBAJA/GDYGLGUWQaETEhptiqxK7Hs0fQB9B4MDb3pbwIiCwA==", + "requires": { + "fastify-plugin": "^4.0.0", + "json-schema-resolver": "^2.0.0", + "openapi-types": "^12.0.0", + "rfdc": "^1.3.0", + "yaml": "^2.2.2" + }, + "dependencies": { + "json-schema-resolver": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/json-schema-resolver/-/json-schema-resolver-2.0.0.tgz", + "integrity": "sha512-pJ4XLQP4Q9HTxl6RVDLJ8Cyh1uitSs0CzDBAz1uoJ4sRD/Bk7cFSXL1FUXDW3zJ7YnfliJx6eu8Jn283bpZ4Yg==", + "requires": { + "debug": "^4.1.1", + "rfdc": "^1.1.4", + "uri-js": "^4.2.2" + } + }, + "openapi-types": { + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==" + }, + "yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==" + } + } + }, + "@fastify/swagger-ui": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/@fastify/swagger-ui/-/swagger-ui-1.10.2.tgz", + "integrity": "sha512-f2mRqtblm6eRAFQ3e8zSngxVNEtiYY7rISKQVjPA++ZsWc5WYlPVTb6Bx0G/zy0BIoucNqDr/Q2Vb/kTYkOq1A==", + "requires": { + "@fastify/static": "^6.0.0", + "fastify-plugin": "^4.0.0", + "openapi-types": "^12.0.2", + "rfdc": "^1.3.0", + "yaml": "^2.2.2" + }, + "dependencies": { + "openapi-types": { + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==" + }, + "yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==" + } + } + }, "@fastify/view": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/@fastify/view/-/view-7.3.0.tgz", @@ -17216,9 +17657,9 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, "fast-querystring": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.0.0.tgz", - "integrity": "sha512-3LQi62IhQoDlmt4ULCYmh17vRO2EtS7hTSsG4WwoKWgV7GLMKBOecEh+aiavASnLx8I2y89OD33AGLo0ccRhzA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz", + "integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==", "requires": { "fast-decode-uri-component": "^1.0.1" } @@ -19925,9 +20366,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "multer": { - "version": "1.4.5-lts.1", - "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", - "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==", + "version": "1.4.5-lts.2", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz", + "integrity": "sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==", "requires": { "append-field": "^1.0.0", "busboy": "^1.0.0", diff --git a/package.json b/package.json index 145aed2d..98c7b972 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,9 @@ "@adminjs/fastify": "^3.0.1", "@adminjs/mongoose": "^3.0.1", "@fastify/env": "^3.0.0", + "@fastify/formbody": "^8.0.2", "@fastify/jwt": "^6.5.0", + "@fastify/multipart": "^9.0.3", "@fastify/view": "^7.1.2", "@google-cloud/storage": "^6.10.1", "adminjs": "^6.7.2", @@ -36,7 +38,7 @@ "fastify-file-upload": "^4.0.0", "fastify-formbody": "^5.3.0", "fastify-jwt": "^4.2.0", - "fastify-multer": "^2.0.2", + "fastify-multer": "^2.0.3", "fastify-multipart": "^5.4.0", "fastify-static": "^4.7.0", "fastify-swagger": "^5.2.0", diff --git a/src/index.js b/src/index.js index f6000cc6..615ecfc0 100644 --- a/src/index.js +++ b/src/index.js @@ -29,6 +29,7 @@ const fastify = require("fastify")({ fastify.register(cors, { origin: 'http://armintaaqua.com:3000', // Allow only your frontend URL methods: ['GET', 'POST', 'PUT', 'DELETE'], // Allowed HTTP methods + allowedContentTypes: ['application/json', 'multipart/form-data'], }); @@ -717,15 +718,57 @@ fastify.register(require("./routes/forTestingRoute")); const {Storage} = require('@google-cloud/storage'); const { Supplier, profilePictureSupplier } = require("./models/supplier"); -const multer = require('fastify-multer'); +//const multer = require('fastify-multer'); +//const fastifyMulter = require('fastify-multer'); +//const upload = fastifyMulter.single('file'); +//fastify.register(fastifyMulter.contentParser); +const multer = require('multer'); +//const upload = multer({ dest: 'uploads/' }); const { ProfilePictureInstall, Install } = require("./models/store.js"); const { TeamMemberProfilePicture, CompanyProfilePicture, Deparments, IndianLocations } = require("./models/Department.js"); fastify.register(require('fastify-formbody')); // fastify.register(multer.contentParser); // const multipart = require('fastify-multipart'); +fastify.addContentTypeParser('multipart/form-data', (request, payload, done) => { + done(null, payload); +}); +//const multipart = require('@fastify/multipart'); + +// fastify.register(multipart, { +// limits: { +// fileSize: 10 * 1024 * 1024, // 10 MB +// }, +// attachFieldsToBody: true, +// }); // fastify.register(multipart); +// const fastifyMultipart = require('@fastify/multipart'); + +// fastify.register(fastifyMultipart, { +// limits: { +// fieldNameSize: 100, +// fieldSize: 1000000, +// fields: 10, +// fileSize: 1000000, +// files: 10, +// headerPairs: 2000 +// } +// }); + const formbody = require('@fastify/formbody'); + +fastify.register(formbody); + + +// const multipart = require("@fastify/multipart"); + +// // register multipart +// fastify.register(require("@fastify/multipart"), { +// limits: { +// fileSize: 10 * 1024 * 1024, // 10 MB +// }, +// attachFieldsToBody: true, +// }); const gc = new Storage({ keyFilename : path.join(__dirname, "../src/arminta-tank-keyFile.json"), projectId : 'arminta-tank' @@ -747,9 +790,11 @@ const storage = new Storage({ // }); // Register fastify-file-upload plugin -fastify.register(require('fastify-multipart')); - +//fastify.register(require('fastify-multipart')); +// fastify.register(require("@fastify/multipart"), { +// attachFieldsToBody: true, +// }); // fastify.post('/upload', async (request, reply) => { // try { @@ -844,44 +889,168 @@ fastify.register(require('fastify-multipart')); // } // }); -fastify.post('/api/uploads_team_profile/:customerId', async (request, reply) => { - try { - const customerId = request.params.customerId; - const data = await request.file(); +// fastify.post('/api/uploads_team_profile/:customerId', async (request, reply) => { +// try { +// const customerId = request.params.customerId; +// const data = await request.file(); - const bucketName = 'arminta_profile_pictures'; - const filePath = `arminta_team_profiles/${data.filename}`; +// const bucketName = 'arminta_profile_pictures'; +// const filePath = `arminta_team_profiles/${data.filename}`; - const file = storage.bucket(bucketName).file(filePath); - const writeStream = file.createWriteStream(); +// const file = storage.bucket(bucketName).file(filePath); +// const writeStream = file.createWriteStream(); - data.file.pipe(writeStream); +// data.file.pipe(writeStream); - await new Promise((resolve, reject) => { - writeStream.on('finish', resolve); - writeStream.on('error', reject); - }); +// await new Promise((resolve, reject) => { +// writeStream.on('finish', resolve); +// writeStream.on('error', reject); +// }); - // Make file public - await file.makePublic(); +// // Make file public +// await file.makePublic(); +// const publicUrl = `https://storage.googleapis.com/${bucketName}/${filePath}`; + +// // Update DB with async/await +// const picture = await TeamMemberProfilePicture.findOneAndUpdate( +// { customerId }, +// { picture: publicUrl }, +// { new: true, upsert: true } +// ); + +// reply.send({ picture: publicUrl }); +// } catch (err) { +// console.error(err); +// reply.code(500).send({ error: 'An error occurred', details: err.message }); +// } +// }); + +// fastify.post('/api/uploads_team_profile/:customerId', async (request, reply) => { +// try { +// const { customerId } = request.params; + +// // get uploaded file +// //const data = await request.file(); +// const data = request.body.file; +// if (!data) { +// return reply.code(400).send({ error: 'No file uploaded' }); +// } + +// const bucketName = 'arminta_profile_pictures'; +// const filePath = `arminta_team_profiles/${data.filename}`; + +// const file = storage.bucket(bucketName).file(filePath); +// const writeStream = file.createWriteStream(); + +// data.file.pipe(writeStream); +// console.log("Logs",request.headers['content-type']); +// await new Promise((resolve, reject) => { +// writeStream.on('finish', resolve); +// writeStream.on('error', reject); +// }); + +// // make file public +// await file.makePublic(); +// const publicUrl = `https://storage.googleapis.com/${bucketName}/${filePath}`; + +// // save in DB +// const picture = await TeamMemberProfilePicture.findOneAndUpdate( +// { customerId }, +// { picture: publicUrl }, +// { new: true, upsert: true } +// ); + +// return reply.send({ picture: publicUrl }); + +// } catch (err) { +// request.log.error(err); +// return reply.code(500).send({ error: 'Upload failed', details: err.message }); +// } +// }); +const fastifyMulter = require('fastify-multer'); + +const upload = fastifyMulter({ + dest: 'uploads/', + limits: { + fieldNameSize: 100, + fieldSize: 1000000, + fields: 10, + fileSize: 1000000000000000, + files: 10, + headerPairs: 2000 + } +}); + +fastify.register(upload.contentParser); + +fastify.post('/api/uploads_team_profile/:customerId', { + preHandler: upload.single('file') +}, async (request, reply) => { + try { + const { customerId } = request.params; + const file = await request.file; // Uncomment this line + const formData = new FormData(); + formData.append('file', file); + const bucketName = 'arminta_profile_pictures'; + const filePath = `arminta_team_profiles/${file.originalname}`; + + const fileBuffer = await fs.promises.readFile(file.path); + + await storage.bucket(bucketName).file(filePath).save(fileBuffer); + + // make file public + await storage.bucket(bucketName).file(filePath).makePublic(); const publicUrl = `https://storage.googleapis.com/${bucketName}/${filePath}`; - // Update DB with async/await + // save in DB const picture = await TeamMemberProfilePicture.findOneAndUpdate( { customerId }, { picture: publicUrl }, { new: true, upsert: true } ); - reply.send({ picture: publicUrl }); + return reply.send({ picture: publicUrl }); + } catch (err) { - console.error(err); - reply.code(500).send({ error: 'An error occurred', details: err.message }); + request.log.error(err); + return reply.code(500).send({ error: 'Upload failed', details: err.message }); } }); +// fastify.post('/api/uploads_team_profile/:customerId', async (request, reply) => { +// try { +// const { customerId } = request.params; + +// // get uploaded file +// const file = await request.multipart(); +// if (!file) { +// return reply.code(400).send({ error: 'No file uploaded' }); +// } + +// const bucketName = 'arminta_profile_pictures'; +// const filePath = `arminta_team_profiles/${file.filename}`; + +// const fileBuffer = await fs.promises.readFile(file.filepath); + +// await storage.bucket(bucketName).file(filePath).save(fileBuffer); + +// // make file public +// await storage.bucket(bucketName).file(filePath).makePublic(); +// const publicUrl = `https://storage.googleapis.com/${bucketName}/${filePath}`; +// // save in DB +// const picture = await TeamMemberProfilePicture.findOneAndUpdate( +// { customerId }, +// { picture: publicUrl }, +// { new: true, upsert: true } +// ); +// return reply.send({ picture: publicUrl }); +// } catch (err) { +// request.log.error(err); +// return reply.code(500).send({ error: 'Upload failed', details: err.message }); +// } +// }); fastify.post('/api/uploads_company_profile/:customerId', async (request, reply) => { try { const customerId = request.params.customerId; @@ -2253,14 +2422,23 @@ fastify.post("/api/teamMemberLogin", { }); // Run the server! -const start = async () => { +// const start = async () => { - try { +// try { - await fastify.listen(3000, "0.0.0.0"); - fastify.log.info(`listening on ${fastify.server.address().port}`); - fastify.log.info(`server listening on ${fastify.config}`); +// await fastify.listen(3000, "0.0.0.0"); +// fastify.log.info(`listening on ${fastify.server.address().port}`); +// fastify.log.info(`server listening on ${fastify.config}`); +// } catch (err) { +// fastify.log.error(err); +// process.exit(1); +// } +// }; +const start = async () => { + try { + await fastify.listen({ port: 3000, host: "0.0.0.0" }); // ✅ correct usage in Fastify v4 + fastify.log.info(`Server listening on ${fastify.server.address().port}`); } catch (err) { fastify.log.error(err); process.exit(1); diff --git a/uploads/45246b640831a27395f9d1dfea1dd72d b/uploads/45246b640831a27395f9d1dfea1dd72d new file mode 100644 index 00000000..54f62aa4 Binary files /dev/null and b/uploads/45246b640831a27395f9d1dfea1dd72d differ diff --git a/uploads/955273029ffa0b831471711c8320d710 b/uploads/955273029ffa0b831471711c8320d710 new file mode 100644 index 00000000..dd973941 Binary files /dev/null and b/uploads/955273029ffa0b831471711c8320d710 differ diff --git a/uploads/986f0b7b4d59233ae60e99a873da1ba8 b/uploads/986f0b7b4d59233ae60e99a873da1ba8 new file mode 100644 index 00000000..dd973941 Binary files /dev/null and b/uploads/986f0b7b4d59233ae60e99a873da1ba8 differ diff --git a/uploads/9ff41d2544f312e3e471ec053b8bbcc9 b/uploads/9ff41d2544f312e3e471ec053b8bbcc9 new file mode 100644 index 00000000..54f62aa4 Binary files /dev/null and b/uploads/9ff41d2544f312e3e471ec053b8bbcc9 differ diff --git a/uploads/ae2e66bb5806eff227d85b57df4d28f7 b/uploads/ae2e66bb5806eff227d85b57df4d28f7 new file mode 100644 index 00000000..dd973941 Binary files /dev/null and b/uploads/ae2e66bb5806eff227d85b57df4d28f7 differ diff --git a/uploads/d09c81cf26a3ba3b463e7c65565e032b b/uploads/d09c81cf26a3ba3b463e7c65565e032b new file mode 100644 index 00000000..735faf85 Binary files /dev/null and b/uploads/d09c81cf26a3ba3b463e7c65565e032b differ diff --git a/uploads/d2bfa56b0d68f890ea38a77a907bc5b8 b/uploads/d2bfa56b0d68f890ea38a77a907bc5b8 new file mode 100644 index 00000000..735faf85 Binary files /dev/null and b/uploads/d2bfa56b0d68f890ea38a77a907bc5b8 differ