diff --git a/backend/Dockerfile.python b/backend/Dockerfile.python deleted file mode 100644 index 7e11f533..00000000 --- a/backend/Dockerfile.python +++ /dev/null @@ -1,14 +0,0 @@ -# Dockerfile for FastAPI application -FROM python:3.11-slim - -WORKDIR /app - -# Install dependencies -COPY requirements.txt requirements.txt -RUN pip install --no-cache-dir -r requirements.txt - -# Copy the FastAPI application -COPY src/api/python-app.py . - -# Command to run the FastAPI application -CMD ["uvicorn", "python-app:app", "--host", "0.0.0.0", "--port", "8000"] diff --git a/backend/package-lock.json b/backend/package-lock.json index 1137060d..c47af9ab 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -17,6 +17,7 @@ "amqplib": "^0.10.3", "aws-sdk": "^2.1551.0", "axios": "^1.6", + "body-parser": "^1.19.0", "bufferutil": "^4.0.7", "class-transformer": "^0.3.1", "class-validator": "^0.14.0", @@ -33,6 +34,7 @@ "helmet": "^4.1.1", "http-proxy-middleware": "^2.0.6", "ip-address": "^9.0.5", + "jsdom": "^22.1", "jsonwebtoken": "^9.0.2", "jwks-rsa": "^3.0", "lodash": "^4.17.21", @@ -41,7 +43,9 @@ "p-queue": "^6.6.2", "p-retry": "^4.6.1", "papaparse": "^5.3.1", + "pg": "^8.11", "portscanner": "^2.2.0", + "reflect-metadata": "^0.1.13", "sanitizer": "^0.1.3", "serverless-better-credentials": "^2.0.0", "serverless-http": "^3.2.0", @@ -76,7 +80,6 @@ "jest": "^27", "json-schema-to-typescript": "^13.0", "nock": "^13.0.4", - "pg": "^8.11", "prettier": "^3.0.0", "sentencer": "^0.2.1", "serverless": "^3.30", @@ -3793,12 +3796,6 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, - "node_modules/@iarna/toml": { - "dev": true, - "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", - "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", - "version": "2.2.5" - }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -6235,6 +6232,14 @@ "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" }, + "node_modules/@tootallnate/once": { + "engines": { + "node": ">= 10" + }, + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "version": "2.0.0" + }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -7101,7 +7106,6 @@ } }, "node_modules/abab": { - "dev": true, "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==" @@ -7234,7 +7238,6 @@ "dependencies": { "debug": "4" }, - "dev": true, "engines": { "node": ">= 6.0.0" } @@ -7419,13 +7422,6 @@ "node": ">=0.2.6" } }, - "node_modules/appdirectory": { - "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", - "dev": true, - "integrity": "sha512-DJ5DV8vZXBbusyiyPlH28xppwS8eAMRuuyMo88xeEcf4bV64lbLtbxRxqixZuJBXsZzLtXFmA13GwVjJc7vdQw==", - "resolved": "https://registry.npmjs.org/appdirectory/-/appdirectory-0.1.0.tgz", - "version": "0.1.0" - }, "node_modules/archive-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/archive-type/-/archive-type-4.0.0.tgz", @@ -8052,7 +8048,6 @@ "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==" }, "node_modules/buffer-writer": { - "devOptional": true, "engines": { "node": ">=4" } @@ -8853,6 +8848,17 @@ "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", "dev": true }, + "node_modules/cssstyle": { + "dependencies": { + "rrweb-cssom": "^0.6.0" + }, + "engines": { + "node": ">=14" + }, + "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", + "version": "3.0.0" + }, "node_modules/d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -8862,6 +8868,19 @@ "type": "^1.0.1" } }, + "node_modules/data-urls": { + "dependencies": { + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^12.0.0" + }, + "engines": { + "node": ">=14" + }, + "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", + "version": "4.0.0" + }, "node_modules/date-fns": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.3.1.tgz", @@ -8897,17 +8916,7 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "node_modules/decamelize": { - "dev": true, - "engines": { - "node": ">=0.10.0" - }, - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "version": "1.2.0" - }, "node_modules/decimal.js": { - "dev": true, "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==" @@ -9345,6 +9354,17 @@ "node": ">=6.0.0" } }, + "node_modules/domexception": { + "dependencies": { + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + }, + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "version": "4.0.0" + }, "node_modules/dotenv": { "version": "16.3.1", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", @@ -9457,6 +9477,17 @@ "node": ">=10.13.0" } }, + "node_modules/entities": { + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + }, + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "version": "4.5.0" + }, "node_modules/envinfo": { "version": "7.10.0", "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.10.0.tgz", @@ -10768,123 +10799,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/glob-all": { - "bin": { - "glob-all": "bin/glob-all" - }, - "dependencies": { - "glob": "^7.2.3", - "yargs": "^15.3.1" - }, - "dev": true, - "integrity": "sha512-Y+ESjdI7ZgMwfzanHZYQ87C59jOO0i+Hd+QYtVt9PhLi6d8wlOpzQnfBxWUlaTuAoR3TkybLqqbIoWveU4Ji7Q==", - "resolved": "https://registry.npmjs.org/glob-all/-/glob-all-3.3.1.tgz", - "version": "3.3.1" - }, - "node_modules/glob-all/node_modules/cliui": { - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - }, - "dev": true, - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "version": "6.0.0" - }, - "node_modules/glob-all/node_modules/find-up": { - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "dev": true, - "engines": { - "node": ">=8" - }, - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "version": "4.1.0" - }, - "node_modules/glob-all/node_modules/locate-path": { - "dependencies": { - "p-locate": "^4.1.0" - }, - "dev": true, - "engines": { - "node": ">=8" - }, - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "version": "5.0.0" - }, - "node_modules/glob-all/node_modules/p-limit": { - "dependencies": { - "p-try": "^2.0.0" - }, - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - }, - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "version": "2.3.0" - }, - "node_modules/glob-all/node_modules/p-locate": { - "dependencies": { - "p-limit": "^2.2.0" - }, - "dev": true, - "engines": { - "node": ">=8" - }, - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "version": "4.1.0" - }, - "node_modules/glob-all/node_modules/y18n": { - "dev": true, - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "version": "4.0.3" - }, - "node_modules/glob-all/node_modules/yargs": { - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "dev": true, - "engines": { - "node": ">=8" - }, - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "version": "15.4.1" - }, - "node_modules/glob-all/node_modules/yargs-parser": { - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "dev": true, - "engines": { - "node": ">=6" - }, - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "version": "18.1.3" - }, "node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -11156,6 +11070,17 @@ "resolved": "https://registry.npmjs.org/hpagent/-/hpagent-0.1.2.tgz", "integrity": "sha512-ePqFXHtSQWAFXYmj+JtOTHr84iNrII4/QRlAAPPE+zqnKy4xJo7Ie1Y4kC7AdB+LxLxSTTzBMASsEcy0q8YyvQ==" }, + "node_modules/html-encoding-sniffer": { + "dependencies": { + "whatwg-encoding": "^2.0.0" + }, + "engines": { + "node": ">=12" + }, + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "version": "3.0.0" + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -11195,6 +11120,19 @@ "node": ">=8.0.0" } }, + "node_modules/http-proxy-agent": { + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + }, + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "version": "5.0.0" + }, "node_modules/http-proxy-middleware": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", @@ -11238,7 +11176,6 @@ "agent-base": "^7.0.2", "debug": "4" }, - "dev": true, "engines": { "node": ">= 14" } @@ -11632,20 +11569,10 @@ } }, "node_modules/is-potential-custom-element-name": { - "dev": true, "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==" }, - "node_modules/is-primitive": { - "dev": true, - "engines": { - "node": ">=0.10.0" - }, - "integrity": "sha512-GljRxhWvlCNRfZyORiH77FwdFwGcMO620o37EOYC0ORWdq+WYNVqW0w2Juzew4M+L81l6/QS3t5gkkihyRqv9w==", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-3.0.1.tgz", - "version": "3.0.1" - }, "node_modules/is-promise": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", @@ -14347,6 +14274,60 @@ "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" }, + "node_modules/jsdom": { + "dependencies": { + "abab": "^2.0.6", + "cssstyle": "^3.0.0", + "data-urls": "^4.0.0", + "decimal.js": "^10.4.3", + "domexception": "^4.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.4", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.6.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^12.0.1", + "ws": "^8.13.0", + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=16" + }, + "integrity": "sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==", + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + }, + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", + "version": "22.1.0" + }, + "node_modules/jsdom/node_modules/form-data": { + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + }, + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "version": "4.0.0" + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -14937,18 +14918,6 @@ "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", "integrity": "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==" }, - "node_modules/lodash.uniqby": { - "dev": true, - "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==", - "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", - "version": "4.7.0" - }, - "node_modules/lodash.values": { - "dev": true, - "integrity": "sha512-r0RwvdCv8id9TUblb/O7rYPwVy6lerCbcawrfdo9iC/1t1wsNMJknO79WNBgwkH0hIeJ08jmvvESbFpNb4jH0Q==", - "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-4.3.0.tgz", - "version": "4.3.0" - }, "node_modules/log": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/log/-/log-6.3.1.tgz", @@ -15630,7 +15599,6 @@ } }, "node_modules/nwsapi": { - "dev": true, "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==" @@ -15917,7 +15885,6 @@ } }, "node_modules/packet-reader": { - "devOptional": true, "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==", "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" @@ -15962,6 +15929,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parse5": { + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + }, + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "version": "7.1.2" + }, "node_modules/parse5-htmlparser2-tree-adapter": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", @@ -16093,7 +16071,6 @@ "pg-types": "^2.1.0", "pgpass": "1.x" }, - "devOptional": true, "engines": { "node": ">= 8.0.0" }, @@ -16110,7 +16087,6 @@ } }, "node_modules/pg-cloudflare": { - "dev": true, "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", "optional": true, "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz", @@ -16118,26 +16094,22 @@ "optional": true }, "node_modules/pg-connection-string": { - "devOptional": true, "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==", "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==" }, "node_modules/pg-int8": { - "devOptional": true, "engines": { "node": ">=4.0.0" } }, "node_modules/pg-pool": { - "devOptional": true, "integrity": "sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==", "peerDependencies": { "pg": ">=8.0" } }, "node_modules/pg-protocol": { - "devOptional": true, "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==", "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz", "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==" @@ -16153,7 +16125,6 @@ "postgres-date": "~1.0.4", "postgres-interval": "^1.1.0" }, - "devOptional": true, "engines": { "node": ">=4" } @@ -16165,7 +16136,6 @@ "dependencies": { "split2": "^4.1.0" }, - "devOptional": true, "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", "version": "1.0.5" @@ -16301,19 +16271,16 @@ } }, "node_modules/postgres-array": { - "devOptional": true, "engines": { "node": ">=4" } }, "node_modules/postgres-bytea": { - "devOptional": true, "engines": { "node": ">=0.10.0" } }, "node_modules/postgres-date": { - "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -16325,7 +16292,6 @@ "dependencies": { "xtend": "^4.0.0" }, - "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -16700,12 +16666,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-main-filename": { - "dev": true, - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "version": "2.0.0" - }, "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", @@ -16840,6 +16800,11 @@ "node": ">=8.0" } }, + "node_modules/rrweb-cssom": { + "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", + "version": "0.6.0" + }, "node_modules/run-applescript": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz", @@ -16949,6 +16914,17 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==" }, + "node_modules/saxes": { + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + }, + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "version": "6.0.0" + }, "node_modules/schema-utils": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", @@ -17260,36 +17236,6 @@ "integrity": "sha512-9OzcpsKOT50dO6WsGM0AiDbsN9TjH8zg/pLVOJlDjliSulWpP6Q5ceqp5zTM3eY/aAlYTq1/UBElKby6V+vZiQ==", "dev": true }, - "node_modules/serverless-python-requirements": { - "dependencies": { - "@iarna/toml": "^2.2.5", - "appdirectory": "^0.1.0", - "bluebird": "^3.7.2", - "child-process-ext": "^2.1.1", - "fs-extra": "^10.1.0", - "glob-all": "^3.3.1", - "is-wsl": "^2.2.0", - "jszip": "^3.10.1", - "lodash.get": "^4.4.2", - "lodash.uniqby": "^4.7.0", - "lodash.values": "^4.3.0", - "rimraf": "^3.0.2", - "semver": "^7.6.0", - "set-value": "^4.1.0", - "sha256-file": "1.0.0", - "shell-quote": "^1.8.1" - }, - "dev": true, - "engines": { - "node": ">=12.0" - }, - "integrity": "sha512-+cgHLXT7AnjAiOXF/lIuw9RWz7GrgTmgpq8FijzKuahEMzcK5J1p+8odiX0V3zMm4CWpFBxQrcCcGaq2zmw8dA==", - "peerDependencies": { - "serverless": "^2.32 || 3" - }, - "resolved": "https://registry.npmjs.org/serverless-python-requirements/-/serverless-python-requirements-6.1.0.tgz", - "version": "6.1.0" - }, "node_modules/serverless-webpack": { "version": "5.13.0", "resolved": "https://registry.npmjs.org/serverless-webpack/-/serverless-webpack-5.13.0.tgz", @@ -17539,30 +17485,6 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, - "node_modules/set-blocking": { - "dev": true, - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "version": "2.0.0" - }, - "node_modules/set-value": { - "dependencies": { - "is-plain-object": "^2.0.4", - "is-primitive": "^3.0.1" - }, - "dev": true, - "engines": { - "node": ">=11.0" - }, - "funding": [ - "https://github.com/sponsors/jonschlinkert", - "https://paypal.me/jonathanschlinkert", - "https://jonschlinkert.dev/sponsor" - ], - "integrity": "sha512-zTEg4HL0RwVrqcWs3ztF+x1vkxfm0lP+MQQFPiMJTKVceBwEV0A569Ou8l9IYQG8jOZdMVI1hGsc0tmeD2o/Lw==", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-4.1.0.tgz", - "version": "4.1.0" - }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -17585,12 +17507,6 @@ "sha.js": "bin.js" } }, - "node_modules/sha256-file": { - "dev": true, - "integrity": "sha512-nqf+g0veqgQAkDx0U2y2Tn2KWyADuuludZTw9A7J3D+61rKlIIl9V5TS4mfnwKuXZOH9B7fQyjYJ9pKRHIsAyg==", - "resolved": "https://registry.npmjs.org/sha256-file/-/sha256-file-1.0.0.tgz", - "version": "1.0.0" - }, "node_modules/shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -17622,15 +17538,6 @@ "node": ">=8" } }, - "node_modules/shell-quote": { - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", - "version": "1.8.1" - }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -17745,7 +17652,6 @@ "dev": true }, "node_modules/split2": { - "devOptional": true, "engines": { "node": ">= 10.x" } @@ -18123,7 +18029,6 @@ } }, "node_modules/symbol-tree": { - "dev": true, "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" @@ -18491,6 +18396,17 @@ "node": ">= 4.0.0" } }, + "node_modules/tr46": { + "dependencies": { + "punycode": "^2.3.0" + }, + "engines": { + "node": ">=14" + }, + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "version": "4.1.1" + }, "node_modules/traverse": { "version": "0.6.7", "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.7.tgz", @@ -19336,6 +19252,17 @@ "browser-process-hrtime": "^1.0.0" } }, + "node_modules/w3c-xmlserializer": { + "dependencies": { + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "version": "4.0.0" + }, "node_modules/wait-for-expect": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/wait-for-expect/-/wait-for-expect-3.0.2.tgz", @@ -19372,6 +19299,14 @@ "defaults": "^1.0.3" } }, + "node_modules/webidl-conversions": { + "engines": { + "node": ">=12" + }, + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "version": "7.0.0" + }, "node_modules/webpack": { "version": "5.88.2", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", @@ -19504,6 +19439,48 @@ "node": ">=0.8.x" } }, + "node_modules/whatwg-encoding": { + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=12" + }, + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "version": "2.0.0" + }, + "node_modules/whatwg-encoding/node_modules/iconv-lite": { + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "version": "0.6.3" + }, + "node_modules/whatwg-mimetype": { + "engines": { + "node": ">=12" + }, + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "version": "3.0.0" + }, + "node_modules/whatwg-url": { + "dependencies": { + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=14" + }, + "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", + "version": "12.0.1" + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -19518,12 +19495,6 @@ "node": ">= 8" } }, - "node_modules/which-module": { - "dev": true, - "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", - "version": "2.0.1" - }, "node_modules/which-typed-array": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", @@ -19713,6 +19684,14 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", "version": "8.18.0" }, + "node_modules/xml-name-validator": { + "engines": { + "node": ">=12" + }, + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "version": "4.0.0" + }, "node_modules/xml2js": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", @@ -19734,13 +19713,11 @@ } }, "node_modules/xmlchars": { - "dev": true, "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" }, "node_modules/xtend": { - "devOptional": true, "engines": { "node": ">=0.4" } diff --git a/backend/package.json b/backend/package.json index 2a441954..3db9811b 100644 --- a/backend/package.json +++ b/backend/package.json @@ -9,6 +9,7 @@ "amqplib": "^0.10.3", "aws-sdk": "^2.1551.0", "axios": "^1.6", + "body-parser": "^1.19.0", "bufferutil": "^4.0.7", "class-transformer": "^0.3.1", "class-validator": "^0.14.0", @@ -25,6 +26,7 @@ "helmet": "^4.1.1", "http-proxy-middleware": "^2.0.6", "ip-address": "^9.0.5", + "jsdom": "^22.1", "jsonwebtoken": "^9.0.2", "jwks-rsa": "^3.0", "lodash": "^4.17.21", @@ -33,7 +35,9 @@ "p-queue": "^6.6.2", "p-retry": "^4.6.1", "papaparse": "^5.3.1", + "pg": "^8.11", "portscanner": "^2.2.0", + "reflect-metadata": "^0.1.13", "sanitizer": "^0.1.3", "serverless-better-credentials": "^2.0.0", "serverless-http": "^3.2.0", @@ -69,7 +73,6 @@ "jest": "^27", "json-schema-to-typescript": "^13.0", "nock": "^13.0.4", - "pg": "^8.11", "prettier": "^3.0.0", "sentencer": "^0.2.1", "serverless": "^3.30", diff --git a/backend/requirements.txt b/backend/requirements.txt deleted file mode 100644 index b1ec7ec2..00000000 --- a/backend/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -fastapi==0.111.0 -mangum==0.17.0 -uvicorn==0.30.1 diff --git a/backend/serverless.yml b/backend/serverless.yml index a4da0c1a..c3ff44a3 100644 --- a/backend/serverless.yml +++ b/backend/serverless.yml @@ -198,4 +198,3 @@ plugins: - serverless-webpack - serverless-dotenv-plugin - serverless-plugin-ifelse - - serverless-python-requirements diff --git a/backend/src/api/app.ts b/backend/src/api/app.ts index ed8d4ca3..c371cf22 100644 --- a/backend/src/api/app.ts +++ b/backend/src/api/app.ts @@ -505,19 +505,6 @@ app.use( peProxy ); -if (process.env.IS_LOCAL) { - app.use( - '/v3', - createProxyMiddleware({ - target: 'http://python-backend:8000', - changeOrigin: true, - pathRewrite: { - '^/v3': '' - } - }) - ); -} - const checkGlobalAdminOrRegionAdmin = async ( req: Request, res: Response, diff --git a/backend/src/api/functions.yml b/backend/src/api/functions.yml index 481c4d1c..af7968b1 100644 --- a/backend/src/api/functions.yml +++ b/backend/src/api/functions.yml @@ -11,30 +11,4 @@ api: path: /{any+} method: ANY cors: true - package: - include: - - src/** - - node_modules/** - exclude: - - requirements.txt - # provisionedConcurrency: 1 - -fastApi: - handler: python-app.handler - runtime: python3.11 - events: - - http: - path: /v3 - method: ANY - cors: true - - http: - path: /v3/{any+} - method: ANY - cors: true - package: - include: - - src/** - - requirements.txt - exclude: - - node_modules/** diff --git a/backend/src/api/python-app.py b/backend/src/api/python-app.py deleted file mode 100644 index 2adfba4c..00000000 --- a/backend/src/api/python-app.py +++ /dev/null @@ -1,40 +0,0 @@ -""" -A simple FastAPI application with a healthcheck endpoint, designed to run on AWS Lambda using the Mangum adapter. - -Third-Party Libraries: -- fastapi: A modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints. -- mangum: An adapter for using ASGI applications with AWS Lambda & API Gateway. - -This application includes: -- A single healthcheck endpoint (`/healthcheck`) that returns a JSON response with the status of the application. - -Example usage: -1. Deploy this application to AWS Lambda using a serverless framework. -2. Access the healthcheck endpoint via the deployed API Gateway URL to verify the service is running. - -Dependencies: -- fastapi==0.111.0 -- mangum==0.17.0 -- uvicorn==0.30.1 (for local development) -""" - -# Third-Party Libraries -from fastapi import FastAPI -from mangum import Mangum - -app = FastAPI() - - -# Healthcheck endpoint -@app.get("/healthcheck") -async def healthcheck(): - """ - Healthcheck endpoint. - - Returns: - dict: A dictionary containing the health status of the application. - """ - return {"status": "ok"} - - -handler = Mangum(app) diff --git a/docker-compose.yml b/docker-compose.yml index 6310b558..bc2c9ca4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,21 +42,6 @@ services: depends_on: - db - python-backend: - build: - context: ./backend - dockerfile: ./Dockerfile.python - volumes: - - ./backend:/app/src - networks: - - backend - ports: - - '8000:8000' - env_file: - - ./.env - depends_on: - - db - minio: image: bitnami/minio:2020.9.26 user: root