From 2e25971ecc14b811a5adb31304f10e34f01a955a Mon Sep 17 00:00:00 2001 From: Xtrah Date: Wed, 13 Apr 2022 21:15:40 +0200 Subject: [PATCH 1/7] feat: install package from npm registry --- README.md | 2 +- backend/package-lock.json | 770 +++++++++++++++++++++-------- backend/package.json | 3 +- package.json | 2 +- package/.editorconfig | 12 - package/.gitattributes | 1 - package/.github/workflows/main.yml | 22 - package/.gitignore | 2 - package/.npmrc | 1 - package/README.md | 45 -- package/customError.ts | 21 - package/index.ts | 129 ----- package/license | 9 - package/package.json | 41 -- package/test.js | 16 - 15 files changed, 574 insertions(+), 502 deletions(-) delete mode 100644 package/.editorconfig delete mode 100644 package/.gitattributes delete mode 100644 package/.github/workflows/main.yml delete mode 100644 package/.gitignore delete mode 100644 package/.npmrc delete mode 100644 package/README.md delete mode 100644 package/customError.ts delete mode 100644 package/index.ts delete mode 100644 package/license delete mode 100644 package/package.json delete mode 100644 package/test.js diff --git a/README.md b/README.md index 7eacbb3a..4682b30d 100644 --- a/README.md +++ b/README.md @@ -45,4 +45,4 @@ To run backend locally, run `npm run backend`. For more details check out [backe ### 📦 TypeScript npm package -The package is included in the `/package` folder. After development is complete it will be published to npm and can be installed with `npm install ntnui-tools`. +The package is published in the [npm registry](https://www.npmjs.com/package/ntnui-tools) and installed using `npm i ntnui-tools`. diff --git a/backend/package-lock.json b/backend/package-lock.json index 286126d5..2d151147 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -19,7 +19,7 @@ "express": "^4.17.3", "jsonwebtoken": "^8.5.1", "mongoose": "^6.2.3", - "ntnui-tools": "file:../package", + "ntnui-tools": "^0.0.2", "validation": "^0.0.1" }, "devDependencies": { @@ -33,21 +33,6 @@ "typescript": "^4.5.5" } }, - "../package": { - "name": "ntnui-tools", - "version": "0.1.0", - "license": "MIT", - "dependencies": { - "axios": "^0.26.0" - }, - "devDependencies": { - "ava": "^3.15.0", - "typescript": "^4.5.5" - }, - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -148,9 +133,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz", - "integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==" + "version": "17.0.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", + "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==" }, "node_modules/@types/qs": { "version": "6.9.7", @@ -258,9 +243,9 @@ "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, "node_modules/axios": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.0.tgz", - "integrity": "sha512-lKoGLMYtHvFrPVt3r+RBMp9nh34N0M8zEfCWqdWZx6phynIEhQqAdydpyBAAG211zlhX9Rgu08cOamy6XjE5Og==", + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", "dependencies": { "follow-redirects": "^1.14.8" } @@ -305,23 +290,26 @@ } }, "node_modules/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", + "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.8.1", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.9.7", - "raw-body": "2.4.3", - "type-is": "~1.6.18" + "on-finished": "2.4.1", + "qs": "6.10.3", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" }, "engines": { - "node": ">= 0.8" + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" } }, "node_modules/boxen": { @@ -369,9 +357,9 @@ } }, "node_modules/bson": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.1.tgz", - "integrity": "sha512-I1LQ7Hz5zgwR4QquilLNZwbhPw0Apx7i7X9kGMBTsqPdml/03Q9NBtD9nt/19ahjlphktQImrnderxqpzeVDjw==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.2.tgz", + "integrity": "sha512-VeJKHShcu1b/ugl0QiujlVuBepab714X9nNyBdA1kfekuDGecxgpTA2Z6nYbagrWFeiIyzSWIOzju3lhj+RNyQ==", "dependencies": { "buffer": "^5.6.0" }, @@ -457,6 +445,18 @@ "node": ">=8" } }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -632,9 +632,9 @@ } }, "node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", "engines": { "node": ">= 0.6" } @@ -651,14 +651,6 @@ "node": ">= 0.8.0" } }, - "node_modules/cookie-parser/node_modules/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", @@ -734,17 +726,21 @@ } }, "node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "engines": { - "node": ">= 0.6" + "node": ">= 0.8" } }, "node_modules/destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } }, "node_modules/dot-prop": { "version": "5.3.0", @@ -870,6 +866,93 @@ "node": ">= 0.10.0" } }, + "node_modules/express/node_modules/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.9.7", + "raw-body": "2.4.3", + "type-is": "~1.6.18" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/express/node_modules/cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express/node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/express/node_modules/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/express/node_modules/raw-body": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", + "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -899,6 +982,17 @@ "node": ">= 0.8" } }, + "node_modules/finalhandler/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/follow-redirects": { "version": "1.14.9", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", @@ -948,6 +1042,24 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -1010,11 +1122,22 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1024,6 +1147,17 @@ "node": ">=4" } }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-yarn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", @@ -1040,18 +1174,26 @@ "dev": true }, "node_modules/http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dependencies": { - "depd": "~1.1.2", + "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", + "statuses": "2.0.1", "toidentifier": "1.0.1" }, "engines": { - "node": ">= 0.6" + "node": ">= 0.8" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" } }, "node_modules/iconv-lite": { @@ -1263,12 +1405,9 @@ "dev": true }, "node_modules/json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dependencies": { - "minimist": "^1.2.5" - }, + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "bin": { "json5": "lib/cli.js" }, @@ -1322,9 +1461,9 @@ } }, "node_modules/kareem": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.4.tgz", - "integrity": "sha512-Vcrt8lcpVl0s8ePx634BxwRqmFo+5DcOhlmNadehxreMTIQi/9hOL/B3hZQQbK5DgMS7Lem3xABXV7/S3jy+7g==" + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.5.tgz", + "integrity": "sha512-qxCyQtp3ioawkiRNQr/v8xw9KIviMSSNmy+63Wubj7KmMn3g7noRXIZB4vPCAP+ETi2SR8eH6CvmlKZuGpoHOg==" }, "node_modules/keyv": { "version": "3.1.0", @@ -1466,19 +1605,19 @@ } }, "node_modules/mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dependencies": { - "mime-db": "1.51.0" + "mime-db": "1.52.0" }, "engines": { "node": ">= 0.6" @@ -1506,9 +1645,10 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true }, "node_modules/mongodb": { "version": "4.3.1", @@ -1528,21 +1668,21 @@ } }, "node_modules/mongodb-connection-string-url": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.5.1.tgz", - "integrity": "sha512-0GAJKc1LBXzlWPhtj9uGawIlYSkTXkgpW9wZ97b4ySEuKbE5j9a0OdLGM31AWMhRS2ut49Z0kufSYsamGEIb8Q==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.5.2.tgz", + "integrity": "sha512-tWDyIG8cQlI5k3skB6ywaEA5F9f5OntrKKsT/Lteub2zgwSUlhqEN2inGgBTm8bpYJf8QYBdA/5naz65XDpczA==", "dependencies": { "@types/whatwg-url": "^8.2.1", "whatwg-url": "^11.0.0" } }, "node_modules/mongoose": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.2.3.tgz", - "integrity": "sha512-FxF2D0MGGIw9bAJ57nSyM4Hs4tDHbu6dn9gQwT1J/lxmRB8jfaWWJ3FSJXTmeYlQ6BpyKeIaT8fj6SAX0YMNBA==", + "version": "6.2.11", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.2.11.tgz", + "integrity": "sha512-YqYAFTOqKthsFduM1IZCArIAwScFJKWoE3pEwmnR7UMw9mynEnOc6c4gBvAon+NtPdB0RAP6ppd3aOvLrVth2g==", "dependencies": { "bson": "^4.2.2", - "kareem": "2.3.4", + "kareem": "2.3.5", "mongodb": "4.3.1", "mpath": "0.8.4", "mquery": "4.0.2", @@ -1582,9 +1722,9 @@ } }, "node_modules/mquery/node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dependencies": { "ms": "2.1.2" }, @@ -1693,8 +1833,15 @@ } }, "node_modules/ntnui-tools": { - "resolved": "../package", - "link": true + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.0.2.tgz", + "integrity": "sha512-dLWIt/ElddMuEJdOqAUCvM9CaepglqVSpP7w1+trkWYXlIcXnxtTHeQTLPfvoMPAhk3oJRR5aaxiRGMqHAH9tQ==", + "dependencies": { + "axios": "^0.26.0" + }, + "engines": { + "node": ">=14.0.0" + } }, "node_modules/object-assign": { "version": "4.1.1", @@ -1704,10 +1851,18 @@ "node": ">=0.10.0" } }, + "node_modules/object-inspect": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { "ee-first": "1.1.1" }, @@ -1840,9 +1995,12 @@ } }, "node_modules/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", + "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "dependencies": { + "side-channel": "^1.0.4" + }, "engines": { "node": ">=0.6" }, @@ -1859,12 +2017,12 @@ } }, "node_modules/raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "dependencies": { "bytes": "3.1.2", - "http-errors": "1.8.1", + "http-errors": "2.0.0", "iconv-lite": "0.4.24", "unpipe": "1.0.0" }, @@ -2026,11 +2184,50 @@ "node": ">= 0.8.0" } }, + "node_modules/send/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/send/node_modules/destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "node_modules/send/node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, + "node_modules/send/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/serve-static": { "version": "1.14.2", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz", @@ -2050,6 +2247,19 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/sift": { "version": "16.0.0", "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.0.tgz", @@ -2233,9 +2443,9 @@ } }, "node_modules/typescript": { - "version": "4.5.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", - "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", + "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -2300,9 +2510,9 @@ } }, "node_modules/update-notifier/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -2528,9 +2738,9 @@ "dev": true }, "@types/node": { - "version": "17.0.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz", - "integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==" + "version": "17.0.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", + "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==" }, "@types/qs": { "version": "6.9.7", @@ -2623,9 +2833,9 @@ "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, "axios": { - "version": "0.26.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.0.tgz", - "integrity": "sha512-lKoGLMYtHvFrPVt3r+RBMp9nh34N0M8zEfCWqdWZx6phynIEhQqAdydpyBAAG211zlhX9Rgu08cOamy6XjE5Og==", + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", "requires": { "follow-redirects": "^1.14.8" } @@ -2653,20 +2863,22 @@ "dev": true }, "body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz", + "integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.8.1", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.9.7", - "raw-body": "2.4.3", - "type-is": "~1.6.18" + "on-finished": "2.4.1", + "qs": "6.10.3", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" } }, "boxen": { @@ -2705,9 +2917,9 @@ } }, "bson": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.1.tgz", - "integrity": "sha512-I1LQ7Hz5zgwR4QquilLNZwbhPw0Apx7i7X9kGMBTsqPdml/03Q9NBtD9nt/19ahjlphktQImrnderxqpzeVDjw==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.2.tgz", + "integrity": "sha512-VeJKHShcu1b/ugl0QiujlVuBepab714X9nNyBdA1kfekuDGecxgpTA2Z6nYbagrWFeiIyzSWIOzju3lhj+RNyQ==", "requires": { "buffer": "^5.6.0" } @@ -2763,6 +2975,15 @@ } } }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, "camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -2890,9 +3111,9 @@ "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" }, "cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==" + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" }, "cookie-parser": { "version": "1.4.6", @@ -2901,13 +3122,6 @@ "requires": { "cookie": "0.4.1", "cookie-signature": "1.0.6" - }, - "dependencies": { - "cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" - } } }, "cookie-signature": { @@ -2970,14 +3184,14 @@ "integrity": "sha512-tfiWc6BQLXNLpNiR5iGd0Ocu3P3VpxfzFiqubLgMfhfOw9WyvgJBd46CClNn9k3qfbjvT//0cf7AlYRX/OslMQ==" }, "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" }, "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, "dot-prop": { "version": "5.3.0", @@ -3083,6 +3297,71 @@ "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" + }, + "dependencies": { + "body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", + "requires": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.9.7", + "raw-body": "2.4.3", + "type-is": "~1.6.18" + } + }, + "cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==" + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==" + }, + "raw-body": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", + "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "requires": { + "bytes": "3.1.2", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + } } }, "fill-range": { @@ -3106,6 +3385,16 @@ "parseurl": "~1.3.3", "statuses": "~1.5.0", "unpipe": "~1.0.0" + }, + "dependencies": { + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + } } }, "follow-redirects": { @@ -3130,6 +3419,21 @@ "dev": true, "optional": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", @@ -3177,17 +3481,30 @@ } }, "graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, "has-yarn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", @@ -3201,15 +3518,22 @@ "dev": true }, "http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "requires": { - "depd": "~1.1.2", + "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", + "statuses": "2.0.1", "toidentifier": "1.0.1" + }, + "dependencies": { + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" + } } }, "iconv-lite": { @@ -3356,12 +3680,9 @@ "dev": true }, "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "requires": { - "minimist": "^1.2.5" - } + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==" }, "jsonwebtoken": { "version": "8.5.1", @@ -3407,9 +3728,9 @@ } }, "kareem": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.4.tgz", - "integrity": "sha512-Vcrt8lcpVl0s8ePx634BxwRqmFo+5DcOhlmNadehxreMTIQi/9hOL/B3hZQQbK5DgMS7Lem3xABXV7/S3jy+7g==" + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.5.tgz", + "integrity": "sha512-qxCyQtp3ioawkiRNQr/v8xw9KIviMSSNmy+63Wubj7KmMn3g7noRXIZB4vPCAP+ETi2SR8eH6CvmlKZuGpoHOg==" }, "keyv": { "version": "3.1.0", @@ -3523,16 +3844,16 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==" + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" }, "mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "requires": { - "mime-db": "1.51.0" + "mime-db": "1.52.0" } }, "mimic-response": { @@ -3551,9 +3872,10 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true }, "mongodb": { "version": "4.3.1", @@ -3568,21 +3890,21 @@ } }, "mongodb-connection-string-url": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.5.1.tgz", - "integrity": "sha512-0GAJKc1LBXzlWPhtj9uGawIlYSkTXkgpW9wZ97b4ySEuKbE5j9a0OdLGM31AWMhRS2ut49Z0kufSYsamGEIb8Q==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.5.2.tgz", + "integrity": "sha512-tWDyIG8cQlI5k3skB6ywaEA5F9f5OntrKKsT/Lteub2zgwSUlhqEN2inGgBTm8bpYJf8QYBdA/5naz65XDpczA==", "requires": { "@types/whatwg-url": "^8.2.1", "whatwg-url": "^11.0.0" } }, "mongoose": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.2.3.tgz", - "integrity": "sha512-FxF2D0MGGIw9bAJ57nSyM4Hs4tDHbu6dn9gQwT1J/lxmRB8jfaWWJ3FSJXTmeYlQ6BpyKeIaT8fj6SAX0YMNBA==", + "version": "6.2.11", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.2.11.tgz", + "integrity": "sha512-YqYAFTOqKthsFduM1IZCArIAwScFJKWoE3pEwmnR7UMw9mynEnOc6c4gBvAon+NtPdB0RAP6ppd3aOvLrVth2g==", "requires": { "bson": "^4.2.2", - "kareem": "2.3.4", + "kareem": "2.3.5", "mongodb": "4.3.1", "mpath": "0.8.4", "mquery": "4.0.2", @@ -3611,9 +3933,9 @@ }, "dependencies": { "debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { "ms": "2.1.2" } @@ -3692,11 +4014,11 @@ "dev": true }, "ntnui-tools": { - "version": "file:../package", + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.0.2.tgz", + "integrity": "sha512-dLWIt/ElddMuEJdOqAUCvM9CaepglqVSpP7w1+trkWYXlIcXnxtTHeQTLPfvoMPAhk3oJRR5aaxiRGMqHAH9tQ==", "requires": { - "ava": "^3.15.0", - "axios": "^0.26.0", - "typescript": "^4.5.5" + "axios": "^0.26.0" } }, "object-assign": { @@ -3704,10 +4026,15 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, + "object-inspect": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==" + }, "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "requires": { "ee-first": "1.1.1" } @@ -3809,9 +4136,12 @@ } }, "qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==" + "version": "6.10.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", + "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "requires": { + "side-channel": "^1.0.4" + } }, "range-parser": { "version": "1.2.1", @@ -3819,12 +4149,12 @@ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" }, "raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "requires": { "bytes": "3.1.2", - "http-errors": "1.8.1", + "http-errors": "2.0.0", "iconv-lite": "0.4.24", "unpipe": "1.0.0" } @@ -3946,10 +4276,40 @@ "statuses": "~1.5.0" }, "dependencies": { + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + } + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } } } }, @@ -3969,6 +4329,16 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, "sift": { "version": "16.0.0", "resolved": "https://registry.npmjs.org/sift/-/sift-16.0.0.tgz", @@ -4105,9 +4475,9 @@ } }, "typescript": { - "version": "4.5.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", - "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", + "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", "dev": true }, "undefsafe": { @@ -4153,9 +4523,9 @@ }, "dependencies": { "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" diff --git a/backend/package.json b/backend/package.json index 4649a079..20df07df 100644 --- a/backend/package.json +++ b/backend/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "private": true, "author": "NTNUI", + "type": "module", "description": "NTNUI Admin application form backend", "repository": { "type": "git", @@ -24,7 +25,7 @@ "express": "^4.17.3", "jsonwebtoken": "^8.5.1", "mongoose": "^6.2.3", - "ntnui-tools": "file:../package", + "ntnui-tools": "^0.0.2", "validation": "^0.0.1" }, "main": "app.ts", diff --git a/package.json b/package.json index 15dc786f..7b135def 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "prefrontend": "cd frontend && npm install", "frontend": "cd frontend && npm run start", - "prebackend": "cd package && npm install && cd ../backend && npm install", + "prebackend": "cd backend && npm install", "backend": "cd backend && npx nodemon --exec npx ts-node app.ts", "test": "echo \"Error: no test specified\" && exit 1", "prettier": "npm install && prettier --check .", diff --git a/package/.editorconfig b/package/.editorconfig deleted file mode 100644 index 1c6314a3..00000000 --- a/package/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -indent_style = tab -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.yml] -indent_style = space -indent_size = 2 diff --git a/package/.gitattributes b/package/.gitattributes deleted file mode 100644 index 6313b56c..00000000 --- a/package/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto eol=lf diff --git a/package/.github/workflows/main.yml b/package/.github/workflows/main.yml deleted file mode 100644 index 082c2453..00000000 --- a/package/.github/workflows/main.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: CI -on: - - push - - pull_request -jobs: - test: - name: Node.js ${{ matrix.node-version }} - runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - node-version: - - 16 - - 14 - - 12 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - - run: npm install - - run: npm test diff --git a/package/.gitignore b/package/.gitignore deleted file mode 100644 index 239ecff1..00000000 --- a/package/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -yarn.lock diff --git a/package/.npmrc b/package/.npmrc deleted file mode 100644 index 43c97e71..00000000 --- a/package/.npmrc +++ /dev/null @@ -1 +0,0 @@ -package-lock=false diff --git a/package/README.md b/package/README.md deleted file mode 100644 index 79983376..00000000 --- a/package/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# ntnui-tools - -An npm package with a collection of useful tools for using NTNUI API. - -## Development - - - -## Installation - - - -## Usage - -```js -import unicornFun from 'ntnui-tools' - -unicornFun('unicorns') -//=> 'unicorns & rainbows' -``` - -## Methods - -### unicornFun(input, options?) - -#### input - -Type: `string` - -Lorem ipsum. - -#### options - -Type: `object` - -##### postfix - -Type: `string`\ -Default: `rainbows` - -Lorem ipsum. diff --git a/package/customError.ts b/package/customError.ts deleted file mode 100644 index bff96ece..00000000 --- a/package/customError.ts +++ /dev/null @@ -1,21 +0,0 @@ -export class CustomError extends Error { - message!: string - - status!: number - - additionalInfo!: any - - constructor(message: string, status: number = 500, additionalInfo: any = {}) { - super() - this.message = message - this.status = status - this.additionalInfo = additionalInfo - Object.setPrototypeOf(this, CustomError.prototype) - } -} - -export const UnauthorizedUserError: CustomError = new CustomError( - 'Unauthorized user', - 401 -) -export const BadRequestError: CustomError = new CustomError('Bad request', 400) diff --git a/package/index.ts b/package/index.ts deleted file mode 100644 index 4c51d1a9..00000000 --- a/package/index.ts +++ /dev/null @@ -1,129 +0,0 @@ -import axios from 'axios' -import { - BadRequestError, - CustomError, - UnauthorizedUserError, -} from './customError' - -axios.defaults.baseURL = 'https://dev.api.ntnui.no/' // TODO: GET FROM ENV OR CONFIG - -type IGroupPageResult = { - data: { - membership: { - type: string - } - } -} - -async function getRoleInGroup( - group_slug: string, - token: string -): Promise { - return axios - .get(`/groups/${group_slug}`, { - headers: { Authorization: `Bearer ${token}` }, - }) - .then((retrievedGroup: IGroupPageResult) => { - const group = retrievedGroup.data - if (group.membership) { - return group.membership.type - } - return null - }) - .catch((err) => { - // Could not find group in NTNUI membership system - if (err.response.status === 404) { - return null - } - throw new CustomError('Could not get role in group', 500) - }) -} - -type INtnuiTokens = { - access: string - refresh: string -} - -interface ITokenResponse { - data: { - refresh: string - access: string - } -} - -async function getNtnuiToken( - phone_number: string, - password: string -): Promise { - return axios - .post('token/', { - phone_number, - password, - }) - .then((tokenRes: ITokenResponse) => ({ - access: tokenRes.data.access, - refresh: tokenRes.data.refresh, - })) - .catch((err) => { - if (err.response.status === 401) { - throw UnauthorizedUserError - } else if (err.response.status === 400) { - throw BadRequestError - } - throw new CustomError('Unexpected error.', 500) - }) -} - -async function isValidNtnuiToken(token: string): Promise { - return axios - .post('token/verify/', { - token, - }) - .then(() => true) - .catch(() => false) -} - -interface IAccessTokenResponse { - data: { - access: string - } -} - -interface INtnuiAccessToken { - access: string -} - -async function refreshNtnuiToken(token: string): Promise { - return axios - .post('token/refresh/', { - refresh: token, - }) - .then((tokenRes: IAccessTokenResponse) => ({ - access: tokenRes.data.access, - })) - .catch((err) => { - if (err.response.status === 401) { - throw new CustomError('Invalid token.', 401) - } else if (err.response.status === 400) { - throw BadRequestError - } - throw new CustomError('Unexpected error.', 500) - }) -} - -interface IUserProfileResponse { - data: { first_name: string; last_name: string } -} - -async function getNtnuiProfile(token: string): Promise { - return axios.get('users/profile', { - headers: { Authorization: `Bearer ${token}` }, - }) -} -export { - getNtnuiProfile, - getRoleInGroup, - getNtnuiToken, - isValidNtnuiToken, - refreshNtnuiToken, -} diff --git a/package/license b/package/license deleted file mode 100644 index cefe07f3..00000000 --- a/package/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) NTNUI Sprint (https://ntnui.no) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/package/package.json b/package/package.json deleted file mode 100644 index cbcabe97..00000000 --- a/package/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "ntnui-tools", - "version": "0.1.0", - "description": "An npm module with collection of tools for utilizing NTNUI API.", - "license": "MIT", - "repository": "NTNUI/ntnui-tools", - "author": { - "name": "Sprint", - "email": "sprint@ntnui.no", - "url": "https://ntnui.no" - }, - "exports": { - ".": "./index.ts", - "./customError": "./customError.ts" - }, - "engines": { - "node": ">=14.0.0" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "files": [ - "index.ts", - "customError.ts" - ], - "keywords": [ - "ntnui", - "ntnui-tools", - "ntnui-client", - "ntnui-api", - "ntnui-api-tools", - "ntnui-api-client" - ], - "dependencies": { - "axios": "^0.26.0" - }, - "devDependencies": { - "ava": "^3.15.0", - "typescript": "^4.5.5" - } -} diff --git a/package/test.js b/package/test.js deleted file mode 100644 index ce6c47a5..00000000 --- a/package/test.js +++ /dev/null @@ -1,16 +0,0 @@ -import test from 'ava' -import unicornFun from './index.js' - -test('main', (t) => { - t.throws( - () => { - unicornFun(123) - }, - { - instanceOf: TypeError, - message: 'Expected a string, got number', - } - ) - - t.is(unicornFun('unicorns'), 'unicorns & rainbows') -}) From 263ec5d4ea127d7e8d73bd84fc551feeeef15d5b Mon Sep 17 00:00:00 2001 From: Xtrah Date: Mon, 18 Apr 2022 14:40:27 +0200 Subject: [PATCH 2/7] remove type module --- backend/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/package.json b/backend/package.json index 20df07df..a18700a9 100644 --- a/backend/package.json +++ b/backend/package.json @@ -3,7 +3,6 @@ "version": "0.1.0", "private": true, "author": "NTNUI", - "type": "module", "description": "NTNUI Admin application form backend", "repository": { "type": "git", From 3c4f90d48e8a10a9d4a0b8e4f0a27657962f7b5b Mon Sep 17 00:00:00 2001 From: Xtrah Date: Tue, 19 Apr 2022 13:10:53 +0200 Subject: [PATCH 3/7] Import using /dist/customError --- backend/controllers/admissionPeriodController.ts | 2 +- backend/controllers/applicationController.ts | 5 ++++- backend/controllers/authController.ts | 5 ++++- backend/controllers/committeeController.ts | 5 ++++- backend/controllers/statusController.ts | 5 ++++- backend/controllers/userController.ts | 2 +- backend/utils/authorizationMiddleware.ts | 5 ++++- backend/utils/errorHandler.ts | 2 +- backend/utils/isApplicationPeriodActive.ts | 2 +- backend/utils/userCommittee.ts | 2 +- 10 files changed, 25 insertions(+), 10 deletions(-) diff --git a/backend/controllers/admissionPeriodController.ts b/backend/controllers/admissionPeriodController.ts index 99c2a0a1..4b390095 100644 --- a/backend/controllers/admissionPeriodController.ts +++ b/backend/controllers/admissionPeriodController.ts @@ -1,5 +1,5 @@ import { Request, Response } from 'express' -import { UnauthorizedUserError } from 'ntnui-tools/customError' +import { UnauthorizedUserError } from 'ntnui-tools/dist/customError' import dayjs from 'dayjs' import { AdmissionPeriodModel } from '../models/AdmissionPeriod' import { getUserCommitteeIdsByUserId } from '../utils/userCommittee' diff --git a/backend/controllers/applicationController.ts b/backend/controllers/applicationController.ts index cba6aaaf..f08fe2ae 100644 --- a/backend/controllers/applicationController.ts +++ b/backend/controllers/applicationController.ts @@ -1,5 +1,8 @@ import { NextFunction, Request, Response } from 'express' -import { CustomError, UnauthorizedUserError } from 'ntnui-tools/customError' +import { + CustomError, + UnauthorizedUserError, +} from 'ntnui-tools/dist/customError' import { RequestWithNtnuiNo } from '../utils/request' import { ApplicationModel, IApplication } from '../models/Application' import { UserModel } from '../models/User' diff --git a/backend/controllers/authController.ts b/backend/controllers/authController.ts index 2fb6f3d5..aa3517a6 100644 --- a/backend/controllers/authController.ts +++ b/backend/controllers/authController.ts @@ -7,7 +7,10 @@ import { refreshNtnuiToken, getNtnuiProfile, } from 'ntnui-tools' -import { CustomError, UnauthorizedUserError } from 'ntnui-tools/customError' +import { + CustomError, + UnauthorizedUserError, +} from 'ntnui-tools/dist/customError' import { CommitteeModel } from '../models/Committee' import { MembershipType } from '../utils/enums' import { IRoleInCommittee, UserModel } from '../models/User' diff --git a/backend/controllers/committeeController.ts b/backend/controllers/committeeController.ts index 7c1858ad..15b19019 100644 --- a/backend/controllers/committeeController.ts +++ b/backend/controllers/committeeController.ts @@ -1,5 +1,8 @@ import { NextFunction, Request, Response } from 'express' -import { CustomError, UnauthorizedUserError } from 'ntnui-tools/customError' +import { + CustomError, + UnauthorizedUserError, +} from 'ntnui-tools/dist/customError' import { CommitteeModel } from '../models/Committee' import MAIN_BOARD_ID from '../utils/constants' import { RequestWithNtnuiNo } from '../utils/request' diff --git a/backend/controllers/statusController.ts b/backend/controllers/statusController.ts index 09841073..fc88df51 100644 --- a/backend/controllers/statusController.ts +++ b/backend/controllers/statusController.ts @@ -1,5 +1,8 @@ import { NextFunction, Response } from 'express' -import { CustomError, UnauthorizedUserError } from 'ntnui-tools/customError' +import { + CustomError, + UnauthorizedUserError, +} from 'ntnui-tools/dist/customError' import { RequestWithNtnuiNo } from '../utils/request' import { IUser, UserModel } from '../models/User' import { StatusModel } from '../models/Status' diff --git a/backend/controllers/userController.ts b/backend/controllers/userController.ts index 2ce24ad3..d36c8739 100644 --- a/backend/controllers/userController.ts +++ b/backend/controllers/userController.ts @@ -1,5 +1,5 @@ import { NextFunction, Response } from 'express' -import { UnauthorizedUserError } from 'ntnui-tools/customError' +import { UnauthorizedUserError } from 'ntnui-tools/dist/customError' import { RequestWithNtnuiNo } from '../utils/request' import { UserModel } from '../models/User' diff --git a/backend/utils/authorizationMiddleware.ts b/backend/utils/authorizationMiddleware.ts index bed0d4d8..a4935450 100644 --- a/backend/utils/authorizationMiddleware.ts +++ b/backend/utils/authorizationMiddleware.ts @@ -1,7 +1,10 @@ import { Response, NextFunction } from 'express' import jsonwebtoken from 'jsonwebtoken' import { isValidNtnuiToken, refreshNtnuiToken } from 'ntnui-tools' -import { CustomError, UnauthorizedUserError } from 'ntnui-tools/customError' +import { + CustomError, + UnauthorizedUserError, +} from 'ntnui-tools/dist/customError' import { RequestWithNtnuiNo } from './request' /** diff --git a/backend/utils/errorHandler.ts b/backend/utils/errorHandler.ts index ab9e7e22..11111165 100644 --- a/backend/utils/errorHandler.ts +++ b/backend/utils/errorHandler.ts @@ -1,5 +1,5 @@ import { Request, Response, NextFunction } from 'express' -import { CustomError } from 'ntnui-tools/customError' +import { CustomError } from 'ntnui-tools/dist/customError' /** * Custom error handler to standardize error objects returned to diff --git a/backend/utils/isApplicationPeriodActive.ts b/backend/utils/isApplicationPeriodActive.ts index 9eb8b78b..aba3f480 100644 --- a/backend/utils/isApplicationPeriodActive.ts +++ b/backend/utils/isApplicationPeriodActive.ts @@ -1,4 +1,4 @@ -import { CustomError } from 'ntnui-tools/customError' +import { CustomError } from 'ntnui-tools/dist/customError' import dayjs from 'dayjs' import { AdmissionPeriodModel } from '../models/AdmissionPeriod' diff --git a/backend/utils/userCommittee.ts b/backend/utils/userCommittee.ts index 7cb110a0..a29e84f7 100644 --- a/backend/utils/userCommittee.ts +++ b/backend/utils/userCommittee.ts @@ -1,4 +1,4 @@ -import { CustomError } from 'ntnui-tools/customError' +import { CustomError } from 'ntnui-tools/dist/customError' import { IRoleInCommittee, UserModel } from '../models/User' async function getUserCommitteeIdsByUserId(userId: number | string) { From 65fc0072f379e8af66d2a34ae80fe8fb2c3d1c37 Mon Sep 17 00:00:00 2001 From: Xtrah Date: Tue, 19 Apr 2022 13:20:25 +0200 Subject: [PATCH 4/7] Use working published version of package --- backend/package-lock.json | 14 +++++++------- backend/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/package-lock.json b/backend/package-lock.json index 2d151147..dbb9ae7a 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -19,7 +19,7 @@ "express": "^4.17.3", "jsonwebtoken": "^8.5.1", "mongoose": "^6.2.3", - "ntnui-tools": "^0.0.2", + "ntnui-tools": "^0.0.3", "validation": "^0.0.1" }, "devDependencies": { @@ -1833,9 +1833,9 @@ } }, "node_modules/ntnui-tools": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.0.2.tgz", - "integrity": "sha512-dLWIt/ElddMuEJdOqAUCvM9CaepglqVSpP7w1+trkWYXlIcXnxtTHeQTLPfvoMPAhk3oJRR5aaxiRGMqHAH9tQ==", + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.0.3.tgz", + "integrity": "sha512-EP9tVsGysKVmqPbSEpBb+paZO3GGbrXc4i0zFNqk3QY7izsgAQRv70ytbhzByd3EtDyTWQSiG2gxoMDmvN7yMw==", "dependencies": { "axios": "^0.26.0" }, @@ -4014,9 +4014,9 @@ "dev": true }, "ntnui-tools": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.0.2.tgz", - "integrity": "sha512-dLWIt/ElddMuEJdOqAUCvM9CaepglqVSpP7w1+trkWYXlIcXnxtTHeQTLPfvoMPAhk3oJRR5aaxiRGMqHAH9tQ==", + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.0.3.tgz", + "integrity": "sha512-EP9tVsGysKVmqPbSEpBb+paZO3GGbrXc4i0zFNqk3QY7izsgAQRv70ytbhzByd3EtDyTWQSiG2gxoMDmvN7yMw==", "requires": { "axios": "^0.26.0" } diff --git a/backend/package.json b/backend/package.json index a18700a9..bc7981b8 100644 --- a/backend/package.json +++ b/backend/package.json @@ -24,7 +24,7 @@ "express": "^4.17.3", "jsonwebtoken": "^8.5.1", "mongoose": "^6.2.3", - "ntnui-tools": "^0.0.2", + "ntnui-tools": "^0.0.3", "validation": "^0.0.1" }, "main": "app.ts", From 705f18d003a5c7c72cc7a79acc52c751b98931d7 Mon Sep 17 00:00:00 2001 From: Xtrah Date: Tue, 19 Apr 2022 13:48:17 +0200 Subject: [PATCH 5/7] remove dist again (: --- README.md | 2 +- backend/controllers/admissionPeriodController.ts | 2 +- backend/controllers/applicationController.ts | 5 +---- backend/controllers/authController.ts | 5 +---- backend/controllers/committeeController.ts | 5 +---- backend/controllers/statusController.ts | 5 +---- backend/controllers/userController.ts | 2 +- backend/package-lock.json | 14 +++++++------- backend/package.json | 2 +- backend/utils/authorizationMiddleware.ts | 5 +---- backend/utils/errorHandler.ts | 2 +- backend/utils/isApplicationPeriodActive.ts | 2 +- backend/utils/userCommittee.ts | 2 +- 13 files changed, 19 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 4682b30d..970618cc 100644 --- a/README.md +++ b/README.md @@ -45,4 +45,4 @@ To run backend locally, run `npm run backend`. For more details check out [backe ### 📦 TypeScript npm package -The package is published in the [npm registry](https://www.npmjs.com/package/ntnui-tools) and installed using `npm i ntnui-tools`. +The package is published to the [npm registry](https://www.npmjs.com/package/ntnui-tools) and installed using `npm i ntnui-tools`. diff --git a/backend/controllers/admissionPeriodController.ts b/backend/controllers/admissionPeriodController.ts index 4b390095..99c2a0a1 100644 --- a/backend/controllers/admissionPeriodController.ts +++ b/backend/controllers/admissionPeriodController.ts @@ -1,5 +1,5 @@ import { Request, Response } from 'express' -import { UnauthorizedUserError } from 'ntnui-tools/dist/customError' +import { UnauthorizedUserError } from 'ntnui-tools/customError' import dayjs from 'dayjs' import { AdmissionPeriodModel } from '../models/AdmissionPeriod' import { getUserCommitteeIdsByUserId } from '../utils/userCommittee' diff --git a/backend/controllers/applicationController.ts b/backend/controllers/applicationController.ts index f08fe2ae..cba6aaaf 100644 --- a/backend/controllers/applicationController.ts +++ b/backend/controllers/applicationController.ts @@ -1,8 +1,5 @@ import { NextFunction, Request, Response } from 'express' -import { - CustomError, - UnauthorizedUserError, -} from 'ntnui-tools/dist/customError' +import { CustomError, UnauthorizedUserError } from 'ntnui-tools/customError' import { RequestWithNtnuiNo } from '../utils/request' import { ApplicationModel, IApplication } from '../models/Application' import { UserModel } from '../models/User' diff --git a/backend/controllers/authController.ts b/backend/controllers/authController.ts index aa3517a6..2fb6f3d5 100644 --- a/backend/controllers/authController.ts +++ b/backend/controllers/authController.ts @@ -7,10 +7,7 @@ import { refreshNtnuiToken, getNtnuiProfile, } from 'ntnui-tools' -import { - CustomError, - UnauthorizedUserError, -} from 'ntnui-tools/dist/customError' +import { CustomError, UnauthorizedUserError } from 'ntnui-tools/customError' import { CommitteeModel } from '../models/Committee' import { MembershipType } from '../utils/enums' import { IRoleInCommittee, UserModel } from '../models/User' diff --git a/backend/controllers/committeeController.ts b/backend/controllers/committeeController.ts index 15b19019..7c1858ad 100644 --- a/backend/controllers/committeeController.ts +++ b/backend/controllers/committeeController.ts @@ -1,8 +1,5 @@ import { NextFunction, Request, Response } from 'express' -import { - CustomError, - UnauthorizedUserError, -} from 'ntnui-tools/dist/customError' +import { CustomError, UnauthorizedUserError } from 'ntnui-tools/customError' import { CommitteeModel } from '../models/Committee' import MAIN_BOARD_ID from '../utils/constants' import { RequestWithNtnuiNo } from '../utils/request' diff --git a/backend/controllers/statusController.ts b/backend/controllers/statusController.ts index fc88df51..09841073 100644 --- a/backend/controllers/statusController.ts +++ b/backend/controllers/statusController.ts @@ -1,8 +1,5 @@ import { NextFunction, Response } from 'express' -import { - CustomError, - UnauthorizedUserError, -} from 'ntnui-tools/dist/customError' +import { CustomError, UnauthorizedUserError } from 'ntnui-tools/customError' import { RequestWithNtnuiNo } from '../utils/request' import { IUser, UserModel } from '../models/User' import { StatusModel } from '../models/Status' diff --git a/backend/controllers/userController.ts b/backend/controllers/userController.ts index d36c8739..2ce24ad3 100644 --- a/backend/controllers/userController.ts +++ b/backend/controllers/userController.ts @@ -1,5 +1,5 @@ import { NextFunction, Response } from 'express' -import { UnauthorizedUserError } from 'ntnui-tools/dist/customError' +import { UnauthorizedUserError } from 'ntnui-tools/customError' import { RequestWithNtnuiNo } from '../utils/request' import { UserModel } from '../models/User' diff --git a/backend/package-lock.json b/backend/package-lock.json index dbb9ae7a..fd677667 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -19,7 +19,7 @@ "express": "^4.17.3", "jsonwebtoken": "^8.5.1", "mongoose": "^6.2.3", - "ntnui-tools": "^0.0.3", + "ntnui-tools": "^0.1.0", "validation": "^0.0.1" }, "devDependencies": { @@ -1833,9 +1833,9 @@ } }, "node_modules/ntnui-tools": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.0.3.tgz", - "integrity": "sha512-EP9tVsGysKVmqPbSEpBb+paZO3GGbrXc4i0zFNqk3QY7izsgAQRv70ytbhzByd3EtDyTWQSiG2gxoMDmvN7yMw==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.1.0.tgz", + "integrity": "sha512-JUkmcDrrpJvbmmkaQqzJuXR69baLrcYqjnNnRzSTnpEE8OK+YTRNh5luXab/7cyS+NZ0E+0jrZ6HouhNFifGiQ==", "dependencies": { "axios": "^0.26.0" }, @@ -4014,9 +4014,9 @@ "dev": true }, "ntnui-tools": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.0.3.tgz", - "integrity": "sha512-EP9tVsGysKVmqPbSEpBb+paZO3GGbrXc4i0zFNqk3QY7izsgAQRv70ytbhzByd3EtDyTWQSiG2gxoMDmvN7yMw==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.1.0.tgz", + "integrity": "sha512-JUkmcDrrpJvbmmkaQqzJuXR69baLrcYqjnNnRzSTnpEE8OK+YTRNh5luXab/7cyS+NZ0E+0jrZ6HouhNFifGiQ==", "requires": { "axios": "^0.26.0" } diff --git a/backend/package.json b/backend/package.json index bc7981b8..95c8e804 100644 --- a/backend/package.json +++ b/backend/package.json @@ -24,7 +24,7 @@ "express": "^4.17.3", "jsonwebtoken": "^8.5.1", "mongoose": "^6.2.3", - "ntnui-tools": "^0.0.3", + "ntnui-tools": "^0.1.0", "validation": "^0.0.1" }, "main": "app.ts", diff --git a/backend/utils/authorizationMiddleware.ts b/backend/utils/authorizationMiddleware.ts index a4935450..bed0d4d8 100644 --- a/backend/utils/authorizationMiddleware.ts +++ b/backend/utils/authorizationMiddleware.ts @@ -1,10 +1,7 @@ import { Response, NextFunction } from 'express' import jsonwebtoken from 'jsonwebtoken' import { isValidNtnuiToken, refreshNtnuiToken } from 'ntnui-tools' -import { - CustomError, - UnauthorizedUserError, -} from 'ntnui-tools/dist/customError' +import { CustomError, UnauthorizedUserError } from 'ntnui-tools/customError' import { RequestWithNtnuiNo } from './request' /** diff --git a/backend/utils/errorHandler.ts b/backend/utils/errorHandler.ts index 11111165..ab9e7e22 100644 --- a/backend/utils/errorHandler.ts +++ b/backend/utils/errorHandler.ts @@ -1,5 +1,5 @@ import { Request, Response, NextFunction } from 'express' -import { CustomError } from 'ntnui-tools/dist/customError' +import { CustomError } from 'ntnui-tools/customError' /** * Custom error handler to standardize error objects returned to diff --git a/backend/utils/isApplicationPeriodActive.ts b/backend/utils/isApplicationPeriodActive.ts index aba3f480..9eb8b78b 100644 --- a/backend/utils/isApplicationPeriodActive.ts +++ b/backend/utils/isApplicationPeriodActive.ts @@ -1,4 +1,4 @@ -import { CustomError } from 'ntnui-tools/dist/customError' +import { CustomError } from 'ntnui-tools/customError' import dayjs from 'dayjs' import { AdmissionPeriodModel } from '../models/AdmissionPeriod' diff --git a/backend/utils/userCommittee.ts b/backend/utils/userCommittee.ts index a29e84f7..7cb110a0 100644 --- a/backend/utils/userCommittee.ts +++ b/backend/utils/userCommittee.ts @@ -1,4 +1,4 @@ -import { CustomError } from 'ntnui-tools/dist/customError' +import { CustomError } from 'ntnui-tools/customError' import { IRoleInCommittee, UserModel } from '../models/User' async function getUserCommitteeIdsByUserId(userId: number | string) { From 4ac32b4432a5f573236384f20b45a5f3ff903e91 Mon Sep 17 00:00:00 2001 From: Xtrah Date: Fri, 22 Apr 2022 12:49:57 +0200 Subject: [PATCH 6/7] Update package-lock.json --- backend/package-lock.json | 80 +++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/backend/package-lock.json b/backend/package-lock.json index fd677667..dd61a8cc 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -133,9 +133,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", - "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==" + "version": "17.0.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.25.tgz", + "integrity": "sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==" }, "node_modules/@types/qs": { "version": "6.9.7", @@ -357,9 +357,9 @@ } }, "node_modules/bson": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.2.tgz", - "integrity": "sha512-VeJKHShcu1b/ugl0QiujlVuBepab714X9nNyBdA1kfekuDGecxgpTA2Z6nYbagrWFeiIyzSWIOzju3lhj+RNyQ==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.3.tgz", + "integrity": "sha512-rAqP5hcUVJhXP2MCSNVsf0oM2OGU1So6A9pVRDYayvJ5+hygXHQApf87wd5NlhPM1J9RJnbqxIG/f8QTzRoQ4A==", "dependencies": { "buffer": "^5.6.0" }, @@ -678,9 +678,9 @@ } }, "node_modules/dayjs": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.0.tgz", - "integrity": "sha512-JLC809s6Y948/FuCZPm5IX8rRhQwOiyMb2TfVVQEixG7P8Lm/gt5S7yoQZmC8x1UehI9Pb7sksEt4xx14m+7Ug==" + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.1.tgz", + "integrity": "sha512-ER7EjqVAMkRRsxNCC5YqJ9d9VQYuWdGt7aiH2qA5R5wt8ZmWaP2dLUSIK6y/kVzLMlmh1Tvu5xUf4M/wdGJ5KA==" }, "node_modules/debug": { "version": "2.6.9", @@ -1651,14 +1651,14 @@ "dev": true }, "node_modules/mongodb": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.3.1.tgz", - "integrity": "sha512-sNa8APSIk+r4x31ZwctKjuPSaeKuvUeNb/fu/3B6dRM02HpEgig7hTHM8A/PJQTlxuC/KFWlDlQjhsk/S43tBg==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.5.0.tgz", + "integrity": "sha512-A2l8MjEpKojnhbCM0MK3+UOGUSGvTNNSv7AkP1fsT7tkambrkkqN/5F2y+PhzsV0Nbv58u04TETpkaSEdI2zKA==", "dependencies": { - "bson": "^4.6.1", + "bson": "^4.6.2", "denque": "^2.0.1", - "mongodb-connection-string-url": "^2.4.1", - "socks": "^2.6.1" + "mongodb-connection-string-url": "^2.5.2", + "socks": "^2.6.2" }, "engines": { "node": ">=12.9.0" @@ -1677,13 +1677,13 @@ } }, "node_modules/mongoose": { - "version": "6.2.11", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.2.11.tgz", - "integrity": "sha512-YqYAFTOqKthsFduM1IZCArIAwScFJKWoE3pEwmnR7UMw9mynEnOc6c4gBvAon+NtPdB0RAP6ppd3aOvLrVth2g==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.3.1.tgz", + "integrity": "sha512-bknh/VzU/7mBudfE4/5N7NR2Bpjvuxl93iePvyCGLhjeHF6w+mCRmucYGQkG6wEbCmEUVmBQrcgr2b40krMo/Q==", "dependencies": { - "bson": "^4.2.2", + "bson": "^4.6.2", "kareem": "2.3.5", - "mongodb": "4.3.1", + "mongodb": "4.5.0", "mpath": "0.8.4", "mquery": "4.0.2", "ms": "2.1.3", @@ -2738,9 +2738,9 @@ "dev": true }, "@types/node": { - "version": "17.0.23", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.23.tgz", - "integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==" + "version": "17.0.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.25.tgz", + "integrity": "sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==" }, "@types/qs": { "version": "6.9.7", @@ -2917,9 +2917,9 @@ } }, "bson": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.2.tgz", - "integrity": "sha512-VeJKHShcu1b/ugl0QiujlVuBepab714X9nNyBdA1kfekuDGecxgpTA2Z6nYbagrWFeiIyzSWIOzju3lhj+RNyQ==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.3.tgz", + "integrity": "sha512-rAqP5hcUVJhXP2MCSNVsf0oM2OGU1So6A9pVRDYayvJ5+hygXHQApf87wd5NlhPM1J9RJnbqxIG/f8QTzRoQ4A==", "requires": { "buffer": "^5.6.0" } @@ -3145,9 +3145,9 @@ "dev": true }, "dayjs": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.0.tgz", - "integrity": "sha512-JLC809s6Y948/FuCZPm5IX8rRhQwOiyMb2TfVVQEixG7P8Lm/gt5S7yoQZmC8x1UehI9Pb7sksEt4xx14m+7Ug==" + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.1.tgz", + "integrity": "sha512-ER7EjqVAMkRRsxNCC5YqJ9d9VQYuWdGt7aiH2qA5R5wt8ZmWaP2dLUSIK6y/kVzLMlmh1Tvu5xUf4M/wdGJ5KA==" }, "debug": { "version": "2.6.9", @@ -3878,15 +3878,15 @@ "dev": true }, "mongodb": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.3.1.tgz", - "integrity": "sha512-sNa8APSIk+r4x31ZwctKjuPSaeKuvUeNb/fu/3B6dRM02HpEgig7hTHM8A/PJQTlxuC/KFWlDlQjhsk/S43tBg==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.5.0.tgz", + "integrity": "sha512-A2l8MjEpKojnhbCM0MK3+UOGUSGvTNNSv7AkP1fsT7tkambrkkqN/5F2y+PhzsV0Nbv58u04TETpkaSEdI2zKA==", "requires": { - "bson": "^4.6.1", + "bson": "^4.6.2", "denque": "^2.0.1", - "mongodb-connection-string-url": "^2.4.1", + "mongodb-connection-string-url": "^2.5.2", "saslprep": "^1.0.3", - "socks": "^2.6.1" + "socks": "^2.6.2" } }, "mongodb-connection-string-url": { @@ -3899,13 +3899,13 @@ } }, "mongoose": { - "version": "6.2.11", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.2.11.tgz", - "integrity": "sha512-YqYAFTOqKthsFduM1IZCArIAwScFJKWoE3pEwmnR7UMw9mynEnOc6c4gBvAon+NtPdB0RAP6ppd3aOvLrVth2g==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.3.1.tgz", + "integrity": "sha512-bknh/VzU/7mBudfE4/5N7NR2Bpjvuxl93iePvyCGLhjeHF6w+mCRmucYGQkG6wEbCmEUVmBQrcgr2b40krMo/Q==", "requires": { - "bson": "^4.2.2", + "bson": "^4.6.2", "kareem": "2.3.5", - "mongodb": "4.3.1", + "mongodb": "4.5.0", "mpath": "0.8.4", "mquery": "4.0.2", "ms": "2.1.3", From b387e2fadcde27ca90c9621668c42076d4263a94 Mon Sep 17 00:00:00 2001 From: Xtrah Date: Fri, 22 Apr 2022 20:42:51 +0200 Subject: [PATCH 7/7] patch ntnui-tools to 0.2.0 --- backend/package-lock.json | 20 +++++++++++--------- backend/package.json | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/backend/package-lock.json b/backend/package-lock.json index ed93038f..5e54230d 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -20,7 +20,7 @@ "express-validator": "^6.14.0", "jsonwebtoken": "^8.5.1", "mongoose": "^6.2.3", - "ntnui-tools": "^0.1.0", + "ntnui-tools": "^0.2.0", "validation": "^0.0.1" }, "devDependencies": { @@ -1851,11 +1851,12 @@ } }, "node_modules/ntnui-tools": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.1.0.tgz", - "integrity": "sha512-JUkmcDrrpJvbmmkaQqzJuXR69baLrcYqjnNnRzSTnpEE8OK+YTRNh5luXab/7cyS+NZ0E+0jrZ6HouhNFifGiQ==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.2.0.tgz", + "integrity": "sha512-TUz8WB9ZqMdgZaTwJERrOc9+zO+OfTYvuO09DolqrGyF6cyE/ey/BSkJpArlf1KBf3vFS5e6cUUPgIoxp1Q7Mg==", "dependencies": { - "axios": "^0.26.0" + "axios": "^0.26.0", + "dotenv": "^16.0.0" }, "engines": { "node": ">=14.0.0" @@ -4054,11 +4055,12 @@ "dev": true }, "ntnui-tools": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.1.0.tgz", - "integrity": "sha512-JUkmcDrrpJvbmmkaQqzJuXR69baLrcYqjnNnRzSTnpEE8OK+YTRNh5luXab/7cyS+NZ0E+0jrZ6HouhNFifGiQ==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ntnui-tools/-/ntnui-tools-0.2.0.tgz", + "integrity": "sha512-TUz8WB9ZqMdgZaTwJERrOc9+zO+OfTYvuO09DolqrGyF6cyE/ey/BSkJpArlf1KBf3vFS5e6cUUPgIoxp1Q7Mg==", "requires": { - "axios": "^0.26.0" + "axios": "^0.26.0", + "dotenv": "^16.0.0" } }, "object-assign": { diff --git a/backend/package.json b/backend/package.json index 9936c47f..92d74e22 100644 --- a/backend/package.json +++ b/backend/package.json @@ -25,7 +25,7 @@ "express-validator": "^6.14.0", "jsonwebtoken": "^8.5.1", "mongoose": "^6.2.3", - "ntnui-tools": "^0.1.0", + "ntnui-tools": "^0.2.0", "validation": "^0.0.1" }, "main": "app.ts",