From e7f18e206fe9f7253d6646e2148d8f79445cd16e Mon Sep 17 00:00:00 2001 From: malyusgun Date: Wed, 4 Sep 2024 18:21:16 +0500 Subject: [PATCH] add pages and users methods and refactor --- package-lock.json | 924 +++++++++++------- package.json | 8 +- prisma/schema.prisma | 100 +- src/controllers/entitiesController.ts | 58 ++ src/controllers/homeController.js | 78 -- src/controllers/pagesController.ts | 60 ++ src/controllers/usersController.ts | 18 + src/helpers/index.js | 11 - src/helpers/index.ts | 121 +++ src/{index.js => index.ts} | 20 +- src/interface/database.ts | 44 + src/interface/requests.ts | 40 + src/routes/{telegramBot.js => telegramBot.ts} | 4 +- src/routes/websocket.js | 47 - src/routes/websocket.ts | 87 ++ src/services/entitiesService.ts | 126 +++ src/services/homeService.js | 172 ---- src/services/pagesService.ts | 108 ++ src/services/usersService.ts | 106 ++ src/telegramBot/{index.js => index.ts} | 8 +- tsconfig.json | 7 +- yarn.lock | 474 +++------ 22 files changed, 1572 insertions(+), 1049 deletions(-) create mode 100644 src/controllers/entitiesController.ts delete mode 100644 src/controllers/homeController.js create mode 100644 src/controllers/pagesController.ts create mode 100644 src/controllers/usersController.ts delete mode 100644 src/helpers/index.js create mode 100644 src/helpers/index.ts rename src/{index.js => index.ts} (63%) create mode 100644 src/interface/database.ts create mode 100644 src/interface/requests.ts rename src/routes/{telegramBot.js => telegramBot.ts} (99%) delete mode 100644 src/routes/websocket.js create mode 100644 src/routes/websocket.ts create mode 100644 src/services/entitiesService.ts delete mode 100644 src/services/homeService.js create mode 100644 src/services/pagesService.ts create mode 100644 src/services/usersService.ts rename src/telegramBot/{index.js => index.ts} (92%) diff --git a/package-lock.json b/package-lock.json index aa3f67b..a2deae4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,10 +19,12 @@ }, "devDependencies": { "@types/node": "^22.3.0", - "nodemon": "^3.1.4", + "@types/node-telegram-bot-api": "^0.64.7", + "@types/ws": "^8.5.12", "prettier": "^3.3.3", "prisma": "^5.18.0", "ts-node": "^10.9.2", + "tsx": "^4.19.0", "typescript": "^5.5.4" } }, @@ -86,6 +88,414 @@ "@cypress/request": "^3.0.0" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", + "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz", + "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", + "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz", + "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", + "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", + "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", + "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", + "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", + "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", + "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", + "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", + "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", + "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", + "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", + "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", + "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", + "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", + "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", + "integrity": "sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", + "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", + "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", + "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", + "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", + "integrity": "sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", @@ -210,6 +620,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/caseless": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.5.tgz", + "integrity": "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { "version": "22.3.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.3.0.tgz", @@ -220,6 +637,62 @@ "undici-types": "~6.18.2" } }, + "node_modules/@types/node-telegram-bot-api": { + "version": "0.64.7", + "resolved": "https://registry.npmjs.org/@types/node-telegram-bot-api/-/node-telegram-bot-api-0.64.7.tgz", + "integrity": "sha512-nuvFFXnvU2sItucyEJ03I+m34z5st386isfEuF6BJTL7p3RjG7naMhvvXjY7oeKahTm1Jf0Gu4PrDa6jDt78/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/request": "*" + } + }, + "node_modules/@types/request": { + "version": "2.48.12", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.12.tgz", + "integrity": "sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/caseless": "*", + "@types/node": "*", + "@types/tough-cookie": "*", + "form-data": "^2.5.0" + } + }, + "node_modules/@types/request/node_modules/form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/ws": { + "version": "8.5.12", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz", + "integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/acorn": { "version": "8.12.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", @@ -263,20 +736,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "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, - "license": "ISC", - "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", @@ -389,13 +848,6 @@ "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", "license": "MIT" }, - "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==", - "dev": true, - "license": "MIT" - }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -405,19 +857,6 @@ "tweetnacl": "^0.14.3" } }, - "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, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/bl": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", @@ -434,30 +873,6 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "license": "MIT" }, - "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==", - "dev": true, - "license": "MIT", - "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, - "license": "MIT", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/call-bind": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", @@ -483,31 +898,6 @@ "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", "license": "Apache-2.0" }, - "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, - "license": "MIT", - "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/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -520,13 +910,6 @@ "node": ">= 0.8" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -616,24 +999,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -851,6 +1216,46 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/esbuild": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", + "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" + } + }, "node_modules/eventemitter3": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", @@ -895,19 +1300,6 @@ "node": ">=0.10.0" } }, - "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, - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -940,6 +1332,21 @@ "node": ">= 0.12" } }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -1012,6 +1419,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-tsconfig": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.0.tgz", + "integrity": "sha512-Pgba6TExTZ0FJAn1qkJAjIeKoDJ3CsI2ChuLohJnZl/tTU8MVrq3b+2t5UOPfRa4RMsorClBjJALkJUMjG1PAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -1021,19 +1441,6 @@ "assert-plus": "^1.0.0" } }, - "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, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/globalthis": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", @@ -1096,16 +1503,6 @@ "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, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/has-property-descriptors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", @@ -1183,13 +1580,6 @@ "node": ">=0.10" } }, - "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, - "license": "ISC" - }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1238,19 +1628,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "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, - "license": "MIT", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/is-boolean-object": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", @@ -1309,29 +1686,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "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, - "license": "MIT", - "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, - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-negative-zero": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", @@ -1344,16 +1698,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "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, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/is-number-object": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", @@ -1561,19 +1905,6 @@ "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==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -1609,45 +1940,6 @@ "ms": "^2.1.1" } }, - "node_modules/nodemon": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.4.tgz", - "integrity": "sha512-wjPBbFhtpJwmIeY2yP7QF+UKzPfltVGtfce1g/bB15/8vCGZj8uxD62b/b9M9/WVgme0NZudpownKN+c0plXlQ==", - "dev": true, - "license": "MIT", - "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/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, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -1822,19 +2114,6 @@ "split2": "^4.1.0" } }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/possible-typed-array-names": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", @@ -1928,13 +2207,6 @@ "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", "license": "MIT" }, - "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, - "license": "MIT" - }, "node_modules/pump": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", @@ -1996,19 +2268,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "license": "MIT" }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "license": "MIT", - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, "node_modules/regexp.prototype.flags": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", @@ -2148,6 +2407,16 @@ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "license": "MIT" }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/safe-array-concat": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", @@ -2215,19 +2484,6 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "license": "MIT" }, - "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -2278,19 +2534,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "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, - "license": "MIT", - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/split2": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", @@ -2398,42 +2641,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "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, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "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, - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "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, - "license": "ISC", - "bin": { - "nodetouch": "bin/nodetouch.js" - } - }, "node_modules/tough-cookie": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", @@ -2493,6 +2700,26 @@ } } }, + "node_modules/tsx": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.0.tgz", + "integrity": "sha512-bV30kM7bsLZKZIOCHeMNVMJ32/LuJzLVajkQI/qf92J2Qr08ueLQvW00PUZGiuLPP760UINwupgUj8qrSCPUKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.23.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -2613,13 +2840,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/undefsafe": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", - "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", - "dev": true, - "license": "MIT" - }, "node_modules/underscore": { "version": "1.13.7", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz", diff --git a/package.json b/package.json index c952524..63c11da 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "ShelfNote_backend", "version": "1.0.0", - "main": "src/index.js", + "main": "src/index.ts", "repository": "https://gl.iqdev.team/d.malygin/shelfnote_backend", "author": "Дмитрий Малюгин ", "license": "MIT", "type": "module", "scripts": { - "start": "nodemon src/index.js" + "start": "tsx watch src/index.ts" }, "dependencies": { "@prisma/client": "^5.18.0", @@ -20,10 +20,12 @@ }, "devDependencies": { "@types/node": "^22.3.0", - "nodemon": "^3.1.4", + "@types/node-telegram-bot-api": "^0.64.7", + "@types/ws": "^8.5.12", "prettier": "^3.3.3", "prisma": "^5.18.0", "ts-node": "^10.9.2", + "tsx": "^4.19.0", "typescript": "^5.5.4" } } diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 5e282ce..4f1562a 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -16,40 +16,84 @@ datasource db { } model User { - user_uuid String @id @default(uuid()) + user_uuid String @id @default(uuid()) nick_name String @unique + password String + email String first_name String? middle_name String? last_name String? - email String? - phone_number String? settings Json? - home_entities Json? -} - -model Home_entity { - entity_uuid String @id @default(uuid()) - entity_order Int @default(autoincrement()) - entity_type String - divider_height Int? - divider_type String? - title String? - text String? @db.Text - font_size String? - paragraph_size String? - text_position String? - image_path String? @db.Text - image_width Int? - image_height Int? - entity_position String? + pages_uuid Json? +} + +model Page { + user_uuid String + page_uuid String @id @default(uuid()) + page_title String + page_icon String + page_navigation_order String + background_path String? @db.Text + page_entities Json? +} + +model Entity { + entity_uuid String @id @default(uuid()) + entity_order Int @default(autoincrement()) + entity_type String + title String? + text String? @db.Text + font_size String? + paragraph_size String? + text_position String? + image_path String? @db.Text + image_width Int? + image_height Int? + entity_position String? + entity_title_position String? + image_scale String? + table_columns Json? + table_data Json? +} + +model Divider { + entity_type String + entity_uuid String @id @default(uuid()) + entity_order Int + divider_height Int? + divider_type String? +} + +model Paragraph { + entity_type String + entity_uuid String @id @default(uuid()) + entity_order Int + title String? + text String? @db.Text + font_size String? + paragraph_size String? + entity_position String? entity_title_position String? - image_scale String? - table_columns Json? - table_data Json? } -model Setting { - setting_uuid String @id @default(uuid()) - setting_name String @unique - setting_value String +model Image { + entity_type String + entity_uuid String @id @default(uuid()) + entity_order Int + image_path String? @db.Text + image_width Int? + image_height Int? + image_scale String? + title String? + text String? @db.Text + font_size String? + paragraph_size String? + entity_title_position String? + text_position String? + entity_position String? } +// model Setting { +// setting_uuid String @id @default(uuid()) +// setting_name String @unique +// setting_value String +// } diff --git a/src/controllers/entitiesController.ts b/src/controllers/entitiesController.ts new file mode 100644 index 0000000..b9ce478 --- /dev/null +++ b/src/controllers/entitiesController.ts @@ -0,0 +1,58 @@ +import EntitiesService from '../services/entitiesService'; +import { IBodyPageUuid, IChangeEntitiesOrder, IWSRequest } from '../interface/requests'; +import { IEntity } from '../interface/database'; + +class EntitiesController { + async createEntity(req: IWSRequest<'createEntities', IEntity>) { + try { + return await EntitiesService.createEntity(req.body); + } catch (error) { + console.log(error); + } + } + async createImage(req: Buffer) { + try { + return await EntitiesService.createImage(req); + } catch (error) { + console.log(error); + } + } + async getEntities(req: IWSRequest<'getEntities', IBodyPageUuid>) { + try { + return await EntitiesService.getEntities(req.body.page_uuid); + } catch (error) { + console.log(error); + return error; + } + } + async editEntity(req: IWSRequest<'editEntity', IEntity>) { + try { + return await EntitiesService.editEntity(req.body); + } catch (error) { + console.log(error); + } + } + async cropImage(req: IWSRequest<'cropImage', IEntity>) { + try { + return await EntitiesService.cropImage(req.body); + } catch (error) { + console.log(error); + } + } + async changeEntitiesOrder(req: IChangeEntitiesOrder) { + try { + return await EntitiesService.changeEntitiesOrder(req.body); + } catch (error) { + console.log(error); + } + } + async deleteEntity(req: IWSRequest<'deleteEntity', IEntity>) { + try { + return await EntitiesService.deleteEntity(req.body); + } catch (error) { + console.log(error); + } + } +} + +export default new EntitiesController(); diff --git a/src/controllers/homeController.js b/src/controllers/homeController.js deleted file mode 100644 index 0250e88..0000000 --- a/src/controllers/homeController.js +++ /dev/null @@ -1,78 +0,0 @@ -import HomeService from '../services/homeService.js'; - -class HomeController { - async getHomeBackground() { - try { - return await HomeService.getHomeBackground(); - } catch (error) { - console.log(error); - return error; - } - } - async changeHomeBackground(req) { - try { - return await HomeService.changeHomeBackground(req.body); - } catch (error) { - console.log(error); - } - } - async removeHomeBackground() { - try { - await HomeService.removeHomeBackground(); - } catch (error) { - console.log(error); - } - } - async getEntities() { - try { - return await HomeService.getEntities(); - } catch (error) { - console.log(error); - return error; - } - } - async createEntity(req) { - try { - return await HomeService.createEntity(req.body); - } catch (error) { - console.log(error); - } - } - async createImage(req) { - try { - return await HomeService.createImage(req); - } catch (error) { - console.log(error); - } - } - async editEntity(req) { - try { - return await HomeService.editEntity(req.body); - } catch (error) { - console.log(error); - } - } - async cropImage(req) { - try { - return await HomeService.cropImage(req.body); - } catch (error) { - console.log(error); - } - } - async deleteEntity(req) { - try { - return await HomeService.deleteEntity(req.body); - } catch (error) { - console.log(error); - } - } - async changeOrderEntity(req) { - try { - return await HomeService.changeOrderEntity(req.body); - } catch (error) { - console.log(error); - } - } -} - -export default new HomeController(); diff --git a/src/controllers/pagesController.ts b/src/controllers/pagesController.ts new file mode 100644 index 0000000..231e942 --- /dev/null +++ b/src/controllers/pagesController.ts @@ -0,0 +1,60 @@ +import PagesService from '../services/pagesService'; +import { IEditPageBackground, IBodyPageUuid, IWSRequest, IBodyPage } from '../interface/requests'; + +class PagesController { + async createPage(req: IWSRequest<'createPage', IBodyPage>) { + try { + return await PagesService.createPage(req.body); + } catch (error) { + console.log(error); + return error; + } + } + async getPage(req: IWSRequest<'getPage', IBodyPageUuid>) { + try { + return await PagesService.getPage(req.body); + } catch (error) { + console.log(error); + return error; + } + } + async getPageBackground(req: IWSRequest<'deletePageBackground', IBodyPageUuid>) { + try { + return await PagesService.getPageBackground(req.body.page_uuid); + } catch (error) { + console.log(error); + return error; + } + } + async editPage(req: IWSRequest<'editPage', IBodyPage>) { + try { + return await PagesService.editPage(req.body); + } catch (error) { + console.log(error); + return error; + } + } + async editPageBackground(req: IWSRequest<'editPageBackground', IEditPageBackground>) { + try { + return await PagesService.editPageBackground(req.body); + } catch (error) { + console.log(error); + } + } + async deletePage(req: IWSRequest<'deletePage', IBodyPage>) { + try { + return PagesService.deletePage(req.body); + } catch (error) { + console.log(error); + } + } + async deletePageBackground(req: IWSRequest<'deletePageBackground', IBodyPageUuid>) { + try { + await PagesService.deletePageBackground(req.body.page_uuid); + } catch (error) { + console.log(error); + } + } +} + +export default new PagesController(); diff --git a/src/controllers/usersController.ts b/src/controllers/usersController.ts new file mode 100644 index 0000000..7e00af1 --- /dev/null +++ b/src/controllers/usersController.ts @@ -0,0 +1,18 @@ +import { IBodyUser, IWSRequest } from '../interface/requests'; +import UsersService from '../services/usersService'; + +class UsersController { + async createUser(req: IWSRequest<'createUser', IBodyUser>) { + return UsersService.createUser(req.body); + } + async getUser(req: IWSRequest<'getUser', IBodyUser>) { + return UsersService.getUser(req.body); + } + async editUser(req: IWSRequest<'editUser', IBodyUser>) { + return UsersService.editUser(req.body); + } + async deleteUser(req: IWSRequest<'deleteUser', IBodyUser>) { + return UsersService.deleteUser(req.body); + } +} +export default new UsersController(); diff --git a/src/helpers/index.js b/src/helpers/index.js deleted file mode 100644 index 3ad49c0..0000000 --- a/src/helpers/index.js +++ /dev/null @@ -1,11 +0,0 @@ -import { bot } from '../telegramBot/index.js'; - -export const validateMessage = async (response, command, alternateCommand, chatId) => { - const regExp = /[a-zA-Zа-яА-Я]/g; - const isValid = regExp.test(response); - if (isValid) { - await bot.sendMessage(chatId, command); - } else { - await bot.sendMessage(chatId, alternateCommand); - } -}; diff --git a/src/helpers/index.ts b/src/helpers/index.ts new file mode 100644 index 0000000..e57be7f --- /dev/null +++ b/src/helpers/index.ts @@ -0,0 +1,121 @@ +import { bot } from '../telegramBot'; +import { PrismaClient } from '@prisma/client'; + +export const validateMessage = async ( + response: any, + command: string, + alternateCommand: string, + chatId: number | string +) => { + const regExp = /[a-zA-Zа-яА-Я]/g; + const isValid = regExp.test(response); + if (isValid) { + await bot.sendMessage(chatId, command); + } else { + await bot.sendMessage(chatId, alternateCommand); + } +}; + +const prisma = new PrismaClient({}); +export const createPrismaEntity = async (body: any) => { + switch (body.entity_type) { + case 'divider': + return prisma.divider.create({ data: { ...body } }); + case 'paragraph': + return prisma.paragraph.create({ data: { ...body } }); + case 'image': + return prisma.image.create({ data: { ...body } }); + // case 'table': + // return prisma.table.create({ data: { ...body } }); + } +}; +export const getPrismaEntity = async (body: any) => { + switch (body.entity_type) { + case 'divider': + return prisma.divider.findFirst({ + where: { + entity_uuid: body.entity_uuid + } + }); + case 'paragraph': + return prisma.paragraph.findFirst({ + where: { + entity_uuid: body.entity_uuid + } + }); + case 'image': + return prisma.image.findFirst({ + where: { + entity_uuid: body.entity_uuid + } + }); + // case 'table': + // return prisma.table.findFirst({ + // where: { + // entity_uuid: body.entity_uuid + // } + // }); + } +}; +export const updatePrismaEntity = async (body: any) => { + switch (body.entity_type) { + case 'divider': + return prisma.divider.update({ + where: { + entity_uuid: body.entity_uuid + }, + data: { ...body } + }); + case 'paragraph': + return prisma.paragraph.update({ + where: { + entity_uuid: body.entity_uuid + }, + data: { ...body } + }); + case 'image': + delete body.imageUrl; + return prisma.image.update({ + where: { + entity_uuid: body.entity_uuid + }, + data: { ...body } + }); + // case 'table': + // return prisma.table.update({ + // where: { + // entity_uuid: body.entity_uuid + // }, + // data: { ...body } + // }); + } +}; +export const deletePrismaEntity = async (body: any) => { + switch (body.entity_type) { + case 'divider': + return prisma.divider.delete({ + where: { + entity_uuid: body.entity_uuid + } + }); + case 'paragraph': + return prisma.paragraph.delete({ + where: { + entity_uuid: body.entity_uuid + } + }); + case 'image': + return prisma.image.delete({ + where: { + entity_uuid: body.entity_uuid + } + }); + // case 'table': + // return prisma.table.delete({ + // where: { + // entity_uuid: body.entity_uuid + // } + // } + // }); + } +}; diff --git a/src/index.js b/src/index.ts similarity index 63% rename from src/index.js rename to src/index.ts index 7c54b7c..430964c 100644 --- a/src/index.js +++ b/src/index.ts @@ -1,14 +1,14 @@ import 'dotenv/config'; import { WebSocketServer } from 'ws'; -import HomeController from './controllers/homeController.js'; -import { websocketRoute } from './routes/websocket.js'; -import { connectBot } from './telegramBot/index.js'; +import EntitiesController from './controllers/entitiesController'; +import { websocketRoute } from './routes/websocket'; +import { connectBot } from './telegramBot'; await connectBot(); const users = new Set(); -const PORT = process.env.PORT || 5000; +const PORT = Number(process.env.PORT) || 5000; const FILES_PORT = process.env.FILES_PORT || 5001; const wss = new WebSocketServer( @@ -34,14 +34,14 @@ const filesWss = new WebSocketServer( ); filesWss.on('connection', (ws) => { users.add(ws); - console.log('users: ', users.size); - ws.on('message', async (req) => { - await HomeController.createImage(req); - submitToUsers('createImageHomeEntity', ''); + console.log('users wss: ', users.size); + ws.on('message', async (req: Buffer) => { + await EntitiesController.createImage(req); + submitToUsers('createImageEntity', ''); }); }); -export function submitToUsers(event, data) { +export function submitToUsers(event: string, data: any) { wss.clients.forEach((client) => { client.send( JSON.stringify({ @@ -51,7 +51,7 @@ export function submitToUsers(event, data) { ); }); } -export function submitFilesToUsers(data) { +export function submitFilesToUsers(data: any) { filesWss.clients.forEach((client) => { client.send(data); }); diff --git a/src/interface/database.ts b/src/interface/database.ts new file mode 100644 index 0000000..f399898 --- /dev/null +++ b/src/interface/database.ts @@ -0,0 +1,44 @@ +export interface IPageEntity { + entity_uuid: string; + entity_type: 'divider' | 'paragraph' | 'image' | 'table'; +} +export interface IEntity { + page_uuid?: string; + entity_uuid: string; + entity_type: 'divider' | 'paragraph' | 'image' | 'table'; + entity_order?: number; + divider_height?: number; + divider_type?: 'solid' | 'dashed' | 'dotted'; + title?: string | null; + text?: string | null; + font_size?: string | null; + paragraph_size?: string | null; + text_position?: string | null; + image_buffer?: string; + image_path?: string; + imageUrl?: string; + image_width?: number; + image_height?: number; + entity_position?: string; + entity_title_position?: string; + image_scale?: string; + table_columns?: ITableColumn[]; + table_data?: { + [key: string]: never; + }[]; +} +export interface ITableColumn { + column_uuid: string; + name: string; + type: ITableColumnTypes; + data: never; +} +type ITableColumnTypes = + | 'text' + | 'number' + | 'select' + | 'multiselect' + | 'checkbox' + | 'status' + | 'rating' + | 'knob'; diff --git a/src/interface/requests.ts b/src/interface/requests.ts new file mode 100644 index 0000000..127cffa --- /dev/null +++ b/src/interface/requests.ts @@ -0,0 +1,40 @@ +export interface IWSRequest { + event: T; + body: B; +} +export interface IBodyPage { + user_uuid: string; + page_title: string; + page_navigation_order?: string; + page_icon?: string; + page_uuid?: string; + page_entities?: string; +} +export interface IBodyUser { + nick_name: string; + email: string; + password: string; + first_name?: string; + middle_name?: string; + last_name?: string; + user_uuid?: string; +} +export interface IBodyPageUuid { + page_uuid: string; +} +export interface IEditPageBackground { + page_uuid: string; + background_url: string; +} +interface IEntityUuidAndOrder { + entity_uuid: string; + entity_order: number; + entity_type: 'divider' | 'paragraph' | 'image' | 'table'; +} +export interface IChangeEntitiesOrder { + event: 'changeEntitiesOrder'; + body: { + main: IEntityUuidAndOrder; + target: IEntityUuidAndOrder; + }; +} diff --git a/src/routes/telegramBot.js b/src/routes/telegramBot.ts similarity index 99% rename from src/routes/telegramBot.js rename to src/routes/telegramBot.ts index 6ce9bed..3d012de 100644 --- a/src/routes/telegramBot.js +++ b/src/routes/telegramBot.ts @@ -1,5 +1,5 @@ -import { bot } from '../telegramBot/index.js'; -import { validateMessage } from '../helpers/index.js'; +import { bot } from '../telegramBot'; +import { validateMessage } from '../helpers'; import path from 'node:path'; import * as fs from 'node:fs'; diff --git a/src/routes/websocket.js b/src/routes/websocket.js deleted file mode 100644 index 532e20a..0000000 --- a/src/routes/websocket.js +++ /dev/null @@ -1,47 +0,0 @@ -import HomeController from '../controllers/homeController.js'; -import { submitFilesToUsers, submitToUsers } from '../index.js'; - -export const websocketRoute = async (req) => { - switch (req.event) { - case 'getHomeBackground': - const homeBackground = await HomeController.getHomeBackground(); - submitFilesToUsers(homeBackground); - break; - case 'changeHomeBackground': - await HomeController.changeHomeBackground(req); - submitToUsers('changeHomeBackground', { ...req.body }); - break; - case 'removeHomeBackground': - await HomeController.removeHomeBackground(); - break; - case 'getHomeEntities': - const getHomeEntitiesData = await HomeController.getEntities(); - getHomeEntitiesData.entitiesImages.forEach((entityBuffer) => { - submitFilesToUsers(entityBuffer); - }); - submitToUsers('getHomeEntities', getHomeEntitiesData.entities); - break; - case 'createHomeEntity': - const createdHomeEntity = await HomeController.createEntity(req); - submitToUsers('createHomeEntity', createdHomeEntity); - break; - case 'editHomeEntity': { - const editedHomeEntity = await HomeController.editEntity(req); - submitToUsers('editHomeEntity', editedHomeEntity); - break; - } - case 'cropImage': { - const editedHomeEntity = await HomeController.cropImage(req); - submitToUsers('editHomeEntity', editedHomeEntity); - break; - } - case 'deleteHomeEntity': - const deletedHomeEntity = await HomeController.deleteEntity(req); - submitToUsers('deleteHomeEntity', deletedHomeEntity); - break; - case 'changeOrderHomeEntity': - await HomeController.changeOrderEntity(req); - submitToUsers('changeOrderHomeEntity', { ...req.body }); - break; - } -}; diff --git a/src/routes/websocket.ts b/src/routes/websocket.ts new file mode 100644 index 0000000..4842700 --- /dev/null +++ b/src/routes/websocket.ts @@ -0,0 +1,87 @@ +import EntitiesController from '../controllers/entitiesController'; +import { submitFilesToUsers, submitToUsers } from '../index'; +import PagesController from '../controllers/pagesController'; +import UsersController from '../controllers/usersController'; + +export const websocketRoute = async (req: any) => { + switch (req.event) { + // create + case 'createUser': + const createdUserData = await UsersController.createUser(req); + submitToUsers('createEntity', createdUserData.startEntity); + submitToUsers('createPage', createdUserData.homePage); + submitToUsers('createUser', createdUserData.createdUser); + break; + case 'createPage': + const createdPage = await PagesController.createPage(req); + submitToUsers('createPage', createdPage); + break; + case 'createEntity': + const createdEntity = await EntitiesController.createEntity(req); + submitToUsers('createEntity', createdEntity); + break; + // read + case 'getUser': + const userInfo = await UsersController.getUser(req); + submitToUsers('getUser', userInfo); + break; + case 'getPage': + const pageInfo = await PagesController.getPage(req); + submitToUsers('getPage', pageInfo); + break; + case 'getPageBackground': + const homeBackground = await PagesController.getPageBackground(req); + submitFilesToUsers(homeBackground); + break; + case 'getPageEntities': + const getPageEntitiesData = await EntitiesController.getEntities(req); + getPageEntitiesData.entitiesImages.forEach((entityBuffer: Buffer) => { + submitFilesToUsers(entityBuffer); + }); + submitToUsers('getPageEntities', getPageEntitiesData.entities); + break; + // update + case 'editUser': + const editedUser = await UsersController.editUser(req); + submitToUsers('editUser', editedUser); + break; + case 'editPage': + const editedPage = await PagesController.editPage(req); + submitToUsers('editPage', editedPage); + break; + case 'editPageBackground': + await PagesController.editPageBackground(req); + submitToUsers('editPageBackground', { ...req.body }); + break; + case 'editEntity': { + const editedHomeEntity = await EntitiesController.editEntity(req); + submitToUsers('editEntity', editedHomeEntity); + break; + } + case 'cropImage': { + const editedEntity = await EntitiesController.cropImage(req); + submitToUsers('editEntity', editedEntity); + break; + } + case 'changeEntitiesOrder': + const changedEntitiesOrders = await EntitiesController.changeEntitiesOrder(req); + submitToUsers('changeEntitiesOrder', changedEntitiesOrders); + break; + // delete + case 'deleteUser': + const deletedUser = await UsersController.deleteUser(req); + submitToUsers('deleteUser', deletedUser); + break; + case 'deletePage': + const deletedPage = await PagesController.deletePage(req); + submitToUsers('deletePage', deletedPage); + break; + case 'deletePageBackground': + await PagesController.deletePageBackground(req); + break; + case 'deleteEntity': + const deletedEntity = await EntitiesController.deleteEntity(req); + submitToUsers('deleteEntity', deletedEntity); + break; + } +}; diff --git a/src/services/entitiesService.ts b/src/services/entitiesService.ts new file mode 100644 index 0000000..8f67d96 --- /dev/null +++ b/src/services/entitiesService.ts @@ -0,0 +1,126 @@ +import { PrismaClient } from '@prisma/client'; +import * as fs from 'node:fs'; +import path from 'node:path'; +import { IEntity, IPageEntity } from '../interface/database'; +import { randomUUID } from 'node:crypto'; +import { + createPrismaEntity, + updatePrismaEntity, + getPrismaEntity, + deletePrismaEntity +} from '../helpers'; +import PagesService from './pagesService'; +const prisma = new PrismaClient(); + +class EntitiesService { + async createEntity(body: IEntity) { + if (!body.entity_uuid) body.entity_uuid = randomUUID(); + if (body?.image_buffer) { + const imagePath = path.join(path.resolve(), `/public/images/image.jpg`); + let newImagePath; + if (process.platform.includes('win')) { + newImagePath = imagePath.split('\\'); + } else { + newImagePath = imagePath.split('/'); + } + newImagePath.splice(-1); + console.log('body in createEntity: ', body, 'body.entity_uuid: ', body.entity_uuid); + newImagePath.push(`${body.entity_uuid}.jpg`); + if (process.platform.includes('win')) { + newImagePath = newImagePath.join('\\'); + } else { + newImagePath = newImagePath.join('/'); + } + fs.rename(imagePath, newImagePath, function (err) { + if (err) console.log('ERROR in fs.rename: ' + err); + }); + delete body.image_buffer; + body.image_path = newImagePath; + } + const page_uuid = body.page_uuid!; + delete body.page_uuid; + const createdEntity = createPrismaEntity(body); + await PagesService.addPageEntity(body, page_uuid); + return createdEntity; + } + // единственная функция, срабатывающая по сокету для файлов + async createImage(body: Buffer) { + const imagePath = path.join(path.resolve(), `/public/images/image.jpg`); + fs.writeFileSync(imagePath, body); + } + async getEntities(page_uuid: string) { + const pageInfo = await prisma.page.findFirst({ + where: { + page_uuid: page_uuid + } + }); + const pageEntities = pageInfo.page_entities; + if (pageEntities) { + const entitiesToReturn: IEntity[] = []; + for (const pageEntity of pageEntities) { + const entityToPush = await getPrismaEntity(pageEntity); + entitiesToReturn.push(entityToPush); + } + const entitiesImages: Buffer[] = []; + entitiesToReturn.forEach((entity) => { + if (!entity?.image_width) return; + const imagePath = path.join(path.resolve(), `/public/images/${entity.entity_uuid}.jpg`); + const file = fs.readFileSync(imagePath); + const buffer = Buffer.from(file); + entitiesImages.push(buffer); + }); + return { + entities: entitiesToReturn, + entitiesImages: entitiesImages + }; + } else + return { + entities: [], + entitiesImages: [] + }; + } + async cropImage(body: IEntity) { + const imagePath = path.join(path.resolve(), `/public/images/image.jpg`); + fs.unlink(body.image_path!, (err) => { + if (err) throw err; + }); + fs.rename(imagePath, body.image_path!, function (err) { + if (err) throw err; + }); + delete body.imageUrl; + return prisma.image.update({ + where: { + entity_uuid: body.entity_uuid + }, + data: { ...body } + }); + } + async editEntity(body: IEntity) { + return updatePrismaEntity(body); + } + async changeEntitiesOrder(body: { main: IEntity; target: IEntity }) { + const mainEntity = body.main; + const targetEntity = body.target; + const mainEntityOrder = mainEntity.entity_order; + mainEntity.entity_order = targetEntity.entity_order; + targetEntity.entity_order = mainEntityOrder; + await updatePrismaEntity({ ...mainEntity }); + await updatePrismaEntity({ ...targetEntity }); + return { + main: mainEntity, + target: targetEntity + }; + } + async deleteEntity(body: IEntity) { + await deletePrismaEntity(body); + if (body.image_path) + fs.unlink(body.image_path, (err) => { + if (err) throw err; + }); + return { + entity_uuid: body.entity_uuid + }; + } +} + +export default new EntitiesService(); diff --git a/src/services/homeService.js b/src/services/homeService.js deleted file mode 100644 index bf08722..0000000 --- a/src/services/homeService.js +++ /dev/null @@ -1,172 +0,0 @@ -import { PrismaClient } from '@prisma/client'; -import * as fs from 'node:fs'; -import path from 'node:path'; - -const prisma = new PrismaClient(); - -class HomeService { - async getHomeBackground() { - const backgroundInfo = await prisma.setting.findFirst({ - where: { - setting_name: 'homeBackground' - } - }); - if (backgroundInfo?.setting_value) { - const file = fs.readFileSync(backgroundInfo.setting_value); - return Buffer.from(file, 'base64'); - } - } - async changeHomeBackground(body) { - const response = await fetch(body.setting_value); - const blob = await response.blob(); - const arrayBuffer = await blob.arrayBuffer(); - const buffer = Buffer.from(arrayBuffer); - const imagePath = path.join(path.resolve(), `/public/images/backgrounds/homeBackground.jpg`); - fs.writeFileSync(imagePath, buffer); - - delete body.extension; - body.setting_value = imagePath; - const homeBackground = await prisma.setting.findFirst({ - where: { - setting_name: 'homeBackground' - } - }); - if (homeBackground) { - return prisma.setting.update({ - where: { - setting_name: 'homeBackground' - }, - data: { ...body } - }); - } - return prisma.setting.create({ data: { ...body } }); - } - async removeHomeBackground() { - const imagePath = path.join(path.resolve(), `/public/images/backgrounds/homeBackground.jpg`); - fs.unlink(imagePath, (err) => { - if (err) throw err; - }); - await prisma.setting.delete({ - where: { - setting_name: 'homeBackground' - } - }); - } - async getEntities() { - const entitiesDB = await prisma.home_entity.findMany({ - orderBy: [{ entity_order: 'asc' }] - }); - const entitiesImages = []; - const entitiesToReturn = entitiesDB.map((entity) => { - if (!entity.image_width) return entity; - const imagePath = path.join(path.resolve(), `/public/images/${entity.entity_uuid}.jpg`); - const file = fs.readFileSync(imagePath); - const buffer = Buffer.from(file, 'base64'); - entitiesImages.push(buffer); - return entity; - }); - return { - entities: entitiesToReturn, - entitiesImages: entitiesImages - }; - } - async createEntity(body) { - if (body.image_buffer) { - const imagePath = path.join(path.resolve(), `/public/images/image.jpg`); - let newImagePath; - if (process.platform.includes('win')) { - newImagePath = imagePath.split('\\'); - } else { - newImagePath = imagePath.split('/'); - } - newImagePath.splice(-1); - newImagePath.push(`${body.entity_uuid}.jpg`); - if (process.platform.includes('win')) { - newImagePath = newImagePath.join('\\'); - } else { - newImagePath = newImagePath.join('/'); - } - fs.rename(imagePath, newImagePath, function (err) { - if (err) console.log('ERROR in fs.rename: ' + err); - }); - delete body.image_buffer; - body.image_path = newImagePath; - } - return prisma.home_entity.create({ data: { ...body } }); - } - // единственная функция, срабатывающая по сокету для файлов - async createImage(body) { - const imagePath = path.join(path.resolve(), `/public/images/image.jpg`); - fs.writeFileSync(imagePath, body); - } - async cropImage(body) { - const imagePath = path.join(path.resolve(), `/public/images/image.jpg`); - fs.unlink(body.image_path, (err) => { - if (err) throw err; - }); - fs.rename(imagePath, body.image_path, function (err) { - if (err) throw err; - }); - delete body.imageUrl; - return prisma.home_entity.update({ - where: { - entity_uuid: body.entity_uuid - }, - data: { ...body } - }); - } - async editEntity(body) { - return prisma.home_entity.update({ - where: { - entity_uuid: body.entity_uuid - }, - data: { ...body } - }); - } - async deleteEntity(body) { - const deletedEntity = await prisma.home_entity.findFirst({ - where: { - entity_uuid: body.entity_uuid - } - }); - await prisma.home_entity.delete({ - where: { - entity_uuid: body.entity_uuid - } - }); - if (body.image_width) - fs.unlink(body.image_path, (err) => { - if (err) throw err; - }); - return deletedEntity; - } - async changeOrderEntity(body) { - const allEntities = await prisma.home_entity.findMany({ - orderBy: [{ entity_order: 'asc' }] - }); - const currentEntity = allEntities.find((entity) => entity.entity_uuid === body.entity_uuid); - const nextEntity = - body.direction === 'up' - ? allEntities.reverse().find((entity) => entity.entity_order < currentEntity.entity_order) - : allEntities.find((entity) => entity.entity_order > currentEntity.entity_order); - await prisma.home_entity.update({ - where: { - entity_uuid: currentEntity.entity_uuid - }, - data: { - entity_order: nextEntity.entity_order - } - }); - await prisma.home_entity.update({ - where: { - entity_uuid: nextEntity.entity_uuid - }, - data: { - entity_order: currentEntity.entity_order - } - }); - return body; - } -} - -export default new HomeService(); diff --git a/src/services/pagesService.ts b/src/services/pagesService.ts new file mode 100644 index 0000000..e3358e1 --- /dev/null +++ b/src/services/pagesService.ts @@ -0,0 +1,108 @@ +import { PrismaClient } from '@prisma/client'; +import * as fs from 'node:fs'; +import path from 'node:path'; +import { IBodyPage, IBodyPageUuid, IEditPageBackground } from '../interface/requests'; +import { randomUUID } from 'node:crypto'; +import UsersService from './usersService'; +import { IEntity } from '../interface/database'; + +const prisma = new PrismaClient(); + +class PagesService { + async createPage(body: IBodyPage) { + body.page_uuid = randomUUID(); + body.page_icon = 'page'; + await UsersService.addUserPage(body.page_uuid, body.user_uuid); + return prisma.page.create({ data: body }); + } + async getPage(body: IBodyPageUuid) { + return prisma.page.findFirst({ + where: { + page_uuid: body.page_uuid + } + }); + } + async getPageBackground(page_uuid: string) { + const backgroundInfo = await prisma.page.findFirst({ + where: { + page_uuid: page_uuid + } + }); + if (backgroundInfo?.background_path) { + const file = fs.readFileSync(backgroundInfo.background_path); + return Buffer.from(file); + } + } + async addPageEntity(body: IEntity, page_uuid: string) { + const page = await prisma.page.findFirst({ + where: { + page_uuid + } + }); + let pageEntities = page.page_entities; + const newEntity = { + entity_type: body.entity_type, + entity_uuid: body.entity_uuid + }; + if (pageEntities?.length) { + pageEntities.push(newEntity); + } else pageEntities = [newEntity]; + page.page_entities = pageEntities; + await prisma.page.update({ + data: page, + where: { + page_uuid + } + }); + } + async editPage(body: IBodyPageUuid) { + return prisma.page.update({ + where: { + page_uuid: body.page_uuid + }, + data: body + }); + } + async editPageBackground(body: IEditPageBackground) { + const response = await fetch(body.background_url); + const blob = await response.blob(); + const arrayBuffer = await blob.arrayBuffer(); + const buffer = Buffer.from(arrayBuffer); + const imagePath = path.join(path.resolve(), `/public/images/backgrounds/homeBackground.jpg`); + fs.writeFileSync(imagePath, buffer); + const currentPage = await prisma.page.findFirst({ + where: { + page_uuid: body.page_uuid + } + }); + if (currentPage) { + return prisma.page.update({ + where: { + page_uuid: body.page_uuid + }, + data: { ...currentPage, background_path: imagePath } + }); + } + } + async deletePage(page: IBodyPage) { + await UsersService.deleteUserPage(page.page_uuid!, page.user_uuid); + return prisma.page.delete({ + where: { + page_uuid: page.page_uuid + } + }); + } + async deletePageBackground(page_uuid: string) { + const imagePath = path.join(path.resolve(), `/public/images/backgrounds/homeBackground.jpg`); + fs.unlink(imagePath, (err) => { + if (err) throw err; + }); + await prisma.page.delete({ + where: { + page_uuid: page_uuid + } + }); + } +} + +export default new PagesService(); diff --git a/src/services/usersService.ts b/src/services/usersService.ts new file mode 100644 index 0000000..dbbe2ee --- /dev/null +++ b/src/services/usersService.ts @@ -0,0 +1,106 @@ +import { PrismaClient } from '@prisma/client'; +import { IBodyPage, IBodyUser } from '../interface/requests'; +import { randomUUID } from 'node:crypto'; +import PagesService from './pagesService'; +import EntitiesService from './entitiesService'; + +const prisma = new PrismaClient(); + +class UsersService { + async createUser(body: IBodyUser) { + body.user_uuid = randomUUID(); + const entityUuid = randomUUID(); + await prisma.user.create({ data: body }); + const homePage = await PagesService.createPage({ + user_uuid: body.user_uuid, + page_title: 'Home page', + page_navigation_order: '-1' + }); + const startEntity = await EntitiesService.createEntity({ + entity_uuid: entityUuid, + page_uuid: homePage.page_uuid, + entity_type: 'paragraph', + title: 'Home, sweet home...', + text: + 'This is your start page.\nWhat can you do? Turn on the "Edit mode" in the upper right corner and see what happens.\n' + + 'Create new something by press the button on the bottom (with plus).\nCheck the Menu by button in the upper left corner.\n' + + 'Note your notes, create something helpful for you and do everything you want!', + paragraph_size: 'half', + font_size: '24', + entity_position: 'center', + entity_title_position: 'center', + entity_order: 1 + }); + const editedHomePage = await prisma.page.findFirst({ + where: { + page_uuid: homePage.page_uuid + } + }); + const createdUser = await prisma.user.findFirst({ + where: { + user_uuid: body.user_uuid + } + }); + return { + createdUser, + homePage: editedHomePage, + startEntity + }; + } + async getUser(body: IBodyUser) { + return prisma.user.findFirst({ + where: { + user_uuid: body.user_uuid + } + }); + } + async addUserPage(page_uuid: string, user_uuid: string) { + const user = await prisma.user.findFirst({ + where: { + user_uuid: user_uuid + } + }); + if (user?.pages_uuid) { + user.pages_uuid.push(page_uuid); + } else user.pages_uuid = [page_uuid]; + return prisma.user.update({ + data: user, + where: { + user_uuid: user.user_uuid + } + }); + } + async editUser(body: IBodyUser) { + return prisma.user.update({ + data: body, + where: { + user_uuid: body.user_uuid + } + }); + } + async deleteUser(body: IBodyUser) { + return prisma.user.delete({ + where: { + user_uuid: body.user_uuid + } + }); + } + async deleteUserPage(page_uuid: string, user_uuid: string) { + const currentUser = await prisma.user.findFirst({ + where: { + user_uuid: user_uuid + } + }); + const pages = JSON.parse(currentUser.pages_uuid); + pages.filter((uuid: string) => uuid !== page_uuid); + currentUser.pages_uuid = JSON.stringify(pages); + return prisma.user.update({ + data: currentUser, + where: { + user_uuid: currentUser.user_uuid + } + }); + } +} + +export default new UsersService(); diff --git a/src/telegramBot/index.js b/src/telegramBot/index.ts similarity index 92% rename from src/telegramBot/index.js rename to src/telegramBot/index.ts index 23535e0..1cb5f69 100644 --- a/src/telegramBot/index.js +++ b/src/telegramBot/index.ts @@ -1,7 +1,7 @@ import TelegramBot from 'node-telegram-bot-api'; -import * as route from '../routes/telegramBot.js'; +import * as route from '../routes/telegramBot'; -export const bot = new TelegramBot(process.env.TELEGRAM_TOKEN, { polling: true }); +export const bot = new TelegramBot(process.env.TELEGRAM_TOKEN!, { polling: true }); export const connectBot = async () => { await bot.setMyCommands([ @@ -11,7 +11,7 @@ export const connectBot = async () => { bot.on('message', async (message) => { const chatId = message.chat.id; - const text = message.text; + const text = message.text!; if (text === '/start') { await route.sendMessageOnStart(chatId); } @@ -34,7 +34,7 @@ export const connectBot = async () => { } }); bot.on('callback_query', async (req) => { - const chatId = req.message.chat.id; + const chatId = req.message!.chat.id; const data = req.data; if (data === '/start') { diff --git a/tsconfig.json b/tsconfig.json index b7bcdc0..a7dede6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,6 @@ // "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. */ @@ -25,9 +24,11 @@ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ /* Modules */ - "module": "commonjs" /* Specify what module code is generated. */, + "module": "ESNext", + "target": "ESNext", // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + "moduleResolution": "Node", /* Specify how TypeScript looks up a file from a given module specifier. */ + "ts-node": { "esm": true }, // "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. */ diff --git a/yarn.lock b/yarn.lock index 7ed1c27..f02bf97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,13 +2,6 @@ # yarn lockfile v1 -"@cspotcode/source-map-support@^0.8.0": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== - dependencies: - "@jridgewell/trace-mapping" "0.3.9" - "@cypress/request-promise@^5.0.0": version "5.0.0" resolved "https://registry.npmjs.org/@cypress/request-promise/-/request-promise-5.0.0.tgz" @@ -19,7 +12,7 @@ stealthy-require "^1.1.1" tough-cookie "^4.1.3" -"@cypress/request@^3.0.1": +"@cypress/request@^3.0.0", "@cypress/request@^3.0.1": version "3.0.1" resolved "https://registry.npmjs.org/@cypress/request/-/request-3.0.1.tgz" integrity sha512-TWivJlJi8ZDx2wGOw1dbLuHJKUYX7bWySw377nlnGOW3hP9/MUKIsEdXT/YngWxVdgNCHRBmFlBipE+5/2ZZlQ== @@ -43,24 +36,6 @@ tunnel-agent "^0.6.0" uuid "^8.3.2" -"@jridgewell/resolve-uri@^3.0.3": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" - integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== - -"@jridgewell/sourcemap-codec@^1.4.10": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" - integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== - -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@prisma/client@^5.18.0": version "5.18.0" resolved "https://registry.npmjs.org/@prisma/client/-/client-5.18.0.tgz" @@ -102,57 +77,15 @@ dependencies: "@prisma/debug" "5.18.0" -"@tsconfig/node10@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" - integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== - -"@tsconfig/node12@^1.0.7": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" - integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== - -"@tsconfig/node14@^1.0.0": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" - integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== - -"@tsconfig/node16@^1.0.2": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" - integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== - -"@types/node@^22.3.0": - version "22.5.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.1.tgz#de01dce265f6b99ed32b295962045d10b5b99560" - integrity sha512-KkHsxej0j9IW1KKOOAA/XBA0z08UFSrRQHErzEfA3Vgq57eXIMYboIlHJuYIfd+lwCQjtKqUu3UnmKbtUc9yRw== - dependencies: - undici-types "~6.19.2" - -acorn-walk@^8.1.1: - version "8.3.3" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.3.tgz#9caeac29eefaa0c41e3d4c65137de4d6f34df43e" - integrity sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw== - dependencies: - acorn "^8.11.0" - -acorn@^8.11.0, acorn@^8.4.1: - version "8.12.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" - integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== - -anymatch@~3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== +ajv@^6.12.3: + version "6.12.6" + resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" array-buffer-byte-length@^1.0.1: version "1.0.1" @@ -194,7 +127,7 @@ asn1@~0.2.3: dependencies: safer-buffer "~2.1.0" -assert-plus@1.0.0, assert-plus@^1.0.0: +assert-plus@^1.0.0, assert-plus@1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== @@ -221,11 +154,6 @@ aws4@^1.8.0: resolved "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz" integrity sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw== -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - bcrypt-pbkdf@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz" @@ -233,11 +161,6 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -binary-extensions@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" - integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== - bl@^1.2.3: version "1.2.3" resolved "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz" @@ -251,21 +174,6 @@ bluebird@^3.5.0: resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@~3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" - integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== - dependencies: - fill-range "^7.1.1" - call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.6, call-bind@^1.0.7: version "1.0.7" resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz" @@ -282,21 +190,6 @@ caseless@~0.12.0: resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz" integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== -chokidar@^3.5.2: - version "3.6.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" - integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== - 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" - optionalDependencies: - fsevents "~2.3.2" - combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" @@ -304,21 +197,16 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== +core-util-is@~1.0.0: + version "1.0.3" + resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" + integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== core-util-is@1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - cors@^2.8.5: version "2.8.5" resolved "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz" @@ -327,11 +215,6 @@ cors@^2.8.5: object-assign "^4" vary "^1" -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - dashdash@^1.12.0: version "1.14.1" resolved "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz" @@ -373,13 +256,6 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4: - version "4.3.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.6.tgz#2ab2c38fbaffebf8aa95fdfe6d88438c7a13c52b" - integrity sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg== - dependencies: - ms "2.1.2" - define-data-property@^1.0.1, define-data-property@^1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz" @@ -403,11 +279,6 @@ delayed-stream@~1.0.0: resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - dotenv@^16.4.5: version "16.4.5" resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz" @@ -534,23 +405,26 @@ extend@~3.0.2: resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -extsprintf@1.3.0, extsprintf@^1.2.0: +extsprintf@^1.2.0, extsprintf@1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz" integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + file-type@^3.9.0: version "3.9.0" resolved "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz" integrity sha512-RLoqTXE8/vPmMuTI88DAzhMYC99I8BWv7zYP4A1puo5HIjEJ5EX48ighy4ZyKMG9EDXxBgW6e++cn7d1xuFghA== -fill-range@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" - integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== - dependencies: - to-regex-range "^5.0.1" - for-each@^0.3.3: version "0.3.3" resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz" @@ -572,11 +446,6 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" -fsevents@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - function-bind@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz" @@ -624,13 +493,6 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - globalthis@^1.0.3: version "1.0.4" resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz" @@ -646,16 +508,24 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz" + integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== + +har-validator@~5.1.3: + version "5.1.5" + resolved "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz" + integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== + dependencies: + ajv "^6.12.3" + har-schema "^2.0.0" + has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz" integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz" @@ -687,6 +557,15 @@ hasown@^2.0.0, hasown@^2.0.1, hasown@^2.0.2: dependencies: function-bind "^1.1.2" +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz" + integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + http-signature@~1.3.6: version "1.3.6" resolved "https://registry.npmjs.org/http-signature/-/http-signature-1.3.6.tgz" @@ -696,11 +575,6 @@ http-signature@~1.3.6: jsprim "^2.0.2" sshpk "^1.14.1" -ignore-by-default@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" - integrity sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA== - inherits@~2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" @@ -730,13 +604,6 @@ is-bigint@^1.0.1: dependencies: has-bigints "^1.0.1" -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - is-boolean-object@^1.1.0: version "1.1.2" resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz" @@ -764,18 +631,6 @@ is-date-object@^1.0.1: dependencies: has-tostringtag "^1.0.0" -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - is-negative-zero@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz" @@ -788,11 +643,6 @@ is-number-object@^1.0.4: dependencies: has-tostringtag "^1.0.0" -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - is-regex@^1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz" @@ -861,6 +711,11 @@ jsbn@~0.1.0: resolved "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz" integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + json-schema@0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz" @@ -871,6 +726,16 @@ json-stringify-safe@~5.0.1: resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== +jsprim@^1.2.2: + version "1.4.2" + resolved "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.4.0" + verror "1.10.0" + jsprim@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/jsprim/-/jsprim-2.0.2.tgz" @@ -886,11 +751,6 @@ lodash@^4.17.15: resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -make-error@^1.1.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - mime-db@1.52.0: version "1.52.0" resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" @@ -908,14 +768,7 @@ mime@^1.6.0: resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -minimatch@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -ms@2.1.2, ms@^2.1.1: +ms@^2.1.1: version "2.1.2" resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== @@ -935,26 +788,10 @@ node-telegram-bot-api@^0.66.0: mime "^1.6.0" pump "^2.0.0" -nodemon@^3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-3.1.4.tgz#c34dcd8eb46a05723ccde60cbdd25addcc8725e4" - integrity sha512-wjPBbFhtpJwmIeY2yP7QF+UKzPfltVGtfce1g/bB15/8vCGZj8uxD62b/b9M9/WVgme0NZudpownKN+c0plXlQ== - 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" - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== object-assign@^4: version "4.1.1" @@ -1036,7 +873,7 @@ pg-types@^2.1.0: postgres-date "~1.0.4" postgres-interval "^1.1.0" -pg@^8.12.0: +pg@^8.12.0, pg@>=8.0: version "8.12.0" resolved "https://registry.npmjs.org/pg/-/pg-8.12.0.tgz" integrity sha512-A+LHUSnwnxrnL/tZ+OLfqR1SxLN3c/pgDztZ47Rpbsd4jUytsTtwQo/TLPRzPJMp/1pbhYVhH9cuSZLAajNfjQ== @@ -1056,11 +893,6 @@ pgpass@1.x: dependencies: split2 "^4.1.0" -picomatch@^2.0.4, picomatch@^2.2.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - possible-typed-array-names@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz" @@ -1088,12 +920,7 @@ postgres-interval@^1.1.0: dependencies: xtend "^4.0.0" -prettier@^3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105" - integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== - -prisma@^5.18.0: +prisma@*, prisma@^5.18.0: version "5.18.0" resolved "https://registry.npmjs.org/prisma/-/prisma-5.18.0.tgz" integrity sha512-+TrSIxZsh64OPOmaSgVPH7ALL9dfU0jceYaMJXsNrTkFHO7/3RANi5K2ZiPB1De9+KDxCWn7jvRq8y8pvk+o9g== @@ -1105,16 +932,11 @@ process-nextick-args@~2.0.0: resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -psl@^1.1.33: +psl@^1.1.28, psl@^1.1.33: version "1.9.0" resolved "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz" integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== -pstree.remy@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a" - integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w== - pump@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz" @@ -1123,11 +945,16 @@ pump@^2.0.0: end-of-stream "^1.1.0" once "^1.3.1" -punycode@^2.1.1: +punycode@^2.1.0, punycode@^2.1.1: version "2.3.1" resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== +qs@~6.5.2: + version "6.5.3" + resolved "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== + qs@6.10.4: version "6.10.4" resolved "https://registry.npmjs.org/qs/-/qs-6.10.4.tgz" @@ -1153,13 +980,6 @@ readable-stream@^2.3.5: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - regexp.prototype.flags@^1.5.2: version "1.5.2" resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz" @@ -1177,6 +997,32 @@ request-promise-core@1.1.3: dependencies: lodash "^4.17.15" +request@^2.34: + version "2.88.2" + resolved "https://registry.npmjs.org/request/-/request-2.88.2.tgz" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.3" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.5.0" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + requires-port@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" @@ -1197,7 +1043,12 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2: resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@~5.1.0: + version "5.1.2" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== @@ -1216,11 +1067,6 @@ safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -semver@^7.5.3: - version "7.6.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" - integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== - set-function-length@^1.2.1: version "1.2.2" resolved "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz" @@ -1253,19 +1099,12 @@ side-channel@^1.0.4: get-intrinsic "^1.2.4" object-inspect "^1.13.1" -simple-update-notifier@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz#d70b92bdab7d6d90dfd73931195a30b6e3d7cebb" - integrity sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w== - dependencies: - semver "^7.5.3" - split2@^4.1.0: version "4.2.0" resolved "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz" integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== -sshpk@^1.14.1: +sshpk@^1.14.1, sshpk@^1.7.0: version "1.18.0" resolved "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz" integrity sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ== @@ -1285,6 +1124,13 @@ stealthy-require@^1.1.1: resolved "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz" integrity sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g== +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + string.prototype.trim@^1.2.9: version "1.2.9" resolved "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz" @@ -1313,32 +1159,6 @@ string.prototype.trimstart@^1.0.8: define-properties "^1.2.1" es-object-atoms "^1.0.0" -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -supports-color@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -touch@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.1.tgz#097a23d7b161476435e5c1344a95c0f75b4a5694" - integrity sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA== - tough-cookie@^4.1.3: version "4.1.4" resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz" @@ -1349,24 +1169,13 @@ tough-cookie@^4.1.3: universalify "^0.2.0" url-parse "^1.5.3" -ts-node@^10.9.2: - version "10.9.2" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" - integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== - 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" +tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" tunnel-agent@^0.6.0: version "0.6.0" @@ -1424,11 +1233,6 @@ typed-array-length@^1.0.6: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" -typescript@^5.5.4: - version "5.5.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" - integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== - unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz" @@ -1439,26 +1243,23 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" -undefsafe@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.5.tgz#38733b9327bdcd226db889fb723a6efd162e6e2c" - integrity sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA== - underscore@^1.13.1: version "1.13.7" resolved "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz" integrity sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g== -undici-types@~6.19.2: - version "6.19.8" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" - integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== - universalify@^0.2.0: version "0.2.0" resolved "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + url-parse@^1.5.3: version "1.5.10" resolved "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz" @@ -1472,16 +1273,16 @@ util-deprecate@~1.0.1: resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + uuid@^8.3.2: version "8.3.2" resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -v8-compile-cache-lib@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== - vary@^1: version "1.1.2" resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz" @@ -1532,8 +1333,3 @@ xtend@^4.0.0: version "4.0.2" resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== -- GitLab