🐛Fix bug with sending files with response stream
Also updated another dependencies and removed old version of the fastify multipart plugin
This commit is contained in:
committed by
Anton Shepilov
parent
999e3087e8
commit
2884193072
Generated
+45
-269
@@ -30,7 +30,7 @@
|
||||
"@types/sharp": "^0.29.5",
|
||||
"amqp-connection-manager": "^3.7.0",
|
||||
"amqplib": "^0.8.0",
|
||||
"analytics-node": "^5.0.0",
|
||||
"analytics-node": "^6.2.0",
|
||||
"archiver": "^5.3.1",
|
||||
"axios": "^1.6.8",
|
||||
"bcrypt": "^5.0.1",
|
||||
@@ -44,9 +44,7 @@
|
||||
"fastify": "^4.26.2",
|
||||
"fastify-cors": "^4.1.0",
|
||||
"fastify-jwt": "^2.2.0",
|
||||
"fastify-multipart": "5.3.1",
|
||||
"fastify-plugin": "^4.5.1",
|
||||
"fastify-sensible": "=3.0.1",
|
||||
"fastify-socket.io": "^5.0.0",
|
||||
"fastify-websocket": "^4.3.0",
|
||||
"fluent-ffmpeg": "^2.1.2",
|
||||
@@ -87,7 +85,7 @@
|
||||
"sharp": "^0.33.3",
|
||||
"short-uuid": "^4.2.2",
|
||||
"socket.io": "^4.6.2",
|
||||
"socket.io-client": "^3.0.0",
|
||||
"socket.io-client": "^4.7.5",
|
||||
"unoconv-promise": "^1.0.8",
|
||||
"uuid": "^8.3.2",
|
||||
"uuid-time": "^1.0.0",
|
||||
@@ -131,7 +129,7 @@
|
||||
"form-auto-content": "^2.2.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-mock-extended": "^3.0.4",
|
||||
"nodemon": "^2.0.22",
|
||||
"nodemon": "^3.1.0",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"prettier": "^2.1.2",
|
||||
"rimraf": "^3.0.2",
|
||||
@@ -2593,11 +2591,6 @@
|
||||
"integrity": "sha512-GsALrTL69mlwbAw/MHF1IPTadSLZQnsxe7a80G8l4inN/iEXCOcVeT/S7aRc6hbhqzL9qZ314kHPDQnQ3ev+HA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/component-emitter": {
|
||||
"version": "1.2.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.14.tgz",
|
||||
"integrity": "sha512-lmPil1g82wwWg/qHSxMWkSKyJGQOK+ejXeMAAWyxNtVUD0/Ycj2maL63RAqpxVfdtvTfZkRnqzB0A9ft59y69g=="
|
||||
},
|
||||
"node_modules/@types/config": {
|
||||
"version": "0.0.36",
|
||||
"resolved": "https://registry.npmjs.org/@types/config/-/config-0.0.36.tgz",
|
||||
@@ -3448,12 +3441,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/analytics-node": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/analytics-node/-/analytics-node-5.1.2.tgz",
|
||||
"integrity": "sha512-WZ8gkXtLuqD2Q2xEOr/2/LJiR0AnhWHfXZhfPnMZpB7vEwCsh3HapYAUmA1cPj1abrhAqBX7POWuWo/1wUu/Fw==",
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/analytics-node/-/analytics-node-6.2.0.tgz",
|
||||
"integrity": "sha512-NLU4tCHlWt0tzEaFQL7NIoWhq2KmQSmz0JvyS2lYn6fc4fEjTMSabhJUx8H1r5995FX8fE3rZ15uIHU6u+ovlQ==",
|
||||
"dependencies": {
|
||||
"@segment/loosely-validate-event": "^2.0.0",
|
||||
"axios": "^0.21.4",
|
||||
"axios": "^0.27.2",
|
||||
"axios-retry": "3.2.0",
|
||||
"lodash.isstring": "^4.0.1",
|
||||
"md5": "^2.2.1",
|
||||
@@ -3466,11 +3459,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/analytics-node/node_modules/axios": {
|
||||
"version": "0.21.4",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
|
||||
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz",
|
||||
"integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.14.0"
|
||||
"follow-redirects": "^1.14.9",
|
||||
"form-data": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-escapes": {
|
||||
@@ -3945,24 +3939,11 @@
|
||||
"@babel/core": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/backo2": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz",
|
||||
"integrity": "sha512-zj6Z6M7Eq+PBZ7PQxl5NT665MvJdAkzp0f60nAJ+sLaSCBPMwVak5ZegFbgVCzFcCJTKFoMizvM5Ld7+JrRJHA=="
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||
},
|
||||
"node_modules/base64-arraybuffer": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz",
|
||||
"integrity": "sha512-a1eIFi4R9ySrbiMuyTGx5e92uRH5tQY6kArNcFaKBUleIoLjdjBg7Zxm3Mqm3Kmkf27HLR/1fnxX9q8GQ7Iavg==",
|
||||
"engines": {
|
||||
"node": ">= 0.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/base64-js": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
|
||||
@@ -4892,14 +4873,6 @@
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
|
||||
},
|
||||
"node_modules/component-emitter": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz",
|
||||
"integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/component-type": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/component-type/-/component-type-1.2.2.tgz",
|
||||
@@ -5686,39 +5659,23 @@
|
||||
}
|
||||
},
|
||||
"node_modules/engine.io-client": {
|
||||
"version": "4.1.4",
|
||||
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-4.1.4.tgz",
|
||||
"integrity": "sha512-843fqAdKeUMFqKi1sSjnR11tJ4wi8sIefu6+JC1OzkkJBmjtc/gM/rZ53tJfu5Iae/3gApm5veoS+v+gtT0+Fg==",
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.3.tgz",
|
||||
"integrity": "sha512-9Z0qLB0NIisTRt1DZ/8U2k12RJn8yls/nXMZLn+/N8hANT3TcYjKFKcwbw5zFQiN4NTde3TSY9zb79e1ij6j9Q==",
|
||||
"dependencies": {
|
||||
"base64-arraybuffer": "0.1.4",
|
||||
"component-emitter": "~1.3.0",
|
||||
"@socket.io/component-emitter": "~3.1.0",
|
||||
"debug": "~4.3.1",
|
||||
"engine.io-parser": "~4.0.1",
|
||||
"has-cors": "1.1.0",
|
||||
"parseqs": "0.0.6",
|
||||
"parseuri": "0.0.6",
|
||||
"ws": "~7.4.2",
|
||||
"xmlhttprequest-ssl": "~1.6.2",
|
||||
"yeast": "0.1.2"
|
||||
}
|
||||
},
|
||||
"node_modules/engine.io-client/node_modules/engine.io-parser": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-4.0.3.tgz",
|
||||
"integrity": "sha512-xEAAY0msNnESNPc00e19y5heTPX4y/TJ36gr8t1voOaNmTojP9b3oK3BbJLFufW2XFPQaaijpFewm2g2Um3uqA==",
|
||||
"dependencies": {
|
||||
"base64-arraybuffer": "0.1.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
"engine.io-parser": "~5.2.1",
|
||||
"ws": "~8.11.0",
|
||||
"xmlhttprequest-ssl": "~2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/engine.io-client/node_modules/ws": {
|
||||
"version": "7.4.6",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
|
||||
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
|
||||
"version": "8.11.0",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz",
|
||||
"integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==",
|
||||
"engines": {
|
||||
"node": ">=8.3.0"
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
@@ -6450,11 +6407,6 @@
|
||||
"semver": "^7.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/fastify-error": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/fastify-error/-/fastify-error-0.3.1.tgz",
|
||||
"integrity": "sha512-oCfpcsDndgnDVgiI7bwFKAun2dO+4h84vBlkWsWnz/OUK9Reff5UFoFl241xTiLeHWX/vU9zkDVXqYUxjOwHcQ=="
|
||||
},
|
||||
"node_modules/fastify-jwt": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/fastify-jwt/-/fastify-jwt-2.5.0.tgz",
|
||||
@@ -6535,111 +6487,11 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fastify-multipart": {
|
||||
"version": "5.3.1",
|
||||
"resolved": "https://registry.npmjs.org/fastify-multipart/-/fastify-multipart-5.3.1.tgz",
|
||||
"integrity": "sha512-c2pnGfkJmiNpYqzFYT2QfBg/06AxG531O+n1elqc8YUbWPRzufdqn3yfGAIV3RA7J4Vnf7Pfvgx0iaWqaRTOVA==",
|
||||
"dependencies": {
|
||||
"@fastify/busboy": "^1.0.0",
|
||||
"deepmerge": "^4.2.2",
|
||||
"end-of-stream": "^1.4.4",
|
||||
"fastify-error": "^0.3.0",
|
||||
"fastify-plugin": "^3.0.0",
|
||||
"hexoid": "^1.0.0",
|
||||
"secure-json-parse": "^2.4.0",
|
||||
"stream-wormhole": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fastify-multipart/node_modules/@fastify/busboy": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-1.2.1.tgz",
|
||||
"integrity": "sha512-7PQA7EH43S0CxcOa9OeAnaeA0oQ+e/DHNPZwSQM9CQHW76jle5+OvLdibRp/Aafs9KXbLhxyjOTkRjWUbQEd3Q==",
|
||||
"dependencies": {
|
||||
"text-decoding": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/fastify-multipart/node_modules/fastify-plugin": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-3.0.1.tgz",
|
||||
"integrity": "sha512-qKcDXmuZadJqdTm6vlCqioEbyewF60b/0LOFCcYN1B6BIZGlYJumWWOYs70SFYLDAH4YqdE1cxH/RKMG7rFxgA=="
|
||||
},
|
||||
"node_modules/fastify-plugin": {
|
||||
"version": "4.5.1",
|
||||
"resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-4.5.1.tgz",
|
||||
"integrity": "sha512-stRHYGeuqpEZTL1Ef0Ovr2ltazUT9g844X5z/zEBFLG8RYlpDiOCIG+ATvYEp+/zmc7sN29mcIMp8gvYplYPIQ=="
|
||||
},
|
||||
"node_modules/fastify-sensible": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fastify-sensible/-/fastify-sensible-3.0.1.tgz",
|
||||
"integrity": "sha512-XVgrQySnpNq6FTUEhLLyA0i6eB7DKF6OJV05gxCDQ008cEgzOs97L/TOd1tT3fgRf3Z6tyA2zb/wMdFX5o1C2Q==",
|
||||
"dependencies": {
|
||||
"@types/node": "^14.0.1",
|
||||
"fast-deep-equal": "^3.1.1",
|
||||
"fastify-plugin": "^2.0.0",
|
||||
"forwarded": "^0.1.2",
|
||||
"http-errors": "^1.7.3",
|
||||
"type-is": "^1.6.18",
|
||||
"vary": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fastify-sensible/node_modules/@types/node": {
|
||||
"version": "14.18.63",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz",
|
||||
"integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ=="
|
||||
},
|
||||
"node_modules/fastify-sensible/node_modules/depd": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
|
||||
"integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fastify-sensible/node_modules/fastify-plugin": {
|
||||
"version": "2.3.4",
|
||||
"resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-2.3.4.tgz",
|
||||
"integrity": "sha512-I+Oaj6p9oiRozbam30sh39BiuiqBda7yK2nmSPVwDCfIBlKnT8YB3MY+pRQc2Fcd07bf6KPGklHJaQ2Qu81TYQ==",
|
||||
"dependencies": {
|
||||
"semver": "^7.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/fastify-sensible/node_modules/forwarded": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
|
||||
"integrity": "sha512-Ua9xNhH0b8pwE3yRbFfXJvfdWF0UHNCdeyb2sbi9Ul/M+r3PTdrz7Cv4SCfZRMjmzEM9PhraqfZFbGTIg3OMyA==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fastify-sensible/node_modules/http-errors": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz",
|
||||
"integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==",
|
||||
"dependencies": {
|
||||
"depd": "~1.1.2",
|
||||
"inherits": "2.0.4",
|
||||
"setprototypeof": "1.2.0",
|
||||
"statuses": ">= 1.5.0 < 2",
|
||||
"toidentifier": "1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fastify-sensible/node_modules/statuses": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
|
||||
"integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fastify-socket.io": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fastify-socket.io/-/fastify-socket.io-5.0.0.tgz",
|
||||
@@ -7366,11 +7218,6 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/has-cors": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz",
|
||||
"integrity": "sha512-g5VNKdkFuUuVCP9gYfDJHjK2nqdQJ7aDLTnycnc2+RvsOQbuLdF5pm7vuE5J76SEBIQjs4kQY/BWq74JUmjbXA=="
|
||||
},
|
||||
"node_modules/has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
@@ -7456,14 +7303,6 @@
|
||||
"integrity": "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/hexoid": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz",
|
||||
"integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/hosted-git-info": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz",
|
||||
@@ -10355,18 +10194,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nodemon": {
|
||||
"version": "2.0.22",
|
||||
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.22.tgz",
|
||||
"integrity": "sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==",
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.0.tgz",
|
||||
"integrity": "sha512-xqlktYlDMCepBJd43ZQhjWwMw2obW/JRvkrLxq5RCNcuDDX1DbcPT+qT1IlIIdf+DhnWs90JpTMe+Y5KxOchvA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"chokidar": "^3.5.2",
|
||||
"debug": "^3.2.7",
|
||||
"debug": "^4",
|
||||
"ignore-by-default": "^1.0.1",
|
||||
"minimatch": "^3.1.2",
|
||||
"pstree.remy": "^1.1.8",
|
||||
"semver": "^5.7.1",
|
||||
"simple-update-notifier": "^1.0.7",
|
||||
"semver": "^7.5.3",
|
||||
"simple-update-notifier": "^2.0.0",
|
||||
"supports-color": "^5.5.0",
|
||||
"touch": "^3.1.0",
|
||||
"undefsafe": "^2.0.5"
|
||||
@@ -10375,22 +10214,13 @@
|
||||
"nodemon": "bin/nodemon.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.10.0"
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/nodemon"
|
||||
}
|
||||
},
|
||||
"node_modules/nodemon/node_modules/debug": {
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
|
||||
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/nodemon/node_modules/has-flag": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||
@@ -10400,15 +10230,6 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/nodemon/node_modules/semver": {
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver"
|
||||
}
|
||||
},
|
||||
"node_modules/nodemon/node_modules/supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
@@ -10809,16 +10630,6 @@
|
||||
"url": "https://ko-fi.com/killymxi"
|
||||
}
|
||||
},
|
||||
"node_modules/parseqs": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz",
|
||||
"integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w=="
|
||||
},
|
||||
"node_modules/parseuri": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz",
|
||||
"integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow=="
|
||||
},
|
||||
"node_modules/path-exists": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
||||
@@ -12335,24 +12146,15 @@
|
||||
"integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
|
||||
},
|
||||
"node_modules/simple-update-notifier": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz",
|
||||
"integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==",
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz",
|
||||
"integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"semver": "~7.0.0"
|
||||
"semver": "^7.5.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/simple-update-notifier/node_modules/semver": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz",
|
||||
"integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/sisteransi": {
|
||||
@@ -12431,30 +12233,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/socket.io-client": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-3.1.3.tgz",
|
||||
"integrity": "sha512-4sIGOGOmCg3AOgGi7EEr6ZkTZRkrXwub70bBB/F0JSkMOUFpA77WsL87o34DffQQ31PkbMUIadGOk+3tx1KGbw==",
|
||||
"version": "4.7.5",
|
||||
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.7.5.tgz",
|
||||
"integrity": "sha512-sJ/tqHOCe7Z50JCBCXrsY3I2k03iOiUe+tj1OmKeD2lXPiGH/RUCdTZFoqVyN7l1MnpIzPrGtLcijffmeouNlQ==",
|
||||
"dependencies": {
|
||||
"@types/component-emitter": "^1.2.10",
|
||||
"backo2": "~1.0.2",
|
||||
"component-emitter": "~1.3.0",
|
||||
"debug": "~4.3.1",
|
||||
"engine.io-client": "~4.1.0",
|
||||
"parseuri": "0.0.6",
|
||||
"socket.io-parser": "~4.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/socket.io-client/node_modules/socket.io-parser": {
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.5.tgz",
|
||||
"integrity": "sha512-sNjbT9dX63nqUFIOv95tTVm6elyIU4RvB1m8dOeZt+IgWwcWklFDOdmGcfo3zSiRsnR/3pJkjY5lfoGqEe4Eig==",
|
||||
"dependencies": {
|
||||
"@types/component-emitter": "^1.2.10",
|
||||
"component-emitter": "~1.3.0",
|
||||
"debug": "~4.3.1"
|
||||
"@socket.io/component-emitter": "~3.1.0",
|
||||
"debug": "~4.3.2",
|
||||
"engine.io-client": "~6.5.2",
|
||||
"socket.io-parser": "~4.2.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
@@ -13017,11 +12803,6 @@
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/text-decoding": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/text-decoding/-/text-decoding-1.0.0.tgz",
|
||||
"integrity": "sha512-/0TJD42KDnVwKmDK6jj3xP7E2MG7SHAOG4tyTgyUCRPdHwvkquYNLEQltmdMa3owq3TkddCVcTsoctJI8VQNKA=="
|
||||
},
|
||||
"node_modules/text-table": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
||||
@@ -14026,9 +13807,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/xmlhttprequest-ssl": {
|
||||
"version": "1.6.3",
|
||||
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.6.3.tgz",
|
||||
"integrity": "sha512-3XfeQE/wNkvrIktn2Kf0869fC0BN6UpydVasGIeSm2B1Llihf7/0UfZM+eCkOw3P7bP4+qPgqhm7ZoxuJtFU0Q==",
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz",
|
||||
"integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
@@ -14109,11 +13890,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/yeast": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz",
|
||||
"integrity": "sha512-8HFIh676uyGYP6wP13R/j6OJ/1HwJ46snpvzE7aHAN3Ryqh2yX6Xox2B4CUmTwwOIzlG3Bs7ocsP5dZH/R1Qbg=="
|
||||
},
|
||||
"node_modules/yn": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
"form-auto-content": "^2.2.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-mock-extended": "^3.0.4",
|
||||
"nodemon": "^2.0.22",
|
||||
"nodemon": "^3.1.0",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"prettier": "^2.1.2",
|
||||
"rimraf": "^3.0.2",
|
||||
@@ -125,7 +125,7 @@
|
||||
"@types/sharp": "^0.29.5",
|
||||
"amqp-connection-manager": "^3.7.0",
|
||||
"amqplib": "^0.8.0",
|
||||
"analytics-node": "^5.0.0",
|
||||
"analytics-node": "^6.2.0",
|
||||
"archiver": "^5.3.1",
|
||||
"axios": "^1.6.8",
|
||||
"bcrypt": "^5.0.1",
|
||||
@@ -139,9 +139,7 @@
|
||||
"fastify": "^4.26.2",
|
||||
"fastify-cors": "^4.1.0",
|
||||
"fastify-jwt": "^2.2.0",
|
||||
"fastify-multipart": "5.3.1",
|
||||
"fastify-plugin": "^4.5.1",
|
||||
"fastify-sensible": "=3.0.1",
|
||||
"fastify-socket.io": "^5.0.0",
|
||||
"fastify-websocket": "^4.3.0",
|
||||
"fluent-ffmpeg": "^2.1.2",
|
||||
@@ -182,7 +180,7 @@
|
||||
"sharp": "^0.33.3",
|
||||
"short-uuid": "^4.2.2",
|
||||
"socket.io": "^4.6.2",
|
||||
"socket.io-client": "^3.0.0",
|
||||
"socket.io-client": "^4.7.5",
|
||||
"unoconv-promise": "^1.0.8",
|
||||
"uuid": "^8.3.2",
|
||||
"uuid-time": "^1.0.0",
|
||||
|
||||
@@ -2,7 +2,7 @@ import { logger, TdriveService } from "../../framework";
|
||||
import { Server, IncomingMessage, ServerResponse } from "http";
|
||||
import { FastifyInstance, fastify, FastifyRegisterOptions, FastifyServerOptions } from "fastify";
|
||||
import sensible from "@fastify/sensible";
|
||||
import multipart from "fastify-multipart";
|
||||
import multipart from "@fastify/multipart";
|
||||
import formbody from "@fastify/formbody";
|
||||
import fastifyStatic from "@fastify/static";
|
||||
import corsPlugin, { FastifyCorsOptions } from "@fastify/cors";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { randomBytes } from "crypto";
|
||||
import { Readable } from "stream";
|
||||
import { Multipart } from "fastify-multipart";
|
||||
import { MultipartFile } from "@fastify/multipart";
|
||||
import { UploadOptions } from "../types";
|
||||
import { File } from "../entities/file";
|
||||
import Repository from "../../../../src/core/platform/services/database/services/orm/repository/repository";
|
||||
@@ -73,7 +73,7 @@ export class FileServiceImpl {
|
||||
|
||||
async save(
|
||||
id: string,
|
||||
file: Multipart,
|
||||
file: MultipartFile,
|
||||
options: UploadOptions,
|
||||
context: CompanyExecutionContext,
|
||||
): Promise<File> {
|
||||
@@ -443,7 +443,7 @@ export class FileServiceImpl {
|
||||
}
|
||||
}
|
||||
|
||||
async restoreFileS3(id: string, file: Multipart, options: UploadOptions): Promise<any> {
|
||||
async restoreFileS3(id: string, file: MultipartFile, options: UploadOptions): Promise<any> {
|
||||
try {
|
||||
const result = await this.checkFileExistsS3(id);
|
||||
if (result.exist) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { FastifyReply, FastifyRequest } from "fastify";
|
||||
import { Multipart } from "fastify-multipart";
|
||||
import { MultipartFile } from "@fastify/multipart";
|
||||
import { ResourceDeleteResponse } from "../../../../utils/types";
|
||||
import { CompanyExecutionContext } from "../types";
|
||||
import { UploadOptions } from "../../types";
|
||||
@@ -16,7 +16,7 @@ export class FileController {
|
||||
): Promise<{ resource: PublicFile }> {
|
||||
const context = getCompanyExecutionContext(request);
|
||||
|
||||
let file: null | Multipart = null;
|
||||
let file: null | MultipartFile = null;
|
||||
if (request.isMultipart()) {
|
||||
file = await request.file();
|
||||
}
|
||||
@@ -52,7 +52,7 @@ export class FileController {
|
||||
response.header("Content-disposition", `attachment; filename="${filename}"`);
|
||||
if (data.size) response.header("Content-Length", data.size);
|
||||
response.type(data.mime);
|
||||
response.send(data.file);
|
||||
return response.send(data.file);
|
||||
} catch (e) {
|
||||
console.log("!!!" + e);
|
||||
throw e;
|
||||
@@ -121,7 +121,7 @@ export class FileController {
|
||||
}>,
|
||||
): Promise<{ resource: PublicFile }> {
|
||||
const params = request.params;
|
||||
let file: null | Multipart = null;
|
||||
let file: null | MultipartFile = null;
|
||||
if (request.isMultipart()) {
|
||||
file = await request.file();
|
||||
}
|
||||
@@ -148,7 +148,7 @@ function getCompanyExecutionContext(
|
||||
|
||||
company: { id: request.params.company_id },
|
||||
url: request.url,
|
||||
method: request.routerMethod,
|
||||
method: request.routeOptions.method,
|
||||
reqId: request.id,
|
||||
transport: "http",
|
||||
};
|
||||
|
||||
@@ -120,7 +120,7 @@ function getExecutionContext(request: FastifyRequest): ExecutionContext {
|
||||
return {
|
||||
user: request.currentUser,
|
||||
url: request.url,
|
||||
method: request.routerMethod,
|
||||
method: request.routeOptions.method,
|
||||
transport: "http",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -22,15 +22,14 @@ describe("the Drive feature", () => {
|
||||
configGetSpy = jest.spyOn(config, "get");
|
||||
|
||||
configHasSpy.mockImplementation((setting: string) => {
|
||||
const value = jest.requireActual("config").has(setting);
|
||||
return value;
|
||||
return jest.requireActual("config").has(setting);
|
||||
});
|
||||
configGetSpy.mockImplementation((setting: string) => {
|
||||
if (setting === "drive.featureUserQuota") {
|
||||
return true;
|
||||
}
|
||||
if (setting === "drive.defaultUserQuota") {
|
||||
return 2000000;
|
||||
return 1000000;
|
||||
}
|
||||
return jest.requireActual("config").get(setting);
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ import { getFilePath } from "../../../src/services/files/services";
|
||||
import UserApi from "../common/user-api";
|
||||
import LocalConnectorService from "../../../src/core/platform/services/storage/connectors/local/service"
|
||||
import { Client as MinioClient } from "minio"
|
||||
import { toInteger } from "lodash";
|
||||
|
||||
describe("The Files feature", () => {
|
||||
const url = "/internal/services/files/v1";
|
||||
@@ -78,9 +79,14 @@ describe("The Files feature", () => {
|
||||
method: "GET",
|
||||
url: `${url}/companies/${platform.workspace.company_id}/files/${filesUpload.id}/download`,
|
||||
});
|
||||
//then file should be not found with 404 error and "File not found message"
|
||||
expect(fileDownloadResponse).toBeTruthy();
|
||||
expect(fileDownloadResponse.statusCode).toBe(200);
|
||||
//check the content length header that it's not empty
|
||||
expect(fileDownloadResponse.headers["content-length"]).toBeDefined();
|
||||
let length = toInteger(fileDownloadResponse.headers["content-length"]);
|
||||
expect(length).toBeGreaterThan(0)
|
||||
//and data is in place
|
||||
expect((fileDownloadResponse.stream().read(100) as Buffer).length).toBeGreaterThanOrEqual(100)
|
||||
});
|
||||
|
||||
it.skip("should save file and generate previews", async () => {
|
||||
|
||||
Reference in New Issue
Block a user