From 465f713624c66fa6f76452c546f8ec8eabcaf37b Mon Sep 17 00:00:00 2001 From: sabarinathan Date: Thu, 30 Jan 2025 12:44:04 +0530 Subject: [PATCH] swagger documentation for Api --- .env | 6 +- .vscode/settings.json | 26 +- compose.yaml | 100 +- package-lock.json | 2104 +++++++++++++++++ package.json | 71 +- serviceFile.ts | 98 +- src/api-server/Dockerfile | 68 +- src/api-server/Routes/camera-Routes.ts | 22 +- src/api-server/Routes/environments-Routes.ts | 16 +- src/api-server/Routes/flooritem-Routes.ts | 18 +- src/api-server/Routes/lines-Routes.ts | 26 +- src/api-server/Routes/share-Routes.ts | 20 +- src/api-server/Routes/user-Routes.ts | 20 +- src/api-server/Routes/wallItems-Routes.ts | 20 +- src/api-server/app.ts | 62 +- .../controller/assets/flooritem-Controller.ts | 136 +- .../controller/assets/wallitem-Controller.ts | 160 +- .../controller/camera/camera-Controlle.ts | 178 +- .../environments/environments-controller.ts | 100 +- .../controller/lines/line-Controller.ts | 250 +- .../controller/share/share-Controller.ts | 86 +- src/api-server/controller/user-Controller.ts | 206 +- src/api-server/main.ts | 47 +- src/shared/connect/mongoose.ts | 94 +- src/shared/model/assets/flooritems-Model.ts | 112 +- src/shared/model/assets/wallitems-Model.ts | 90 +- src/shared/model/camera/camera-Model.ts | 172 +- .../model/environments/environments-Model.ts | 74 +- src/shared/model/lines/lines-Model.ts | 84 +- src/shared/model/user-Model.ts | 136 +- src/shared/security/Hasing.ts | 46 +- src/shared/security/token.ts | 76 +- src/shared/swagger/swagger.ts | 46 + src/socket-server/Dockerfile | 68 +- src/socket-server/index.ts | 45 +- .../services/assets/flooritem-Controller.ts | 106 +- .../services/assets/wallitem-Controller.ts | 120 +- .../services/camera/camera-Controller.ts | 62 +- .../environments/environments-controller.ts | 66 +- .../services/lines/line-Controller.ts | 200 +- .../services/users/user-controller.ts | 194 +- src/socket-server/socket/events.ts | 88 +- src/socket-server/socket/socketManager.ts | 842 +++---- swagger-output.json | 728 ++++++ tsconfig.json | 220 +- 45 files changed, 5201 insertions(+), 2308 deletions(-) create mode 100644 package-lock.json create mode 100644 src/shared/swagger/swagger.ts create mode 100644 swagger-output.json diff --git a/.env b/.env index e024ed1..ed99f79 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -# MONGO_URI=mongodb://127.0.0.1:27017/ -MONGO_URI=mongodb://mongo/ -API_PORT=5000 +# MONGO_URI=mongodb://127.0.0.1:27017/ +MONGO_URI=mongodb://mongo/ +API_PORT=5000 SOCKET_PORT=8000 \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index f03a8f5..faeed09 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,14 +1,14 @@ -{ - "files.exclude": { - "**/.git": true, - "**/.svn": true, - "**/.hg": true, - "**/CVS": true, - "**/.DS_Store": true, - "**/Thumbs.db": true, - "**/.retool_types/**": true, - "**/*tsconfig.json": true, - ".cache": true, - "retool.config.json": true - } +{ + "files.exclude": { + "**/.git": true, + "**/.svn": true, + "**/.hg": true, + "**/CVS": true, + "**/.DS_Store": true, + "**/Thumbs.db": true, + "**/.retool_types/**": true, + "**/*tsconfig.json": true, + ".cache": true, + "retool.config.json": true + } } \ No newline at end of file diff --git a/compose.yaml b/compose.yaml index 481b4a1..105fdcd 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,50 +1,50 @@ - -services: - api-server: - build: # Assuming Dockerfile for API is in the root directory - context: ./ # Root directory context - dockerfile: src/api-server/Dockerfile - container_name: DwinzoApi_end - environment: - NODE_ENV: development - ports: - - "5000:5000" # Host port 5000 mapped to container's port 5000 - expose: - - 5000 - depends_on: - - mongo - networks: - - DwinzoMajor - - socket-server: - build: # Assuming Dockerfile for Socket server is in the root directory - context: ./ # Root directory context - dockerfile: src/socket-server/Dockerfile - container_name: DwinzoSocket_end - environment: - NODE_ENV: development - ports: - - "8000:8000" # Changed host port to avoid conflict with API server - expose: - - 8000 - depends_on: - - mongo - networks: - - DwinzoMajor # Socket server on the same network as the API server - - mongo: - image: mongo:latest - container_name: mongo-Dwinzocontainer - ports: - - "27017:27017" - volumes: - - mongo-data:/data/db - networks: - - DwinzoMajor # Mongo is now on the same network - -volumes: - mongo-data: # Persistent volume for MongoDB data - -networks: - DwinzoMajor: - driver: bridge + +services: + api-server: + build: # Assuming Dockerfile for API is in the root directory + context: ./ # Root directory context + dockerfile: src/api-server/Dockerfile + container_name: DwinzoApi_end + environment: + NODE_ENV: development + ports: + - "5000:5000" # Host port 5000 mapped to container's port 5000 + expose: + - 5000 + depends_on: + - mongo + networks: + - DwinzoMajor + + socket-server: + build: # Assuming Dockerfile for Socket server is in the root directory + context: ./ # Root directory context + dockerfile: src/socket-server/Dockerfile + container_name: DwinzoSocket_end + environment: + NODE_ENV: development + ports: + - "8000:8000" # Changed host port to avoid conflict with API server + expose: + - 8000 + depends_on: + - mongo + networks: + - DwinzoMajor # Socket server on the same network as the API server + + mongo: + image: mongo:latest + container_name: mongo-Dwinzocontainer + ports: + - "27017:27017" + volumes: + - mongo-data:/data/db + networks: + - DwinzoMajor # Mongo is now on the same network + +volumes: + mongo-data: # Persistent volume for MongoDB data + +networks: + DwinzoMajor: + driver: bridge diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..174fae3 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2104 @@ +{ + "name": "dwinzo_major", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "dwinzo_major", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "bcryptjs": "^2.4.3", + "cors": "^2.8.5", + "dotenv": "^16.4.7", + "express": "^4.21.1", + "http": "^0.0.1-security", + "ip": "^2.0.1", + "jsonwebtoken": "^9.0.2", + "mongoose": "^8.8.1", + "socket.io": "^4.8.1", + "swagger-autogen": "^2.23.7", + "swagger-ui-express": "^5.0.1" + }, + "devDependencies": { + "@types/cors": "^2.8.17", + "@types/express": "^5.0.0", + "@types/ip": "^1.1.3", + "@types/jsonwebtoken": "^9.0.7", + "@types/node": "^22.9.0", + "@types/swagger-ui-express": "^4.1.7", + "nodemon": "^3.1.7", + "ts-node": "^10.9.2", + "typescript": "^5.6.3" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz", + "integrity": "sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==", + "dependencies": { + "sparse-bitfield": "^3.0.3" + } + }, + "node_modules/@scarf/scarf": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scarf/scarf/-/scarf-1.4.0.tgz", + "integrity": "sha512-xxeapPiUXdZAE3che6f3xogoJPeZgig6omHEy1rIY5WVsB3H2BHNnZH+gHG6x91SCWyQCzWGsuL2Hh3ClO5/qQ==", + "hasInstallScript": true + }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==" + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dev": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/cors": { + "version": "2.8.17", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz", + "integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.0.tgz", + "integrity": "sha512-DvZriSMehGHL1ZNLzi6MidnsDhUZM/x2pRdDIKdwbUNqqwHxMlRdkxtn6/EPKyqKpHqTl/4nRZsRNLpZxZRpPQ==", + "dev": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^5.0.0", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.5.tgz", + "integrity": "sha512-GLZPrd9ckqEBFMcVM/qRFAP0Hg3qiVEojgEFsx/N/zKXsBzbGF6z5FBDpZ0+Xhp1xr+qRZYjfGr1cWHB9oFHSA==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true + }, + "node_modules/@types/ip": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/ip/-/ip-1.1.3.tgz", + "integrity": "sha512-64waoJgkXFTYnCYDUWgSATJ/dXEBanVkaP5d4Sbk7P6U7cTTMhxVyROTckc6JKdwCrgnAjZMn0k3177aQxtDEA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/jsonwebtoken": { + "version": "9.0.8", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.8.tgz", + "integrity": "sha512-7fx54m60nLFUVYlxAB1xpe9CBWX2vSrk50Y6ogRJ1v5xxtba7qXTg5BgYDN5dq+yuQQ9HaVlHJyAAt1/mxryFg==", + "dev": true, + "dependencies": { + "@types/ms": "*", + "@types/node": "*" + } + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "22.10.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.10.tgz", + "integrity": "sha512-X47y/mPNzxviAGY5TcYPtYL8JsY3kAq2n8fMmKoRCxq/c4v4pyGNCzM2R6+M5/umG4ZfHuT+sgqDYqWc9rJ6ww==", + "dependencies": { + "undici-types": "~6.20.0" + } + }, + "node_modules/@types/qs": { + "version": "6.9.18", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz", + "integrity": "sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==", + "dev": true + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true + }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", + "dev": true, + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/@types/swagger-ui-express": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/swagger-ui-express/-/swagger-ui-express-4.1.7.tgz", + "integrity": "sha512-ovLM9dNincXkzH4YwyYpll75vhzPBlWx6La89wwvYH7mHjVpf0X0K/vR/aUM7SRxmr5tt9z7E5XJcjQ46q+S3g==", + "dev": true, + "dependencies": { + "@types/express": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/webidl-conversions": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", + "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==" + }, + "node_modules/@types/whatwg-url": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", + "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", + "dependencies": { + "@types/webidl-conversions": "*" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "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/base64id": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", + "engines": { + "node": "^4.5.0 || >= 5.9" + } + }, + "node_modules/bcryptjs": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", + "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==" + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bson": { + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.10.1.tgz", + "integrity": "sha512-P92xmHDQjSKPLHqFxefqMxASNq/aWJMEZugpCjf+AF/pgcUpMMQCg7t7+ewko0/u8AapvF3luf/FoehddEK+sA==", + "engines": { + "node": ">=16.20.1" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dotenv": { + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/engine.io": { + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.3.tgz", + "integrity": "sha512-2hkLItQMBkoYSagneiisupWGvsQlWXqzhSMvsjaM8GYbnfUsX7tzYQq9QARnate5LRedVTX+MbkSZAANAr3NtQ==", + "dependencies": { + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", + "accepts": "~1.3.4", + "base64id": "2.0.0", + "cookie": "~1.0.2", + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.17.1" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/engine.io-parser": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", + "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/engine.io/node_modules/cookie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz", + "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==", + "engines": { + "node": ">=18" + } + }, + "node_modules/engine.io/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/engine.io/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.12", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "function-bind": "^1.1.2", + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/http/-/http-0.0.1-security.tgz", + "integrity": "sha512-RnDvP10Ty9FxqOtPZuxtebw1j4L/WiqNMDtuc1YMH1XQm5TgDRaR1G9u8upL6KD1bXHSp9eSXo/ED+8Q7FAr+g==" + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", + "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/kareem": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz", + "integrity": "sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==" + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mongodb": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.12.0.tgz", + "integrity": "sha512-RM7AHlvYfS7jv7+BXund/kR64DryVI+cHbVAy9P61fnb1RcWZqOW1/Wj2YhqMCx+MuYhqTRGv7AwHBzmsCKBfA==", + "dependencies": { + "@mongodb-js/saslprep": "^1.1.9", + "bson": "^6.10.1", + "mongodb-connection-string-url": "^3.0.0" + }, + "engines": { + "node": ">=16.20.1" + }, + "peerDependencies": { + "@aws-sdk/credential-providers": "^3.188.0", + "@mongodb-js/zstd": "^1.1.0 || ^2.0.0", + "gcp-metadata": "^5.2.0", + "kerberos": "^2.0.1", + "mongodb-client-encryption": ">=6.0.0 <7", + "snappy": "^7.2.2", + "socks": "^2.7.1" + }, + "peerDependenciesMeta": { + "@aws-sdk/credential-providers": { + "optional": true + }, + "@mongodb-js/zstd": { + "optional": true + }, + "gcp-metadata": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "snappy": { + "optional": true + }, + "socks": { + "optional": true + } + } + }, + "node_modules/mongodb-connection-string-url": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.2.tgz", + "integrity": "sha512-rMO7CGo/9BFwyZABcKAWL8UJwH/Kc2x0g72uhDWzG48URRax5TCIcJ7Rc3RZqffZzO/Gwff/jyKwCU9TN8gehA==", + "dependencies": { + "@types/whatwg-url": "^11.0.2", + "whatwg-url": "^14.1.0 || ^13.0.0" + } + }, + "node_modules/mongoose": { + "version": "8.9.5", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.9.5.tgz", + "integrity": "sha512-SPhOrgBm0nKV3b+IIHGqpUTOmgVL5Z3OO9AwkFEmvOZznXTvplbomstCnPOGAyungtRXE5pJTgKpKcZTdjeESg==", + "dependencies": { + "bson": "^6.10.1", + "kareem": "2.6.3", + "mongodb": "~6.12.0", + "mpath": "0.9.0", + "mquery": "5.0.0", + "ms": "2.1.3", + "sift": "17.1.3" + }, + "engines": { + "node": ">=16.20.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } + }, + "node_modules/mongoose/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/mpath": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", + "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mquery": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", + "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==", + "dependencies": { + "debug": "4.x" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/mquery/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mquery/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nodemon": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.9.tgz", + "integrity": "sha512-hdr1oIb2p6ZSxu3PB2JWWYS7ZQ0qvaZsc3hK8DR8f02kRzc8rjYmxAIvdz+aYC+8F2IjNaB7HMcSDg8nQpJxyg==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sift": { + "version": "17.1.3", + "resolved": "https://registry.npmjs.org/sift/-/sift-17.1.3.tgz", + "integrity": "sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==" + }, + "node_modules/simple-update-notifier": { + "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.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/socket.io": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz", + "integrity": "sha512-oZ7iUCxph8WYRHHcjBEc9unw3adt5CmSNlppj/5Q4k2RIrhl8Z5yY2Xr4j9zj0+wzVZ0bxmYoGSzKJnRl6A4yg==", + "dependencies": { + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "cors": "~2.8.5", + "debug": "~4.3.2", + "engine.io": "~6.6.0", + "socket.io-adapter": "~2.5.2", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/socket.io-adapter": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz", + "integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==", + "dependencies": { + "debug": "~4.3.4", + "ws": "~8.17.1" + } + }, + "node_modules/socket.io-adapter/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io-adapter/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/socket.io-parser": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-parser/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io-parser/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/socket.io/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/swagger-autogen": { + "version": "2.23.7", + "resolved": "https://registry.npmjs.org/swagger-autogen/-/swagger-autogen-2.23.7.tgz", + "integrity": "sha512-vr7uRmuV0DCxWc0wokLJAwX3GwQFJ0jwN+AWk0hKxre2EZwusnkGSGdVFd82u7fQLgwSTnbWkxUL7HXuz5LTZQ==", + "dependencies": { + "acorn": "^7.4.1", + "deepmerge": "^4.2.2", + "glob": "^7.1.7", + "json5": "^2.2.3" + } + }, + "node_modules/swagger-autogen/node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/swagger-ui-dist": { + "version": "5.18.3", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.18.3.tgz", + "integrity": "sha512-G33HFW0iFNStfY2x6QXO2JYVMrFruc8AZRX0U/L71aA7WeWfX2E5Nm8E/tsipSZJeIZZbSjUDeynLK/wcuNWIw==", + "dependencies": { + "@scarf/scarf": "=1.4.0" + } + }, + "node_modules/swagger-ui-express": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/swagger-ui-express/-/swagger-ui-express-5.0.1.tgz", + "integrity": "sha512-SrNU3RiBGTLLmFU8GIJdOdanJTl4TOmT27tt3bWWHppqYmAZ6IDuEuBvMU6nZq0zLEe6b/1rACXCgLZqO6ZfrA==", + "dependencies": { + "swagger-ui-dist": ">=5.0.0" + }, + "engines": { + "node": ">= v0.10.32" + }, + "peerDependencies": { + "express": ">=4.0.0 || >=5.0.0-beta" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "dev": true, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/tr46": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, + "node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.1.0.tgz", + "integrity": "sha512-jlf/foYIKywAt3x/XWKZ/3rz8OSJPiWktjmk891alJUEjiVxKX9LEO92qH3hv4aJ0mN3MWPvGMCy8jQi95xK4w==", + "dependencies": { + "tr46": "^5.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + } + } +} diff --git a/package.json b/package.json index b1d318a..a2b1de1 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,38 @@ -{ - "name": "dwinzo_major", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "start:api": "nodemon --exec ts-node src/api-server/main.ts", - "start:socket": "nodemon --exec ts-node src/socket-server/index.ts" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "bcryptjs": "^2.4.3", - "cors": "^2.8.5", - "dotenv": "^16.4.5", - "express": "^4.21.1", - "http": "^0.0.1-security", - "jsonwebtoken": "^9.0.2", - "mongoose": "^8.8.1", - "socket.io": "^4.8.1" - }, - "devDependencies": { - "@types/cors": "^2.8.17", - "@types/express": "^5.0.0", - "@types/jsonwebtoken": "^9.0.7", - "@types/node": "^22.9.0", - "nodemon": "^3.1.7", - "ts-node": "^10.9.2", - "typescript": "^5.6.3" - } -} +{ + "name": "dwinzo_major", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start:api": "nodemon --exec ts-node src/api-server/main.ts", + "start:socket": "nodemon --exec ts-node src/socket-server/index.ts" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "bcryptjs": "^2.4.3", + "cors": "^2.8.5", + "dotenv": "^16.4.7", + "express": "^4.21.1", + "http": "^0.0.1-security", + "ip": "^2.0.1", + "jsonwebtoken": "^9.0.2", + "mongoose": "^8.8.1", + "socket.io": "^4.8.1", + "swagger-autogen": "^2.23.7", + "swagger-ui-express": "^5.0.1" + }, + "devDependencies": { + "@types/cors": "^2.8.17", + "@types/express": "^5.0.0", + "@types/ip": "^1.1.3", + "@types/jsonwebtoken": "^9.0.7", + "@types/node": "^22.9.0", + "@types/swagger-ui-express": "^4.1.7", + "nodemon": "^3.1.7", + "ts-node": "^10.9.2", + "typescript": "^5.6.3" + } +} diff --git a/serviceFile.ts b/serviceFile.ts index 2b4324f..4d5869a 100644 --- a/serviceFile.ts +++ b/serviceFile.ts @@ -1,50 +1,50 @@ -let url_Backend_dwinzoMajor = "http://192.168.0.110:3503"; -//Login Api -export const createCamera = async (userId:string, position:Object) => { - try { - const response = await fetch(`${url_Backend_dwinzoMajor}/api/v1/createCamera`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ userId, position }), - }); - - if (!response.ok) { - throw new Error("Failed to create Camera"); - } - - const result = await response.json(); - return result; - } catch (error) { - if (error instanceof Error) { - throw new Error(error.message); // Now TypeScript knows `error` is an instance of `Error` - } else { - throw new Error("An unknown error occurred"); - } - } - }; - - export const getCamera = async (userId:string) => { - try { - const response = await fetch(`${url_Backend_dwinzoMajor}/api/v1/getCamera/${userId}`, { - method: "GET", - headers: { - "Content-Type": "application/json", - }, - }); - - if (!response.ok) { - throw new Error("Failed to get Camera"); - } - - const result = await response.json(); - return result; - } catch (error) { - if (error instanceof Error) { - throw new Error(error.message); // Now TypeScript knows `error` is an instance of `Error` - } else { - throw new Error("An unknown error occurred"); - } - } +let url_Backend_dwinzoMajor = "http://192.168.0.110:3503"; +//Login Api +export const createCamera = async (userId:string, position:Object) => { + try { + const response = await fetch(`${url_Backend_dwinzoMajor}/api/v1/createCamera`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ userId, position }), + }); + + if (!response.ok) { + throw new Error("Failed to create Camera"); + } + + const result = await response.json(); + return result; + } catch (error) { + if (error instanceof Error) { + throw new Error(error.message); // Now TypeScript knows `error` is an instance of `Error` + } else { + throw new Error("An unknown error occurred"); + } + } + }; + + export const getCamera = async (userId:string) => { + try { + const response = await fetch(`${url_Backend_dwinzoMajor}/api/v1/getCamera/${userId}`, { + method: "GET", + headers: { + "Content-Type": "application/json", + }, + }); + + if (!response.ok) { + throw new Error("Failed to get Camera"); + } + + const result = await response.json(); + return result; + } catch (error) { + if (error instanceof Error) { + throw new Error(error.message); // Now TypeScript knows `error` is an instance of `Error` + } else { + throw new Error("An unknown error occurred"); + } + } }; \ No newline at end of file diff --git a/src/api-server/Dockerfile b/src/api-server/Dockerfile index bc4a711..cd31368 100644 --- a/src/api-server/Dockerfile +++ b/src/api-server/Dockerfile @@ -1,35 +1,35 @@ -ARG NODE_VERSION=lts - -FROM node:${NODE_VERSION}-alpine AS development -# Use production node environment by default. - -ENV NODE_ENV development - -WORKDIR /usr/src/app - -RUN npm install -g npm - -COPY package.json /usr/src/app/package.json - - -# COPY package-lock.json /usr/src/app/package-lock.json - - -RUN npm install - -# Run the application as a non-root user. -USER root - -# Copy the rest of the source files into the image. - - -COPY . . -# Expose the port that the application listens on. - -EXPOSE 3503 - - -# Run the application. - - +ARG NODE_VERSION=lts + +FROM node:${NODE_VERSION}-alpine AS development +# Use production node environment by default. + +ENV NODE_ENV development + +WORKDIR /usr/src/app + +RUN npm install -g npm + +COPY package.json /usr/src/app/package.json + + +# COPY package-lock.json /usr/src/app/package-lock.json + + +RUN npm install + +# Run the application as a non-root user. +USER root + +# Copy the rest of the source files into the image. + + +COPY . . +# Expose the port that the application listens on. + +EXPOSE 3503 + + +# Run the application. + + CMD ["npm", "run", "start:api"] \ No newline at end of file diff --git a/src/api-server/Routes/camera-Routes.ts b/src/api-server/Routes/camera-Routes.ts index 0003973..a3f9d29 100644 --- a/src/api-server/Routes/camera-Routes.ts +++ b/src/api-server/Routes/camera-Routes.ts @@ -1,11 +1,11 @@ -import express from 'express'; -import { camera } from '../controller/camera/camera-Controlle'; - -const router = express.Router(); - -router.post('/setCamera',camera.createCamera) -router.get('/getCamera/:organization/:userId',camera.getCamera) -router.get('/activeCameras/:organization',camera.onlineActiveDatas) - - -export default router; +import express from 'express'; +import { camera } from '../controller/camera/camera-Controlle'; + +const router = express.Router(); + +router.post('/setCamera',camera.createCamera) +router.get('/getCamera/:organization/:userId',camera.getCamera) +router.get('/activeCameras/:organization',camera.onlineActiveDatas) + + +export default router; diff --git a/src/api-server/Routes/environments-Routes.ts b/src/api-server/Routes/environments-Routes.ts index 8dfba1c..17046c9 100644 --- a/src/api-server/Routes/environments-Routes.ts +++ b/src/api-server/Routes/environments-Routes.ts @@ -1,9 +1,9 @@ -import express from 'express'; -import { environment } from '../controller/environments/environments-controller'; - -const router = express.Router(); -router.post('/setEvironments',environment.setEnvironment) -router.get('/findEnvironments/:organization/:userId',environment.getEnvironment) - - +import express from 'express'; +import { environment } from '../controller/environments/environments-controller'; + +const router = express.Router(); +router.post('/setEvironments',environment.setEnvironment) +router.get('/findEnvironments/:organization/:userId',environment.getEnvironment) + + export default router; \ No newline at end of file diff --git a/src/api-server/Routes/flooritem-Routes.ts b/src/api-server/Routes/flooritem-Routes.ts index 43e3aec..02568b8 100644 --- a/src/api-server/Routes/flooritem-Routes.ts +++ b/src/api-server/Routes/flooritem-Routes.ts @@ -1,10 +1,10 @@ -import express from 'express'; -import { floorItems } from '../controller/assets/flooritem-Controller'; - -const router = express.Router(); -router.post('/setfloorItems',floorItems.setFloorItems) -router.get('/findfloorItems/:organization',floorItems.getFloorItems) -router.delete('/deletefloorItem',floorItems.deleteFloorItems) - - +import express from 'express'; +import { floorItems } from '../controller/assets/flooritem-Controller'; + +const router = express.Router(); +router.post('/setfloorItems',floorItems.setFloorItems) +router.get('/findfloorItems/:organization',floorItems.getFloorItems) +router.delete('/deletefloorItem',floorItems.deleteFloorItems) + + export default router; \ No newline at end of file diff --git a/src/api-server/Routes/lines-Routes.ts b/src/api-server/Routes/lines-Routes.ts index 97c3847..2bfcff8 100644 --- a/src/api-server/Routes/lines-Routes.ts +++ b/src/api-server/Routes/lines-Routes.ts @@ -1,14 +1,14 @@ -import express from 'express'; -import { lines } from '../controller/lines/line-Controller'; - - -const router = express.Router(); -router.post('/setLine',lines.setLines) -router.post('/updatePoint',lines.updateLines) -router.get('/findLines/:organization',lines.getLines) -router.delete('/deleteLine',lines.deleteLineItems) -router.delete('/deletePoint',lines.deleteLinPoiteItems) -router.post('/deleteLayer',lines.deleteLayer) - - +import express from 'express'; +import { lines } from '../controller/lines/line-Controller'; + + +const router = express.Router(); +router.post('/setLine',lines.setLines) +router.post('/updatePoint',lines.updateLines) +router.get('/findLines/:organization',lines.getLines) +router.delete('/deleteLine',lines.deleteLineItems) +router.delete('/deletePoint',lines.deleteLinPoiteItems) +router.post('/deleteLayer',lines.deleteLayer) + + export default router; \ No newline at end of file diff --git a/src/api-server/Routes/share-Routes.ts b/src/api-server/Routes/share-Routes.ts index 8ada476..cb41051 100644 --- a/src/api-server/Routes/share-Routes.ts +++ b/src/api-server/Routes/share-Routes.ts @@ -1,11 +1,11 @@ -import express from 'express'; -import { share } from '../controller/share/share-Controller'; - - -const router = express.Router(); - -router.post('/shareUser',share.shareUser) -router.get('/findshareUsers',share.findshareUser) - - +import express from 'express'; +import { share } from '../controller/share/share-Controller'; + + +const router = express.Router(); + +router.post('/shareUser',share.shareUser) +router.get('/findshareUsers',share.findshareUser) + + export default router; \ No newline at end of file diff --git a/src/api-server/Routes/user-Routes.ts b/src/api-server/Routes/user-Routes.ts index c110913..64c321b 100644 --- a/src/api-server/Routes/user-Routes.ts +++ b/src/api-server/Routes/user-Routes.ts @@ -1,10 +1,10 @@ -import express from 'express'; -import { user } from '../controller/user-Controller'; - -const router = express.Router(); - -router.post('/signup',user.signup) -router.post('/login',user.login) - - -export default router; +import express from 'express'; +import { user } from '../controller/user-Controller'; + +const router = express.Router(); + +router.post('/signup',user.signup) +router.post('/login',user.login) + + +export default router; diff --git a/src/api-server/Routes/wallItems-Routes.ts b/src/api-server/Routes/wallItems-Routes.ts index 4ffbc52..143d5aa 100644 --- a/src/api-server/Routes/wallItems-Routes.ts +++ b/src/api-server/Routes/wallItems-Routes.ts @@ -1,11 +1,11 @@ -import express from 'express'; -import { wallItems } from '../controller/assets/wallitem-Controller'; - - -const router = express.Router(); -router.post('/setWallItems',wallItems.setWallItems) -router.get('/findWallItems/:organization',wallItems.getWallItems) -router.delete('/deleteWallItem',wallItems.deleteWallItems) - - +import express from 'express'; +import { wallItems } from '../controller/assets/wallitem-Controller'; + + +const router = express.Router(); +router.post('/setWallItems',wallItems.setWallItems) +router.get('/findWallItems/:organization',wallItems.getWallItems) +router.delete('/deleteWallItem',wallItems.deleteWallItems) + + export default router; \ No newline at end of file diff --git a/src/api-server/app.ts b/src/api-server/app.ts index 0969d18..10b54a7 100644 --- a/src/api-server/app.ts +++ b/src/api-server/app.ts @@ -1,31 +1,31 @@ -import express from 'express'; -import cors from 'cors'; -import connectDB from '../shared/connect/mongoose'; -import dotenv from 'dotenv'; -import cameraRoutes from './Routes/camera-Routes' -import environmentsRoutes from './Routes/environments-Routes' -import linesRoutes from './Routes/lines-Routes' -import flooritemRoutes from './Routes/flooritem-Routes' -import WallitemRoutes from './Routes/wallItems-Routes' -import userRoutes from './Routes/user-Routes' -import shareRoutes from './Routes/share-Routes' - -const app = express(); -app.use(cors()); -app.use(express.json()); -dotenv.config(); -app.get('/', (req, res) => { - res.send('Hello, I am Major-Dwinzo API!'); - }); -// connectDB(); -app.get('/health',(req,res)=>{ - res.status(200).json({ message: 'Server is running' }); -}) -app.use('/api/v1', cameraRoutes); -app.use('/api/v1', environmentsRoutes); -app.use('/api/v1', linesRoutes); -app.use('/api/v1', flooritemRoutes); -app.use('/api/v1', WallitemRoutes); -app.use('/api/v1', userRoutes); -app.use('/api/v1', shareRoutes); -export default app; +import express from 'express'; +import cors from 'cors'; +import connectDB from '../shared/connect/mongoose'; +import dotenv from 'dotenv'; +import cameraRoutes from './Routes/camera-Routes' +import environmentsRoutes from './Routes/environments-Routes' +import linesRoutes from './Routes/lines-Routes' +import flooritemRoutes from './Routes/flooritem-Routes' +import WallitemRoutes from './Routes/wallItems-Routes' +import userRoutes from './Routes/user-Routes' +import shareRoutes from './Routes/share-Routes' + +const app = express(); +app.use(cors()); +app.use(express.json()); +dotenv.config(); +app.get('/', (req, res) => { + res.send('Hello, I am Major-Dwinzo API!'); + }); +// connectDB(); +app.get('/health',(req,res)=>{ + res.status(200).json({ message: 'Server is running' }); +}) +app.use('/api/v1', cameraRoutes); +app.use('/api/v1', environmentsRoutes); +app.use('/api/v1', linesRoutes); +app.use('/api/v1', flooritemRoutes); +app.use('/api/v1', WallitemRoutes); +app.use('/api/v1', userRoutes); +app.use('/api/v1', shareRoutes); +export default app; diff --git a/src/api-server/controller/assets/flooritem-Controller.ts b/src/api-server/controller/assets/flooritem-Controller.ts index a45a5ad..893af0b 100644 --- a/src/api-server/controller/assets/flooritem-Controller.ts +++ b/src/api-server/controller/assets/flooritem-Controller.ts @@ -1,68 +1,68 @@ -import { Request, Response } from "express"; -import floorItemsModel from "../../../shared/model/assets/flooritems-Model"; - - -export class floorItems { - static async setFloorItems(req: Request, res: Response) { - try { - const { modeluuid, modelname, position, modelfileID,rotation,isLocked,isVisible,organization } = req.body - - - const findvalue = await floorItemsModel(organization).findOne({ modeluuid: modeluuid,modelname:modelname }) - - if (findvalue) { - - const updatevalue = await floorItemsModel(organization).findOneAndUpdate( - { modeluuid: modeluuid,modelname:modelname }, { position: position, rotation: rotation,isVisible:isVisible,isLocked:isLocked }, { new: true }); - res.status(201).json(updatevalue); - - - } else { - - const newValue = await floorItemsModel(organization).create({ modeluuid, modelfileID,modelname, position, rotation,isLocked,isVisible, }); - - - res.status(201).json(newValue); - - } - - // Send response with the created document - } catch (error) { - console.error('Error creating flooritems:', error); - res.status(500).json({ message: "Failed to create flooritems" }); - } - } - static async getFloorItems(req: Request, res: Response) { - try { - const { organization } = req.params; - // console.log('req.params: ', req.params); - - const findValue = await floorItemsModel(organization).find() - if (!findValue) { - res.status(200).json("floorItems not found"); - } else { - - res.status(201).json(findValue); - } - } catch (error) { - console.error('Error get flooritems:', error); - res.status(500).json({ error: "Failed to get flooritems" }); - } - } - static async deleteFloorItems(req: Request, res: Response) { - try { - const { modeluuid,modelname,organization } = req.body; - - const findValue = await floorItemsModel(organization).findOneAndDelete({modeluuid:modeluuid,modelname:modelname}) - if (!findValue) { - res.status(200).json("user not found"); - } else { - - res.status(201).json(findValue); - } - } catch (error) { - console.error('Error get flooritems:', error); - res.status(500).json({ error: "Failed to get flooritems" }); - } - } -} +import { Request, Response } from "express"; +import floorItemsModel from "../../../shared/model/assets/flooritems-Model"; + + +export class floorItems { + static async setFloorItems(req: Request, res: Response) { + try { + const { modeluuid, modelname, position, modelfileID,rotation,isLocked,isVisible,organization } = req.body + + + const findvalue = await floorItemsModel(organization).findOne({ modeluuid: modeluuid,modelname:modelname }) + + if (findvalue) { + + const updatevalue = await floorItemsModel(organization).findOneAndUpdate( + { modeluuid: modeluuid,modelname:modelname }, { position: position, rotation: rotation,isVisible:isVisible,isLocked:isLocked }, { new: true }); + res.status(201).json(updatevalue); + + + } else { + + const newValue = await floorItemsModel(organization).create({ modeluuid, modelfileID,modelname, position, rotation,isLocked,isVisible, }); + + + res.status(201).json(newValue); + + } + + // Send response with the created document + } catch (error) { + console.error('Error creating flooritems:', error); + res.status(500).json({ message: "Failed to create flooritems" }); + } + } + static async getFloorItems(req: Request, res: Response) { + try { + const { organization } = req.params; + // console.log('req.params: ', req.params); + + const findValue = await floorItemsModel(organization).find() + if (!findValue) { + res.status(200).json("floorItems not found"); + } else { + + res.status(201).json(findValue); + } + } catch (error) { + console.error('Error get flooritems:', error); + res.status(500).json({ error: "Failed to get flooritems" }); + } + } + static async deleteFloorItems(req: Request, res: Response) { + try { + const { modeluuid,modelname,organization } = req.body; + + const findValue = await floorItemsModel(organization).findOneAndDelete({modeluuid:modeluuid,modelname:modelname}) + if (!findValue) { + res.status(200).json("user not found"); + } else { + + res.status(201).json(findValue); + } + } catch (error) { + console.error('Error get flooritems:', error); + res.status(500).json({ error: "Failed to get flooritems" }); + } + } +} diff --git a/src/api-server/controller/assets/wallitem-Controller.ts b/src/api-server/controller/assets/wallitem-Controller.ts index 8ab2558..ff9ad78 100644 --- a/src/api-server/controller/assets/wallitem-Controller.ts +++ b/src/api-server/controller/assets/wallitem-Controller.ts @@ -1,80 +1,80 @@ -import { Request, Response } from "express"; -import wallItenmModel from "../../../shared/model/assets/wallitems-Model"; - - -export class wallItems { - static async setWallItems(req: Request, res: Response) { - try { - const { modeluuid, modelname, position, type, csgposition,csgscale,quaternion,scale,organization } = req.body - - - const findvalue = await wallItenmModel(organization).findOne({ modeluuid: modeluuid}) - - if (findvalue) { - const updatevalue = await wallItenmModel(organization).findOneAndUpdate( - { modeluuid: modeluuid }, - { - modelname, - position, - type, - csgposition, - csgscale, - quaternion, - scale, - }, - { new: true } // Return the updated document - ); - res.status(201).json(updatevalue); - - - } else { - const newValue = await wallItenmModel(organization).create({ modeluuid,modelname, position, type, csgposition,csgscale,quaternion,scale }); - - - res.status(201).json(newValue); - - } - - // Send response with the created document - } catch (error) { - console.error('Error creating wallitems:', error); - res.status(500).json({ message: "Failed to create wallitems" }); - } - } - static async getWallItems(req: Request, res: Response) { - try { - const { organization } = req.params; - - - const findValue = await wallItenmModel -(organization).find() - if (!findValue) { - res.status(200).json("wallitems not found"); - } else { - - res.status(201).json(findValue); - } - } catch (error) { - console.error('Error get wallitems:', error); - res.status(500).json({ error: "Failed to get wallitems" }); - } - } - static async deleteWallItems(req: Request, res: Response) { - try { - const { modeluuid,modelname,organization } = req.body; - - - const findValue = await wallItenmModel -(organization).findOneAndDelete({modeluuid:modeluuid,modelname:modelname}) - if (!findValue) { - res.status(200).json("user not found"); - } else { - - res.status(201).json(findValue); - } - } catch (error) { - console.error('Error get wallitems:', error); - res.status(500).json({ error: "Failed to get wallitems" }); - } - } -} +import { Request, Response } from "express"; +import wallItenmModel from "../../../shared/model/assets/wallitems-Model"; + + +export class wallItems { + static async setWallItems(req: Request, res: Response) { + try { + const { modeluuid, modelname, position, type, csgposition,csgscale,quaternion,scale,organization } = req.body + + + const findvalue = await wallItenmModel(organization).findOne({ modeluuid: modeluuid}) + + if (findvalue) { + const updatevalue = await wallItenmModel(organization).findOneAndUpdate( + { modeluuid: modeluuid }, + { + modelname, + position, + type, + csgposition, + csgscale, + quaternion, + scale, + }, + { new: true } // Return the updated document + ); + res.status(201).json(updatevalue); + + + } else { + const newValue = await wallItenmModel(organization).create({ modeluuid,modelname, position, type, csgposition,csgscale,quaternion,scale }); + + + res.status(201).json(newValue); + + } + + // Send response with the created document + } catch (error) { + console.error('Error creating wallitems:', error); + res.status(500).json({ message: "Failed to create wallitems" }); + } + } + static async getWallItems(req: Request, res: Response) { + try { + const { organization } = req.params; + + + const findValue = await wallItenmModel +(organization).find() + if (!findValue) { + res.status(200).json("wallitems not found"); + } else { + + res.status(201).json(findValue); + } + } catch (error) { + console.error('Error get wallitems:', error); + res.status(500).json({ error: "Failed to get wallitems" }); + } + } + static async deleteWallItems(req: Request, res: Response) { + try { + const { modeluuid,modelname,organization } = req.body; + + + const findValue = await wallItenmModel +(organization).findOneAndDelete({modeluuid:modeluuid,modelname:modelname}) + if (!findValue) { + res.status(200).json("user not found"); + } else { + + res.status(201).json(findValue); + } + } catch (error) { + console.error('Error get wallitems:', error); + res.status(500).json({ error: "Failed to get wallitems" }); + } + } +} diff --git a/src/api-server/controller/camera/camera-Controlle.ts b/src/api-server/controller/camera/camera-Controlle.ts index 94b5f79..e53c4e3 100644 --- a/src/api-server/controller/camera/camera-Controlle.ts +++ b/src/api-server/controller/camera/camera-Controlle.ts @@ -1,89 +1,89 @@ -import { Request, Response } from "express"; -import cameraModel from "../../../shared/model/camera/camera-Model"; -import userModel from "../../../shared/model/user-Model"; - -export class camera { - static async createCamera(req: Request, res: Response) { - try { - const { userId, position, target, rotation,organization } = req.body - - - const findCamera = await cameraModel(organization).findOne({ userId: userId }) - - if (findCamera) { - const updateCamera = await cameraModel(organization).findOneAndUpdate( - { userId: userId }, { position: position, target: target,rotation:rotation }, { new: true }); - res.status(201).json(updateCamera); - - } else { - const newCamera = await cameraModel(organization).create({ userId, position, target,rotation }); - - res.status(201).json(newCamera); - - } - - // Send response with the created document - } catch (error) { - console.error('Error creating camera:', error); - res.status(500).json({message:"Failed to create camera"}); - } - } - static async getCamera(req: Request, res: Response) { - try { - const { userId, organization } = req.params; - -// if (!userId) { -// res.status(201).json("User data is insufficient"); -// } - const findCamera = await cameraModel(organization).findOne({ userId: userId }) - if (!findCamera) { - res.status(200).json("user not found"); - } else { - - res.status(201).json(findCamera); - } - } catch (error) { - console.error('Error get camera:', error); - res.status(500).json({ error: "Failed to get camera" }); - } - } - - static async onlineActiveDatas(req: Request, res: Response) { - const {organization } = req.params; - try { - const findactiveUsers = await userModel(organization).find({activeStatus:"online"}) - - - const cameraDataPromises = findactiveUsers.map(async (activeUser) => { - const cameraData = await cameraModel(organization) - .findOne({ userId: activeUser._id }) - .select("position target rotation -_id"); - - if (cameraData) { - return { - position: cameraData.position, - target: cameraData.target, - rotation:cameraData.rotation, - userData: { - _id: activeUser._id, - userName: activeUser.userName, - email: activeUser.email, - activeStatus: activeUser.activeStatus, - }, - }; - } - - // Return null if no camera data is found for the user - return null; - }); - - const cameraDatas = (await Promise.all(cameraDataPromises)).filter((singledata:any) => singledata !== null); - - - res.status(200).send({ cameraDatas }); - - } catch (error:any) { - res.status(500).send(error); - } - } -} +import { Request, Response } from "express"; +import cameraModel from "../../../shared/model/camera/camera-Model"; +import userModel from "../../../shared/model/user-Model"; + +export class camera { + static async createCamera(req: Request, res: Response) { + try { + const { userId, position, target, rotation,organization } = req.body + + + const findCamera = await cameraModel(organization).findOne({ userId: userId }) + + if (findCamera) { + const updateCamera = await cameraModel(organization).findOneAndUpdate( + { userId: userId }, { position: position, target: target,rotation:rotation }, { new: true }); + res.status(201).json(updateCamera); + + } else { + const newCamera = await cameraModel(organization).create({ userId, position, target,rotation }); + + res.status(201).json(newCamera); + + } + + // Send response with the created document + } catch (error) { + console.error('Error creating camera:', error); + res.status(500).json({message:"Failed to create camera"}); + } + } + static async getCamera(req: Request, res: Response) { + try { + const { userId, organization } = req.params; + +// if (!userId) { +// res.status(201).json("User data is insufficient"); +// } + const findCamera = await cameraModel(organization).findOne({ userId: userId }) + if (!findCamera) { + res.status(200).json("user not found"); + } else { + + res.status(201).json(findCamera); + } + } catch (error) { + console.error('Error get camera:', error); + res.status(500).json({ error: "Failed to get camera" }); + } + } + + static async onlineActiveDatas(req: Request, res: Response) { + const {organization } = req.params; + try { + const findactiveUsers = await userModel(organization).find({activeStatus:"online"}) + + + const cameraDataPromises = findactiveUsers.map(async (activeUser) => { + const cameraData = await cameraModel(organization) + .findOne({ userId: activeUser._id }) + .select("position target rotation -_id"); + + if (cameraData) { + return { + position: cameraData.position, + target: cameraData.target, + rotation:cameraData.rotation, + userData: { + _id: activeUser._id, + userName: activeUser.userName, + email: activeUser.email, + activeStatus: activeUser.activeStatus, + }, + }; + } + + // Return null if no camera data is found for the user + return null; + }); + + const cameraDatas = (await Promise.all(cameraDataPromises)).filter((singledata:any) => singledata !== null); + + + res.status(200).send({ cameraDatas }); + + } catch (error:any) { + res.status(500).send(error); + } + } +} diff --git a/src/api-server/controller/environments/environments-controller.ts b/src/api-server/controller/environments/environments-controller.ts index 80d8162..d93fbf3 100644 --- a/src/api-server/controller/environments/environments-controller.ts +++ b/src/api-server/controller/environments/environments-controller.ts @@ -1,50 +1,50 @@ -import { Request, Response } from "express"; -import environmentModel from "../../../shared/model/environments/environments-Model"; - -export class environment { - static async setEnvironment(req: Request, res: Response) { - try { - const { userId,roofVisibility,wallVisibility, organization } = req.body - - - const findvalue = await environmentModel(organization).findOne({ userId: userId }) - - if (findvalue) { - - const updatevalue = await environmentModel(organization).findOneAndUpdate( - { userId: userId }, { roofVisibility:roofVisibility,wallVisibility:wallVisibility }, { new: true }); - res.status(201).json(updatevalue); - - - } else { - const newValue = await environmentModel(organization).create({ userId, roofVisibility, wallVisibility }); - - - res.status(201).json(newValue); - - } - - // Send response with the created document - } catch (error) { - console.error('Error creating environments:', error); - res.status(500).json({message:"Failed to create environments"}); - } - } - static async getEnvironment(req: Request, res: Response) { - try { - const { userId, organization } = req.params; - - - const findValue = await environmentModel(organization).findOne({ userId: userId }) - if (!findValue) { - res.status(200).json("user not found"); - } else { - - res.status(201).json(findValue); - } - } catch (error) { - console.error('Error get environments:', error); - res.status(500).json({ error: "Failed to get environments" }); - } - } -} +import { Request, Response } from "express"; +import environmentModel from "../../../shared/model/environments/environments-Model"; + +export class environment { + static async setEnvironment(req: Request, res: Response) { + try { + const { userId,roofVisibility,wallVisibility, organization } = req.body + + + const findvalue = await environmentModel(organization).findOne({ userId: userId }) + + if (findvalue) { + + const updatevalue = await environmentModel(organization).findOneAndUpdate( + { userId: userId }, { roofVisibility:roofVisibility,wallVisibility:wallVisibility }, { new: true }); + res.status(201).json(updatevalue); + + + } else { + const newValue = await environmentModel(organization).create({ userId, roofVisibility, wallVisibility }); + + + res.status(201).json(newValue); + + } + + // Send response with the created document + } catch (error) { + console.error('Error creating environments:', error); + res.status(500).json({message:"Failed to create environments"}); + } + } + static async getEnvironment(req: Request, res: Response) { + try { + const { userId, organization } = req.params; + + + const findValue = await environmentModel(organization).findOne({ userId: userId }) + if (!findValue) { + res.status(200).json("user not found"); + } else { + + res.status(201).json(findValue); + } + } catch (error) { + console.error('Error get environments:', error); + res.status(500).json({ error: "Failed to get environments" }); + } + } +} diff --git a/src/api-server/controller/lines/line-Controller.ts b/src/api-server/controller/lines/line-Controller.ts index 25b6253..aee5d59 100644 --- a/src/api-server/controller/lines/line-Controller.ts +++ b/src/api-server/controller/lines/line-Controller.ts @@ -1,125 +1,125 @@ -import { Request, Response } from "express"; -import lineModel from "../../../shared/model/lines/lines-Model"; - -export class lines { - static async setLines(req: Request, res: Response) { - try { - const {organization,layer,line,type}=req.body - const newLine = await lineModel(organization).create({ layer,line,type }); - - - res.status(201).json(newLine); - - // Send response with the created document - } catch (error) { - console.error('Error creating Lines:', error); - res.status(500).json({message:"Failed to create Lines"}); - } - } - static async updateLines(req: Request, res: Response) { - try { - const {organization,uuid,position,}=req.body - // const findLine = await lineModel(organization).find({ 'line.uuid': uuid }); - // Update the position of the line matching the uuid - const updateResult = await lineModel(organization).updateMany( - { 'line.uuid': uuid }, // Filter: Find the line with the given uuid - { $set: { 'line.$.position': position } } // Update the position and type - ); - - res.status(201).json(updateResult); - - // Send response with the created document - } catch (error) { - console.error('Error creating Lines:', error); - res.status(500).json({message:"Failed to create Lines"}); - } - } - static async getLines(req: Request, res: Response) { - try { - const { organization } = req.params; - - - const findValue = await lineModel(organization).find() - if (!findValue) { - res.status(200).json("user not found"); - } else { - - res.status(201).json(findValue); - } - } catch (error) { - console.error('Error get Lines:', error); - res.status(500).json({ error: "Failed to get Lines" }); - } - } - static async deleteLineItems(req: Request, res: Response) { - try { - const {organization,layer,line,type}=req.body - - const inputUuids = line.map((item: any) => item.uuid); - - - // const findValue = await lineModel(organization).findOneAndDelete({ - - // line: { $elemMatch: { uuid: { $in: inputUuids } } }, - // }); - const findValue = await lineModel(organization).findOneAndDelete({ - "line.uuid": { $all: inputUuids } // Ensure all UUIDs are present in the `line` key - }); - - if (!findValue) { - res.status(200).json("data not found"); - } else { - - res.status(201).json(findValue); - } - } catch (error) { - console.error('Error delete Lines:', error); - res.status(500).json({ error: "Failed to delete Lines" }); - } - } - static async deleteLinPoiteItems(req: Request, res: Response) { - try { - const {organization,layer,uuid,type}=req.body - - const findValue = await lineModel(organization).deleteMany({ 'line.uuid': uuid }) - - if (!findValue) { - res.status(200).json("data not found"); - } else { - - res.status(201).json(findValue); - } - } catch (error) { - console.error('Error delete Lines:', error); - res.status(500).json({ error: "Failed to delete Lines" }); - } - } - - static async deleteLayer(req: Request, res: Response) { - try { - const {organization,layer}=req.body - - // Fetch the documents with the specified layer value - const findValue = await lineModel(organization).find({ layer: layer }); - - if (!findValue) { - res.status(200).json("data not found"); - } else { - await lineModel(organization).deleteMany({ layer: layer }); - // console.log(`Documents with layer ${layer} have been deleted.`); - - // Update documents with layer greater than -1 - const updateResult = await lineModel(organization).updateMany( - { layer: { $gt:layer} }, - { $inc: { layer: -1 } } // Example operation: decrementing layer by 1 - ); - - - res.status(201).json(updateResult); - } - } catch (error) { - console.error('Error delete Lines:', error); - res.status(500).json({ error: "Failed to delete Lines" }); - } - } -} +import { Request, Response } from "express"; +import lineModel from "../../../shared/model/lines/lines-Model"; + +export class lines { + static async setLines(req: Request, res: Response) { + try { + const {organization,layer,line,type}=req.body + const newLine = await lineModel(organization).create({ layer,line,type }); + + + res.status(201).json(newLine); + + // Send response with the created document + } catch (error) { + console.error('Error creating Lines:', error); + res.status(500).json({message:"Failed to create Lines"}); + } + } + static async updateLines(req: Request, res: Response) { + try { + const {organization,uuid,position,}=req.body + // const findLine = await lineModel(organization).find({ 'line.uuid': uuid }); + // Update the position of the line matching the uuid + const updateResult = await lineModel(organization).updateMany( + { 'line.uuid': uuid }, // Filter: Find the line with the given uuid + { $set: { 'line.$.position': position } } // Update the position and type + ); + + res.status(201).json(updateResult); + + // Send response with the created document + } catch (error) { + console.error('Error creating Lines:', error); + res.status(500).json({message:"Failed to create Lines"}); + } + } + static async getLines(req: Request, res: Response) { + try { + const { organization } = req.params; + + + const findValue = await lineModel(organization).find() + if (!findValue) { + res.status(200).json("user not found"); + } else { + + res.status(201).json(findValue); + } + } catch (error) { + console.error('Error get Lines:', error); + res.status(500).json({ error: "Failed to get Lines" }); + } + } + static async deleteLineItems(req: Request, res: Response) { + try { + const {organization,layer,line,type}=req.body + + const inputUuids = line.map((item: any) => item.uuid); + + + // const findValue = await lineModel(organization).findOneAndDelete({ + + // line: { $elemMatch: { uuid: { $in: inputUuids } } }, + // }); + const findValue = await lineModel(organization).findOneAndDelete({ + "line.uuid": { $all: inputUuids } // Ensure all UUIDs are present in the `line` key + }); + + if (!findValue) { + res.status(200).json("data not found"); + } else { + + res.status(201).json(findValue); + } + } catch (error) { + console.error('Error delete Lines:', error); + res.status(500).json({ error: "Failed to delete Lines" }); + } + } + static async deleteLinPoiteItems(req: Request, res: Response) { + try { + const {organization,layer,uuid,type}=req.body + + const findValue = await lineModel(organization).deleteMany({ 'line.uuid': uuid }) + + if (!findValue) { + res.status(200).json("data not found"); + } else { + + res.status(201).json(findValue); + } + } catch (error) { + console.error('Error delete Lines:', error); + res.status(500).json({ error: "Failed to delete Lines" }); + } + } + + static async deleteLayer(req: Request, res: Response) { + try { + const {organization,layer}=req.body + + // Fetch the documents with the specified layer value + const findValue = await lineModel(organization).find({ layer: layer }); + + if (!findValue) { + res.status(200).json("data not found"); + } else { + await lineModel(organization).deleteMany({ layer: layer }); + // console.log(`Documents with layer ${layer} have been deleted.`); + + // Update documents with layer greater than -1 + const updateResult = await lineModel(organization).updateMany( + { layer: { $gt:layer} }, + { $inc: { layer: -1 } } // Example operation: decrementing layer by 1 + ); + + + res.status(201).json(updateResult); + } + } catch (error) { + console.error('Error delete Lines:', error); + res.status(500).json({ error: "Failed to delete Lines" }); + } + } +} diff --git a/src/api-server/controller/share/share-Controller.ts b/src/api-server/controller/share/share-Controller.ts index 573eb35..d00d05b 100644 --- a/src/api-server/controller/share/share-Controller.ts +++ b/src/api-server/controller/share/share-Controller.ts @@ -1,43 +1,43 @@ -import { Request, Response } from "express"; -import userModel from "../../../shared/model/user-Model"; - - -export class share { - static async shareUser(req: Request, res: Response) { - try { - const { email, isShare, organization } = req.body - - - const findValue = await userModel(organization).findOneAndUpdate({email:email},{isShare:isShare},{new:true}) - - res.status(201).json({message:"scene shared successfully",data:findValue}); - if (!findValue) { - res.status(404).json({message:"Not found"}) - } - // Send response with the created document - } catch (error) { - console.error('Error creating Share:', error); - res.status(500).json({message:"Failed to create Share"}); - } - } - - static async findshareUser(req: Request, res: Response) { - try { - const organization = req.query.organization as string; - - - const findValue = await userModel(organization).find({}).select("isShare email userName -_id") - // console.log('findValue: ', findValue); - - res.status(201).json({message:"scene shared datas",data:findValue}); - if (!findValue) { - res.status(404).json({message:"Not found"}) - } - // Send response with the created document - } catch (error) { - console.error('Error Share:', error); - res.status(500).json({message:"Failed to Share datas "}); - } - } - -} +import { Request, Response } from "express"; +import userModel from "../../../shared/model/user-Model"; + + +export class share { + static async shareUser(req: Request, res: Response) { + try { + const { email, isShare, organization } = req.body + + + const findValue = await userModel(organization).findOneAndUpdate({email:email},{isShare:isShare},{new:true}) + + res.status(201).json({message:"scene shared successfully",data:findValue}); + if (!findValue) { + res.status(404).json({message:"Not found"}) + } + // Send response with the created document + } catch (error) { + console.error('Error creating Share:', error); + res.status(500).json({message:"Failed to create Share"}); + } + } + + static async findshareUser(req: Request, res: Response) { + try { + const organization = req.query.organization as string; + + + const findValue = await userModel(organization).find({}).select("isShare email userName -_id") + // console.log('findValue: ', findValue); + + res.status(201).json({message:"scene shared datas",data:findValue}); + if (!findValue) { + res.status(404).json({message:"Not found"}) + } + // Send response with the created document + } catch (error) { + console.error('Error Share:', error); + res.status(500).json({message:"Failed to Share datas "}); + } + } + +} diff --git a/src/api-server/controller/user-Controller.ts b/src/api-server/controller/user-Controller.ts index 365f8b7..64c6e8c 100644 --- a/src/api-server/controller/user-Controller.ts +++ b/src/api-server/controller/user-Controller.ts @@ -1,103 +1,103 @@ -import { Request, Response } from "express"; -import { Server } from 'http'; -import userModel from "../../shared/model/user-Model"; -import { isSharedArrayBuffer } from "util/types"; -const {hashGenerate,hashValidator} = require("../../shared/security/Hasing.ts") -// import {hashGenerate} from '../security/Hasing' - -let serverAlive = true; -export class user { - static async signup(req: Request, res: Response) { - try { - let role; - const { userName, email, password,organization,profilePicture } = req.body; - const caseChange = email.toLowerCase(); - const emailcheck = await userModel(organization).findOne({ email: caseChange }); - if (emailcheck!==null) { - res.json({ - message:"User already exists" - }); - } else { - const hashpassword=await hashGenerate(password) - const userCount = await userModel(organization).countDocuments({}); - role = userCount === 0 ? "Admin" : "User"; - const isShare = role === "Admin" ? "true" : "false"; - const newuser = await userModel(organization).create({ - userName: userName, - email: caseChange, - isShare:isShare, - password: hashpassword, - role:role, - profilePicture:profilePicture - }); - newuser.save(); - res.status(200).json({ - message:"New User created" - }); - } - } catch (error:any) { - res.status(500).send(error); - } - } - static async login(req: Request, res: Response) { - try { - let role; - const { email, password,organization } = req.body; - // console.log(' req.body: ', req.body); - - const existingMail = await userModel(organization).findOne({ - email:email - }); - - if (existingMail === null || !existingMail) { - res.status(404).json({ message: "User Not Found!!! Kindly signup..." }); - } else { - const hashedpassword= existingMail.password - const checkpassword = await hashValidator( - password, - hashedpassword - ) - // console.log('checkpassword: ', checkpassword); - if (checkpassword) { - // const tokenValidation=await tokenGenerator(existingMail.email) - res.status(200).send({ - message: "login successfull", - email: existingMail.email, - name: existingMail.userName, - userId: existingMail._id, - isShare:existingMail.isShare, - // token:tokenValidation - - }); - } else { - res.status(404).json({message:"email & password is invalid...Check the credentials"}) - } - } - } catch (error:any) { - res.status(500).send(error); - } - } - - // static async checkserverHealth(server:Server,organization: string){ - // try { - // if (server.listening) { - // console.log('Server is running'); - // serverAlive = true; - // // Update all users to online status - // } else { - // // await userModel(organization).updateMany({}, { activeStatus: "offline" }); // Replace `activeStatus` with your actual field - // throw new Error('Server is not running'); - // } - // } catch (error:any) { - // console.error('Server health check failed:', error.message); - // serverAlive = false; - - // // Update all users to offline status - // // await userModel(organization).updateMany({}, { activeStatus: "offline" }); - // } - // } - -} -// export const startHealthCheck = (server: Server, organization: string) => { -// setInterval(() => user.checkserverHealth(server, organization), 5000); -// }; +import { Request, Response } from "express"; +import { Server } from 'http'; +import userModel from "../../shared/model/user-Model"; +import { isSharedArrayBuffer } from "util/types"; +const {hashGenerate,hashValidator} = require("../../shared/security/Hasing.ts") +// import {hashGenerate} from '../security/Hasing' + +let serverAlive = true; +export class user { + static async signup(req: Request, res: Response) { + try { + let role; + const { userName, email, password,organization,profilePicture } = req.body; + const caseChange = email.toLowerCase(); + const emailcheck = await userModel(organization).findOne({ email: caseChange }); + if (emailcheck!==null) { + res.json({ + message:"User already exists" + }); + } else { + const hashpassword=await hashGenerate(password) + const userCount = await userModel(organization).countDocuments({}); + role = userCount === 0 ? "Admin" : "User"; + const isShare = role === "Admin" ? "true" : "false"; + const newuser = await userModel(organization).create({ + userName: userName, + email: caseChange, + isShare:isShare, + password: hashpassword, + role:role, + profilePicture:profilePicture + }); + newuser.save(); + res.status(200).json({ + message:"New User created" + }); + } + } catch (error:any) { + res.status(500).send(error); + } + } + static async login(req: Request, res: Response) { + try { + let role; + const { email, password,organization } = req.body; + // console.log(' req.body: ', req.body); + + const existingMail = await userModel(organization).findOne({ + email:email + }); + + if (existingMail === null || !existingMail) { + res.status(404).json({ message: "User Not Found!!! Kindly signup..." }); + } else { + const hashedpassword= existingMail.password + const checkpassword = await hashValidator( + password, + hashedpassword + ) + // console.log('checkpassword: ', checkpassword); + if (checkpassword) { + // const tokenValidation=await tokenGenerator(existingMail.email) + res.status(200).send({ + message: "login successfull", + email: existingMail.email, + name: existingMail.userName, + userId: existingMail._id, + isShare:existingMail.isShare, + // token:tokenValidation + + }); + } else { + res.status(404).json({message:"email & password is invalid...Check the credentials"}) + } + } + } catch (error:any) { + res.status(500).send(error); + } + } + + // static async checkserverHealth(server:Server,organization: string){ + // try { + // if (server.listening) { + // console.log('Server is running'); + // serverAlive = true; + // // Update all users to online status + // } else { + // // await userModel(organization).updateMany({}, { activeStatus: "offline" }); // Replace `activeStatus` with your actual field + // throw new Error('Server is not running'); + // } + // } catch (error:any) { + // console.error('Server health check failed:', error.message); + // serverAlive = false; + + // // Update all users to offline status + // // await userModel(organization).updateMany({}, { activeStatus: "offline" }); + // } + // } + +} +// export const startHealthCheck = (server: Server, organization: string) => { +// setInterval(() => user.checkserverHealth(server, organization), 5000); +// }; diff --git a/src/api-server/main.ts b/src/api-server/main.ts index 78e45fb..ee8abf6 100644 --- a/src/api-server/main.ts +++ b/src/api-server/main.ts @@ -1,19 +1,28 @@ -import app from './app'; -import http from 'http'; -// import { startHealthCheck } from './controller/user-Controller'; - -const server = http.createServer(app); - - - -const organization = process.env.ORGANIZATION_NAME || 'defaultOrganization'; // Replace with your logic - -if (!organization) { - throw new Error('ORGANIZATION_NAME is not defined in the environment'); -} - -const PORT = process.env.API_PORT -server.listen(PORT, () => { - console.log(`API-Server running on port ${PORT}`); - // startHealthCheck(server, organization); -}); +import app from './app'; +import http from 'http'; +import ip from 'ip'; +// import { startHealthCheck } from './controller/user-Controller'; +import swaggerUi from 'swagger-ui-express'; +const server = http.createServer(app); + +let swaggerDocument; +try { + swaggerDocument = require('../../swagger-output.json'); +} catch (error) { + console.error('Error loading Swagger JSON:', error); + swaggerDocument = {}; // Fallback: empty object or some default +} +app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument)); +const organization = process.env.ORGANIZATION_NAME || 'defaultOrganization'; // Replace with your logic + +if (!organization) { + throw new Error('ORGANIZATION_NAME is not defined in the environment'); +} + +const PORT = process.env.API_PORT +server.listen(PORT, () => { + console.log(`API-Server running on http://localhost:${PORT}`); + console.log(`Swagger UI available at http://localhost:${PORT}/api-docs`); + // console.log(`Server is also accessible on IP address: ${ip.address()}`); + +}); diff --git a/src/shared/connect/mongoose.ts b/src/shared/connect/mongoose.ts index 585e827..ec13e52 100644 --- a/src/shared/connect/mongoose.ts +++ b/src/shared/connect/mongoose.ts @@ -1,47 +1,47 @@ -import mongoose, { Schema, Connection, Model } from "mongoose"; - -interface ConnectionCache { - [key: string]: Connection; -} - -const connections: ConnectionCache = {}; - -const MainModel = ( - db: string, - modelName: string, - schema: Schema, - collectionName: string -): Model => { - const db1_url = `${process.env.MONGO_URI}${db}`; - - // Check if the connection already exists - if (connections[db]) { - return connections[db].model(modelName, schema, collectionName); - } - - try { - const db1 = mongoose.createConnection(db1_url, { - maxPoolSize: 50, - }); - - // Cache the connection - connections[db] = db1; - - // Log connection success or handle errors - db1.on("connected", () => { - console.log(`Connected to MongoDB database: ${db}`); - }); - - db1.on("error", (err) => { - console.error(`MongoDB connection error for database ${db}:`, err.message); - }); - - return db1.model(modelName, schema, collectionName); - } catch (error) { - console.error("Database connection error:", (error as Error).message); - throw error; - } -}; - -export default MainModel; - +import mongoose, { Schema, Connection, Model } from "mongoose"; + +interface ConnectionCache { + [key: string]: Connection; +} + +const connections: ConnectionCache = {}; + +const MainModel = ( + db: string, + modelName: string, + schema: Schema, + collectionName: string +): Model => { + const db1_url = `${process.env.MONGO_URI}${db}`; + + // Check if the connection already exists + if (connections[db]) { + return connections[db].model(modelName, schema, collectionName); + } + + try { + const db1 = mongoose.createConnection(db1_url, { + maxPoolSize: 50, + }); + + // Cache the connection + connections[db] = db1; + + // Log connection success or handle errors + db1.on("connected", () => { + console.log(`Connected to MongoDB database: ${db}`); + }); + + db1.on("error", (err) => { + console.error(`MongoDB connection error for database ${db}:`, err.message); + }); + + return db1.model(modelName, schema, collectionName); + } catch (error) { + console.error("Database connection error:", (error as Error).message); + throw error; + } +}; + +export default MainModel; + diff --git a/src/shared/model/assets/flooritems-Model.ts b/src/shared/model/assets/flooritems-Model.ts index 56cb068..ded0185 100644 --- a/src/shared/model/assets/flooritems-Model.ts +++ b/src/shared/model/assets/flooritems-Model.ts @@ -1,57 +1,57 @@ -import mongoose, { Document, Schema } from 'mongoose'; -import MainModel from '../../connect/mongoose'; - -// Interface for TypeScript with PascalCase -export interface floorItenms extends Document { - modeluuid: string; - modelfileID: string; - modelname: string - isLocked:boolean - isVisible:boolean - position: [] - rotation: { - x: number; - y: number; - z: number; - }; - - -} - -// Define the Mongoose Schema -const floorItemsSchema: Schema = new Schema({ - modeluuid: { type: String }, - modelfileID: { type: String }, - modelname: { type: String }, - position: { type: Array}, - isLocked:{type:Boolean}, - isVisible:{type:Boolean}, - rotation: { - x: { type: Number, required: true }, - y: { type: Number, required: true }, - z: { type: Number, required: true } - } -}); - -// Model for MongoDB collection -// const cameraModel = model("Camera", cameraSchema); - -// export default cameraModel; -// const floorItemsModel = (db: string) => { -// const mongoUrl = process.env.MONGO_URI || ''; -// if (!mongoUrl) { -// throw new Error('MONGO_URI environment variable is not set'); -// } -// // Connect to the database -// const dbConnection = mongoose.createConnection(mongoUrl, { -// dbName: db, // Specify the database name here -// serverSelectionTimeoutMS: 30000, -// }); -// return dbConnection.model('floorItenms', floorItenmsSchema,`floorItenms`); -// } - -// export default floorItemsModel; -const floorItemsModel = (db:string) => { - return MainModel(db, "floorItems", floorItemsSchema, "floorItems") -}; +import mongoose, { Document, Schema } from 'mongoose'; +import MainModel from '../../connect/mongoose'; + +// Interface for TypeScript with PascalCase +export interface floorItenms extends Document { + modeluuid: string; + modelfileID: string; + modelname: string + isLocked:boolean + isVisible:boolean + position: [] + rotation: { + x: number; + y: number; + z: number; + }; + + +} + +// Define the Mongoose Schema +const floorItemsSchema: Schema = new Schema({ + modeluuid: { type: String }, + modelfileID: { type: String }, + modelname: { type: String }, + position: { type: Array}, + isLocked:{type:Boolean}, + isVisible:{type:Boolean}, + rotation: { + x: { type: Number, required: true }, + y: { type: Number, required: true }, + z: { type: Number, required: true } + } +}); + +// Model for MongoDB collection +// const cameraModel = model("Camera", cameraSchema); + +// export default cameraModel; +// const floorItemsModel = (db: string) => { +// const mongoUrl = process.env.MONGO_URI || ''; +// if (!mongoUrl) { +// throw new Error('MONGO_URI environment variable is not set'); +// } +// // Connect to the database +// const dbConnection = mongoose.createConnection(mongoUrl, { +// dbName: db, // Specify the database name here +// serverSelectionTimeoutMS: 30000, +// }); +// return dbConnection.model('floorItenms', floorItenmsSchema,`floorItenms`); +// } + +// export default floorItemsModel; +const floorItemsModel = (db:string) => { + return MainModel(db, "floorItems", floorItemsSchema, "floorItems") +}; export default floorItemsModel; \ No newline at end of file diff --git a/src/shared/model/assets/wallitems-Model.ts b/src/shared/model/assets/wallitems-Model.ts index 80895aa..03d2535 100644 --- a/src/shared/model/assets/wallitems-Model.ts +++ b/src/shared/model/assets/wallitems-Model.ts @@ -1,46 +1,46 @@ -import mongoose, { Document, Schema } from 'mongoose'; -import MainModel from '../../connect/mongoose'; -// Interface for TypeScript with PascalCase -export interface wallitems extends Document { - modeluuid: string; - modelname: string - type: string - csgposition: [] - csgscale: [] - position: [] - quaternion: [] - scale: [] - - -} - -// Define the Mongoose Schema -const wallItemsSchema: Schema = new Schema({ - modeluuid: { type: String,unique:true }, - modelname: { type: String}, - type: { type: String }, - csgposition: { type: Array}, - csgscale: { type: Array,}, - position: { type: Array }, - quaternion: { type: Array}, - scale: { type: Array} -}); - -// const wallItenmModel = (db: string) => { -// const mongoUrl = process.env.MONGO_URI || ''; -// if (!mongoUrl) { -// throw new Error('MONGO_URI environment variable is not set'); -// } -// // Connect to the database -// const dbConnection = mongoose.createConnection(mongoUrl, { -// dbName: db, // Specify the database name here -// serverSelectionTimeoutMS: 30000, -// }); -// return dbConnection.model('wallitenms', wallItenmsSchema, `wallitenms`); -// } - -// export default wallItenmModel; -const wallItenmModel = (db:string) => { - return MainModel(db, "wallitems", wallItemsSchema, "wallitems") - }; +import mongoose, { Document, Schema } from 'mongoose'; +import MainModel from '../../connect/mongoose'; +// Interface for TypeScript with PascalCase +export interface wallitems extends Document { + modeluuid: string; + modelname: string + type: string + csgposition: [] + csgscale: [] + position: [] + quaternion: [] + scale: [] + + +} + +// Define the Mongoose Schema +const wallItemsSchema: Schema = new Schema({ + modeluuid: { type: String,unique:true }, + modelname: { type: String}, + type: { type: String }, + csgposition: { type: Array}, + csgscale: { type: Array,}, + position: { type: Array }, + quaternion: { type: Array}, + scale: { type: Array} +}); + +// const wallItenmModel = (db: string) => { +// const mongoUrl = process.env.MONGO_URI || ''; +// if (!mongoUrl) { +// throw new Error('MONGO_URI environment variable is not set'); +// } +// // Connect to the database +// const dbConnection = mongoose.createConnection(mongoUrl, { +// dbName: db, // Specify the database name here +// serverSelectionTimeoutMS: 30000, +// }); +// return dbConnection.model('wallitenms', wallItenmsSchema, `wallitenms`); +// } + +// export default wallItenmModel; +const wallItenmModel = (db:string) => { + return MainModel(db, "wallitems", wallItemsSchema, "wallitems") + }; export default wallItenmModel; \ No newline at end of file diff --git a/src/shared/model/camera/camera-Model.ts b/src/shared/model/camera/camera-Model.ts index c3f0708..e51b824 100644 --- a/src/shared/model/camera/camera-Model.ts +++ b/src/shared/model/camera/camera-Model.ts @@ -1,87 +1,87 @@ -import mongoose, { Document, Schema } from 'mongoose'; -import MainModel from '../../connect/mongoose'; - -// Interface for TypeScript with PascalCase -export interface Camera extends Document { - userId: string; - position: { - x: number; - y: number; - z: number; - } - target: { - x: { type: Number, required: true }, - y: { type: Number, required: true }, - z: { type: Number, required: true } - } - rotation: { - x: { type: Number, required: true }, - y: { type: Number, required: true }, - z: { type: Number, required: true } - } -} - -// Define the Mongoose Schema -const cameraSchema: Schema = new Schema({ - userId: { type: String }, - position: { - x: { type: Number, required: true }, - y: { type: Number, required: true }, - z: { type: Number, required: true } - }, - target: { - x: { type: Number, required: true }, - y: { type: Number, required: true }, - z: { type: Number, required: true } - }, - rotation: { - x: { type: Number, required: true }, - y: { type: Number, required: true }, - z: { type: Number, required: true } - } -}); - -// Model for MongoDB collection -// const cameraModel = model("Camera", cameraSchema); - -// export default cameraModel; -// const cameraModel = (db: string) => { -// const mongoUrl = process.env.MONGO_URI || ''; -// if (!mongoUrl) { -// throw new Error('MONGO_URI environment variable is not set'); -// } -// // Connect to the database -// const dbConnection = mongoose.createConnection(mongoUrl, { -// dbName: db, // Specify the database name here -// serverSelectionTimeoutMS: 30000, -// }); -// return dbConnection.model('Camera', cameraSchema,`Camera`); -// } - -// export default cameraModel; -// const cameraModel = (db: string) => { -// const mongoUrl = process.env.MONGO_URI || ''; -// if (!mongoUrl) { -// throw new Error('MONGO_URI environment variable is not set'); -// } - -// const dbConnection = mongoose.createConnection(mongoUrl, { -// dbName: db, -// serverSelectionTimeoutMS: 60000, // Increased timeout -// }); - -// dbConnection.on('error', (err) => { -// console.error(`MongoDB connection error for database ${db}:`, err); -// }); - -// dbConnection.once('open', () => { -// console.log(`Connected to MongoDB database: ${db}`); -// }); - -// return dbConnection.model('Camera', cameraSchema, 'Camera'); -// }; -// export default cameraModel -const cameraModel = (db:string) => { - return MainModel(db, "Camera", cameraSchema, "Camera") -}; +import mongoose, { Document, Schema } from 'mongoose'; +import MainModel from '../../connect/mongoose'; + +// Interface for TypeScript with PascalCase +export interface Camera extends Document { + userId: string; + position: { + x: number; + y: number; + z: number; + } + target: { + x: { type: Number, required: true }, + y: { type: Number, required: true }, + z: { type: Number, required: true } + } + rotation: { + x: { type: Number, required: true }, + y: { type: Number, required: true }, + z: { type: Number, required: true } + } +} + +// Define the Mongoose Schema +const cameraSchema: Schema = new Schema({ + userId: { type: String }, + position: { + x: { type: Number, required: true }, + y: { type: Number, required: true }, + z: { type: Number, required: true } + }, + target: { + x: { type: Number, required: true }, + y: { type: Number, required: true }, + z: { type: Number, required: true } + }, + rotation: { + x: { type: Number, required: true }, + y: { type: Number, required: true }, + z: { type: Number, required: true } + } +}); + +// Model for MongoDB collection +// const cameraModel = model("Camera", cameraSchema); + +// export default cameraModel; +// const cameraModel = (db: string) => { +// const mongoUrl = process.env.MONGO_URI || ''; +// if (!mongoUrl) { +// throw new Error('MONGO_URI environment variable is not set'); +// } +// // Connect to the database +// const dbConnection = mongoose.createConnection(mongoUrl, { +// dbName: db, // Specify the database name here +// serverSelectionTimeoutMS: 30000, +// }); +// return dbConnection.model('Camera', cameraSchema,`Camera`); +// } + +// export default cameraModel; +// const cameraModel = (db: string) => { +// const mongoUrl = process.env.MONGO_URI || ''; +// if (!mongoUrl) { +// throw new Error('MONGO_URI environment variable is not set'); +// } + +// const dbConnection = mongoose.createConnection(mongoUrl, { +// dbName: db, +// serverSelectionTimeoutMS: 60000, // Increased timeout +// }); + +// dbConnection.on('error', (err) => { +// console.error(`MongoDB connection error for database ${db}:`, err); +// }); + +// dbConnection.once('open', () => { +// console.log(`Connected to MongoDB database: ${db}`); +// }); + +// return dbConnection.model('Camera', cameraSchema, 'Camera'); +// }; +// export default cameraModel +const cameraModel = (db:string) => { + return MainModel(db, "Camera", cameraSchema, "Camera") +}; export default cameraModel; \ No newline at end of file diff --git a/src/shared/model/environments/environments-Model.ts b/src/shared/model/environments/environments-Model.ts index 27d3b70..8c22cfc 100644 --- a/src/shared/model/environments/environments-Model.ts +++ b/src/shared/model/environments/environments-Model.ts @@ -1,38 +1,38 @@ -import mongoose, { Document, Schema } from 'mongoose'; -import MainModel from '../../connect/mongoose'; -// Interface for TypeScript with PascalCase -export interface environment extends Document { - userId: string; - roofVisibility:boolean - wallVisibility:boolean -} - -// Define the Mongoose Schema -const environmentSchema: Schema = new Schema({ - userId: { type: String, unique: true }, - roofVisibility: { type: Boolean ,default:false}, - wallVisibility: { type: Boolean ,default:false}, -}); - -// Model for MongoDB collection -// const cameraModel = model("Camera", cameraSchema); - -// export default cameraModel; -// const environmentModel = (db: string) => { -// const mongoUrl = process.env.MONGO_URI || ''; -// if (!mongoUrl) { -// throw new Error('MONGO_URI environment variable is not set'); -// } -// // Connect to the database -// const dbConnection = mongoose.createConnection(mongoUrl, { -// dbName: db, // Specify the database name here -// serverSelectionTimeoutMS: 30000, -// }); -// return dbConnection.model('environments', environmentSchema,`environments`); -// } - -// export default environmentModel; -const environmentModel = (db:string) => { - return MainModel(db, "environments", environmentSchema, "environments") -}; +import mongoose, { Document, Schema } from 'mongoose'; +import MainModel from '../../connect/mongoose'; +// Interface for TypeScript with PascalCase +export interface environment extends Document { + userId: string; + roofVisibility:boolean + wallVisibility:boolean +} + +// Define the Mongoose Schema +const environmentSchema: Schema = new Schema({ + userId: { type: String, unique: true }, + roofVisibility: { type: Boolean ,default:false}, + wallVisibility: { type: Boolean ,default:false}, +}); + +// Model for MongoDB collection +// const cameraModel = model("Camera", cameraSchema); + +// export default cameraModel; +// const environmentModel = (db: string) => { +// const mongoUrl = process.env.MONGO_URI || ''; +// if (!mongoUrl) { +// throw new Error('MONGO_URI environment variable is not set'); +// } +// // Connect to the database +// const dbConnection = mongoose.createConnection(mongoUrl, { +// dbName: db, // Specify the database name here +// serverSelectionTimeoutMS: 30000, +// }); +// return dbConnection.model('environments', environmentSchema,`environments`); +// } + +// export default environmentModel; +const environmentModel = (db:string) => { + return MainModel(db, "environments", environmentSchema, "environments") +}; export default environmentModel; \ No newline at end of file diff --git a/src/shared/model/lines/lines-Model.ts b/src/shared/model/lines/lines-Model.ts index 14beabc..2f10c65 100644 --- a/src/shared/model/lines/lines-Model.ts +++ b/src/shared/model/lines/lines-Model.ts @@ -1,43 +1,43 @@ -import mongoose, { Document, Schema } from "mongoose"; -import MainModel from "../../connect/mongoose"; -const positionSchema = new mongoose.Schema({ - x: { type: Number, }, // Optional position fields - y: { type: Number, }, - z: { type: Number}, - }); - - // Define a schema for the individual line - const Vector3 = new mongoose.Schema({ - position: { type: positionSchema, required: false }, // Optional position - uuid: { type: String, required: false }, // Optional uuid - }); - - // Define the main schema - const LineSchema = new mongoose.Schema({ - layer: { type: Number, required: true }, // Layer is mandatory - line: { type: [Vector3], required: true }, // Array of line objects - type: { type: String, required: false }, // Optional type - }); - -// Database connection and model creation -// const lineModel = (db: string) => { -// const mongoUrl = process.env.MONGO_URI || ""; -// if (!mongoUrl) { -// throw new Error("MONGO_URI environment variable is not set"); -// } - -// // Connect to the database -// const dbConnection = mongoose.createConnection(mongoUrl, { -// dbName: db, // Specify the database name here -// serverSelectionTimeoutMS: 30000, -// }); - -// // Return the model -// return dbConnection.model("lines", LineSchema, "lines"); -// }; - -// export default lineModel; -const lineModel = (db:string) => { - return MainModel(db, "lines", LineSchema, "lines") -}; +import mongoose, { Document, Schema } from "mongoose"; +import MainModel from "../../connect/mongoose"; +const positionSchema = new mongoose.Schema({ + x: { type: Number, }, // Optional position fields + y: { type: Number, }, + z: { type: Number}, + }); + + // Define a schema for the individual line + const Vector3 = new mongoose.Schema({ + position: { type: positionSchema, required: false }, // Optional position + uuid: { type: String, required: false }, // Optional uuid + }); + + // Define the main schema + const LineSchema = new mongoose.Schema({ + layer: { type: Number, required: true }, // Layer is mandatory + line: { type: [Vector3], required: true }, // Array of line objects + type: { type: String, required: false }, // Optional type + }); + +// Database connection and model creation +// const lineModel = (db: string) => { +// const mongoUrl = process.env.MONGO_URI || ""; +// if (!mongoUrl) { +// throw new Error("MONGO_URI environment variable is not set"); +// } + +// // Connect to the database +// const dbConnection = mongoose.createConnection(mongoUrl, { +// dbName: db, // Specify the database name here +// serverSelectionTimeoutMS: 30000, +// }); + +// // Return the model +// return dbConnection.model("lines", LineSchema, "lines"); +// }; + +// export default lineModel; +const lineModel = (db:string) => { + return MainModel(db, "lines", LineSchema, "lines") +}; export default lineModel; \ No newline at end of file diff --git a/src/shared/model/user-Model.ts b/src/shared/model/user-Model.ts index f4d40af..746e417 100644 --- a/src/shared/model/user-Model.ts +++ b/src/shared/model/user-Model.ts @@ -1,69 +1,69 @@ -import mongoose, { Document, Schema } from "mongoose"; -import MainModel from "../connect/mongoose"; -export interface User extends Document { - userName: String; - email: String; - password: String; - - role: String; - profilePicture: String; - isShare:Boolean, - activeStatus:string - -} -const signupschema: Schema = new Schema({ - userName: { - type: String, - required: true, - }, - email: { - type: String, - unique: true, - required: true, - }, - password: { - type: String, - min: 8, - required: true, - }, - role: { - type: String, - default: "User", - enum: ["User", "Admin", "Project Manager", "Manager", "Owner"], - }, - profilePicture: { - type: String, - // default: "default-profile-picture.jpg" - }, - isShare:{ - type:Boolean, - default:false - }, - activeStatus:{ - type:String, - enum: ["online", "offline"], - default: "offline" - } - -}); -// const userModel = (db: string) => { -// const mongoUrl = process.env.MONGO_URI || ""; -// if (!mongoUrl) { -// throw new Error("MONGO_URI environment variable is not set"); -// } - -// // Connect to the database -// const dbConnection = mongoose.createConnection(mongoUrl, { -// dbName: db, // Specify the database name here -// serverSelectionTimeoutMS: 30000, -// }); - -// // Return the model -// return dbConnection.model("Users", signupschema, "Users"); -// }; - -// export default userModel; -const userModel = (db:string) => { - return MainModel(db, "Users", signupschema, "Users") -}; +import mongoose, { Document, Schema } from "mongoose"; +import MainModel from "../connect/mongoose"; +export interface User extends Document { + userName: String; + email: String; + password: String; + + role: String; + profilePicture: String; + isShare:Boolean, + activeStatus:string + +} +const signupschema: Schema = new Schema({ + userName: { + type: String, + required: true, + }, + email: { + type: String, + unique: true, + required: true, + }, + password: { + type: String, + min: 8, + required: true, + }, + role: { + type: String, + default: "User", + enum: ["User", "Admin", "Project Manager", "Manager", "Owner"], + }, + profilePicture: { + type: String, + // default: "default-profile-picture.jpg" + }, + isShare:{ + type:Boolean, + default:false + }, + activeStatus:{ + type:String, + enum: ["online", "offline"], + default: "offline" + } + +}); +// const userModel = (db: string) => { +// const mongoUrl = process.env.MONGO_URI || ""; +// if (!mongoUrl) { +// throw new Error("MONGO_URI environment variable is not set"); +// } + +// // Connect to the database +// const dbConnection = mongoose.createConnection(mongoUrl, { +// dbName: db, // Specify the database name here +// serverSelectionTimeoutMS: 30000, +// }); + +// // Return the model +// return dbConnection.model("Users", signupschema, "Users"); +// }; + +// export default userModel; +const userModel = (db:string) => { + return MainModel(db, "Users", signupschema, "Users") +}; export default userModel; \ No newline at end of file diff --git a/src/shared/security/Hasing.ts b/src/shared/security/Hasing.ts index d5690d2..f74281e 100644 --- a/src/shared/security/Hasing.ts +++ b/src/shared/security/Hasing.ts @@ -1,24 +1,24 @@ -const bcrypt = require("bcryptjs"); -const saltRounds = 10; -const hashGenerate = async (Password:String) => { - try { - const salt = await bcrypt.genSalt(saltRounds); - const hash = await bcrypt.hash(Password, salt); - - return hash; - } catch (error) { - return error; - } -}; -const hashValidator = async (password:String, hashedPassword:String) => { - - try { - const result = await bcrypt.compare(password, hashedPassword); - - return result; - } catch (error) { - return false; - } -}; -module.exports.hashGenerate = hashGenerate; +const bcrypt = require("bcryptjs"); +const saltRounds = 10; +const hashGenerate = async (Password:String) => { + try { + const salt = await bcrypt.genSalt(saltRounds); + const hash = await bcrypt.hash(Password, salt); + + return hash; + } catch (error) { + return error; + } +}; +const hashValidator = async (password:String, hashedPassword:String) => { + + try { + const result = await bcrypt.compare(password, hashedPassword); + + return result; + } catch (error) { + return false; + } +}; +module.exports.hashGenerate = hashGenerate; module.exports.hashValidator = hashValidator; \ No newline at end of file diff --git a/src/shared/security/token.ts b/src/shared/security/token.ts index 09588bd..ea71280 100644 --- a/src/shared/security/token.ts +++ b/src/shared/security/token.ts @@ -1,38 +1,38 @@ -import { Request, Response, NextFunction } from 'express'; -import * as Jwt from 'jsonwebtoken'; // Correct way to import jsonwebtoken - -// Define a new interface extending Request -interface AuthenticatedRequest extends Request { - user?: { - email: string; - // Add more fields as needed based on your JWT payload - }; -} -const tokenGenerator = (email: string) => { - const token = Jwt.sign({ email: email }, "Milestone", { - expiresIn: "3hours", - }); - return token; - }; - -const tokenValidator = (req: AuthenticatedRequest, res: Response, next: NextFunction): void => { - const token: string | undefined = req.headers.token as string | undefined; - if (!token) { - res.status(403).json({ - msg: "No token present", - }); - return; // Make sure to return after sending a response - } - - try { - const decoded = Jwt.verify(token,"Milestone") as { email: string }; // adjust if your JWT payload has more fields - req.user = decoded; - next(); - } catch (err) { - res.status(401).json({ - msg: "Invalid Token", - }); - } -}; - -export { tokenValidator,tokenGenerator }; +import { Request, Response, NextFunction } from 'express'; +import * as Jwt from 'jsonwebtoken'; // Correct way to import jsonwebtoken + +// Define a new interface extending Request +interface AuthenticatedRequest extends Request { + user?: { + email: string; + // Add more fields as needed based on your JWT payload + }; +} +const tokenGenerator = (email: string) => { + const token = Jwt.sign({ email: email }, "Milestone", { + expiresIn: "3hours", + }); + return token; + }; + +const tokenValidator = (req: AuthenticatedRequest, res: Response, next: NextFunction): void => { + const token: string | undefined = req.headers.token as string | undefined; + if (!token) { + res.status(403).json({ + msg: "No token present", + }); + return; // Make sure to return after sending a response + } + + try { + const decoded = Jwt.verify(token,"Milestone") as { email: string }; // adjust if your JWT payload has more fields + req.user = decoded; + next(); + } catch (err) { + res.status(401).json({ + msg: "Invalid Token", + }); + } +}; + +export { tokenValidator,tokenGenerator }; diff --git a/src/shared/swagger/swagger.ts b/src/shared/swagger/swagger.ts new file mode 100644 index 0000000..6506300 --- /dev/null +++ b/src/shared/swagger/swagger.ts @@ -0,0 +1,46 @@ +const swaggerAutogen = require('swagger-autogen') + +const dotenv = require('dotenv') +const path = require("path"); + +const envPath = path.resolve(__dirname, "../../../.env"); + + +dotenv.config({ path: envPath }); +const ip = require('ip') +const PORT = process.env.API_PORT; + +const doc = { + info: { + title: 'dwinzo documetion', + description: 'Description' + }, + host: '185.100.212.76:5000', + basePath: '/api/v1', + schemes: ['http'], + +}; + +const outputFile = './../../../swagger-output.json'; +const routes = [ + './../../api-server/Routes/user-Routes.ts', + './../../api-server/Routes/camera-Routes.ts', + './../../api-server/Routes/environments-Routes.ts', + './../../api-server/Routes/flooritem-Routes.ts', + './../../api-server/Routes/lines-Routes.ts', + './../../api-server/Routes/share-Routes.ts', + './../../api-server/Routes/wallItems-Routes.ts', +]; + +/* NOTE: If you are using the express Router, you must pass in the 'routes' only the +root file where the route starts, such as index.js, app.js, routes.js, etc ... */ + +swaggerAutogen()(outputFile, routes, doc).then(() => { + console.log('Swagger documentation generated!'); + +}) + + + + + diff --git a/src/socket-server/Dockerfile b/src/socket-server/Dockerfile index ea6ed17..5ecee54 100644 --- a/src/socket-server/Dockerfile +++ b/src/socket-server/Dockerfile @@ -1,35 +1,35 @@ -ARG NODE_VERSION=lts - -FROM node:${NODE_VERSION}-alpine AS development -# Use production node environment by default. - -ENV NODE_ENV development - -WORKDIR /usr/src/app - -RUN npm install -g npm - -COPY package.json /usr/src/app/package.json - - -# COPY package-lock.json /usr/src/app/package-lock.json - - -RUN npm install - -# Run the application as a non-root user. -USER root - -# Copy the rest of the source files into the image. - - -COPY . . -# Expose the port that the application listens on. - -EXPOSE 1059 - - -# Run the application. - - +ARG NODE_VERSION=lts + +FROM node:${NODE_VERSION}-alpine AS development +# Use production node environment by default. + +ENV NODE_ENV development + +WORKDIR /usr/src/app + +RUN npm install -g npm + +COPY package.json /usr/src/app/package.json + + +# COPY package-lock.json /usr/src/app/package-lock.json + + +RUN npm install + +# Run the application as a non-root user. +USER root + +# Copy the rest of the source files into the image. + + +COPY . . +# Expose the port that the application listens on. + +EXPOSE 1059 + + +# Run the application. + + CMD ["npm", "run", "start:socket"] \ No newline at end of file diff --git a/src/socket-server/index.ts b/src/socket-server/index.ts index 79341d2..56a1878 100644 --- a/src/socket-server/index.ts +++ b/src/socket-server/index.ts @@ -1,22 +1,23 @@ - -import express from "express" -import { Response, Request } from "express"; -import http from "http"; -import dotenv from "dotenv"; // Import dotenv - -dotenv.config(); - -import { initSocketServer } from "./socket/socketManager"; - -const app = express(); -const PORT = process.env.SOCKET_PORT; -const server = http.createServer(app); - -app.get('/', (req: Request, res: Response) => { - res.send('Hello, I am Major-Dwinzo RealTime!'); -}); - -initSocketServer(server); -server.listen(PORT, () => { - console.log(`socket-Server is running on http://localhost:${PORT}`); -}); + +import express from "express" +import { Response, Request } from "express"; +import http from "http"; +import ip from 'ip'; +import dotenv from "dotenv"; // Import dotenv + +dotenv.config(); + +import { initSocketServer } from "./socket/socketManager"; + +const app = express(); +const PORT = process.env.SOCKET_PORT; +const server = http.createServer(app); + +app.get('/', (req: Request, res: Response) => { + res.send('Hello, I am Major-Dwinzo RealTime!'); +}); + +initSocketServer(server); +server.listen(PORT, () => { + console.log(`socket-Server is running on http://localhost:${PORT}`); +}); diff --git a/src/socket-server/services/assets/flooritem-Controller.ts b/src/socket-server/services/assets/flooritem-Controller.ts index 4b3ff67..9f14a06 100644 --- a/src/socket-server/services/assets/flooritem-Controller.ts +++ b/src/socket-server/services/assets/flooritem-Controller.ts @@ -1,53 +1,53 @@ -import { Request, Response } from "express"; -import floorItemsModel from "../../../shared/model/assets/flooritems-Model"; - -export const setFloorItems = async (data: any) => { - try { - const { modelfileID,modeluuid, modelname, position, rotation,isLocked,isVisible, organization } = data - - - - const findvalue = await floorItemsModel(organization).findOne({ modeluuid: modeluuid, modelname: modelname }) - - if (findvalue) { - - const updatevalue = await floorItemsModel(organization).findOneAndUpdate( - { modeluuid: modeluuid, modelname: modelname }, { position: position, rotation: rotation ,isVisible:isVisible,isLocked:isLocked}, { new: true }); - return { success: true, message: 'flooritems updated', data: updatevalue,organization:organization } - - - } else { - - const newValue = await floorItemsModel(organization).create({ modeluuid, modelname, modelfileID,position, rotation,isLocked,isVisible }); - - - return { success: true, message: 'flooritem created', data: newValue,organization:organization } - - } - - // Send response with the created document - } catch (error) { - console.error('Error creating flooritems:', error); - return { success: false, message: 'Error creating or updating camera', error } - } -} - - export const deleteFloorItems = async (data: any)=>{ - try { - const { modeluuid,modelname,organization } = data; - - const findValue = await floorItemsModel(organization).findOneAndDelete({modeluuid:modeluuid,modelname:modelname}) - if (!findValue) { - return { success: false, message: 'model not found',organization:organization } - - } else { - - return { success: true, message: 'flooritem deleted', data: findValue,organization:organization } - } - } catch (error) { - console.error('Error get flooritems:', error); - return { success: false, message: 'Failed to delete flooritems', error } - - } - } - +import { Request, Response } from "express"; +import floorItemsModel from "../../../shared/model/assets/flooritems-Model"; + +export const setFloorItems = async (data: any) => { + try { + const { modelfileID,modeluuid, modelname, position, rotation,isLocked,isVisible, organization } = data + + + + const findvalue = await floorItemsModel(organization).findOne({ modeluuid: modeluuid, modelname: modelname }) + + if (findvalue) { + + const updatevalue = await floorItemsModel(organization).findOneAndUpdate( + { modeluuid: modeluuid, modelname: modelname }, { position: position, rotation: rotation ,isVisible:isVisible,isLocked:isLocked}, { new: true }); + return { success: true, message: 'flooritems updated', data: updatevalue,organization:organization } + + + } else { + + const newValue = await floorItemsModel(organization).create({ modeluuid, modelname, modelfileID,position, rotation,isLocked,isVisible }); + + + return { success: true, message: 'flooritem created', data: newValue,organization:organization } + + } + + // Send response with the created document + } catch (error) { + console.error('Error creating flooritems:', error); + return { success: false, message: 'Error creating or updating camera', error } + } +} + + export const deleteFloorItems = async (data: any)=>{ + try { + const { modeluuid,modelname,organization } = data; + + const findValue = await floorItemsModel(organization).findOneAndDelete({modeluuid:modeluuid,modelname:modelname}) + if (!findValue) { + return { success: false, message: 'model not found',organization:organization } + + } else { + + return { success: true, message: 'flooritem deleted', data: findValue,organization:organization } + } + } catch (error) { + console.error('Error get flooritems:', error); + return { success: false, message: 'Failed to delete flooritems', error } + + } + } + diff --git a/src/socket-server/services/assets/wallitem-Controller.ts b/src/socket-server/services/assets/wallitem-Controller.ts index d665bf7..f702af7 100644 --- a/src/socket-server/services/assets/wallitem-Controller.ts +++ b/src/socket-server/services/assets/wallitem-Controller.ts @@ -1,60 +1,60 @@ -import { Request, Response } from "express"; -import wallItenmModel from "../../../shared/model/assets/wallitems-Model"; - - -export const setWallItems = async (data: any) => { - try { - const { modeluuid, modelname, position, type, csgposition, csgscale, quaternion, scale, organization } = data - - - const findvalue = await wallItenmModel(organization).findOne({ modeluuid: modeluuid }) - if (findvalue) { - - const updatevalue = await wallItenmModel(organization).findOneAndUpdate( - { modeluuid: modeluuid }, - { - modelname, - position, - type, - csgposition, - csgscale, - quaternion, - scale, - }, - { new: true } // Return the updated document - ); - return { success: true, message: 'wallIitem updated', data: updatevalue, organization: organization } - - - } else { - - const newValue = await wallItenmModel(organization).create({ modeluuid, modelname, position, type, csgposition, csgscale, quaternion, scale }); - return { success: true, message: 'wallIitem created', data: newValue, organization: organization } - } - - // Send response with the created document - } catch (error) { - console.error('Error creating wallIitem:', error); - return { success: false, message: 'Error creating or updating camera', error } - } -} - -export const deleteWallItems = async (data: any) => { - try { - const { modeluuid, modelname, organization } = data; - - - const findValue = await wallItenmModel(organization).findOneAndDelete({ modeluuid: modeluuid, modelname: modelname }) - if (!findValue) { - return { success: false, message: 'model not found', organization: organization } - - } else { - - return { success: true, message: 'wallitem deleted', data: findValue, organization: organization } - } - } catch (error) { - console.error('Error get wallitem:', error); - return { success: false, message: 'Failed to delete wallitem', error } - - } -} +import { Request, Response } from "express"; +import wallItenmModel from "../../../shared/model/assets/wallitems-Model"; + + +export const setWallItems = async (data: any) => { + try { + const { modeluuid, modelname, position, type, csgposition, csgscale, quaternion, scale, organization } = data + + + const findvalue = await wallItenmModel(organization).findOne({ modeluuid: modeluuid }) + if (findvalue) { + + const updatevalue = await wallItenmModel(organization).findOneAndUpdate( + { modeluuid: modeluuid }, + { + modelname, + position, + type, + csgposition, + csgscale, + quaternion, + scale, + }, + { new: true } // Return the updated document + ); + return { success: true, message: 'wallIitem updated', data: updatevalue, organization: organization } + + + } else { + + const newValue = await wallItenmModel(organization).create({ modeluuid, modelname, position, type, csgposition, csgscale, quaternion, scale }); + return { success: true, message: 'wallIitem created', data: newValue, organization: organization } + } + + // Send response with the created document + } catch (error) { + console.error('Error creating wallIitem:', error); + return { success: false, message: 'Error creating or updating camera', error } + } +} + +export const deleteWallItems = async (data: any) => { + try { + const { modeluuid, modelname, organization } = data; + + + const findValue = await wallItenmModel(organization).findOneAndDelete({ modeluuid: modeluuid, modelname: modelname }) + if (!findValue) { + return { success: false, message: 'model not found', organization: organization } + + } else { + + return { success: true, message: 'wallitem deleted', data: findValue, organization: organization } + } + } catch (error) { + console.error('Error get wallitem:', error); + return { success: false, message: 'Failed to delete wallitem', error } + + } +} diff --git a/src/socket-server/services/camera/camera-Controller.ts b/src/socket-server/services/camera/camera-Controller.ts index 3975c0d..9b18f55 100644 --- a/src/socket-server/services/camera/camera-Controller.ts +++ b/src/socket-server/services/camera/camera-Controller.ts @@ -1,31 +1,31 @@ -import { Request, Response } from "express"; -import { Socket } from "socket.io"; -import cameraModel from "../../../shared/model/camera/camera-Model"; - -export const createCamera = async (data: any,) => { - try { - - const { userId, position, target, organization,rotation } = data - - const findCamera = await cameraModel(organization).findOne({ userId: userId }) - if (findCamera) { - const updateCamera = await cameraModel(organization).findOneAndUpdate( - { userId: userId }, { position: position, target: target,rotation:rotation }, { new: true }); - // io.emit('cameraUpdateResponse', { success: true, message: 'Camera updated', data: updateCamera }); - return { success: true, message: 'Camera updated', data: updateCamera,organization:organization} - - } - else { - const newCamera = await cameraModel(organization).create({ userId, position, target,rotation }) - - return { success: false, message: 'Camera created' ,data:newCamera,organization:organization} - - } - - // Send response with the created document - } catch (error) { - console.error('Error creating camera:', error); - return { success: false, message: 'Error creating or updating camera', error, } - } -} - +import { Request, Response } from "express"; +import { Socket } from "socket.io"; +import cameraModel from "../../../shared/model/camera/camera-Model"; + +export const createCamera = async (data: any,) => { + try { + + const { userId, position, target, organization,rotation } = data + + const findCamera = await cameraModel(organization).findOne({ userId: userId }) + if (findCamera) { + const updateCamera = await cameraModel(organization).findOneAndUpdate( + { userId: userId }, { position: position, target: target,rotation:rotation }, { new: true }); + // io.emit('cameraUpdateResponse', { success: true, message: 'Camera updated', data: updateCamera }); + return { success: true, message: 'Camera updated', data: updateCamera,organization:organization} + + } + else { + const newCamera = await cameraModel(organization).create({ userId, position, target,rotation }) + + return { success: false, message: 'Camera created' ,data:newCamera,organization:organization} + + } + + // Send response with the created document + } catch (error) { + console.error('Error creating camera:', error); + return { success: false, message: 'Error creating or updating camera', error, } + } +} + diff --git a/src/socket-server/services/environments/environments-controller.ts b/src/socket-server/services/environments/environments-controller.ts index ebadce7..cc163bd 100644 --- a/src/socket-server/services/environments/environments-controller.ts +++ b/src/socket-server/services/environments/environments-controller.ts @@ -1,33 +1,33 @@ -import { Request, Response } from "express"; -import environmentModel from "../../../shared/model/environments/environments-Model"; - - - -export const setEnvironment = async (data: any,) => { - try { - const { userId,roofVisibility,wallVisibility,shadowVisibility, organization } = data - - const findvalue = await environmentModel(organization).findOne({ userId: userId }) - if (findvalue) { - const updatevalue = await environmentModel(organization).findOneAndUpdate( - { userId: userId }, { roofVisibility:roofVisibility,wallVisibility:wallVisibility,shadowVisibility:shadowVisibility }, { new: true }); - // res.status(201).json(updatevalue); - return { success: true, message: 'evironments updated', data: updatevalue,organization:organization } - - } else { - const newValue = await environmentModel(organization).create({ userId, roofVisibility, wallVisibility,shadowVisibility }); - - return { success: true, message: 'evironments created', data: newValue,organization:organization } - // res.status(201).json(newValue); - - } - - - - // Send response with the created document - } catch (error) { - console.error('Error creating evironments:', error); - return { success: false, message: 'Error creating or updating evironments', error } - } -} - +import { Request, Response } from "express"; +import environmentModel from "../../../shared/model/environments/environments-Model"; + + + +export const setEnvironment = async (data: any,) => { + try { + const { userId,roofVisibility,wallVisibility,shadowVisibility, organization } = data + + const findvalue = await environmentModel(organization).findOne({ userId: userId }) + if (findvalue) { + const updatevalue = await environmentModel(organization).findOneAndUpdate( + { userId: userId }, { roofVisibility:roofVisibility,wallVisibility:wallVisibility,shadowVisibility:shadowVisibility }, { new: true }); + // res.status(201).json(updatevalue); + return { success: true, message: 'evironments updated', data: updatevalue,organization:organization } + + } else { + const newValue = await environmentModel(organization).create({ userId, roofVisibility, wallVisibility,shadowVisibility }); + + return { success: true, message: 'evironments created', data: newValue,organization:organization } + // res.status(201).json(newValue); + + } + + + + // Send response with the created document + } catch (error) { + console.error('Error creating evironments:', error); + return { success: false, message: 'Error creating or updating evironments', error } + } +} + diff --git a/src/socket-server/services/lines/line-Controller.ts b/src/socket-server/services/lines/line-Controller.ts index 17b66ce..286023c 100644 --- a/src/socket-server/services/lines/line-Controller.ts +++ b/src/socket-server/services/lines/line-Controller.ts @@ -1,100 +1,100 @@ -import { Request, Response } from "express"; -import lineModel from "../../../shared/model/lines/lines-Model"; - - -export const createLineItems = async (data: any)=>{ - try { - const {organization,layer,line,type}=data - const newLine = await lineModel(organization).create({ layer,line,type }); - return { success: true, message: 'line create', data: newLine,organization:organization } - - // Send response with the created document - } catch (error) { - - return { success: false, message: 'Error create line', error } - - } - } -export const updateLineItems = async (data: any)=>{ - try { - const {organization,uuid,position,}=data - // const findLine = await lineModel(organization).find({ 'line.uuid': uuid }); - // Update the position of the line matching the uuid - const updateResult = await lineModel(organization).updateMany( - { 'line.uuid': uuid }, // Filter: Find the line with the given uuid - { $set: { 'line.$.position': position } } // Update the position and type - ); - return { success: true, message: 'line updated', data: {uuid:uuid,position:position},organization:organization } - - // Send response with the created document - } catch (error) { - console.error('Error creating Lines:', error); - return { success: false, message: 'Error updating line', error } - } - } - - export const deleteLineItems = async (data: any)=>{ - try { - const {organization,line}=data - - const inputUuids = line.map((item: any) => item.uuid); - - // const findValue = await lineModel(organization).findOneAndDelete({ - - // line: { $elemMatch: { uuid: { $in: inputUuids } } }, - // }); - const findValue = await lineModel(organization).findOneAndDelete({ - "line.uuid": { $all: inputUuids } // Ensure all UUIDs are present in the `line` key - }); - - if (!findValue) { - return { success: false, message: 'line not found',organization:organization } - } else { - return { success: true, message: 'line deleted', data: findValue,organization:organization } - } - } catch (error) { - console.error('Error delete Lines:', error); - return { success: false, message: 'Failed to delete line', error } - } - } - export const deleteLayer = async (data: any)=>{ - try { - const {organization,layer}=data - - const findValue = await lineModel(organization).find({ layer: layer }); - - if (!findValue) { - return { success: false, message: 'layer not found' } - } else { - await lineModel(organization).deleteMany({ layer: layer }); - - // Update documents with layer greater than -1 - const updateResult = await lineModel(organization).updateMany( - { layer: { $gt:layer} }, - { $inc: { layer: -1 } } // Example operation: decrementing layer by 1 - ); - return { success: true, message: 'layer deleted', data: layer,organization:organization } - } - } catch (error) { - console.error('Error delete layer:', error); - return { success: false, message: 'Failed to delete layer', error } - } - } - export const deleteLinPoiteItems = async (data: any)=>{ - try { - const {organization,uuid}=data - - - const findValue = await lineModel(organization).deleteMany({ 'line.uuid': uuid }) - - if (!findValue) { - return { success: false, message: 'line not found',organization:organization } - } else { - - return { success: true, message: 'point deleted', data: uuid ,organization:organization} - } - } catch (error) { - console.error('Error delete Lines:', error); - return { success: false, message: 'Failed to delete point', error } - } - } +import { Request, Response } from "express"; +import lineModel from "../../../shared/model/lines/lines-Model"; + + +export const createLineItems = async (data: any)=>{ + try { + const {organization,layer,line,type}=data + const newLine = await lineModel(organization).create({ layer,line,type }); + return { success: true, message: 'line create', data: newLine,organization:organization } + + // Send response with the created document + } catch (error) { + + return { success: false, message: 'Error create line', error } + + } + } +export const updateLineItems = async (data: any)=>{ + try { + const {organization,uuid,position,}=data + // const findLine = await lineModel(organization).find({ 'line.uuid': uuid }); + // Update the position of the line matching the uuid + const updateResult = await lineModel(organization).updateMany( + { 'line.uuid': uuid }, // Filter: Find the line with the given uuid + { $set: { 'line.$.position': position } } // Update the position and type + ); + return { success: true, message: 'line updated', data: {uuid:uuid,position:position},organization:organization } + + // Send response with the created document + } catch (error) { + console.error('Error creating Lines:', error); + return { success: false, message: 'Error updating line', error } + } + } + + export const deleteLineItems = async (data: any)=>{ + try { + const {organization,line}=data + + const inputUuids = line.map((item: any) => item.uuid); + + // const findValue = await lineModel(organization).findOneAndDelete({ + + // line: { $elemMatch: { uuid: { $in: inputUuids } } }, + // }); + const findValue = await lineModel(organization).findOneAndDelete({ + "line.uuid": { $all: inputUuids } // Ensure all UUIDs are present in the `line` key + }); + + if (!findValue) { + return { success: false, message: 'line not found',organization:organization } + } else { + return { success: true, message: 'line deleted', data: findValue,organization:organization } + } + } catch (error) { + console.error('Error delete Lines:', error); + return { success: false, message: 'Failed to delete line', error } + } + } + export const deleteLayer = async (data: any)=>{ + try { + const {organization,layer}=data + + const findValue = await lineModel(organization).find({ layer: layer }); + + if (!findValue) { + return { success: false, message: 'layer not found' } + } else { + await lineModel(organization).deleteMany({ layer: layer }); + + // Update documents with layer greater than -1 + const updateResult = await lineModel(organization).updateMany( + { layer: { $gt:layer} }, + { $inc: { layer: -1 } } // Example operation: decrementing layer by 1 + ); + return { success: true, message: 'layer deleted', data: layer,organization:organization } + } + } catch (error) { + console.error('Error delete layer:', error); + return { success: false, message: 'Failed to delete layer', error } + } + } + export const deleteLinPoiteItems = async (data: any)=>{ + try { + const {organization,uuid}=data + + + const findValue = await lineModel(organization).deleteMany({ 'line.uuid': uuid }) + + if (!findValue) { + return { success: false, message: 'line not found',organization:organization } + } else { + + return { success: true, message: 'point deleted', data: uuid ,organization:organization} + } + } catch (error) { + console.error('Error delete Lines:', error); + return { success: false, message: 'Failed to delete point', error } + } + } diff --git a/src/socket-server/services/users/user-controller.ts b/src/socket-server/services/users/user-controller.ts index c75ff9d..4bde56c 100644 --- a/src/socket-server/services/users/user-controller.ts +++ b/src/socket-server/services/users/user-controller.ts @@ -1,97 +1,97 @@ -import cameraModel from "../../../shared/model/camera/camera-Model" -import userModel from "../../../shared/model/user-Model" - -export const activeUsers = async (data: any) => { - try { - if (data && data.email) { - - const email = data.email - const organization = email.split("@")[1].split(".")[0] - - const findUser = await userModel(organization).findOne({email}) - - if (findUser) { - const updateActiveStatus = await userModel(organization).findOneAndUpdate({email:findUser.email},{activeStatus:"online"},{new:true}) - - if (updateActiveStatus) { - const cameraDatas=await cameraModel(organization).findOne({userId:updateActiveStatus._id}) - .select("position target rotation -_id"); - - if (cameraDatas) { - const result = { - position: cameraDatas.position, - target: cameraDatas.target, - rotation: cameraDatas.rotation, - userData: { - _id: updateActiveStatus._id, - userName: updateActiveStatus.userName, - email: updateActiveStatus.email, - }, - }; - - - - return { success: true, message: 'user connect ', data: result,organization:organization } - // return result; - } - } - - } - }else { - console.error('Invalid data or missing email:', data); - // Handle the error or return a default value - // Example: Return an error response if the email is invalid - - return { success: false, message: 'Email is missing or invalid', } - // return res.status(400).send({ message: 'Email is missing or invalid' }); - } - - - // // return []; - } catch (error) { - - return { success: false, message:error} - } -} - -export const activeUserOffline = async (data: any) => { - try { - - const email = data.email - const organization = email.split("@")[1].split(".")[0] - - const findUsers = await userModel(organization).findOne({email}) - // console.log('findUsers: ', findUsers); - if (findUsers) { - const updateActiveStatus = await userModel(organization).findOneAndUpdate({email:email},{activeStatus:"offline"},{new:true}) - // console.log('updateActiveStatus: ',updateActiveStatus); - if (updateActiveStatus) { - const cameraDatas=await cameraModel(organization).findOne({userId:updateActiveStatus._id}) - .select("position target rotation -_id"); - // console.log('cameraDatas: ', cameraDatas); - if (cameraDatas) { - const result = { - position: cameraDatas.position, - target: cameraDatas.target, - rotation: cameraDatas.rotation, - userData: { - _id: updateActiveStatus._id, - userName: updateActiveStatus.userName, - email: updateActiveStatus.email, - }, - }; - - // console.log("Formatted Result:", result); - - - // return result; - return { success: true, message: 'user disconnect', data: result,organization:organization } - } - } - } - // // return []; - } catch (error) { - - return { success: false, message: error} - } -} +import cameraModel from "../../../shared/model/camera/camera-Model" +import userModel from "../../../shared/model/user-Model" + +export const activeUsers = async (data: any) => { + try { + if (data && data.email) { + + const email = data.email + const organization = email.split("@")[1].split(".")[0] + + const findUser = await userModel(organization).findOne({email}) + + if (findUser) { + const updateActiveStatus = await userModel(organization).findOneAndUpdate({email:findUser.email},{activeStatus:"online"},{new:true}) + + if (updateActiveStatus) { + const cameraDatas=await cameraModel(organization).findOne({userId:updateActiveStatus._id}) + .select("position target rotation -_id"); + + if (cameraDatas) { + const result = { + position: cameraDatas.position, + target: cameraDatas.target, + rotation: cameraDatas.rotation, + userData: { + _id: updateActiveStatus._id, + userName: updateActiveStatus.userName, + email: updateActiveStatus.email, + }, + }; + + + + return { success: true, message: 'user connect ', data: result,organization:organization } + // return result; + } + } + + } + }else { + // console.error('Invalid data or missing email:', data); + // Handle the error or return a default value + // Example: Return an error response if the email is invalid + + return { success: false, message: 'Email is missing or invalid', } + // return res.status(400).send({ message: 'Email is missing or invalid' }); + } + + + // // return []; + } catch (error) { + + return { success: false, message:error} + } +} + +export const activeUserOffline = async (data: any) => { + try { + + const email = data.email + const organization = email.split("@")[1].split(".")[0] + + const findUsers = await userModel(organization).findOne({email}) + // console.log('findUsers: ', findUsers); + if (findUsers) { + const updateActiveStatus = await userModel(organization).findOneAndUpdate({email:email},{activeStatus:"offline"},{new:true}) + // console.log('updateActiveStatus: ',updateActiveStatus); + if (updateActiveStatus) { + const cameraDatas=await cameraModel(organization).findOne({userId:updateActiveStatus._id}) + .select("position target rotation -_id"); + // console.log('cameraDatas: ', cameraDatas); + if (cameraDatas) { + const result = { + position: cameraDatas.position, + target: cameraDatas.target, + rotation: cameraDatas.rotation, + userData: { + _id: updateActiveStatus._id, + userName: updateActiveStatus.userName, + email: updateActiveStatus.email, + }, + }; + + // console.log("Formatted Result:", result); + + + // return result; + return { success: true, message: 'user disconnect', data: result,organization:organization } + } + } + } + // // return []; + } catch (error) { + + return { success: false, message: error} + } +} diff --git a/src/socket-server/socket/events.ts b/src/socket-server/socket/events.ts index 3ace75c..e34709f 100644 --- a/src/socket-server/socket/events.ts +++ b/src/socket-server/socket/events.ts @@ -1,45 +1,45 @@ -export const EVENTS = { - connection: "connection", - disconnect:"disconnect", - //userActiveStatus - userConnect:"userConnectRespones", - userDisConnect:"userDisConnectRespones", - // Room management events - joinRoom: 'joinRoom', - createroom: "createRoom", // When a client joins a room - leaveRoom: 'leaveRoom', // When a client leaves a room - roomCreated: 'roomCreated', // When a new room is created - roomDeleted: 'roomDeleted', // When a room is deleted - - // Camera //response - setCamera: 'v1:Camera:set', - cameraCreateResponse: "cameraCreateResponse", // Response for camera creation - cameraUpdateResponse: "cameraUpdateResponse", // Response for camera update - cameraError: "cameraError", - //Environment - setenvironment: "v1:Environment:set", - EnvironmentUpdateResponse: "EnvironmentUpdateResponse", - //FloorItems - setFloorItems: "v1:FloorItems:set", - FloorItemsUpdateResponse: "FloorItemsUpdateResponse", - deleteFloorItems: "v1:FloorItems:delete", - FloorItemsDeleteResponse: "FloorItemsDeleteResponse", - floorItemError: "floorItemError", - //WALLItems - setWallItems: "v1:wallItems:set", - wallItemsUpdateResponse: "wallItemsUpdateResponse", - deleteWallItems: "v1:wallItems:delete", - wallItemsDeleteResponse: "wallItemsDeleteResponse", - wallItemError: "wallItemError", - //Lines - createLine:"v1:Line:create", - createLineResponse:"Line:response:create", - updateLine:"v1:Line:update", - updateLineResponse:"Line:response:update", - deleteLine:"v1:Line:delete", - deleteLineResponse:"Line:response:delete", - deletePoint:"v1:Line:delete:point", - deletePointResponse:"Line:response:delete:point", - deleteLineLayer:"v1:Line:delete:layer", - deleteLineLayerResponse:"Line:response:delete:layer", +export const EVENTS = { + connection: "connection", + disconnect:"disconnect", + //userActiveStatus + userConnect:"userConnectRespones", + userDisConnect:"userDisConnectRespones", + // Room management events + joinRoom: 'joinRoom', + createroom: "createRoom", // When a client joins a room + leaveRoom: 'leaveRoom', // When a client leaves a room + roomCreated: 'roomCreated', // When a new room is created + roomDeleted: 'roomDeleted', // When a room is deleted + + // Camera //response + setCamera: 'v1:Camera:set', + cameraCreateResponse: "cameraCreateResponse", // Response for camera creation + cameraUpdateResponse: "cameraUpdateResponse", // Response for camera update + cameraError: "cameraError", + //Environment + setenvironment: "v1:Environment:set", + EnvironmentUpdateResponse: "EnvironmentUpdateResponse", + //FloorItems + setFloorItems: "v1:FloorItems:set", + FloorItemsUpdateResponse: "FloorItemsUpdateResponse", + deleteFloorItems: "v1:FloorItems:delete", + FloorItemsDeleteResponse: "FloorItemsDeleteResponse", + floorItemError: "floorItemError", + //WALLItems + setWallItems: "v1:wallItems:set", + wallItemsUpdateResponse: "wallItemsUpdateResponse", + deleteWallItems: "v1:wallItems:delete", + wallItemsDeleteResponse: "wallItemsDeleteResponse", + wallItemError: "wallItemError", + //Lines + createLine:"v1:Line:create", + createLineResponse:"Line:response:create", + updateLine:"v1:Line:update", + updateLineResponse:"Line:response:update", + deleteLine:"v1:Line:delete", + deleteLineResponse:"Line:response:delete", + deletePoint:"v1:Line:delete:point", + deletePointResponse:"Line:response:delete:point", + deleteLineLayer:"v1:Line:delete:layer", + deleteLineLayerResponse:"Line:response:delete:layer", } \ No newline at end of file diff --git a/src/socket-server/socket/socketManager.ts b/src/socket-server/socket/socketManager.ts index caa5c3d..d413bfe 100644 --- a/src/socket-server/socket/socketManager.ts +++ b/src/socket-server/socket/socketManager.ts @@ -1,421 +1,421 @@ -import { Server, Socket } from 'socket.io'; -import { EVENTS } from './events'; -import { createCamera } from '../services/camera/camera-Controller'; -import { setEnvironment } from '../services/environments/environments-controller'; -import { deleteFloorItems, setFloorItems } from '../services/assets/flooritem-Controller'; -import { deleteWallItems, setWallItems } from '../services/assets/wallitem-Controller'; -import { deleteLineItems, deleteLinPoiteItems, updateLineItems ,createLineItems, deleteLayer} from '../services/lines/line-Controller'; -import { activeUserOffline, activeUsers } from '../services/users/user-controller'; - - - - - -const cameraHandleEvent =async (event: string, socket: Socket, data: any,io:any) => { - switch (event) { - - case EVENTS.setCamera: - const result = await createCamera(data,); - // console.log('result: ', result); - if (result.success) { - // console.log('result.success: ', result.success); - // if (result.message === 'Camera updated') { - // Emit update response - - io.emit(EVENTS.cameraUpdateResponse, { - success: true, - message: result.message, - data: result.data, - socketId: socket.id, - organization:result.organization - }); - } else if (result.message === 'Camera created') { - // Emit create response - io.emit(EVENTS.cameraCreateResponse, { - success: true, - message: result.message, - data: result.data, - socketId: socket.id, - organization:result.organization - }); - // } - } else { - // Emit error response - socket.emit(EVENTS.cameraError, { - success: false, - message: result.message, - error: result.error, - socketId: socket.id, - organization:result.organization - }); - } - break; - // case EVENTS.updataControlle_iot: - // updateControlle(data); - break; - // case EVENTS.deleteControlle_iot: - // deleteControlle(data); - break; - - - default: - // console.error(`Unhandled event type: ${event}`); - } -} -const EnvironmentHandleEvent =async (event: string, socket: Socket, data: any,io:any) => { - switch (event) { - - case EVENTS.setenvironment: - const result = await setEnvironment(data,); - // console.log('result: ', result); - if (result.success) { - // if (result.message === 'Camera updated') { - // Emit update response - - io.emit(EVENTS.EnvironmentUpdateResponse, { - success: true, - message: result.message, - data: result.data, - socketId: socket.id, - organization:result.organization - }); - // } else if (result.message === 'evironments created') { - // // Emit create response - // io.emit(EVENTS.cameraCreateResponse, { - // success: true, - // message: result.message, - // data: result.data, - // }); - // } - } else { - // Emit error response - socket.emit(EVENTS.cameraError, { - success: false, - message: result.message, - error: result.error, - socketId: socket.id, - organization:result.organization - }); - } - break; - // case EVENTS.updataControlle_iot: - // updateControlle(data); - break; - // case EVENTS.deleteControlle_iot: - // deleteControlle(data); - break; - - - default: -// console.error(`Unhandled event type: ${event}`); - } -} -const floorItemsHandleEvent =async (event: string, socket: Socket, data: any,io:any) => { - switch (event) { - - case EVENTS.setFloorItems:{ - const result = await setFloorItems(data); - // console.log('result: ', result); - if (result.success) { - io.emit(EVENTS.FloorItemsUpdateResponse, { - success: true || false, - message: result.message, - data: result.data, - socketId: socket.id, - organization:result.organization - - }); - - } else { - // Emit error response - socket.emit(EVENTS.floorItemError, { - success: false, - message: result.message, - error: result.error, - socketId: socket.id, - organization:result.organization - }); - } - break;} - case EVENTS.deleteFloorItems:{ - const result = await deleteFloorItems(data); - // console.log('result: ', result); - if (result.success) { - - - io.emit(EVENTS.FloorItemsDeleteResponse, { - success: true || false, - message: result.message, - data: result.data, - socketId: socket.id, - organization:result.organization - - }); - - } else { - // Emit error response - socket.emit(EVENTS.floorItemError, { - success: false, - message: result.message, - error: result.error, - socketId: socket.id, - organization:result.organization - }); - } - break;} - - default: -// console.error(`Unhandled event type: ${event}`); - } -} -const wallItemsHandleEvent =async (event: string, socket: Socket, data: any,io:any) => { - switch (event) { - - case EVENTS.setWallItems:{ - const result = await setWallItems(data); - // console.log('result: ', result); - if (result.success) { - io.emit(EVENTS.wallItemsUpdateResponse, { - success: true, - message: result.message, - data: result.data, - socketId: socket.id, - organization:result.organization - - }); - - } else { - // Emit error response - socket.emit(EVENTS.wallItemError, { - success: false, - message: result.message, - error: result.error, - }); - } - break; - } - case EVENTS.deleteWallItems:{ - const result = await deleteWallItems(data); - // console.log('result: ', result); - if (result.success) { - - - io.emit(EVENTS.wallItemsDeleteResponse, { - success: true || false, - message: result.message, - data: result.data, - socketId: socket.id, - organization:result.organization - - }); - - } else { - // Emit error response - socket.emit(EVENTS.wallItemError, { - success: false, - message: result.message, - error: result.error, - }); - } - break; -} - - default: -// console.error(`Unhandled event type: ${event}`); - } -} -const lineHandleEvent =async (event: string, socket: Socket, data: any,io:any) => { - switch (event) { - case EVENTS.createLine:{ - const result = await createLineItems(data); - // console.log('result: ', result); - if (result.success) { - - - io.emit(EVENTS.createLineResponse, { - success: true || false, - message: result.message, - data: result.data, - socketId: socket.id, - organization:result.organization - - }); - - } else { - // Emit error response - // socket.emit(EVENTS.wallItemError, { - // success: false, - // message: result.message, - // error: result.error, - // }); - } - break; - } - case EVENTS.updateLine: { - const result = await updateLineItems(data); - // console.log('result: ', result); - if (result.success) { - - - io.emit(EVENTS.updateLineResponse, { - success: true || false, - message: result.message, - data: result.data, - socketId: socket.id, - organization: result.organization - - }); - - } - break; - } - case EVENTS.deleteLine:{ - const result = await deleteLineItems(data); - // console.log('result: ', result); - if (result.success) { - - - io.emit(EVENTS.deleteLineResponse, { - success: true || false, - message: result.message, - data: result.data, - socketId: socket.id, - organization:result.organization - - }); - - } else { - // Emit error response - // socket.emit(EVENTS.wallItemError, { - // success: false, - // message: result.message, - // error: result.error, - // }); - } - break; -} -case EVENTS.deletePoint:{ - const result = await deleteLinPoiteItems(data); - // console.log('result: ', result); - if (result.success) { - - io.emit(EVENTS.deletePointResponse, { - success: true || false, - message: result.message, - data: result.data, - socketId: socket.id, - organization:result.organization - - }); - -} else { - // Emit error response - // socket.emit(EVENTS.wallItemError, { - // success: false, - // message: result.message, - // error: result.error, - // }); -} - break; -} -case EVENTS.deleteLineLayer:{ - const result = await deleteLayer(data); - // console.log('result: ', result); - if (result.success) { - - io.emit(EVENTS.deleteLineLayerResponse, { - success: true || false, - message: result.message, - data: result.data, - socketId: socket.id, - organization:result.organization - - }); - -} else { - // Emit error response - // socket.emit(EVENTS.wallItemError, { - // success: false, - // message: result.message, - // error: result.error, - // }); -} - break; -} - - default: -// console.error(`Unhandled event type: ${event}`); - } -} -const userStatus =async (event: string, socket: Socket, data: any,io:any) => { - switch (event) { - case EVENTS.connection: { - // console.log('EVENTS.connection: ', EVENTS.connection); - // console.log('event: ', event); - const result = await activeUsers(data); - if (result?.success) { - // console.log('result.success: ', result.success) - - io.emit(EVENTS.userConnect, { - success: true || false, - message: result.message, - data: result.data, - socketId: socket.id, - organization:result.organization - - });} - break; - } - case EVENTS.disconnect: { - // console.log('EVENTS.disconnect: ', EVENTS.connection); - // console.log('event: ', event); - const result = await activeUserOffline(data); - if (result?.success) { - // console.log('result.success: ', result.success) - - io.emit(EVENTS.userDisConnect, { - success: true || false, - message: result.message, - data: result.data, - socketId: socket.id, - organization:result.organization - - });} - break; - } - } -} -export const initSocketServer = (httpServer: any) => { - const io = new Server(httpServer, { - cors: { - origin: '*', // Allow CORS for all origins (adjust in production) - methods: ['GET', 'POST'], - }, - }); - - // Listen for new connections - io.on(EVENTS.connection, (socket: Socket) => { - // console.log(`New client connected: ${socket.id}`); -// console.log(socket.handshake.auth); -userStatus(EVENTS.connection, socket, socket.handshake.auth,io); - - // Handle all incoming events with the handleEvent function - socket.onAny((event: string, data: any,) => { - cameraHandleEvent(event, socket, data,io); - EnvironmentHandleEvent(event, socket, data,io); - floorItemsHandleEvent(event, socket, data,io); - wallItemsHandleEvent(event, socket, data,io); - lineHandleEvent(event, socket, data,io); - - - }); - socket.on(EVENTS.disconnect, (reason: string) => { - // console.log(`Client disconnected: ${socket.id}, Reason: ${reason}`); - // console.log(socket.handshake.auth); - userStatus(EVENTS.disconnect, socket, socket.handshake.auth,io); - // Perform cleanup or other necessary actions - }); - }); - - return io; -}; +import { Server, Socket } from 'socket.io'; +import { EVENTS } from './events'; +import { createCamera } from '../services/camera/camera-Controller'; +import { setEnvironment } from '../services/environments/environments-controller'; +import { deleteFloorItems, setFloorItems } from '../services/assets/flooritem-Controller'; +import { deleteWallItems, setWallItems } from '../services/assets/wallitem-Controller'; +import { deleteLineItems, deleteLinPoiteItems, updateLineItems ,createLineItems, deleteLayer} from '../services/lines/line-Controller'; +import { activeUserOffline, activeUsers } from '../services/users/user-controller'; + + + + + +const cameraHandleEvent =async (event: string, socket: Socket, data: any,io:any) => { + switch (event) { + + case EVENTS.setCamera: + const result = await createCamera(data,); + // console.log('result: ', result); + if (result.success) { + // console.log('result.success: ', result.success); + // if (result.message === 'Camera updated') { + // Emit update response + + io.emit(EVENTS.cameraUpdateResponse, { + success: true, + message: result.message, + data: result.data, + socketId: socket.id, + organization:result.organization + }); + } else if (result.message === 'Camera created') { + // Emit create response + io.emit(EVENTS.cameraCreateResponse, { + success: true, + message: result.message, + data: result.data, + socketId: socket.id, + organization:result.organization + }); + // } + } else { + // Emit error response + socket.emit(EVENTS.cameraError, { + success: false, + message: result.message, + error: result.error, + socketId: socket.id, + organization:result.organization + }); + } + break; + // case EVENTS.updataControlle_iot: + // updateControlle(data); + break; + // case EVENTS.deleteControlle_iot: + // deleteControlle(data); + break; + + + default: + // console.error(`Unhandled event type: ${event}`); + } +} +const EnvironmentHandleEvent =async (event: string, socket: Socket, data: any,io:any) => { + switch (event) { + + case EVENTS.setenvironment: + const result = await setEnvironment(data,); + // console.log('result: ', result); + if (result.success) { + // if (result.message === 'Camera updated') { + // Emit update response + + io.emit(EVENTS.EnvironmentUpdateResponse, { + success: true, + message: result.message, + data: result.data, + socketId: socket.id, + organization:result.organization + }); + // } else if (result.message === 'evironments created') { + // // Emit create response + // io.emit(EVENTS.cameraCreateResponse, { + // success: true, + // message: result.message, + // data: result.data, + // }); + // } + } else { + // Emit error response + socket.emit(EVENTS.cameraError, { + success: false, + message: result.message, + error: result.error, + socketId: socket.id, + organization:result.organization + }); + } + break; + // case EVENTS.updataControlle_iot: + // updateControlle(data); + break; + // case EVENTS.deleteControlle_iot: + // deleteControlle(data); + break; + + + default: +// console.error(`Unhandled event type: ${event}`); + } +} +const floorItemsHandleEvent =async (event: string, socket: Socket, data: any,io:any) => { + switch (event) { + + case EVENTS.setFloorItems:{ + const result = await setFloorItems(data); + // console.log('result: ', result); + if (result.success) { + io.emit(EVENTS.FloorItemsUpdateResponse, { + success: true || false, + message: result.message, + data: result.data, + socketId: socket.id, + organization:result.organization + + }); + + } else { + // Emit error response + socket.emit(EVENTS.floorItemError, { + success: false, + message: result.message, + error: result.error, + socketId: socket.id, + organization:result.organization + }); + } + break;} + case EVENTS.deleteFloorItems:{ + const result = await deleteFloorItems(data); + // console.log('result: ', result); + if (result.success) { + + + io.emit(EVENTS.FloorItemsDeleteResponse, { + success: true || false, + message: result.message, + data: result.data, + socketId: socket.id, + organization:result.organization + + }); + + } else { + // Emit error response + socket.emit(EVENTS.floorItemError, { + success: false, + message: result.message, + error: result.error, + socketId: socket.id, + organization:result.organization + }); + } + break;} + + default: +// console.error(`Unhandled event type: ${event}`); + } +} +const wallItemsHandleEvent =async (event: string, socket: Socket, data: any,io:any) => { + switch (event) { + + case EVENTS.setWallItems:{ + const result = await setWallItems(data); + // console.log('result: ', result); + if (result.success) { + io.emit(EVENTS.wallItemsUpdateResponse, { + success: true, + message: result.message, + data: result.data, + socketId: socket.id, + organization:result.organization + + }); + + } else { + // Emit error response + socket.emit(EVENTS.wallItemError, { + success: false, + message: result.message, + error: result.error, + }); + } + break; + } + case EVENTS.deleteWallItems:{ + const result = await deleteWallItems(data); + // console.log('result: ', result); + if (result.success) { + + + io.emit(EVENTS.wallItemsDeleteResponse, { + success: true || false, + message: result.message, + data: result.data, + socketId: socket.id, + organization:result.organization + + }); + + } else { + // Emit error response + socket.emit(EVENTS.wallItemError, { + success: false, + message: result.message, + error: result.error, + }); + } + break; +} + + default: +// console.error(`Unhandled event type: ${event}`); + } +} +const lineHandleEvent =async (event: string, socket: Socket, data: any,io:any) => { + switch (event) { + case EVENTS.createLine:{ + const result = await createLineItems(data); + // console.log('result: ', result); + if (result.success) { + + + io.emit(EVENTS.createLineResponse, { + success: true || false, + message: result.message, + data: result.data, + socketId: socket.id, + organization:result.organization + + }); + + } else { + // Emit error response + // socket.emit(EVENTS.wallItemError, { + // success: false, + // message: result.message, + // error: result.error, + // }); + } + break; + } + case EVENTS.updateLine: { + const result = await updateLineItems(data); + // console.log('result: ', result); + if (result.success) { + + + io.emit(EVENTS.updateLineResponse, { + success: true || false, + message: result.message, + data: result.data, + socketId: socket.id, + organization: result.organization + + }); + + } + break; + } + case EVENTS.deleteLine:{ + const result = await deleteLineItems(data); + // console.log('result: ', result); + if (result.success) { + + + io.emit(EVENTS.deleteLineResponse, { + success: true || false, + message: result.message, + data: result.data, + socketId: socket.id, + organization:result.organization + + }); + + } else { + // Emit error response + // socket.emit(EVENTS.wallItemError, { + // success: false, + // message: result.message, + // error: result.error, + // }); + } + break; +} +case EVENTS.deletePoint:{ + const result = await deleteLinPoiteItems(data); + // console.log('result: ', result); + if (result.success) { + + io.emit(EVENTS.deletePointResponse, { + success: true || false, + message: result.message, + data: result.data, + socketId: socket.id, + organization:result.organization + + }); + +} else { + // Emit error response + // socket.emit(EVENTS.wallItemError, { + // success: false, + // message: result.message, + // error: result.error, + // }); +} + break; +} +case EVENTS.deleteLineLayer:{ + const result = await deleteLayer(data); + // console.log('result: ', result); + if (result.success) { + + io.emit(EVENTS.deleteLineLayerResponse, { + success: true || false, + message: result.message, + data: result.data, + socketId: socket.id, + organization:result.organization + + }); + +} else { + // Emit error response + // socket.emit(EVENTS.wallItemError, { + // success: false, + // message: result.message, + // error: result.error, + // }); +} + break; +} + + default: +// console.error(`Unhandled event type: ${event}`); + } +} +const userStatus =async (event: string, socket: Socket, data: any,io:any) => { + switch (event) { + case EVENTS.connection: { + // console.log('EVENTS.connection: ', EVENTS.connection); + // console.log('event: ', event); + const result = await activeUsers(data); + if (result?.success) { + // console.log('result.success: ', result.success) + + io.emit(EVENTS.userConnect, { + success: true || false, + message: result.message, + data: result.data, + socketId: socket.id, + organization:result.organization + + });} + break; + } + case EVENTS.disconnect: { + // console.log('EVENTS.disconnect: ', EVENTS.connection); + // console.log('event: ', event); + const result = await activeUserOffline(data); + if (result?.success) { + // console.log('result.success: ', result.success) + + io.emit(EVENTS.userDisConnect, { + success: true || false, + message: result.message, + data: result.data, + socketId: socket.id, + organization:result.organization + + });} + break; + } + } +} +export const initSocketServer = (httpServer: any) => { + const io = new Server(httpServer, { + cors: { + origin: '*', // Allow CORS for all origins (adjust in production) + methods: ['GET', 'POST'], + }, + }); + + // Listen for new connections + io.on(EVENTS.connection, (socket: Socket) => { + // console.log(`New client connected: ${socket.id}`); +// console.log(socket.handshake.auth); +userStatus(EVENTS.connection, socket, socket.handshake.auth,io); + + // Handle all incoming events with the handleEvent function + socket.onAny((event: string, data: any,) => { + cameraHandleEvent(event, socket, data,io); + EnvironmentHandleEvent(event, socket, data,io); + floorItemsHandleEvent(event, socket, data,io); + wallItemsHandleEvent(event, socket, data,io); + lineHandleEvent(event, socket, data,io); + + + }); + socket.on(EVENTS.disconnect, (reason: string) => { + // console.log(`Client disconnected: ${socket.id}, Reason: ${reason}`); + // console.log(socket.handshake.auth); + userStatus(EVENTS.disconnect, socket, socket.handshake.auth,io); + // Perform cleanup or other necessary actions + }); + }); + + return io; +}; diff --git a/swagger-output.json b/swagger-output.json new file mode 100644 index 0000000..7904ea2 --- /dev/null +++ b/swagger-output.json @@ -0,0 +1,728 @@ +{ + "swagger": "2.0", + "info": { + "title": "dwinzo documetion", + "description": "Description", + "version": "1.0.0" + }, + "host": "185.100.212.76:5000", + "basePath": "/api/v1", + "schemes": [ + "http" + ], + "paths": { + "/signup": { + "post": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userName": { + "example": "any" + }, + "email": { + "example": "any" + }, + "password": { + "example": "any" + }, + "organization": { + "example": "any" + }, + "profilePicture": { + "example": "any" + } + } + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/login": { + "post": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "example": "any" + }, + "password": { + "example": "any" + }, + "organization": { + "example": "any" + } + } + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "404": { + "description": "Not Found" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/setCamera": { + "post": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "example": "any" + }, + "position": { + "example": "any" + }, + "target": { + "example": "any" + }, + "rotation": { + "example": "any" + }, + "organization": { + "example": "any" + } + } + } + } + ], + "responses": { + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/getCamera/{organization}/{userId}": { + "get": { + "description": "", + "parameters": [ + { + "name": "organization", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "userId", + "in": "path", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/activeCameras/{organization}": { + "get": { + "description": "", + "parameters": [ + { + "name": "organization", + "in": "path", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/setEvironments": { + "post": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "example": "any" + }, + "roofVisibility": { + "example": "any" + }, + "wallVisibility": { + "example": "any" + }, + "organization": { + "example": "any" + } + } + } + } + ], + "responses": { + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/findEnvironments/{organization}/{userId}": { + "get": { + "description": "", + "parameters": [ + { + "name": "organization", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "userId", + "in": "path", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/setfloorItems": { + "post": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "modeluuid": { + "example": "any" + }, + "modelname": { + "example": "any" + }, + "position": { + "example": "any" + }, + "modelfileID": { + "example": "any" + }, + "rotation": { + "example": "any" + }, + "isLocked": { + "example": "any" + }, + "isVisible": { + "example": "any" + }, + "organization": { + "example": "any" + } + } + } + } + ], + "responses": { + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/findfloorItems/{organization}": { + "get": { + "description": "", + "parameters": [ + { + "name": "organization", + "in": "path", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/deletefloorItem": { + "delete": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "modeluuid": { + "example": "any" + }, + "modelname": { + "example": "any" + }, + "organization": { + "example": "any" + } + } + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/setLine": { + "post": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "organization": { + "example": "any" + }, + "layer": { + "example": "any" + }, + "line": { + "example": "any" + }, + "type": { + "example": "any" + } + } + } + } + ], + "responses": { + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/updatePoint": { + "post": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "organization": { + "example": "any" + }, + "uuid": { + "example": "any" + }, + "position": { + "example": "any" + } + } + } + } + ], + "responses": { + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/findLines/{organization}": { + "get": { + "description": "", + "parameters": [ + { + "name": "organization", + "in": "path", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/deleteLine": { + "delete": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "organization": { + "example": "any" + }, + "layer": { + "example": "any" + }, + "line": { + "example": "any" + }, + "type": { + "example": "any" + } + } + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/deletePoint": { + "delete": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "organization": { + "example": "any" + }, + "layer": { + "example": "any" + }, + "uuid": { + "example": "any" + }, + "type": { + "example": "any" + } + } + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/deleteLayer": { + "post": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "organization": { + "example": "any" + }, + "layer": { + "example": "any" + } + } + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/shareUser": { + "post": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "example": "any" + }, + "isShare": { + "example": "any" + }, + "organization": { + "example": "any" + } + } + } + } + ], + "responses": { + "201": { + "description": "Created" + }, + "404": { + "description": "Not Found" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/findshareUsers": { + "get": { + "description": "", + "parameters": [ + { + "name": "organization", + "in": "query", + "type": "string" + } + ], + "responses": { + "201": { + "description": "Created" + }, + "404": { + "description": "Not Found" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/setWallItems": { + "post": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "modeluuid": { + "example": "any" + }, + "modelname": { + "example": "any" + }, + "position": { + "example": "any" + }, + "type": { + "example": "any" + }, + "csgposition": { + "example": "any" + }, + "csgscale": { + "example": "any" + }, + "quaternion": { + "example": "any" + }, + "scale": { + "example": "any" + }, + "organization": { + "example": "any" + } + } + } + } + ], + "responses": { + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/findWallItems/{organization}": { + "get": { + "description": "", + "parameters": [ + { + "name": "organization", + "in": "path", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/deleteWallItem": { + "delete": { + "description": "", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "type": "object", + "properties": { + "modeluuid": { + "example": "any" + }, + "modelname": { + "example": "any" + }, + "organization": { + "example": "any" + } + } + } + } + ], + "responses": { + "200": { + "description": "OK" + }, + "201": { + "description": "Created" + }, + "500": { + "description": "Internal Server Error" + } + } + } + } + } +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 56a8ab8..d7bd47c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,110 +1,110 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ - // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ - // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ - // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - // "outDir": "./", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ - // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - } -} +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "noUncheckedSideEffectImports": true, /* Check side effect imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +}