From 26748324fe334468aa4a4e7bab1c068462f2e804 Mon Sep 17 00:00:00 2001 From: anshuk Date: Tue, 11 Jul 2023 16:04:45 +0530 Subject: [PATCH] - Added sequelize as a package dependency, and sequelize-cli as a dev dependency. - First steps towards migrating towards an ORM for database queries and management. - Fixed error handling. - Bumped up version to 0.1.9 --- .gitignore | 14 +- COMMITMESSAGE.md | 6 +- package-lock.json | 891 +++++++++++++++++- package.json | 7 +- src/components/LabelManager.js | 20 +- src/components/admin/ManageUsers.js | 4 + src/components/common/GenericLists.js | 15 +- .../common/calendars/AddNewCalendar.js | 13 +- .../caldavAccounts/AddCaldavAccount.js | 15 +- .../caldavAccounts/CaldavAccounts.js | 12 +- src/components/events/EventEditor.js | 42 +- src/components/tasks/ParentTaskSearch.js | 13 +- src/components/tasks/TaskEditor.js | 34 +- src/components/tasks/TaskList.js | 11 +- src/config/constants.js | 2 +- src/helpers/api/cal/caldav.js | 16 +- src/helpers/api/db.js | 31 + src/helpers/api/install.js | 4 +- src/helpers/frontend/calendar.js | 44 +- src/helpers/frontend/classes/FilterHelper.js | 14 +- .../frontend/classes/RruleServerHelper.js | 25 +- src/helpers/frontend/cookies.js | 11 +- src/helpers/frontend/events.js | 11 +- src/helpers/frontend/filters.js | 39 +- src/helpers/frontend/ics.js | 30 +- src/helpers/frontend/labels.js | 25 +- src/helpers/frontend/sync.js | 46 +- src/helpers/frontend/tasks.js | 17 +- src/helpers/general.js | 1 - src/i18n/strings.json | 3 + src/pages/accounts/register.js | 14 +- src/pages/accounts/resetpassword.js | 23 +- src/pages/accounts/settings.js | 48 +- src/pages/api/caldav/calendars/add/event.js | 2 +- src/pages/api/caldav/calendars/events/all.js | 14 +- .../api/caldav/calendars/modify/object.js | 2 +- src/pages/api/caldav/event/delete.js | 37 +- src/pages/api/calendars/refresh.js | 7 +- src/pages/api/install/check.js | 10 +- src/pages/install/index.js | 25 +- src/pages/login.js | 25 +- 41 files changed, 1231 insertions(+), 392 deletions(-) diff --git a/.gitignore b/.gitignore index 1847478..c0706d6 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,16 @@ COMMITMESSAGE.md docker-compose.yml index.js.backup view/ -COMBINEDCOMMITMESSAGE \ No newline at end of file +COMBINEDCOMMITMESSAGE +config/config.json +package-withSequelize.json + + +#Sequelise Temporary Ignore list +models/ +config/ +migrations/ +src/helpers/api/installSequelize.ts +src/helpers/installation.ts +src/helpers/models.ts +.sequelizerc diff --git a/COMMITMESSAGE.md b/COMMITMESSAGE.md index 229b15f..98865a9 100644 --- a/COMMITMESSAGE.md +++ b/COMMITMESSAGE.md @@ -1 +1,5 @@ -- Fixed bug in the login process. +- Added sequelize as a package dependency, and sequelize-cli as a dev dependency. + - First steps towards migrating towards an ORM for database queries and management. +- Fixed error handling. +- Bumped up version to 0.1.9 + diff --git a/package-lock.json b/package-lock.json index 9f3feef..d4dd581 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "manage-my-damn-life-nextjs", - "version": "0.1.8", + "version": "0.1.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "manage-my-damn-life-nextjs", - "version": "0.1.8", + "version": "0.1.9", "dependencies": { "@babel/core": "7.21.8", "@babel/preset-react": "7.18.6", @@ -31,6 +31,7 @@ "crypto-js": "4.1.1", "dexie": "3.2.3", "dexie-react-hooks": "1.1.3", + "dotenv": "16.3.1", "fuzzy-search": "3.2.1", "gantt-task-react": "0.3.9", "i18next": "22.4.13", @@ -42,6 +43,7 @@ "lodash": "4.17.21", "moment": "2.29.4", "mysql": "2.18.1", + "mysql2": "3.4.0", "next": "13.2.4", "nextjs-progressbar": "0.0.16", "nodemailer": "6.9.1", @@ -57,6 +59,8 @@ "react-icons": "4.8.0", "react-toastify": "9.1.1", "rrule": "2.7.2", + "sequelize": "6.32.1", + "sequelize-cli": "6.6.1", "timezone-validator": "1.0.3", "tsdav": "2.0.3", "validator": "13.9.0", @@ -64,6 +68,7 @@ }, "devDependencies": { "@types/node": "20.1.3", + "sequelize-auto": "0.8.8", "typescript": "5.0.4" } }, @@ -124,8 +129,9 @@ } }, "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.0", - "license": "ISC", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -178,8 +184,9 @@ } }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.0", - "license": "ISC", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -1210,11 +1217,23 @@ "node": ">=10.13.0" } }, + "node_modules/@types/debug": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.8.tgz", + "integrity": "sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/ms": { + "version": "0.7.31", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", + "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" + }, "node_modules/@types/node": { "version": "20.1.3", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.1.3.tgz", - "integrity": "sha512-NP2yfZpgmf2eDRPmgGq+fjGjSwFgYbihA8/gK+ey23qT9RkxsgNTZvGOEpXgzIGqesTYkElELLgtKoMQTys5vA==", - "dev": true + "integrity": "sha512-NP2yfZpgmf2eDRPmgGq+fjGjSwFgYbihA8/gK+ey23qT9RkxsgNTZvGOEpXgzIGqesTYkElELLgtKoMQTys5vA==" }, "node_modules/@types/nprogress": { "version": "0.2.0", @@ -1255,10 +1274,28 @@ "version": "0.16.3", "license": "MIT" }, + "node_modules/@types/validator": { + "version": "13.7.17", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.7.17.tgz", + "integrity": "sha512-aqayTNmeWrZcvnG2MG9eGYI6b7S5fl+yKgPs6bAjOTwPS316R5SxBGKvtSExfyoJU7pIeHJfsHI0Ji41RVMkvQ==" + }, "node_modules/@types/warning": { "version": "3.0.0", "license": "MIT" }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, "node_modules/ansi-styles": { "version": "3.2.1", "license": "MIT", @@ -1273,6 +1310,14 @@ "version": "0.4.0", "license": "MIT" }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/axios": { "version": "1.4.0", "license": "MIT", @@ -1295,6 +1340,11 @@ "npm": ">=6" } }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, "node_modules/base-64": { "version": "1.0.0", "license": "MIT" @@ -1311,6 +1361,11 @@ "node": "*" } }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, "node_modules/boolbase": { "version": "1.0.0", "license": "ISC" @@ -1336,6 +1391,14 @@ "version": "1.10.3", "license": "MIT" }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, "node_modules/browserslist": { "version": "4.21.5", "funding": [ @@ -1420,10 +1483,35 @@ "version": "2.3.2", "license": "MIT" }, + "node_modules/cli-color": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-2.0.3.tgz", + "integrity": "sha512-OkoZnxyC4ERN3zLzZaY9Emb7f/MhBOIpePv0Ycok0fJYT+Ouo00UBEIwsVsr0yoow++n5YWlSUgST9GKhNHiRQ==", + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.61", + "es6-iterator": "^2.0.3", + "memoizee": "^0.4.15", + "timers-ext": "^0.1.7" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/client-only": { "version": "0.0.1", "license": "MIT" }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, "node_modules/clsx": { "version": "1.2.1", "license": "MIT", @@ -1477,6 +1565,15 @@ "node": ">=0.10.0" } }, + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, "node_modules/convert-source-map": { "version": "1.9.0", "license": "MIT" @@ -1656,6 +1753,15 @@ "version": "3.1.2", "license": "MIT" }, + "node_modules/d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dependencies": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, "node_modules/debug": { "version": "4.3.4", "license": "MIT", @@ -1678,6 +1784,14 @@ "node": ">=0.4.0" } }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "engines": { + "node": ">=0.10" + } + }, "node_modules/dequal": { "version": "2.0.3", "license": "MIT", @@ -1756,10 +1870,50 @@ "url": "https://github.com/fb55/domutils?sponsor=1" } }, + "node_modules/dotenv": { + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" + } + }, + "node_modules/dottie": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.6.tgz", + "integrity": "sha512-iGCHkfUc5kFekGiqhe8B/mdaurD+lakO9txNnTvKtA6PISrw86LgqHvRzWYPyoE2Ph5aMIrCw9/uko6XHTKCwA==" + }, + "node_modules/editorconfig": { + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz", + "integrity": "sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g==", + "dependencies": { + "commander": "^2.19.0", + "lru-cache": "^4.1.5", + "semver": "^5.6.0", + "sigmund": "^1.0.1" + }, + "bin": { + "editorconfig": "bin/editorconfig" + } + }, + "node_modules/editorconfig/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, "node_modules/electron-to-chromium": { "version": "1.4.387", "license": "ISC" }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, "node_modules/entities": { "version": "2.2.0", "license": "BSD-2-Clause", @@ -1774,6 +1928,50 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es5-ext": { + "version": "0.10.62", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz", + "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==", + "hasInstallScript": true, + "dependencies": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "next-tick": "^1.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", + "dependencies": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dependencies": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "node_modules/es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "dependencies": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, "node_modules/escalade": { "version": "3.1.1", "license": "MIT", @@ -1795,10 +1993,32 @@ "version": "0.6.1", "license": "MIT" }, + "node_modules/event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, "node_modules/eventemitter3": { "version": "4.0.7", "license": "MIT" }, + "node_modules/ext": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", + "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", + "dependencies": { + "type": "^2.7.2" + } + }, + "node_modules/ext/node_modules/type": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", + "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" + }, "node_modules/find-root": { "version": "1.1.0", "license": "MIT" @@ -1833,6 +2053,25 @@ "node": ">= 6" } }, + "node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, "node_modules/function-bind": { "version": "1.1.1", "license": "MIT" @@ -1852,6 +2091,14 @@ "react": "^18.0.0" } }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dependencies": { + "is-property": "^1.0.2" + } + }, "node_modules/generic-names": { "version": "4.0.0", "license": "MIT", @@ -1866,6 +2113,32 @@ "node": ">=6.9.0" } }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/globals": { "version": "11.12.0", "license": "MIT", @@ -1873,6 +2146,11 @@ "node": ">=4" } }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, "node_modules/has": { "version": "1.0.3", "license": "MIT", @@ -1963,6 +2241,17 @@ "ical2json": "bin/ical2json" } }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/icss-replace-symbols": { "version": "1.1.0", "license": "ISC" @@ -2018,10 +2307,32 @@ "node": ">=8" } }, + "node_modules/inflection": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.4.tgz", + "integrity": "sha512-6I/HUDeYFfuNCVS3td055BaXBwKYuzw7K3ExVMStBowKo9oOAMJIXIHvdyR3iboTCp1b+1i5DSkIZTcwIktuDw==", + "engines": [ + "node >= 0.4.0" + ] + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "node_modules/inherits": { "version": "2.0.4", "license": "ISC" }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, "node_modules/invariant": { "version": "2.2.4", "license": "MIT", @@ -2043,6 +2354,24 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-promise": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==" + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" + }, "node_modules/isarray": { "version": "1.0.0", "license": "MIT" @@ -2051,6 +2380,25 @@ "version": "3.7.5", "license": "BSD-3-Clause" }, + "node_modules/js-beautify": { + "version": "1.14.8", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.14.8.tgz", + "integrity": "sha512-4S7HFeI9YfRvRgKnEweohs0tgJj28InHVIj4Nl8Htf96Y6pHg3+tJrmo4ucAM9f7l4SHbFI3IvFAZ2a1eQPbyg==", + "dependencies": { + "config-chain": "^1.1.13", + "editorconfig": "^0.15.3", + "glob": "^8.1.0", + "nopt": "^6.0.0" + }, + "bin": { + "css-beautify": "js/bin/css-beautify.js", + "html-beautify": "js/bin/html-beautify.js", + "js-beautify": "js/bin/js-beautify.js" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/js-cookie": { "version": "3.0.1", "license": "MIT", @@ -2086,6 +2434,17 @@ "node": ">=6" } }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, "node_modules/lilconfig": { "version": "2.1.0", "license": "MIT", @@ -2124,6 +2483,11 @@ "version": "4.5.0", "license": "MIT" }, + "node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, "node_modules/loose-envify": { "version": "1.4.0", "license": "MIT", @@ -2134,6 +2498,23 @@ "loose-envify": "cli.js" } }, + "node_modules/lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dependencies": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "node_modules/lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==", + "dependencies": { + "es5-ext": "~0.10.2" + } + }, "node_modules/luxon": { "version": "1.28.1", "license": "MIT", @@ -2150,6 +2531,21 @@ "version": "2.0.14", "license": "CC0-1.0" }, + "node_modules/memoizee": { + "version": "0.4.15", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz", + "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==", + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.53", + "es6-weak-map": "^2.0.3", + "event-emitter": "^0.3.5", + "is-promise": "^2.2.2", + "lru-queue": "^0.1.0", + "next-tick": "^1.1.0", + "timers-ext": "^0.1.7" + } + }, "node_modules/mime-db": { "version": "1.52.0", "license": "MIT", @@ -2167,6 +2563,29 @@ "node": ">= 0.6" } }, + "node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/moment": { "version": "2.29.4", "license": "MIT", @@ -2174,6 +2593,17 @@ "node": "*" } }, + "node_modules/moment-timezone": { + "version": "0.5.43", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.43.tgz", + "integrity": "sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==", + "dependencies": { + "moment": "^2.29.4" + }, + "engines": { + "node": "*" + } + }, "node_modules/ms": { "version": "2.1.2", "license": "MIT" @@ -2191,6 +2621,59 @@ "node": ">= 0.6" } }, + "node_modules/mysql2": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.4.0.tgz", + "integrity": "sha512-l952dVcdWVfEIIxMQ1PNSPHYY2htylG7H9ahrQe9lIgDpEMg3hB0S88OhC/loNSZpV8OcywSjgOzjSjEUiuwiQ==", + "dependencies": { + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.6.3", + "long": "^5.2.1", + "lru-cache": "^8.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/mysql2/node_modules/lru-cache": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", + "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==", + "engines": { + "node": ">=16.14" + } + }, + "node_modules/mysql2/node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/named-placeholders/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, "node_modules/nanoid": { "version": "3.3.6", "funding": [ @@ -2261,6 +2744,11 @@ } } }, + "node_modules/next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + }, "node_modules/nextjs-progressbar": { "version": "0.0.16", "license": "MIT", @@ -2303,6 +2791,20 @@ "node": ">=6.0.0" } }, + "node_modules/nopt": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", + "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", + "dependencies": { + "abbrev": "^1.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, "node_modules/normalize-url": { "version": "6.1.0", "license": "MIT", @@ -2334,6 +2836,14 @@ "node": ">=0.10.0" } }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, "node_modules/p-finally": { "version": "1.0.0", "license": "MIT", @@ -2402,6 +2912,11 @@ "node": ">=8" } }, + "node_modules/pg-connection-string": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.0.tgz", + "integrity": "sha512-x14ibktcwlHKoHxx9X3uTVW9zIGR41ZB6QNhHb21OPNdCCO3NaRnpJuwKIQSR4u+Yqjx4HCvy7Hh7VSy1U4dGg==" + }, "node_modules/picocolors": { "version": "1.0.0", "license": "ISC" @@ -2954,10 +3469,20 @@ "version": "16.13.1", "license": "MIT" }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==" + }, "node_modules/proxy-from-env": { "version": "1.1.0", "license": "MIT" }, + "node_modules/pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" + }, "node_modules/rctx-contextmenu": { "version": "1.4.1", "license": "MIT", @@ -3173,6 +3698,20 @@ "version": "0.13.11", "license": "MIT" }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/reserved-words": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/reserved-words/-/reserved-words-0.1.2.tgz", + "integrity": "sha512-0S5SrIUJ9LfpbVl4Yzij6VipUdafHrOTzvmfazSw/jeZrZtQK303OPZW+obtkaw7jQlTQppy0UvZWm9872PbRw==", + "dev": true + }, "node_modules/resolve": { "version": "1.22.2", "license": "MIT", @@ -3195,6 +3734,11 @@ "node": ">=4" } }, + "node_modules/retry-as-promised": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-7.0.4.tgz", + "integrity": "sha512-XgmCoxKWkDofwH8WddD0w85ZfqYz+ZHlr5yo+3YUCfycWawU56T5ckWXsScsj5B8tqUcIG67DxXByo3VUgiAdA==" + }, "node_modules/rollup-plugin-postcss": { "version": "4.0.2", "license": "MIT", @@ -3300,6 +3844,11 @@ "version": "0.4.2", "license": "ISC" }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, "node_modules/sax": { "version": "1.2.4", "license": "ISC" @@ -3311,6 +3860,165 @@ "loose-envify": "^1.1.0" } }, + "node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, + "node_modules/sequelize": { + "version": "6.32.1", + "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.32.1.tgz", + "integrity": "sha512-3Iv0jruv57Y0YvcxQW7BE56O7DC1BojcfIrqh6my+IQwde+9u/YnuYHzK+8kmZLhLvaziRT1eWu38nh9yVwn/g==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/sequelize" + } + ], + "dependencies": { + "@types/debug": "^4.1.8", + "@types/validator": "^13.7.17", + "debug": "^4.3.4", + "dottie": "^2.0.4", + "inflection": "^1.13.4", + "lodash": "^4.17.21", + "moment": "^2.29.4", + "moment-timezone": "^0.5.43", + "pg-connection-string": "^2.6.0", + "retry-as-promised": "^7.0.4", + "semver": "^7.5.1", + "sequelize-pool": "^7.1.0", + "toposort-class": "^1.0.1", + "uuid": "^8.3.2", + "validator": "^13.9.0", + "wkx": "^0.5.0" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependenciesMeta": { + "ibm_db": { + "optional": true + }, + "mariadb": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "oracledb": { + "optional": true + }, + "pg": { + "optional": true + }, + "pg-hstore": { + "optional": true + }, + "snowflake-sdk": { + "optional": true + }, + "sqlite3": { + "optional": true + }, + "tedious": { + "optional": true + } + } + }, + "node_modules/sequelize-auto": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/sequelize-auto/-/sequelize-auto-0.8.8.tgz", + "integrity": "sha512-9o0qi2yMA86oFqcA5Nh14PnQSHP0E9WPEB4hP/NgxqdFE44Nq2u8Di5O3xmvWwXMIV6W+Q0YI/2VTLvlMJAjnQ==", + "dev": true, + "dependencies": { + "lodash": "^4.17.21", + "mkdirp": "^1.0.4", + "reserved-words": "^0.1.2", + "yargs": "^16.2.0" + }, + "bin": { + "sequelize-auto": "bin/sequelize-auto" + }, + "engines": { + "node": ">= 10" + }, + "peerDependencies": { + "sequelize": ">3.30.0" + } + }, + "node_modules/sequelize-cli": { + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/sequelize-cli/-/sequelize-cli-6.6.1.tgz", + "integrity": "sha512-C3qRpy1twBsFa855qOQFSYWer8ngiaZP05/OAsT1QCUwtc6UxVNNiQ0CGUt98T9T1gi5D3TGWL6le8HWUKELyw==", + "dependencies": { + "cli-color": "^2.0.3", + "fs-extra": "^9.1.0", + "js-beautify": "^1.14.5", + "lodash": "^4.17.21", + "resolve": "^1.22.1", + "umzug": "^2.3.0", + "yargs": "^16.2.0" + }, + "bin": { + "sequelize": "lib/sequelize", + "sequelize-cli": "lib/sequelize" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/sequelize-pool": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-7.1.0.tgz", + "integrity": "sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/sequelize/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sequelize/node_modules/semver": { + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz", + "integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sequelize/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha512-fCvEXfh6NWpm+YSuY2bpXb/VIihqWA6hLsgboC+0nl71Q7N7o2eaCW8mJa/NLvQhs6jpd3VZV4UiUQlV6+lc8g==" + }, "node_modules/source-map": { "version": "0.5.7", "license": "BSD-3-Clause", @@ -3347,6 +4055,30 @@ "version": "1.1.3", "license": "CC0-1.0" }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/style-inject": { "version": "0.3.0", "license": "MIT" @@ -3436,6 +4168,15 @@ "node": ">= 10" } }, + "node_modules/timers-ext": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", + "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "dependencies": { + "es5-ext": "~0.10.46", + "next-tick": "1" + } + }, "node_modules/timezone-validator": { "version": "1.0.3", "license": "MIT" @@ -3451,6 +4192,11 @@ "node": ">=4" } }, + "node_modules/toposort-class": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", + "integrity": "sha512-OsLcGGbYF3rMjPUf8oKktyvCiUxSbqMMS39m33MAjLTC1DVIH6x3WSt63/M77ihI09+Sdfk1AXvfhCEeUmC7mg==" + }, "node_modules/tr46": { "version": "0.0.3", "license": "MIT" @@ -3472,6 +4218,11 @@ "version": "2.5.0", "license": "0BSD" }, + "node_modules/type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, "node_modules/typescript": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", @@ -3485,6 +4236,17 @@ "node": ">=12.20" } }, + "node_modules/umzug": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/umzug/-/umzug-2.3.0.tgz", + "integrity": "sha512-Z274K+e8goZK8QJxmbRPhl89HPO1K+ORFtm6rySPhFKfKc5GHhqdzD0SGhSWHkzoXasqJuItdhorSvY7/Cgflw==", + "dependencies": { + "bluebird": "^3.7.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/uncontrollable": { "version": "7.2.1", "license": "MIT", @@ -3498,6 +4260,14 @@ "react": ">=15.0.0" } }, + "node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/update-browserslist-db": { "version": "1.0.11", "funding": [ @@ -3530,6 +4300,14 @@ "version": "1.0.2", "license": "MIT" }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/validator": { "version": "13.9.0", "license": "MIT", @@ -3570,6 +4348,65 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/wkx": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/wkx/-/wkx-0.5.0.tgz", + "integrity": "sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, "node_modules/xml-js": { "version": "1.6.11", "license": "MIT", @@ -3580,12 +4417,50 @@ "xml-js": "bin/cli.js" } }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" + }, "node_modules/yaml": { "version": "1.10.2", "license": "ISC", "engines": { "node": ">= 6" } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "engines": { + "node": ">=10" + } } } } diff --git a/package.json b/package.json index 9a1c911..349ca52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "manage-my-damn-life-nextjs", - "version": "0.1.8", + "version": "0.1.9", "private": true, "scripts": { "dev": "next dev", @@ -32,6 +32,7 @@ "crypto-js": "4.1.1", "dexie": "3.2.3", "dexie-react-hooks": "1.1.3", + "dotenv": "16.3.1", "fuzzy-search": "3.2.1", "gantt-task-react": "0.3.9", "i18next": "22.4.13", @@ -43,6 +44,7 @@ "lodash": "4.17.21", "moment": "2.29.4", "mysql": "2.18.1", + "mysql2": "3.4.0", "next": "13.2.4", "nextjs-progressbar": "0.0.16", "nodemailer": "6.9.1", @@ -58,6 +60,8 @@ "react-icons": "4.8.0", "react-toastify": "9.1.1", "rrule": "2.7.2", + "sequelize": "6.32.1", + "sequelize-cli": "6.6.1", "timezone-validator": "1.0.3", "tsdav": "2.0.3", "validator": "13.9.0", @@ -65,6 +69,7 @@ }, "devDependencies": { "@types/node": "20.1.3", + "sequelize-auto": "0.8.8", "typescript": "5.0.4" } } diff --git a/src/components/LabelManager.js b/src/components/LabelManager.js index 3565459..341f1ba 100644 --- a/src/components/LabelManager.js +++ b/src/components/LabelManager.js @@ -74,8 +74,7 @@ class LabelManager extends Component{ mode: 'cors', headers: new Headers({'authorization': authorisationData, 'Content-Type':'application/json'}), } - try - { + fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ @@ -93,13 +92,12 @@ class LabelManager extends Component{ } } - }); - } - catch(e) - { - toast.error(this.i18next.t("ERROR_GENERIC")) - console.log(e) - } + }).catch(e=> + { + toast.error(this.i18next.t("ERROR_GENERIC")) + console.error("makeModifyLabelRequest", e) + } + ) } @@ -191,7 +189,9 @@ class LabelManager extends Component{ } - }); + }).catch(e =>{ + console.error("getLabelsFromServer", e) + }) } getColorEditorModal() diff --git a/src/components/admin/ManageUsers.js b/src/components/admin/ManageUsers.js index 9229dda..2b03417 100644 --- a/src/components/admin/ManageUsers.js +++ b/src/components/admin/ManageUsers.js @@ -94,6 +94,8 @@ export default class ManageUsers extends Component{ console.log(body) toast.error(message) } + }).catch(e =>{ + console.error("getUsersFromDB", e) }) } @@ -145,6 +147,8 @@ export default class ManageUsers extends Component{ this.setState({isSubmitting: false, showDeleteModal: false }) + }).catch(e =>{ + console.error("makeDeleteRequesttoServer", e) }) } diff --git a/src/components/common/GenericLists.js b/src/components/common/GenericLists.js index efdf6cd..c525c65 100644 --- a/src/components/common/GenericLists.js +++ b/src/components/common/GenericLists.js @@ -65,7 +65,7 @@ class GenericLists extends Component{ return new Promise( (resolve, reject) => { - try{ + const response = fetch(url_api, requestOptions) .then(response =>{ return response.json() @@ -129,14 +129,11 @@ class GenericLists extends Component{ } - }); - - }catch(e) - { - logVar(e,"GenericLists: generateLabelList") - toast.error(e.message) - - } + }).catch(e =>{ + console.error(e,"GenericLists: generateLabelList") + //toast.error("GenericLists: generateLabelList: "+e.message) + }) + }) diff --git a/src/components/common/calendars/AddNewCalendar.js b/src/components/common/calendars/AddNewCalendar.js index b4434aa..b771fc2 100644 --- a/src/components/common/calendars/AddNewCalendar.js +++ b/src/components/common/calendars/AddNewCalendar.js @@ -29,9 +29,8 @@ export default class AddNewCalendar extends Component{ mode: 'cors', headers: new Headers({'authorization': authorisationData, 'Content-Type':'application/json'}), } - try - { - const response = await fetch(url_api, requestOptions) + + const response = await fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ console.log(body) @@ -39,12 +38,10 @@ export default class AddNewCalendar extends Component{ - }); - } - catch(e) - { + }).catch(e =>{ this.props.onResponse(e.message) - } + }) + } calendarNameValueChanged(e) diff --git a/src/components/common/calendars/caldavAccounts/AddCaldavAccount.js b/src/components/common/calendars/caldavAccounts/AddCaldavAccount.js index 1db8d45..625a482 100644 --- a/src/components/common/calendars/caldavAccounts/AddCaldavAccount.js +++ b/src/components/common/calendars/caldavAccounts/AddCaldavAccount.js @@ -72,7 +72,7 @@ export default class AddCaldavAccount extends Component{ } return new Promise( (resolve, reject) => { - try{ + const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ @@ -95,14 +95,11 @@ export default class AddCaldavAccount extends Component{ } - }); - - } - catch(e) - { - logVar(e, "AddCaldavAccount:makeServerRequest") - toast.error(e.message) - } + }).catch(e =>{ + console.error(e, "AddCaldavAccount:makeServerRequest") + toast.error(e.message) + }) + }) } diff --git a/src/components/common/calendars/caldavAccounts/CaldavAccounts.js b/src/components/common/calendars/caldavAccounts/CaldavAccounts.js index 8d806d0..0138328 100644 --- a/src/components/common/calendars/caldavAccounts/CaldavAccounts.js +++ b/src/components/common/calendars/caldavAccounts/CaldavAccounts.js @@ -204,8 +204,7 @@ export default class CaldavAccounts extends Component{ mode: 'cors', headers: new Headers({'authorization': authorisationData, 'Content-Type':'application/json'}), } - try - { + const response = await fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ @@ -229,12 +228,11 @@ export default class CaldavAccounts extends Component{ } - }); - } - catch(e) - { + }).catch(e =>{ this.props.onResponse(e.message) - } + + }) + } diff --git a/src/components/events/EventEditor.js b/src/components/events/EventEditor.js index 7dea1ca..37162a2 100644 --- a/src/components/events/EventEditor.js +++ b/src/components/events/EventEditor.js @@ -132,7 +132,6 @@ export default class EventEditor extends Component { mode: 'cors', headers: new Headers({ 'authorization': authorisationData, 'Content-Type': 'application/json' }), } - try { fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { @@ -151,11 +150,9 @@ export default class EventEditor extends Component { this.setState({alarms: alarms, parsedEventV2: message["VCALENDAR"][0].VEVENT[0]}) } - }); - } - catch (e) { - logVar(e, "EventEditor:getVAlarms") - } + }).catch (e=> { + logVar(e, "EventEditor:getVAlarms") + }) } componentDidUpdate(prevProps, prevState) { @@ -493,7 +490,7 @@ export default class EventEditor extends Component { mode: 'cors', headers: new Headers({ 'authorization': authorisationData, 'Content-Type': 'application/json' }), } - try { + const response = await fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { @@ -510,12 +507,10 @@ export default class EventEditor extends Component { - }); - } - catch (e) { - toast.error(e.message) - this.props.onDismiss() - } + }).catch (e =>{ + toast.error(e.message) + this.props.onDismiss() + }) } async updateEvent(calendar_id, url, etag, data) { @@ -531,7 +526,6 @@ export default class EventEditor extends Component { mode: 'cors', headers: new Headers({ 'authorization': authorisationData, 'Content-Type': 'application/json' }), } - try { const response = await fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { @@ -547,11 +541,11 @@ export default class EventEditor extends Component { this.props.onDismiss() - }); - } - catch (e) { - toast.error(e.message) - } + }).catch (e =>{ + toast.error(e.message) + this.props.onDismiss() + + }) } onDismissDeleteDialog() { @@ -569,7 +563,6 @@ export default class EventEditor extends Component { mode: 'cors', headers: new Headers({ 'authorization': authorisationData, 'Content-Type': 'application/json' }), } - try { const response = await fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { @@ -584,11 +577,10 @@ export default class EventEditor extends Component { - }); - } - catch (e) { - this.props.onDismiss(e.message) - } + }).catch (e =>{ + console.error("deleteEventFromServer:", e) + this.props.onDismiss(e.message) + }) } diff --git a/src/components/tasks/ParentTaskSearch.js b/src/components/tasks/ParentTaskSearch.js index 35c9d4e..72c4222 100644 --- a/src/components/tasks/ParentTaskSearch.js +++ b/src/components/tasks/ParentTaskSearch.js @@ -54,8 +54,6 @@ export default class ParentTaskSearch extends Component{ var finalOutput = [] - try - { const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ @@ -92,12 +90,11 @@ export default class ParentTaskSearch extends Component{ } } - ) - - }catch(e) - { - logVar(e, "ParentTaskSearch: searchForTasks") - } + ).catch(e =>{ + logVar(e, "ParentTaskSearch: searchForTasks") + + }) + }else{ this.setState({searchOutput: null}) diff --git a/src/components/tasks/TaskEditor.js b/src/components/tasks/TaskEditor.js index 70b9020..1522466 100644 --- a/src/components/tasks/TaskEditor.js +++ b/src/components/tasks/TaskEditor.js @@ -30,6 +30,7 @@ import { makeParseICSRequest } from "@/helpers/frontend/ics"; import { VTODO } from "@/helpers/frontend/classes/VTODO"; import { RecurrenceHelper } from "@/helpers/frontend/classes/RecurrenceHelper"; import { getStandardDateFormat } from "@/helpers/frontend/settings"; +import { getErrorResponse } from "@/helpers/errros"; export default class TaskEditor extends Component { constructor(props) { super(props) @@ -441,7 +442,7 @@ export default class TaskEditor extends Component { mode: 'cors', headers: new Headers({ 'authorization': authorisationData, 'Content-Type': 'application/json' }), } - try { + const response = await fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { @@ -449,11 +450,10 @@ export default class TaskEditor extends Component { - }); - } - catch (e) { - this.props.onDismiss(e.message) - } + }).catch(e =>{ + this.props.onDismiss(e.message) + }) + } checkifValid() @@ -573,7 +573,7 @@ export default class TaskEditor extends Component { mode: 'cors', headers: new Headers({ 'authorization': authorisationData, 'Content-Type': 'application/json' }), } - try { + const response = await fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { @@ -581,11 +581,9 @@ export default class TaskEditor extends Component { - }); - } - catch (e) { - this.props.onDismiss(e.message) - } + }).catch (e => { + this.props.onDismiss(e.message) + }) } async updateTodo(calendar_id, url, etag, data) { const url_api = getAPIURL() + "caldav/calendars/modify/object" @@ -599,18 +597,18 @@ export default class TaskEditor extends Component { mode: 'cors', headers: new Headers({ 'authorization': authorisationData, 'Content-Type': 'application/json' }), } - try { + const response = await fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { this.props.onDismiss(body) - }); - } - catch (e) { - toast.error(e.message) - } + }).catch (e => { + console.error("TaskEditor: updateTodo ", e) + this.props.onDismiss(getErrorResponse(e)) + + }) } onParentSelect(uid) { diff --git a/src/components/tasks/TaskList.js b/src/components/tasks/TaskList.js index b4f7d7d..e21f1af 100644 --- a/src/components/tasks/TaskList.js +++ b/src/components/tasks/TaskList.js @@ -188,7 +188,7 @@ import { getAPIURL, logVar } from '@/helpers/general'; } - try{ + const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { @@ -196,13 +196,10 @@ import { getAPIURL, logVar } from '@/helpers/general'; if (body.data.message != null && body.data.message.caldav_name != null) { this.setState({ taskListName: body.data.message.caldav_name + " >> " + body.data.message.calendar_name, taskListColor:body.data.message.color }) } + }).catch(e => + { + console.error(e, "TaskList:getCalendarName") }) - - - }catch(e) - { - logVar(e, "TaskList:getCalendarName") - } } } diff --git a/src/config/constants.js b/src/config/constants.js index 2d43c9b..881a335 100644 --- a/src/config/constants.js +++ b/src/config/constants.js @@ -1,4 +1,4 @@ -export const VERSION_NUMBER = "0.1.8" +export const VERSION_NUMBER = "0.1.9" /* * SYSTEM_DEFAULT_LABEL_PREFIX: Default prefix applied to all system generated labels like * "My Day" diff --git a/src/helpers/api/cal/caldav.js b/src/helpers/api/cal/caldav.js index f6714ea..30f8d91 100644 --- a/src/helpers/api/cal/caldav.js +++ b/src/helpers/api/cal/caldav.js @@ -234,6 +234,13 @@ export async function createEventinCalDAVAccount(url, caldav_accounts_id, calend }, (rejected) => { console.log(rejected) + var statusText="Server error. Check Logs." + if(varNotEmpty(rejected) && varNotEmpty(rejected.message)) + { + statusText=rejected.message + } + + return resolve({result: {status: 500, error:rejected, statusText:statusText}, client:null}) }) @@ -275,7 +282,14 @@ export async function updateEventinCalDAVAccount(caldav_accounts_id, event) }, (rejected) => { - return resolve(rejected) + console.error(rejected) + var statusText="Server error. Check Logs." + if(varNotEmpty(rejected) && varNotEmpty(rejected.message)) + { + statusText=rejected.message + } + return resolve({result: {status: 500, error:rejected, statusText:statusText}, client:null, }) + }) diff --git a/src/helpers/api/db.js b/src/helpers/api/db.js index a5fda15..8ab3d33 100644 --- a/src/helpers/api/db.js +++ b/src/helpers/api/db.js @@ -1,4 +1,5 @@ import { varNotEmpty } from '../general'; +const { Sequelize } = require('sequelize'); export function getConnectionVar() { @@ -31,3 +32,33 @@ export function getSimpleConnectionVar() return con } + +export function getSequelizeObj(){ + + const sequelize = new Sequelize( + process.env.DB_NAME, + process.env.DB_USER, + process.env.DB_PASS, + { + host: process.env.DB_HOST, + dialect: 'mysql' + }); + + return sequelize + + +} + +export async function testDBConnectionSequelize(){ + var sequelize= getSequelizeObj() + try { + await sequelize.authenticate(); + console.log('Connection has been established successfully.'); + + return null + } catch (error) { + console.error('testDBConnectionSequelize: Unable to connect to the database:', error); + return error + } + +} \ No newline at end of file diff --git a/src/helpers/api/install.js b/src/helpers/api/install.js index 0b521f1..b105795 100644 --- a/src/helpers/api/install.js +++ b/src/helpers/api/install.js @@ -74,13 +74,15 @@ export async function testDBConnectionSimple() export async function isInstalled() { var allTables = await getListofTables() - if(varNotEmpty(allTables) && allTables.length==FINAL_TABLES.length) + if(varNotEmpty(allTables) && allTables.length>=FINAL_TABLES.length) { return true }else{ return false } } + + export async function getListofTables() { diff --git a/src/helpers/frontend/calendar.js b/src/helpers/frontend/calendar.js index af72492..4613d14 100644 --- a/src/helpers/frontend/calendar.js +++ b/src/helpers/frontend/calendar.js @@ -19,7 +19,7 @@ export async function getCaldavAccountsfromServer() } return new Promise( (resolve, reject) => { - try{ + const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ @@ -27,11 +27,9 @@ export async function getCaldavAccountsfromServer() return resolve(body) - }); - }catch(e) - { + }).catch(e =>{ return resolve(getErrorResponse(e)) - } + }) }) @@ -50,7 +48,6 @@ export async function caldavAccountsfromServer() return new Promise( (resolve, reject) => { - try{ const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ @@ -71,13 +68,11 @@ export async function caldavAccountsfromServer() } - }); - - }catch(e) - { - logVar(e, "caldavAccountsfromServer") - return resolve(null) - } + }).catch(e => + { + logVar(e, "caldavAccountsfromServer") + return resolve(null) + }) }) } @@ -97,20 +92,16 @@ export async function getLatestCalendarEvents(caldav_accounts_id, calendars_id, } return new Promise( (resolve, reject) => { - try{ const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ //Save the events to db. return resolve(body) - }); - - } - catch(e) - { - return resolve(getErrorResponse(e)) - } + }).catch(e => + { + return resolve(getErrorResponse(e)) + }) }) } @@ -136,7 +127,7 @@ export async function getAllEvents(filters) } return new Promise( (resolve, reject) => { - try{ + const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ @@ -144,12 +135,9 @@ export async function getAllEvents(filters) return resolve(body) - }); - - }catch(e) - { - return resolve(getErrorResponse(e)) - } + }).catch(e =>{ + return resolve(getErrorResponse(e)) + }) }) } diff --git a/src/helpers/frontend/classes/FilterHelper.js b/src/helpers/frontend/classes/FilterHelper.js index 214b994..e71b34e 100644 --- a/src/helpers/frontend/classes/FilterHelper.js +++ b/src/helpers/frontend/classes/FilterHelper.js @@ -23,21 +23,15 @@ export class FilterHelper{ } return new Promise( (resolve, reject) => { - try{ const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ - return resolve(body) - + return resolve(body) } - ) - - } - catch(e) - { - logVar(e, "deleteFromServer") + ).catch(e =>{ + console.error("deleteFromServer",e) return resolve(getErrorResponse(e)) - } + }) }); diff --git a/src/helpers/frontend/classes/RruleServerHelper.js b/src/helpers/frontend/classes/RruleServerHelper.js index aaa1119..1e29ce9 100644 --- a/src/helpers/frontend/classes/RruleServerHelper.js +++ b/src/helpers/frontend/classes/RruleServerHelper.js @@ -84,20 +84,17 @@ export default class RruleServerHelper extends RRuleHelper { } return new Promise((resolve, reject) => { - try{ const response = fetch(url_api, requestOptions) .then(response => { return response.json() }) .then((body) => { + throw new Error("asdasd") return resolve(body) - }) - - }catch(e) - { - logVar(e, "getRepeatRuleFromServer") + }).catch(e =>{ + console.error("getRepeatRuleFromServer", e) return resolve(getErrorResponse(e)) - } + }) }) @@ -133,7 +130,6 @@ export default class RruleServerHelper extends RRuleHelper { */ - try{ axios({ method: 'post', url: getAPIURL() + "tasks/rrule/postrepeatobj", @@ -145,16 +141,13 @@ export default class RruleServerHelper extends RRuleHelper { }).then(function (response) { return(response) - }) .catch(function (error) { - console.log(error); + }).catch(function (error) { + console.error("postRepeatRule", error); + return (getErrorResponse(e)) + }); - } - catch(e) - { - logVar(e, "postRepeatRule") - return (getErrorResponse(e)) - } + } diff --git a/src/helpers/frontend/cookies.js b/src/helpers/frontend/cookies.js index 8f1a1f7..fd72a6f 100644 --- a/src/helpers/frontend/cookies.js +++ b/src/helpers/frontend/cookies.js @@ -26,7 +26,6 @@ export async function getDefaultCalendarID() return new Promise( (resolve, reject) => { - try{ fetch(url_api, requestOptions) .then(response =>{ return response.json() @@ -39,14 +38,10 @@ export async function getDefaultCalendarID() }else{ return resolve('') } + }).catch(e =>{ + console.error(e, "getDefaultCalendarID") + return resolve('') }) - - } - catch(e) - { - logVar(e, "getDefaultCalendarID") - return resolve('') - } }) diff --git a/src/helpers/frontend/events.js b/src/helpers/frontend/events.js index abef5ba..f48e2fa 100644 --- a/src/helpers/frontend/events.js +++ b/src/helpers/frontend/events.js @@ -486,18 +486,15 @@ export async function updateEvent(calendar_id, url, etag, data) { headers: new Headers({ 'authorization': authorisationData, 'Content-Type': 'application/json' }), } return new Promise( (resolve, reject) => { - try { fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { return resolve(body) - }); - } - catch (e) { - logVar(e) - return resolve({success: false, data:{message: e.message}}) - } + }).catch (e =>{ + console.error(e) + return resolve({success: false, data:{message: e.message}}) + }) }) diff --git a/src/helpers/frontend/filters.js b/src/helpers/frontend/filters.js index 0e1095e..ff71238 100644 --- a/src/helpers/frontend/filters.js +++ b/src/helpers/frontend/filters.js @@ -23,21 +23,15 @@ export async function saveFiltertoServer(name, filter) mode: 'cors', headers: new Headers({'authorization': authorisationData, 'Content-Type':'application/json'}), } - try - { fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ - console.log(body) return resolve(body) - - - }); - } - catch(e) - { - this.props.onResponse(e.message) - } + }).catch(e => + { + console.error("saveFiltertoServer: ",e) + return resolve(getErrorResponse(e.message)) + }) }) @@ -60,21 +54,17 @@ export async function makeFilterEditRequest(filterid, name, finalFilter) mode: 'cors', headers: new Headers({'authorization': authorisationData, 'Content-Type':'application/json'}), } - try - { + fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ return resolve(body) - }); - } - catch(e) - { - console.log(e.message) - return resolve(null) - } + }).catch(e =>{ + console.error(e) + return resolve(getErrorResponse(e)) + }) }) @@ -181,19 +171,16 @@ export async function getFiltersFromServer() } return new Promise( (resolve, reject) => { - try{ const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ return resolve(body) } - ) - }catch(e) - { - logVar(e, "getFiltersFromServer") + ).catch(e =>{ + console.error("getFiltersFromServer",e) return resolve(getErrorResponse(e)) - } + }) }); diff --git a/src/helpers/frontend/ics.js b/src/helpers/frontend/ics.js index d7482a4..41715e5 100644 --- a/src/helpers/frontend/ics.js +++ b/src/helpers/frontend/ics.js @@ -20,7 +20,7 @@ export async function makeGenerateICSRequest(eventObj) } return new Promise( (resolve, reject) => { - try{ + fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ @@ -40,13 +40,11 @@ export async function makeGenerateICSRequest(eventObj) return resolve(null) } + }).catch(e =>{ + console.error("makeGenerateICSRequest", e) + + return resolve(null) }) - } - catch(e) - { - return resolve(null) - logVar(e, "makeGenerateICSRequest" ) - } }) @@ -185,21 +183,19 @@ export async function makeParseICSRequest(data,type) headers: new Headers({ 'authorization': authorisationData, 'Content-Type': 'application/json' }), } return new Promise( (resolve, reject) => { - try { + + fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { - console.log("body", body) return resolve(body) + }).catch(e =>{ + console.error("makeParseICSRequest", e) + return resolve({ + success:false, + data:{message:e.message, details:e} + }) }) - } - catch(e) - { - return resolve({ - success:false, - data:{message:e.message, details:e} - }) - } }) } \ No newline at end of file diff --git a/src/helpers/frontend/labels.js b/src/helpers/frontend/labels.js index 03a19ae..b6bdece 100644 --- a/src/helpers/frontend/labels.js +++ b/src/helpers/frontend/labels.js @@ -80,11 +80,9 @@ export async function getLabelsFromServer() return new Promise( (resolve, reject) => { - try{ const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ - //Save the events to db. if(body!=null && body.data.message!=null) { var labels= body.data.message @@ -97,14 +95,10 @@ export async function getLabelsFromServer() } - }); - - } - catch(e) - { - logVar(e, "getLabelsFromServer") - return resolve(null) - } + }).catch(e =>{ + console.error("getLabelsFromServer", e) + return resolve(null) + }) }) } export async function makeUpdateLabelRequest() @@ -120,19 +114,14 @@ export async function makeUpdateLabelRequest() } return new Promise( (resolve, reject) => { - try{ const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ return resolve(body) - }); - - } - catch(e) - { - logVar(e, "makeUpdateLabelRequest") + }).catch(e =>{ + console.error("makeUpdateLabelRequest", e) return resolve(getErrorResponse(e)) - } + }) }) } diff --git a/src/helpers/frontend/sync.js b/src/helpers/frontend/sync.js index f3f6270..ace62b6 100644 --- a/src/helpers/frontend/sync.js +++ b/src/helpers/frontend/sync.js @@ -1,3 +1,4 @@ +import { toast } from "react-toastify" import { getErrorResponse } from "../errros" import { getAPIURL, isValidResultArray, logVar } from "../general" import { caldavAccountsfromServer } from "./calendar" @@ -17,18 +18,17 @@ export async function makeSyncRequest() } return new Promise( (resolve, reject) => { - try{ + const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ return resolve(body) - }) + }).catch(e =>{ + console.error("makeSyncRequest", e) + return resolve(getErrorResponse(e)) - }catch(e) - { - logVar(e, "makeSyncRequest") - return resolve(getErrorResponse(e)) - } + }) + }) } @@ -76,18 +76,18 @@ export async function refreshEventsinDB(caldav_accounts_id) } return new Promise( (resolve, reject) => { - try{ - const response = fetch(url_api, requestOptions) - .then(response => response.json()) - .then((body) =>{ - return resolve(body) - }) - - }catch(e) - { + + const response = fetch(url_api, requestOptions) + .then(response => response.json()) + .then((body) =>{ + return resolve(body) + }).catch(e =>{ logVar(e, "refreshEventsinDB") return resolve(getErrorResponse(e)) - } + + }) + + }) } @@ -108,18 +108,18 @@ export async function refreshCalendarList() return new Promise( (resolve, reject) => { - try{ + const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ + console.log("refreshCalendarList", body) return resolve(body) + }).catch(e =>{ + logVar(e, "refreshCalendarList") + return resolve(getErrorResponse(e)) }) - }catch(e) - { - logVar(e, "refreshCalendarList") - return resolve(getErrorResponse(e)) - } + }) diff --git a/src/helpers/frontend/tasks.js b/src/helpers/frontend/tasks.js index f6bad38..9b67df5 100644 --- a/src/helpers/frontend/tasks.js +++ b/src/helpers/frontend/tasks.js @@ -129,23 +129,16 @@ export async function updateTodo(calendar_id, url, etag, dataObj) { } return new Promise( (resolve, reject) => { - try { fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { - - return resolve(body) - - }); - - } - catch (e) { - toast.error(e.message) - return resolve(null) - - } + return resolve(body) + }).catch (e => { + toast.error(e.message) + return resolve(null) + }) }) } diff --git a/src/helpers/general.js b/src/helpers/general.js index a44728e..f9591d8 100644 --- a/src/helpers/general.js +++ b/src/helpers/general.js @@ -138,7 +138,6 @@ export function logVar(variable,tag) console.log("=====================") if(varNotEmpty(tag)) console.log(tag) if(varNotEmpty(variable)) console.log(variable) - console.log("=====================") } } diff --git a/src/i18n/strings.json b/src/i18n/strings.json index 6f347c5..666c339 100644 --- a/src/i18n/strings.json +++ b/src/i18n/strings.json @@ -157,6 +157,9 @@ "RESET_PASSWORD": "Reset your password", "RRULE_EMPTY_FREQ": "Please select a frequency of recurrence.", "SAVE": "Save", + "ERROR_UPDATE": "Error updating event. Check logs.", + "ERROR_ADDING_EVENT":"Error adding event. Check logs.", + "CANT_REACH_CALDAV_ACCOUNT":"Can't reach CalDAV account. Check logs.", "SAVING_LABEL_COLOR": "Saving label color to database...", "SCHEDULE": "Schedule", "SEARCH": "Search", diff --git a/src/pages/accounts/register.js b/src/pages/accounts/register.js index 3c8791a..4145852 100644 --- a/src/pages/accounts/register.js +++ b/src/pages/accounts/register.js @@ -110,9 +110,8 @@ class Register extends Component{ headers: new Headers({'Content-Type':'application/json'}), } - try - { - const response = await fetch(url_api, requestOptions) + + const response = await fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ console.log(body) @@ -142,12 +141,11 @@ class Register extends Component{ toast.error(this.i18next.t("ERROR_GENERIC")) } - }); - } - catch(e) + }).catch(e => { - console.log(e.message) - } + toast.error(this.i18next.t("ERROR_GENERIC")) + console.error("makeRequesttoServer",e) + }) } diff --git a/src/pages/accounts/resetpassword.js b/src/pages/accounts/resetpassword.js index 355907b..be81482 100644 --- a/src/pages/accounts/resetpassword.js +++ b/src/pages/accounts/resetpassword.js @@ -50,12 +50,10 @@ class ResetPassword extends Component{ method: 'GET', } - try{ const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ //Save the events to db. - console.log(body) if(body!=null) { if(body.success==true) @@ -90,12 +88,9 @@ class ResetPassword extends Component{ } - }); - - }catch(e) - { - logVar(e, "makeGetOTPRequest") - } + }).catch(e =>{ + console.error("makeGetOTPRequest",e) + }) } @@ -170,8 +165,7 @@ class ResetPassword extends Component{ mode: 'cors', headers: new Headers({'Content-Type':'application/json'}), } - try - { + fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ @@ -193,13 +187,10 @@ class ResetPassword extends Component{ } - }); - } - catch(e) - { - console.log(e) + }).catch(e =>{ + console.error("makePassResetRequest", e) toast.error(e.message) - } + }) diff --git a/src/pages/accounts/settings.js b/src/pages/accounts/settings.js index d88a22b..932d7e1 100644 --- a/src/pages/accounts/settings.js +++ b/src/pages/accounts/settings.js @@ -49,7 +49,6 @@ class Settings extends Component { headers: new Headers({ 'authorization': authorisationData }), } - try{ fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { @@ -88,14 +87,11 @@ class Settings extends Component { toast.error(this.state.i18next.t("ERROR_GETTING_SETTINGS")) } - }) - - }catch(e) - { - logVar(e, "getAllUserSettings") - toast.error(this.state.i18next.t("ERROR_GETTING_SETTINGS")) + }).catch(e =>{ + console.error("getAllUserSettings", e) + toast.error(this.i18next.t("ERROR_GETTING_SETTINGS")) - } + }) } @@ -114,7 +110,6 @@ class Settings extends Component { headers: new Headers({ 'authorization': authorisationData }), } - try{ fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { @@ -170,19 +165,15 @@ class Settings extends Component { } } else { - toast.error(this.state.i18next.t("ERROR_GENERIC")) + toast.error(this.i18next.t("ERROR_GENERIC")) } - }); - - } - catch(e) - { - toast.error(this.state.i18next.t("ERROR_GENERIC")) - logVar(e, "getUserInfo") - } + }).catch(e =>{ + toast.error(this.i18next.t("ERROR_GENERIC")) + console.error( "getUserInfo" ,e) + }) @@ -218,7 +209,6 @@ class Settings extends Component { mode: 'cors', headers: new Headers({ 'authorization': authorisationData, 'Content-Type': 'application/json' }), } - try { fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { @@ -234,11 +224,10 @@ class Settings extends Component { } this.getAllUserSettings() - }); - } - catch (e) { - toast.error(e.message) - } + }).catch (e => { + console.error("updateDefaultCalendaronServer",e) + toast.error(e.message) + }) } allowRegChanged(e) @@ -267,7 +256,6 @@ class Settings extends Component { mode: 'cors', headers: new Headers({ 'authorization': authorisationData, 'Content-Type': 'application/json' }), } - try { fetch(url_api, requestOptions) .then(response => response.json()) .then((body) => { @@ -276,17 +264,15 @@ class Settings extends Component { toast.success(this.i18next.t("UPDATE_OK")) }else{ toast.success(this.i18next.t("ERROR_GENERIC")) - console.log("Setting update response GLOBAL_DISABLE_USER_REGISTRATION:") + console.error("Setting update response GLOBAL_DISABLE_USER_REGISTRATION:") console.error(body) } - }); - } - catch (e) { - toast.error(e.message) - } + }).catch (e => { + toast.error(e.message) + }) } diff --git a/src/pages/api/caldav/calendars/add/event.js b/src/pages/api/caldav/calendars/add/event.js index de6f924..b6d9654 100644 --- a/src/pages/api/caldav/calendars/add/event.js +++ b/src/pages/api/caldav/calendars/add/event.js @@ -60,7 +60,7 @@ export default async function handler(req, res) { else { console.log(response) - res.status(200).json({ success: false, data: {message: 'ERROR_UPDATE', details: response.result.statusText}}) + res.status(500).json({ success: false, data: {message: 'ERROR_ADDING_EVENT', details: response.result.statusText}}) } diff --git a/src/pages/api/caldav/calendars/events/all.js b/src/pages/api/caldav/calendars/events/all.js index 0ed8773..ff637bf 100644 --- a/src/pages/api/caldav/calendars/events/all.js +++ b/src/pages/api/caldav/calendars/events/all.js @@ -31,12 +31,14 @@ export default async function handler(req, res) { if(caldav_accounts[i].caldav_accounts_id==req.query.caldav_accounts_id) { - var client = await getCaldavClient(caldav_accounts[i].caldav_accounts_id) - logVar(client, LOGTAG) + var client = await getCaldavClient(caldav_accounts[i].caldav_accounts_id).catch(e =>{ + console.error(e) + + }) const allCalendarsinCaldavAccount= await getCalendarsfromCaldavAccountsID(caldav_accounts[i].caldav_accounts_id) logVar(allCalendarsinCaldavAccount, LOGTAG+": allCalendarsinCaldavAccount") - if(allCalendarsinCaldavAccount!=null && Array.isArray(allCalendarsinCaldavAccount) && allCalendarsinCaldavAccount.length>0) + if(allCalendarsinCaldavAccount!=null && Array.isArray(allCalendarsinCaldavAccount) && allCalendarsinCaldavAccount.length>0 && client!=null) { //Pull all calendar objects from Remote CALDAV. for(let j=0; j{ + console.log("createDAVClient:", e) + }) - const response_caldav = await client.deleteCalendarObject({ - calendarObject: { - url: req.body.url, - etag: req.body.etag, - }, - }); - // Now we delete object from DB (which means, just set it as DELETED) - const response = await deleteCalendarObjectsFromDB(req.body.url, req.body.calendar_id) + if(client!=null && client!=undefined){ + const response_caldav = await client.deleteCalendarObject({ + calendarObject: { + url: req.body.url, + etag: req.body.etag, + }, + }).catch(e =>{ + console.log(e) + }) + + if(response_caldav!=null){ + // Now we delete object from DB (which means, just set it as DELETED) + + const response = await deleteCalendarObjectsFromDB(req.body.url, req.body.calendar_id) + + res.status(200).json({ success: true, data: { message: "DELETE_OK", detail: response_caldav} }) + + }else{ + res.status(500).json({ success: false, data: { message: "ERROR_GENERIC", detail: "Check logs."} }) + + } + + }else{ + res.status(401).json({ success: false, data: { message: "CANT_REACH_CALDAV_ACCOUNT", detail: "No access to Caldav Account."} }) - res.status(200).json({ success: true, data: { message: "DELETE_OK", detail: response_caldav} }) + } }else{ res.status(401).json({ success: false, data: { message: 'CALENDAR_NOT_ACCESSIBLE'} }) diff --git a/src/pages/api/calendars/refresh.js b/src/pages/api/calendars/refresh.js index d91c8c4..b7257f7 100644 --- a/src/pages/api/calendars/refresh.js +++ b/src/pages/api/calendars/refresh.js @@ -40,6 +40,7 @@ export default async function handler(req, res) { if(client!=null && typeof(client)== 'object') { + finalResponse.push({url: caldav_accounts[i].url, status: "ok"}) const calendars = await client.fetchCalendars() logVar(calendars, "calendars: "+LOGTAG) @@ -94,13 +95,13 @@ export default async function handler(req, res) { }else{ - res.status(401).json({ success: false, data: { message: "INVALID_CALDAV_ACCOUNT" }}) - + finalResponse.push({url: caldav_accounts[i].url, status: "error"}) + } } - res.status(200).json({ success: true, data: { message: "REFRESH_OK" }}) + res.status(200).json({ success: true, data: { message: "REFRESH_OK", details: finalResponse }}) diff --git a/src/pages/api/install/check.js b/src/pages/api/install/check.js index a475bac..2cbcfa8 100644 --- a/src/pages/api/install/check.js +++ b/src/pages/api/install/check.js @@ -1,15 +1,9 @@ -import Settings from "@/helpers/api/classes/Settings" -import { User } from "@/helpers/api/classes/User" -import { getConnectionVar } from "@/helpers/api/db" -import { getICS } from "@/helpers/api/ical" -import { getInstallDateFromDB, isInstalled, testDBConnection, testDBConnectionSimple } from "@/helpers/api/install" -import { middleWareForAuthorisation } from "@/helpers/api/user" +import { isInstalled, testDBConnection } from "@/helpers/api/install" import { logVar, varNotEmpty } from "@/helpers/general" -import moment from "moment" const LOGTAG = "api/install/check" export default async function handler(req, res) { if (req.method === 'GET') { - var connStatus = await testDBConnectionSimple() + var connStatus = await testDBConnection() logVar(connStatus, LOGTAG+" connStatus") if(varNotEmpty(connStatus)) { diff --git a/src/pages/install/index.js b/src/pages/install/index.js index 9798e41..9dfe833 100644 --- a/src/pages/install/index.js +++ b/src/pages/install/index.js @@ -55,7 +55,6 @@ class StartInstall extends Component{ //headers: new Headers({ 'authorization': authorisationData }), } - try{ fetch(url_api, requestOptions) .then(response => { return response.json() @@ -82,12 +81,13 @@ class StartInstall extends Component{ )}) } - }) + }).catch(e => { + console.error("installButtonClicked" ,e) + this.setState({output: ( + {this.i18next.t("ERROR_GENERIC")} + )}) - }catch(e) - { - logVar(e, "installButtonClicked") - } + }) } getInstallForm() @@ -112,7 +112,6 @@ class StartInstall extends Component{ //headers: new Headers({ 'authorization': authorisationData }), } - try{ fetch(url_api, requestOptions) .then(response => { @@ -154,13 +153,13 @@ class StartInstall extends Component{ } - }) - + }).catch(e =>{ + console.error( "checkifInstalled" , e) + this.setState({output: ( + {this.i18next.t("ERROR_GENERIC")} + )}) - }catch(e) - { - logVar(e, "checkifInstalled") - } + }) } diff --git a/src/pages/login.js b/src/pages/login.js index 4388d1a..83a6d0f 100644 --- a/src/pages/login.js +++ b/src/pages/login.js @@ -72,19 +72,14 @@ class Login extends Component{ } return new Promise( (resolve, reject) => { - try{ const response = fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ return resolve(body) - }) - - } - catch(e) - { - logVar(e, "getRegistrationStatusFromServer") + }).catch(e =>{ + console.error("getRegistrationStatusFromServer", e) return resolve(getErrorResponse(e)) - } + }) }) } @@ -131,21 +126,17 @@ class Login extends Component{ headers: new Headers({'Content-Type':'application/json'}), } - try - { const response = await fetch(url_api, requestOptions) .then(response => response.json()) .then((body) =>{ - console.log(body) this.processReponse(body) - }); - } - catch(e) + }).catch(e => { - this.processReponse(getErrorResponse()) - logVar(e, "loginButtonClicked") - } + console.error("loginButtonClicked", e) + this.processReponse(getErrorResponse(e)) + + }) }