diff --git a/apps/server/src/apps/server.app.ts b/apps/server/src/apps/server.app.ts index 7f51ee9b92e..83f924ca7f1 100644 --- a/apps/server/src/apps/server.app.ts +++ b/apps/server/src/apps/server.app.ts @@ -49,7 +49,7 @@ async function bootstrap() { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const feathersExpress = await legacyAppPromise(orm); // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access - feathersExpress.setup(); + await feathersExpress.setup(); // set reference to legacy app as an express setting so we can // access it over the current request within FeathersServiceProvider diff --git a/config/default.json b/config/default.json index 7dd1802a037..05499b0fc0e 100644 --- a/config/default.json +++ b/config/default.json @@ -2,12 +2,9 @@ "$schema": "./default.schema.json", "host": "localhost", "port": 3030, - "public": "../public/", + "public": "./public/", "services": { - "calendar": "http://localhost:3000", - "content": "https://content.schul-cloud.org", - "hydra": "http://localhost:9001", - "web": "http://localhost:3100" + "hydra": "http://localhost:9001" }, "I18N": { "AVAILABLE_LANGUAGES": "de,en,es,uk", diff --git a/config/production.json b/config/production.json index 77110333930..dbe5a3eddfd 100644 --- a/config/production.json +++ b/config/production.json @@ -3,11 +3,8 @@ "host": "localhost", "port": "PORT", "mongodb": "MONGO_URI", - "public": "../public/", + "public": "./public/", "services": { - "calendar": "CALENDAR_URI", - "content": "CONTENT_URI", - "hydra": "HYDRA_URI", - "web": "HOST" + "hydra": "HYDRA_URI" } } diff --git a/config/test.json b/config/test.json index cf7e080ce15..08b9d373609 100644 --- a/config/test.json +++ b/config/test.json @@ -5,11 +5,7 @@ "SC_DOMAIN": "localhost", "PUBLIC_BACKEND_URL": "http://localhost:3030/api", "DB_URL": "mongodb://127.0.0.1:27017/schulcloud-test", - "public": "../public/", - "services": { - "calendar": "https://schul.tech:3000", - "content": "https://content.schul-cloud.org" - }, + "public": "./public/", "FORCE_SEND_EMAIL": true, "LDAP_PASSWORD_ENCRYPTION_KEY": "1234567890123456", "AES_KEY": "6543210987654321", diff --git a/esbuild/esmodules-bundler.js b/esbuild/esmodules-bundler.js index 13fe59f73b2..5774ae47391 100644 --- a/esbuild/esmodules-bundler.js +++ b/esbuild/esmodules-bundler.js @@ -31,6 +31,9 @@ const options = [ { pathToResolutionModeError: 'node_modules/strtok3/lib/types.d.ts', }, + { + noExportedMember: 'node_modules/@feathersjs/express/lib/declarations.d.ts', + }, ]; const globalOptions = { @@ -41,11 +44,16 @@ const globalOptions = { loader: { '.js': 'jsx' }, }; -function replace(pathToResolutionModeError) { - const file = resolve(__dirname, '..', pathToResolutionModeError); +function replace(type, filePath) { + const file = resolve(__dirname, '..', filePath); fs.readFile(file, 'utf8', (err, data) => { if (err) throw err; - const result = data.replace(/resolution-mode="require"/g, ''); + let result = data; + if (type === 'pathToResolutionModeError') { + result = data.replace(/resolution-mode="require"/g, ''); + } else if (type === 'noExportedMember') { + result = `// @ts-nocheck\n\n${data}`; + } fs.writeFile(file, result, 'utf8', (err) => { if (err) throw err; @@ -54,7 +62,7 @@ function replace(pathToResolutionModeError) { } for (const option of options) { - const { entryPoint, outdir, pathToResolutionModeError } = option; + const { entryPoint, outdir, pathToResolutionModeError, noExportedMember } = option; try { if (entryPoint && outdir) { build({ @@ -71,7 +79,10 @@ for (const option of options) { // remove resolution-mode="require" from file because it provokes an error in the commonjs build if (pathToResolutionModeError) { - replace(pathToResolutionModeError); + replace('pathToResolutionModeError', pathToResolutionModeError); + } + if (noExportedMember) { + replace('noExportedMember', noExportedMember); } } catch (e) { process.exit(1); diff --git a/package-lock.json b/package-lock.json index 5c704127ebc..cfc28d06760 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,12 @@ "license": "AGPL-3.0", "dependencies": { "@aws-sdk/lib-storage": "^3.100.0", - "@feathersjs/authentication": "^4.5.16", - "@feathersjs/authentication-local": "^4.5.11", - "@feathersjs/configuration": "^4.5.11", - "@feathersjs/errors": "^4.5.11", - "@feathersjs/express": "^4.5.11", - "@feathersjs/feathers": "^4.5.11", + "@feathersjs/authentication": "^5.0.12", + "@feathersjs/authentication-local": "^5.0.12", + "@feathersjs/configuration": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/express": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", "@golevelup/nestjs-rabbitmq": "^4.0.0", "@hendt/xml2json": "^1.0.3", "@hpi-schul-cloud/commons": "^1.3.4", @@ -73,10 +73,10 @@ "crypto-js": "^4.2.0", "disposable-email-domains": "^1.0.56", "es6-promisify": "^7.0.0", - "express": "^4.14.0", + "express": "^4.18.2", "express-openapi-validator": "^4.13.2", "express-session": "^1.17.3", - "feathers-hooks-common": "^5.0.3", + "feathers-hooks-common": "^8.1.1", "feathers-mongoose": "^6.3.0", "feathers-swagger": "^3.0.0", "file-type": "^18.5.0", @@ -136,6 +136,7 @@ "urlsafe-base64": "^1.0.0", "uuid": "^8.3.0", "winston": "^3.8.2", + "ws": "^7.5.7", "y-mongodb-provider": "^0.1.7", "y-protocols": "^1.0.5", "yjs": "^13.6.7" @@ -2978,31 +2979,42 @@ "npm": ">=6.14.13" } }, - "node_modules/@feathers-plus/batch-loader": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@feathers-plus/batch-loader/-/batch-loader-0.3.6.tgz", - "integrity": "sha512-r+n31iZ/B5Rl1mLkC9/S20UI445MdkZvE3VBmjupep2t8OuyTYHPkFEgR25HY6khH+RothK1VL3B5eumk9N2QQ==", + "node_modules/@feathersjs/adapter-commons": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/adapter-commons/-/adapter-commons-5.0.12.tgz", + "integrity": "sha512-HP4330c2hhhiih1oFheKzS/YzBChBWvm4dDNhzcv+p4W7kmciclpyShGvDALZehe3R/8JHdxhkjB/3eo6zpn+w==", + "dependencies": { + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12" + }, "engines": { - "node": ">= 6.0.0" + "node": ">= 12" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/feathers" } }, "node_modules/@feathersjs/authentication": { - "version": "4.5.16", - "resolved": "https://registry.npmjs.org/@feathersjs/authentication/-/authentication-4.5.16.tgz", - "integrity": "sha512-xg4ESYc6RUvhwxpcd8WTiHTawtzIB3cbnFml6DVp3LEYshRw8J5dkNhCWLmM2w6jDif5WvwuhbZW6w+AuFpc8A==", - "dependencies": { - "@feathersjs/errors": "^4.5.16", - "@feathersjs/feathers": "^4.5.16", - "@feathersjs/transport-commons": "^4.5.16", - "@types/jsonwebtoken": "^9.0.0", - "debug": "^4.3.3", - "jsonwebtoken": "^9.0.0", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/authentication/-/authentication-5.0.12.tgz", + "integrity": "sha512-eaxRGCPVkvZ6MAh50zDPdYmSofrFDJUHFgT4kaAzEc3+fUGpsriqjUBrrxSF88wWojR6ZHpZIzB8IMYD7oKs7Q==", + "dependencies": { + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", + "@feathersjs/hooks": "^0.8.1", + "@feathersjs/schema": "^5.0.12", + "@feathersjs/transport-commons": "^5.0.12", + "@types/jsonwebtoken": "^9.0.5", + "jsonwebtoken": "^9.0.2", "lodash": "^4.17.21", "long-timeout": "^0.1.1", - "uuid": "^8.3.2" + "uuid": "^9.0.1" }, "engines": { - "node": ">= 10" + "node": ">= 12" }, "funding": { "type": "github", @@ -3010,31 +3022,111 @@ } }, "node_modules/@feathersjs/authentication-local": { - "version": "4.5.15", - "resolved": "https://registry.npmjs.org/@feathersjs/authentication-local/-/authentication-local-4.5.15.tgz", - "integrity": "sha512-5K+S6eAUVbrEqaL12yYjCP5dn+QXklVg/nJgBIkCfRp/uaTbQM4W7VQanrB9EgBwhX1p4EJhWkB/xeNam8qb5A==", - "dependencies": { - "@feathersjs/authentication": "^4.5.15", - "@feathersjs/errors": "^4.5.15", - "@feathersjs/feathers": "^4.5.15", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/authentication-local/-/authentication-local-5.0.12.tgz", + "integrity": "sha512-JvMcz2JxPfuCur5NCTI5zrSLp8Vx15FBHu8izlUl31OuXHox0/pJ2TP/FZV8RFIsoo9MpyrWAByeDwNRhKe1zA==", + "dependencies": { + "@feathersjs/authentication": "^5.0.12", + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", "bcryptjs": "^2.4.3", - "debug": "^4.3.3", "lodash": "^4.17.21" }, "engines": { - "node": ">= 10" + "node": ">= 12" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/daffl" + } + }, + "node_modules/@feathersjs/authentication/node_modules/@feathersjs/schema": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/schema/-/schema-5.0.12.tgz", + "integrity": "sha512-xuiePDDeWPEH24KFzdbP3kSeshxpPa3XuVxylwtEZnBRAq9mN7AxQEMDalKAvjYWlfhbnJ2qGScMlav5BdWGYw==", + "dependencies": { + "@feathersjs/adapter-commons": "^5.0.12", + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", + "@feathersjs/hooks": "^0.8.1", + "@types/json-schema": "^7.0.15", + "ajv": "^8.12.0", + "ajv-formats": "^2.1.1", + "json-schema-to-ts": "^2.9.2" + }, + "engines": { + "node": ">= 12" }, "funding": { "type": "github", "url": "https://github.com/sponsors/daffl" + }, + "peerDependencies": { + "typescript": ">=5.3" + } + }, + "node_modules/@feathersjs/authentication/node_modules/@types/jsonwebtoken": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.5.tgz", + "integrity": "sha512-VRLSGzik+Unrup6BsouBeHsf4d1hOEgYWTm/7Nmw1sXoN1+tRly/Gy/po3yeahnP4jfnQWWAhQAqcNfH7ngOkA==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@feathersjs/authentication/node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/@feathersjs/authentication/node_modules/typescript": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", + "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/@feathersjs/authentication/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" } }, "node_modules/@feathersjs/commons": { - "version": "4.5.16", - "resolved": "https://registry.npmjs.org/@feathersjs/commons/-/commons-4.5.16.tgz", - "integrity": "sha512-FXKAcGApcd9w3M42gjLi8+oaPijabS8qbD4ynQK3PM8J7BqpbSdCzURsI7EpReoQxFxdhrR4jix8cQIC/iAeuw==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/commons/-/commons-5.0.12.tgz", + "integrity": "sha512-/6LiS4PLu60O39C91EXE7xzv04Ja+WupZ9UcR1p0qwp58OQRlE/60GWLzQ6XPEIVwELb7ylNgakMAq9D7Z9k8A==", "engines": { - "node": ">= 10" + "node": ">= 12" }, "funding": { "type": "github", @@ -3042,48 +3134,91 @@ } }, "node_modules/@feathersjs/configuration": { - "version": "4.5.12", - "resolved": "https://registry.npmjs.org/@feathersjs/configuration/-/configuration-4.5.12.tgz", - "integrity": "sha512-9fmEcz/yCB8lpzo3cB5uwiAp7rDzSSxGv+pHh6O5a3ZZoCL/7AZrh7/mZB2fFIBK2yAVE1GNdHkLXJI4OMWDGA==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/configuration/-/configuration-5.0.12.tgz", + "integrity": "sha512-p5N+12AC3sBk+hz/RYcKRlbpzm5W9yo7ifTz9u/lAH6XrJ/lJqFlC1FCixzYE60tJxC4NAuhBFQDduo0V1vSMA==", "dependencies": { - "@feathersjs/feathers": "^4.5.12", - "config": "^3.3.6", - "debug": "^4.3.3" + "@feathersjs/commons": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", + "@feathersjs/schema": "^5.0.12", + "@types/config": "^3.3.3", + "config": "^3.3.9" }, "engines": { - "node": ">= 10" + "node": ">= 12" }, "funding": { "type": "github", "url": "https://github.com/sponsors/daffl" } }, - "node_modules/@feathersjs/errors": { - "version": "4.5.17", - "resolved": "https://registry.npmjs.org/@feathersjs/errors/-/errors-4.5.17.tgz", - "integrity": "sha512-HY1YJV/9d5wKd3RPNaWggOhAX4NmOulr5EvBMMm6jaMizJ7UMRUgZmqyRtuHL4h+u2LoLmWv9+wO3V+uCFoULg==", + "node_modules/@feathersjs/configuration/node_modules/@feathersjs/schema": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/schema/-/schema-5.0.12.tgz", + "integrity": "sha512-xuiePDDeWPEH24KFzdbP3kSeshxpPa3XuVxylwtEZnBRAq9mN7AxQEMDalKAvjYWlfhbnJ2qGScMlav5BdWGYw==", "dependencies": { - "debug": "^4.3.3" + "@feathersjs/adapter-commons": "^5.0.12", + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", + "@feathersjs/hooks": "^0.8.1", + "@types/json-schema": "^7.0.15", + "ajv": "^8.12.0", + "ajv-formats": "^2.1.1", + "json-schema-to-ts": "^2.9.2" }, "engines": { - "node": ">= 10" + "node": ">= 12" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/daffl" + }, + "peerDependencies": { + "typescript": ">=5.3" + } + }, + "node_modules/@feathersjs/configuration/node_modules/typescript": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", + "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/@feathersjs/errors": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/errors/-/errors-5.0.12.tgz", + "integrity": "sha512-WU3rDO/tlvXkwLeTG4rgcplxKkNQrirCs5MRWp5SH0pGmoNgoBmzVtq/LrGBuyQcr1TdEOaFASJpmQXx1+pcKw==", + "engines": { + "node": ">= 12" } }, "node_modules/@feathersjs/express": { - "version": "4.5.12", - "resolved": "https://registry.npmjs.org/@feathersjs/express/-/express-4.5.12.tgz", - "integrity": "sha512-ftGbrBHQZ3vXL/Pq9FBGmMZrJLFmNTjUtBA85YZSyChbVhAdmf8teDJc5JSu8sy4ylM8SkP4C9XgXlixehxw+Q==", - "dependencies": { - "@feathersjs/commons": "^4.5.12", - "@feathersjs/errors": "^4.5.12", - "@types/express": "^4.17.13", - "debug": "^4.3.3", - "express": "^4.17.2", - "lodash": "^4.17.21", - "uberproto": "^2.0.6" + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/express/-/express-5.0.12.tgz", + "integrity": "sha512-8X6OXupTtbg5jHT0eEXvYxBSHomuJ6v3v8dMvShPfrrTq6+shVUycdWVvp3s/U133DPpz38TjDKWNy0IVKK26w==", + "dependencies": { + "@feathersjs/authentication": "^5.0.12", + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", + "@feathersjs/transport-commons": "^5.0.12", + "@types/compression": "^1.7.5", + "@types/cors": "^2.8.17", + "@types/express": "^4.17.21", + "@types/express-serve-static-core": "^4.17.41", + "compression": "^1.7.4", + "cors": "^2.8.5", + "express": "^4.18.2" }, "engines": { - "node": ">= 10" + "node": ">= 12" }, "funding": { "type": "github", @@ -3091,36 +3226,43 @@ } }, "node_modules/@feathersjs/feathers": { - "version": "4.5.16", - "resolved": "https://registry.npmjs.org/@feathersjs/feathers/-/feathers-4.5.16.tgz", - "integrity": "sha512-MpLeomC+WwTcRtVjhMzx41wdlR2+5yDU6kpJHv2HAjIMVWtw547Uw62d8vNZ6BvltbbUTG03JJpOyyWcAMy57w==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/feathers/-/feathers-5.0.12.tgz", + "integrity": "sha512-m4rj6sFGMBc5fWmZRpphlXPmk2QodzTmKHw0Vb7npc/Q1pGz86NVY3KBwoIxJSahaF7AaaRofzYHooWaCEnOyw==", "dependencies": { - "@feathersjs/commons": "^4.5.16", - "debug": "^4.3.3", - "events": "^3.3.0", - "uberproto": "^2.0.6" + "@feathersjs/commons": "^5.0.12", + "@feathersjs/hooks": "^0.8.1", + "events": "^3.3.0" }, "engines": { - "node": ">= 10" + "node": ">= 12" }, "funding": { "type": "github", "url": "https://github.com/sponsors/daffl" } }, + "node_modules/@feathersjs/hooks": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@feathersjs/hooks/-/hooks-0.8.1.tgz", + "integrity": "sha512-q/OGjm2BEhT9cHYYcMZR4YKX4lHyufBJmi5Dz+XRM5YqUuEg9MYtR45CWgDiC1klrd2srNSsdmGNVU1otL4+0Q==", + "engines": { + "node": ">= 14" + } + }, "node_modules/@feathersjs/transport-commons": { - "version": "4.5.18", - "resolved": "https://registry.npmjs.org/@feathersjs/transport-commons/-/transport-commons-4.5.18.tgz", - "integrity": "sha512-dTcU56x5qP2KVZRacL/QVBIKEXHxHDXmKAyd0XXI9hXOmC2drZxvQWVKVZC4YdUBp18tSAYBc42fRO1qr8T3Bw==", - "dependencies": { - "@feathersjs/commons": "^4.5.16", - "@feathersjs/errors": "^4.5.17", - "debug": "^4.3.3", - "lodash": "^4.17.21", - "radix-router": "^3.0.1" + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/transport-commons/-/transport-commons-5.0.12.tgz", + "integrity": "sha512-HduReTKT7VHM1MHk8FFp2UaTZtLIKRU87AtGn6RhHAqSKfX01sz1r7OIaB8vPJ/ZAYAqW9P+0UHQaQaA/XDaZQ==", + "dependencies": { + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", + "encodeurl": "^1.0.2", + "lodash": "^4.17.21" }, "engines": { - "node": ">= 10" + "node": ">= 12" }, "funding": { "type": "github", @@ -5596,6 +5738,19 @@ "follow-redirects": "^1.14.4" } }, + "node_modules/@types/compression": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@types/compression/-/compression-1.7.5.tgz", + "integrity": "sha512-AAQvK5pxMpaT+nDvhHrsBhLSYG5yQdtkaJE1WYieSNY2mVFKAgmU4ks65rkZD5oqnGCFLyQpUr1CqI4DmUMyDg==", + "dependencies": { + "@types/express": "*" + } + }, + "node_modules/@types/config": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@types/config/-/config-3.3.3.tgz", + "integrity": "sha512-BB8DBAud88EgiAKlz8WQStzI771Kb6F3j4dioRJ4GD+tP4tzcZyMlz86aXuZT4s9hyesFORehMQE6eqtA5O+Vg==" + }, "node_modules/@types/connect": { "version": "3.4.35", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", @@ -5627,6 +5782,14 @@ "integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==", "dev": true }, + "node_modules/@types/cors": { + "version": "2.8.17", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz", + "integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/crypto-js": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.1.0.tgz", @@ -5666,12 +5829,12 @@ "dev": true }, "node_modules/@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "dependencies": { "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", + "@types/express-serve-static-core": "^4.17.33", "@types/qs": "*", "@types/serve-static": "*" } @@ -5686,13 +5849,14 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.28", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", - "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "version": "4.17.41", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.41.tgz", + "integrity": "sha512-OaJ7XLaelTgrvlZD8/aa0vvvxZdUmlCn6MtWeB7TkiKW70BQLc9XEPpDLPdbo52ZhXUCrznlWdCHWxJWtdyajA==", "dependencies": { "@types/node": "*", "@types/qs": "*", - "@types/range-parser": "*" + "@types/range-parser": "*", + "@types/send": "*" } }, "node_modules/@types/express-session": { @@ -5781,9 +5945,9 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==" + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==" }, "node_modules/@types/json5": { "version": "0.0.29", @@ -5901,14 +6065,14 @@ "dev": true }, "node_modules/@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + "version": "6.9.10", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.10.tgz", + "integrity": "sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==" }, "node_modules/@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, "node_modules/@types/redis": { "version": "2.8.32", @@ -5953,6 +6117,15 @@ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, "node_modules/@types/serve-static": { "version": "1.13.10", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", @@ -6729,7 +6902,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", - "dev": true, "dependencies": { "ajv": "^8.0.0" }, @@ -9013,11 +9185,11 @@ } }, "node_modules/config": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/config/-/config-3.3.7.tgz", - "integrity": "sha512-mX/n7GKDYZMqvvkY6e6oBY49W8wxdmQt+ho/5lhwFDXqQW9gI+Ahp8EKp8VAbISPnmf2+Bv5uZK7lKXZ6pf1aA==", + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/config/-/config-3.3.9.tgz", + "integrity": "sha512-G17nfe+cY7kR0wVpc49NCYvNtelm/pPy8czHoFkAgtV1lkmcp7DHtWCdDu+C9Z7gb2WVqa9Tm3uF9aKaPbCfhg==", "dependencies": { - "json5": "^2.1.1" + "json5": "^2.2.3" }, "engines": { "node": ">= 10.0.0" @@ -11857,23 +12029,22 @@ } }, "node_modules/feathers-hooks-common": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/feathers-hooks-common/-/feathers-hooks-common-5.0.6.tgz", - "integrity": "sha512-XxCPxZxUgKdNRSLAt0l8c/ovA5AmYHrD5LVuDNdawUapm3dLmfSIBex2emHHEaLuyscpiAl9AtkK0+MnqR2Y1g==", - "dependencies": { - "@feathers-plus/batch-loader": "^0.3.6", - "@feathersjs/commons": "^4.5.11", - "@feathersjs/errors": "^4.5.11", - "@feathersjs/feathers": "^4.5.11", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/feathers-hooks-common/-/feathers-hooks-common-8.1.1.tgz", + "integrity": "sha512-l33cpzRAjBnX/koyyCdeRY7dFPJBZVRKmN1fR1926S8p3gjS+gq5HE7wIipFcIPLDFKfwE9o2ZU5FlM2eCteXA==", + "dependencies": { + "@feathersjs/errors": "^5.0.8", "ajv": "^6.12.6", - "debug": "^4.3.1", - "graphql": "^15.5.0", + "debug": "^4.3.4", + "graphql": "^16.8.0", "lodash": "^4.17.21", - "process": "0.11.10", - "traverse": "^0.6.6" + "traverse": "^0.6.7" }, "engines": { - "node": ">= 10" + "node": ">= 14" + }, + "peerDependencies": { + "@feathersjs/feathers": "^5.0.0" } }, "node_modules/feathers-hooks-common/node_modules/ajv": { @@ -11891,6 +12062,22 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/feathers-hooks-common/node_modules/debug": { + "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" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/feathers-hooks-common/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -12707,11 +12894,11 @@ "dev": true }, "node_modules/graphql": { - "version": "15.8.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz", - "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==", + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", "engines": { - "node": ">= 10.x" + "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } }, "node_modules/growl": { @@ -15982,6 +16169,19 @@ "node": ">=10" } }, + "node_modules/json-schema-to-ts": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/json-schema-to-ts/-/json-schema-to-ts-2.9.2.tgz", + "integrity": "sha512-h9WqLkTVpBbiaPb5OmeUpz/FBLS/kvIJw4oRCPiEisIu2WjMh+aai0QIY2LoOhRFx5r92taGLcerIrzxKBAP6g==", + "dependencies": { + "@babel/runtime": "^7.18.3", + "@types/json-schema": "^7.0.9", + "ts-algebra": "^1.2.0" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", @@ -16427,6 +16627,36 @@ "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -16450,6 +16680,11 @@ "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", "integrity": "sha1-brGa5aHuHdnfC5aeZs4Lf6MLXmA=" }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, "node_modules/lodash.pad": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.5.1.tgz", @@ -20350,14 +20585,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -20544,11 +20771,6 @@ } ] }, - "node_modules/radix-router": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/radix-router/-/radix-router-3.0.1.tgz", - "integrity": "sha512-jpHXHgP+ZmVzEfmZ7WVRSvc/EqMoAqYuMtBsHd9s47Hs9Iy8FDJhkweMrDH0wmdxanLzVIWhq0UpomLXNpW8tg==" - }, "node_modules/random-bytes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", @@ -23570,9 +23792,12 @@ } }, "node_modules/traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.7.tgz", + "integrity": "sha512-/y956gpUo9ZNCb99YjxG7OaslxZWHfCHAUUfshwqOXmxUIvqLjVO581BT+gM59+QV9tFe6/CGG53tsA1Y7RSdg==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/tree-kill": { "version": "1.2.2", @@ -23587,6 +23812,11 @@ "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" }, + "node_modules/ts-algebra": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/ts-algebra/-/ts-algebra-1.2.2.tgz", + "integrity": "sha512-kloPhf1hq3JbCPOTYoOWDKxebWjNb2o/LKnNfkWhxVVisFFmMJPPdJeGoGmM+iRLyoXAR61e08Pb+vUXINg8aA==" + }, "node_modules/ts-expect": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/ts-expect/-/ts-expect-1.3.0.tgz", @@ -25083,8 +25313,6 @@ "version": "7.5.7", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", - "optional": true, - "peer": true, "engines": { "node": ">=8.3.0" }, @@ -27539,98 +27767,191 @@ "integrity": "sha512-38DT60rumHfBYynif3lmtxMqMqmsOQIxQgEuPZxCk2yUYN0eqWpTACgxi0VpidvsJB8CRxCpvP7B3anK85FjtQ==", "dev": true }, - "@feathers-plus/batch-loader": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@feathers-plus/batch-loader/-/batch-loader-0.3.6.tgz", - "integrity": "sha512-r+n31iZ/B5Rl1mLkC9/S20UI445MdkZvE3VBmjupep2t8OuyTYHPkFEgR25HY6khH+RothK1VL3B5eumk9N2QQ==" + "@feathersjs/adapter-commons": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/adapter-commons/-/adapter-commons-5.0.12.tgz", + "integrity": "sha512-HP4330c2hhhiih1oFheKzS/YzBChBWvm4dDNhzcv+p4W7kmciclpyShGvDALZehe3R/8JHdxhkjB/3eo6zpn+w==", + "requires": { + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12" + } }, "@feathersjs/authentication": { - "version": "4.5.16", - "resolved": "https://registry.npmjs.org/@feathersjs/authentication/-/authentication-4.5.16.tgz", - "integrity": "sha512-xg4ESYc6RUvhwxpcd8WTiHTawtzIB3cbnFml6DVp3LEYshRw8J5dkNhCWLmM2w6jDif5WvwuhbZW6w+AuFpc8A==", - "requires": { - "@feathersjs/errors": "^4.5.16", - "@feathersjs/feathers": "^4.5.16", - "@feathersjs/transport-commons": "^4.5.16", - "@types/jsonwebtoken": "^9.0.0", - "debug": "^4.3.3", - "jsonwebtoken": "^9.0.0", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/authentication/-/authentication-5.0.12.tgz", + "integrity": "sha512-eaxRGCPVkvZ6MAh50zDPdYmSofrFDJUHFgT4kaAzEc3+fUGpsriqjUBrrxSF88wWojR6ZHpZIzB8IMYD7oKs7Q==", + "requires": { + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", + "@feathersjs/hooks": "^0.8.1", + "@feathersjs/schema": "^5.0.12", + "@feathersjs/transport-commons": "^5.0.12", + "@types/jsonwebtoken": "^9.0.5", + "jsonwebtoken": "^9.0.2", "lodash": "^4.17.21", "long-timeout": "^0.1.1", - "uuid": "^8.3.2" + "uuid": "^9.0.1" + }, + "dependencies": { + "@feathersjs/schema": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/schema/-/schema-5.0.12.tgz", + "integrity": "sha512-xuiePDDeWPEH24KFzdbP3kSeshxpPa3XuVxylwtEZnBRAq9mN7AxQEMDalKAvjYWlfhbnJ2qGScMlav5BdWGYw==", + "requires": { + "@feathersjs/adapter-commons": "^5.0.12", + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", + "@feathersjs/hooks": "^0.8.1", + "@types/json-schema": "^7.0.15", + "ajv": "^8.12.0", + "ajv-formats": "^2.1.1", + "json-schema-to-ts": "^2.9.2" + } + }, + "@types/jsonwebtoken": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-9.0.5.tgz", + "integrity": "sha512-VRLSGzik+Unrup6BsouBeHsf4d1hOEgYWTm/7Nmw1sXoN1+tRly/Gy/po3yeahnP4jfnQWWAhQAqcNfH7ngOkA==", + "requires": { + "@types/node": "*" + } + }, + "jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + } + }, + "typescript": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", + "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "peer": true + }, + "uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==" + } } }, "@feathersjs/authentication-local": { - "version": "4.5.15", - "resolved": "https://registry.npmjs.org/@feathersjs/authentication-local/-/authentication-local-4.5.15.tgz", - "integrity": "sha512-5K+S6eAUVbrEqaL12yYjCP5dn+QXklVg/nJgBIkCfRp/uaTbQM4W7VQanrB9EgBwhX1p4EJhWkB/xeNam8qb5A==", - "requires": { - "@feathersjs/authentication": "^4.5.15", - "@feathersjs/errors": "^4.5.15", - "@feathersjs/feathers": "^4.5.15", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/authentication-local/-/authentication-local-5.0.12.tgz", + "integrity": "sha512-JvMcz2JxPfuCur5NCTI5zrSLp8Vx15FBHu8izlUl31OuXHox0/pJ2TP/FZV8RFIsoo9MpyrWAByeDwNRhKe1zA==", + "requires": { + "@feathersjs/authentication": "^5.0.12", + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", "bcryptjs": "^2.4.3", - "debug": "^4.3.3", "lodash": "^4.17.21" } }, "@feathersjs/commons": { - "version": "4.5.16", - "resolved": "https://registry.npmjs.org/@feathersjs/commons/-/commons-4.5.16.tgz", - "integrity": "sha512-FXKAcGApcd9w3M42gjLi8+oaPijabS8qbD4ynQK3PM8J7BqpbSdCzURsI7EpReoQxFxdhrR4jix8cQIC/iAeuw==" + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/commons/-/commons-5.0.12.tgz", + "integrity": "sha512-/6LiS4PLu60O39C91EXE7xzv04Ja+WupZ9UcR1p0qwp58OQRlE/60GWLzQ6XPEIVwELb7ylNgakMAq9D7Z9k8A==" }, "@feathersjs/configuration": { - "version": "4.5.12", - "resolved": "https://registry.npmjs.org/@feathersjs/configuration/-/configuration-4.5.12.tgz", - "integrity": "sha512-9fmEcz/yCB8lpzo3cB5uwiAp7rDzSSxGv+pHh6O5a3ZZoCL/7AZrh7/mZB2fFIBK2yAVE1GNdHkLXJI4OMWDGA==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/configuration/-/configuration-5.0.12.tgz", + "integrity": "sha512-p5N+12AC3sBk+hz/RYcKRlbpzm5W9yo7ifTz9u/lAH6XrJ/lJqFlC1FCixzYE60tJxC4NAuhBFQDduo0V1vSMA==", "requires": { - "@feathersjs/feathers": "^4.5.12", - "config": "^3.3.6", - "debug": "^4.3.3" + "@feathersjs/commons": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", + "@feathersjs/schema": "^5.0.12", + "@types/config": "^3.3.3", + "config": "^3.3.9" + }, + "dependencies": { + "@feathersjs/schema": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/schema/-/schema-5.0.12.tgz", + "integrity": "sha512-xuiePDDeWPEH24KFzdbP3kSeshxpPa3XuVxylwtEZnBRAq9mN7AxQEMDalKAvjYWlfhbnJ2qGScMlav5BdWGYw==", + "requires": { + "@feathersjs/adapter-commons": "^5.0.12", + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", + "@feathersjs/hooks": "^0.8.1", + "@types/json-schema": "^7.0.15", + "ajv": "^8.12.0", + "ajv-formats": "^2.1.1", + "json-schema-to-ts": "^2.9.2" + } + }, + "typescript": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", + "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "peer": true + } } }, "@feathersjs/errors": { - "version": "4.5.17", - "resolved": "https://registry.npmjs.org/@feathersjs/errors/-/errors-4.5.17.tgz", - "integrity": "sha512-HY1YJV/9d5wKd3RPNaWggOhAX4NmOulr5EvBMMm6jaMizJ7UMRUgZmqyRtuHL4h+u2LoLmWv9+wO3V+uCFoULg==", - "requires": { - "debug": "^4.3.3" - } + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/errors/-/errors-5.0.12.tgz", + "integrity": "sha512-WU3rDO/tlvXkwLeTG4rgcplxKkNQrirCs5MRWp5SH0pGmoNgoBmzVtq/LrGBuyQcr1TdEOaFASJpmQXx1+pcKw==" }, "@feathersjs/express": { - "version": "4.5.12", - "resolved": "https://registry.npmjs.org/@feathersjs/express/-/express-4.5.12.tgz", - "integrity": "sha512-ftGbrBHQZ3vXL/Pq9FBGmMZrJLFmNTjUtBA85YZSyChbVhAdmf8teDJc5JSu8sy4ylM8SkP4C9XgXlixehxw+Q==", - "requires": { - "@feathersjs/commons": "^4.5.12", - "@feathersjs/errors": "^4.5.12", - "@types/express": "^4.17.13", - "debug": "^4.3.3", - "express": "^4.17.2", - "lodash": "^4.17.21", - "uberproto": "^2.0.6" + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/express/-/express-5.0.12.tgz", + "integrity": "sha512-8X6OXupTtbg5jHT0eEXvYxBSHomuJ6v3v8dMvShPfrrTq6+shVUycdWVvp3s/U133DPpz38TjDKWNy0IVKK26w==", + "requires": { + "@feathersjs/authentication": "^5.0.12", + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", + "@feathersjs/transport-commons": "^5.0.12", + "@types/compression": "^1.7.5", + "@types/cors": "^2.8.17", + "@types/express": "^4.17.21", + "@types/express-serve-static-core": "^4.17.41", + "compression": "^1.7.4", + "cors": "^2.8.5", + "express": "^4.18.2" } }, "@feathersjs/feathers": { - "version": "4.5.16", - "resolved": "https://registry.npmjs.org/@feathersjs/feathers/-/feathers-4.5.16.tgz", - "integrity": "sha512-MpLeomC+WwTcRtVjhMzx41wdlR2+5yDU6kpJHv2HAjIMVWtw547Uw62d8vNZ6BvltbbUTG03JJpOyyWcAMy57w==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/feathers/-/feathers-5.0.12.tgz", + "integrity": "sha512-m4rj6sFGMBc5fWmZRpphlXPmk2QodzTmKHw0Vb7npc/Q1pGz86NVY3KBwoIxJSahaF7AaaRofzYHooWaCEnOyw==", "requires": { - "@feathersjs/commons": "^4.5.16", - "debug": "^4.3.3", - "events": "^3.3.0", - "uberproto": "^2.0.6" + "@feathersjs/commons": "^5.0.12", + "@feathersjs/hooks": "^0.8.1", + "events": "^3.3.0" } }, + "@feathersjs/hooks": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@feathersjs/hooks/-/hooks-0.8.1.tgz", + "integrity": "sha512-q/OGjm2BEhT9cHYYcMZR4YKX4lHyufBJmi5Dz+XRM5YqUuEg9MYtR45CWgDiC1klrd2srNSsdmGNVU1otL4+0Q==" + }, "@feathersjs/transport-commons": { - "version": "4.5.18", - "resolved": "https://registry.npmjs.org/@feathersjs/transport-commons/-/transport-commons-4.5.18.tgz", - "integrity": "sha512-dTcU56x5qP2KVZRacL/QVBIKEXHxHDXmKAyd0XXI9hXOmC2drZxvQWVKVZC4YdUBp18tSAYBc42fRO1qr8T3Bw==", - "requires": { - "@feathersjs/commons": "^4.5.16", - "@feathersjs/errors": "^4.5.17", - "debug": "^4.3.3", - "lodash": "^4.17.21", - "radix-router": "^3.0.1" + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@feathersjs/transport-commons/-/transport-commons-5.0.12.tgz", + "integrity": "sha512-HduReTKT7VHM1MHk8FFp2UaTZtLIKRU87AtGn6RhHAqSKfX01sz1r7OIaB8vPJ/ZAYAqW9P+0UHQaQaA/XDaZQ==", + "requires": { + "@feathersjs/commons": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", + "encodeurl": "^1.0.2", + "lodash": "^4.17.21" } }, "@golevelup/nestjs-common": { @@ -29421,6 +29742,19 @@ } } }, + "@types/compression": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@types/compression/-/compression-1.7.5.tgz", + "integrity": "sha512-AAQvK5pxMpaT+nDvhHrsBhLSYG5yQdtkaJE1WYieSNY2mVFKAgmU4ks65rkZD5oqnGCFLyQpUr1CqI4DmUMyDg==", + "requires": { + "@types/express": "*" + } + }, + "@types/config": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@types/config/-/config-3.3.3.tgz", + "integrity": "sha512-BB8DBAud88EgiAKlz8WQStzI771Kb6F3j4dioRJ4GD+tP4tzcZyMlz86aXuZT4s9hyesFORehMQE6eqtA5O+Vg==" + }, "@types/connect": { "version": "3.4.35", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", @@ -29452,6 +29786,14 @@ "integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==", "dev": true }, + "@types/cors": { + "version": "2.8.17", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz", + "integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==", + "requires": { + "@types/node": "*" + } + }, "@types/crypto-js": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.1.0.tgz", @@ -29491,12 +29833,12 @@ "dev": true }, "@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "requires": { "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", + "@types/express-serve-static-core": "^4.17.33", "@types/qs": "*", "@types/serve-static": "*" } @@ -29511,13 +29853,14 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.28", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", - "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "version": "4.17.41", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.41.tgz", + "integrity": "sha512-OaJ7XLaelTgrvlZD8/aa0vvvxZdUmlCn6MtWeB7TkiKW70BQLc9XEPpDLPdbo52ZhXUCrznlWdCHWxJWtdyajA==", "requires": { "@types/node": "*", "@types/qs": "*", - "@types/range-parser": "*" + "@types/range-parser": "*", + "@types/send": "*" } }, "@types/express-session": { @@ -29606,9 +29949,9 @@ } }, "@types/json-schema": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==" + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==" }, "@types/json5": { "version": "0.0.29", @@ -29725,14 +30068,14 @@ "dev": true }, "@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + "version": "6.9.10", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.10.tgz", + "integrity": "sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==" }, "@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, "@types/redis": { "version": "2.8.32", @@ -29777,6 +30120,15 @@ "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, + "@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "requires": { + "@types/mime": "^1", + "@types/node": "*" + } + }, "@types/serve-static": { "version": "1.13.10", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", @@ -30360,7 +30712,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", - "dev": true, "requires": { "ajv": "^8.0.0" } @@ -32169,11 +32520,11 @@ } }, "config": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/config/-/config-3.3.7.tgz", - "integrity": "sha512-mX/n7GKDYZMqvvkY6e6oBY49W8wxdmQt+ho/5lhwFDXqQW9gI+Ahp8EKp8VAbISPnmf2+Bv5uZK7lKXZ6pf1aA==", + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/config/-/config-3.3.9.tgz", + "integrity": "sha512-G17nfe+cY7kR0wVpc49NCYvNtelm/pPy8czHoFkAgtV1lkmcp7DHtWCdDu+C9Z7gb2WVqa9Tm3uF9aKaPbCfhg==", "requires": { - "json5": "^2.1.1" + "json5": "^2.2.3" } }, "confusing-browser-globals": { @@ -34244,20 +34595,16 @@ } }, "feathers-hooks-common": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/feathers-hooks-common/-/feathers-hooks-common-5.0.6.tgz", - "integrity": "sha512-XxCPxZxUgKdNRSLAt0l8c/ovA5AmYHrD5LVuDNdawUapm3dLmfSIBex2emHHEaLuyscpiAl9AtkK0+MnqR2Y1g==", - "requires": { - "@feathers-plus/batch-loader": "^0.3.6", - "@feathersjs/commons": "^4.5.11", - "@feathersjs/errors": "^4.5.11", - "@feathersjs/feathers": "^4.5.11", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/feathers-hooks-common/-/feathers-hooks-common-8.1.1.tgz", + "integrity": "sha512-l33cpzRAjBnX/koyyCdeRY7dFPJBZVRKmN1fR1926S8p3gjS+gq5HE7wIipFcIPLDFKfwE9o2ZU5FlM2eCteXA==", + "requires": { + "@feathersjs/errors": "^5.0.8", "ajv": "^6.12.6", - "debug": "^4.3.1", - "graphql": "^15.5.0", + "debug": "^4.3.4", + "graphql": "^16.8.0", "lodash": "^4.17.21", - "process": "0.11.10", - "traverse": "^0.6.6" + "traverse": "^0.6.7" }, "dependencies": { "ajv": { @@ -34271,6 +34618,14 @@ "uri-js": "^4.2.2" } }, + "debug": { + "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" + } + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -34871,9 +35226,9 @@ "dev": true }, "graphql": { - "version": "15.8.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz", - "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==" + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==" }, "growl": { "version": "1.10.5", @@ -37305,6 +37660,16 @@ "@apidevtools/json-schema-ref-parser": "9.0.9" } }, + "json-schema-to-ts": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/json-schema-to-ts/-/json-schema-to-ts-2.9.2.tgz", + "integrity": "sha512-h9WqLkTVpBbiaPb5OmeUpz/FBLS/kvIJw4oRCPiEisIu2WjMh+aai0QIY2LoOhRFx5r92taGLcerIrzxKBAP6g==", + "requires": { + "@babel/runtime": "^7.18.3", + "@types/json-schema": "^7.0.9", + "ts-algebra": "^1.2.0" + } + }, "json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", @@ -37660,6 +38025,36 @@ "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -37683,6 +38078,11 @@ "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", "integrity": "sha1-brGa5aHuHdnfC5aeZs4Lf6MLXmA=" }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, "lodash.pad": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.5.1.tgz", @@ -40663,11 +41063,6 @@ "react-is": "^18.0.0" } }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" - }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -40809,11 +41204,6 @@ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" }, - "radix-router": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/radix-router/-/radix-router-3.0.1.tgz", - "integrity": "sha512-jpHXHgP+ZmVzEfmZ7WVRSvc/EqMoAqYuMtBsHd9s47Hs9Iy8FDJhkweMrDH0wmdxanLzVIWhq0UpomLXNpW8tg==" - }, "random-bytes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", @@ -43171,9 +43561,9 @@ } }, "traverse": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.7.tgz", + "integrity": "sha512-/y956gpUo9ZNCb99YjxG7OaslxZWHfCHAUUfshwqOXmxUIvqLjVO581BT+gM59+QV9tFe6/CGG53tsA1Y7RSdg==" }, "tree-kill": { "version": "1.2.2", @@ -43185,6 +43575,11 @@ "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" }, + "ts-algebra": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/ts-algebra/-/ts-algebra-1.2.2.tgz", + "integrity": "sha512-kloPhf1hq3JbCPOTYoOWDKxebWjNb2o/LKnNfkWhxVVisFFmMJPPdJeGoGmM+iRLyoXAR61e08Pb+vUXINg8aA==" + }, "ts-expect": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/ts-expect/-/ts-expect-1.3.0.tgz", @@ -44316,8 +44711,6 @@ "version": "7.5.7", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", - "optional": true, - "peer": true, "requires": {} }, "xml2js": { diff --git a/package.json b/package.json index 279785a0828..73a3ddd5e6d 100644 --- a/package.json +++ b/package.json @@ -104,12 +104,12 @@ }, "dependencies": { "@aws-sdk/lib-storage": "^3.100.0", - "@feathersjs/authentication": "^4.5.16", - "@feathersjs/authentication-local": "^4.5.11", - "@feathersjs/configuration": "^4.5.11", - "@feathersjs/errors": "^4.5.11", - "@feathersjs/express": "^4.5.11", - "@feathersjs/feathers": "^4.5.11", + "@feathersjs/authentication": "^5.0.12", + "@feathersjs/authentication-local": "^5.0.12", + "@feathersjs/configuration": "^5.0.12", + "@feathersjs/errors": "^5.0.12", + "@feathersjs/express": "^5.0.12", + "@feathersjs/feathers": "^5.0.12", "@golevelup/nestjs-rabbitmq": "^4.0.0", "@hendt/xml2json": "^1.0.3", "@hpi-schul-cloud/commons": "^1.3.4", @@ -168,10 +168,10 @@ "crypto-js": "^4.2.0", "disposable-email-domains": "^1.0.56", "es6-promisify": "^7.0.0", - "express": "^4.14.0", + "express": "^4.18.2", "express-openapi-validator": "^4.13.2", "express-session": "^1.17.3", - "feathers-hooks-common": "^5.0.3", + "feathers-hooks-common": "^8.1.1", "feathers-mongoose": "^6.3.0", "feathers-swagger": "^3.0.0", "file-type": "^18.5.0", @@ -231,6 +231,7 @@ "urlsafe-base64": "^1.0.0", "uuid": "^8.3.0", "winston": "^3.8.2", + "ws": "^7.5.7", "y-mongodb-provider": "^0.1.7", "y-protocols": "^1.0.5", "yjs": "^13.6.7" diff --git a/src/app.js b/src/app.js index 2db10f27cff..4106bfa514d 100644 --- a/src/app.js +++ b/src/app.js @@ -1,12 +1,12 @@ const express = require('@feathersjs/express'); -const feathers = require('@feathersjs/feathers'); +const { feathers } = require('@feathersjs/feathers'); const configuration = require('@feathersjs/configuration'); const { Configuration } = require('@hpi-schul-cloud/commons'); const path = require('path'); const favicon = require('serve-favicon'); const compress = require('compression'); const cors = require('cors'); -const rest = require('@feathersjs/express/rest'); +const { rest } = require('@feathersjs/express'); const bodyParser = require('body-parser'); const { ObjectId } = require('mongoose').Types; @@ -50,7 +50,6 @@ const setupApp = async (orm) => { setupSwagger(app); initializeRedisClient(); rabbitMq.setup(app); - app .use(compress()) .options('*', cors()) diff --git a/src/errors/index.js b/src/errors/index.js index ede2f19bacd..efb695ba3c6 100644 --- a/src/errors/index.js +++ b/src/errors/index.js @@ -1,5 +1,5 @@ /* eslint-disable max-classes-per-file */ -const featherErrors = require('@feathersjs/errors'); +const FeathersError = require('@feathersjs/errors'); const { ObjectId } = require('mongoose').Types; const logger = require('../logger'); @@ -65,114 +65,114 @@ const prepare = (ref, message, additional, params, className) => { // Error.captureStackTrace(ref, ref.constructor); }; -class BadRequest extends featherErrors.BadRequest { +class BadRequest extends FeathersError.BadRequest { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'bad-request'); } } -class NotAuthenticated extends featherErrors.NotAuthenticated { +class NotAuthenticated extends FeathersError.NotAuthenticated { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'not-authenticated'); } } -class AutoLogout extends featherErrors.NotAuthenticated { +class AutoLogout extends FeathersError.NotAuthenticated { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'auto-logout'); } } -class PaymentError extends featherErrors.PaymentError { +class PaymentError extends FeathersError.PaymentError { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'payment-error'); } } -class Forbidden extends featherErrors.Forbidden { +class Forbidden extends FeathersError.Forbidden { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'forbidden'); } } -class NotFound extends featherErrors.NotFound { +class NotFound extends FeathersError.NotFound { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'not-found'); } } -class MethodNotAllowed extends featherErrors.MethodNotAllowed { +class MethodNotAllowed extends FeathersError.MethodNotAllowed { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'method-not-allowed'); } } -class NotAcceptable extends featherErrors.NotAcceptable { +class NotAcceptable extends FeathersError.NotAcceptable { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'not-acceptable'); } } -class Timeout extends featherErrors.Timeout { +class Timeout extends FeathersError.Timeout { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'timeout'); } } -class SlowQuery extends featherErrors.Timeout { +class SlowQuery extends FeathersError.Timeout { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'slow-query'); } } -class Conflict extends featherErrors.Conflict { +class Conflict extends FeathersError.Conflict { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'conflict'); } } -class LengthRequired extends featherErrors.LengthRequired { +class LengthRequired extends FeathersError.LengthRequired { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'length-required'); } } -class Unprocessable extends featherErrors.Unprocessable { +class Unprocessable extends FeathersError.Unprocessable { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'unprocessable'); } } -class TooManyRequests extends featherErrors.TooManyRequests { +class TooManyRequests extends FeathersError.TooManyRequests { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'too-many-requests'); } } -class BruteForcePrevention extends featherErrors.TooManyRequests { +class BruteForcePrevention extends FeathersError.TooManyRequests { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'brute-force-prevention'); } } -class GeneralError extends featherErrors.GeneralError { +class GeneralError extends FeathersError.GeneralError { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'general-error'); // keep original error location by re throwing errors if (Error.captureStackTrace) { @@ -181,30 +181,30 @@ class GeneralError extends featherErrors.GeneralError { } } -class NotImplemented extends featherErrors.NotImplemented { +class NotImplemented extends FeathersError.NotImplemented { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'not-implemented'); } } -class BadGateway extends featherErrors.BadGateway { +class BadGateway extends FeathersError.BadGateway { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'bad-gateway'); } } -class Unavailable extends featherErrors.Unavailable { +class Unavailable extends FeathersError.Unavailable { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'unavailable'); } } -class Gone extends featherErrors.Gone { +class Gone extends FeathersError.Gone { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'gone'); } } @@ -217,9 +217,9 @@ class PageNotFound extends NotFound { } } -class UnhandledRejection extends featherErrors.GeneralError { +class UnhandledRejection extends FeathersError.GeneralError { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'unhandled-rejection'); if (Error.captureStackTrace) { Error.captureStackTrace(this, UnhandledRejection); @@ -227,9 +227,9 @@ class UnhandledRejection extends featherErrors.GeneralError { } } -class UnhandledException extends featherErrors.GeneralError { +class UnhandledException extends FeathersError.GeneralError { constructor(message, additional, ...params) { - super(message, additional, ...params); + super(message, ...params); prepare(this, message, additional, params, 'unhandled-exception'); if (Error.captureStackTrace) { Error.captureStackTrace(this, UnhandledException); @@ -251,8 +251,8 @@ module.exports = { AssertionError, ForbiddenError, DeletedUserDataError, - FeathersError: featherErrors.FeathersError, - FeathersNotAuthenticated: featherErrors.NotAuthenticated, + FeathersError: FeathersError.FeathersError, + FeathersNotAuthenticated: FeathersError.NotAuthenticated, BadRequest, NotAuthenticated, AutoLogout, diff --git a/src/services/calendar/courseCalendar.js b/src/services/calendar/courseCalendar.js index be7f2338c48..938be072301 100644 --- a/src/services/calendar/courseCalendar.js +++ b/src/services/calendar/courseCalendar.js @@ -3,17 +3,16 @@ const request = require('request-promise-native'); const { Configuration } = require('@hpi-schul-cloud/commons'); const hooks = require('./hooks'); +const calendarUri = Configuration.get('CALENDAR_URI'); class CourseCalendarService { constructor(app) { this.app = app; } remove(id, params) { - const serviceUrls = this.app.get('services') || {}; - const userId = (params.query || {}).userId || (params.account || {}).userId || params.payload.userId; const options = { - uri: `${serviceUrls.calendar}/scopes/${id}`, + uri: `${calendarUri}/scopes/${id}`, headers: { Authorization: userId, }, diff --git a/src/services/calendar/index.js b/src/services/calendar/index.js index b52640196ed..babbc21974c 100644 --- a/src/services/calendar/index.js +++ b/src/services/calendar/index.js @@ -8,6 +8,8 @@ const courseCalendarSetup = require('./courseCalendar'); const hooks = require('./hooks'); +const calendarUri = Configuration.get('CALENDAR_URI'); + /** * converts a jsonApi-event to a plain event * @param event {object} @@ -34,34 +36,36 @@ const convertJsonApiToEvent = (event) => { * @param body * @returns {object} - valid json-api body for calendar-service */ -const convertEventToJsonApi = (body) => ({ - data: [ - { - type: 'event', - attributes: { - summary: body.summary, - location: body.location, - description: body.description, - dtstart: body.startDate, - dtend: body.endDate || new Date(new Date(body.startDate).getTime() + body.duration).toISOString(), - dtstamp: new Date(), - transp: 'OPAQUE', - sequence: 0, - repeat_freq: body.frequency, - repeat_wkst: body.weekday, - repeat_until: body.repeat_until, - 'x-sc-courseId': body.courseId, - 'x-sc-teamId': body.teamId, - 'x-sc-featureVideoConference': body.featureVideoConference === 'on', - 'x-sc-courseTimeId': body.courseTimeId, - }, - relationships: { - 'scope-ids': [body.scopeId], - 'separate-users': false, +const convertEventToJsonApi = (body) => { + return { + data: [ + { + type: 'event', + attributes: { + summary: body.summary, + location: body.location, + description: body.description, + dtstart: body.startDate, + dtend: body.endDate || new Date(new Date(body.startDate).getTime() + body.duration).toISOString(), + dtstamp: new Date(), + transp: 'OPAQUE', + sequence: 0, + repeat_freq: body.frequency, + repeat_wkst: body.weekday, + repeat_until: body.repeat_until, + 'x-sc-courseId': body.courseId, + 'x-sc-teamId': body.teamId, + 'x-sc-featureVideoConference': body.featureVideoConference === 'on', + 'x-sc-courseTimeId': body.courseTimeId, + }, + relationships: { + 'scope-ids': [body.scopeId], + 'separate-users': false, + }, }, - }, - ], -}); + ], + }; +}; class Service { constructor(options) { @@ -172,11 +176,9 @@ class Service { } create(data, params) { - const serviceUrls = this.app.get('services') || {}; - const userId = (params.query || {}).userId || (params.account || {}).userId || params.payload.userId; const options = { - uri: `${serviceUrls.calendar}/events/`, + uri: `${calendarUri}/events/`, method: 'POST', headers: { Authorization: userId, @@ -201,10 +203,9 @@ class Service { } find(params) { - const serviceUrls = this.app.get('services') || {}; const userId = (params.query || {}).userId || (params.account || {}).userId || params.payload.userId; const options = { - uri: `${serviceUrls.calendar}/events?${queryString.stringify(params.query)}`, + uri: `${calendarUri}/events?${queryString.stringify(params.query)}`, headers: { Authorization: userId, }, @@ -229,11 +230,9 @@ class Service { } remove(id, params) { - const serviceUrls = this.app.get('services') || {}; - const userId = (params.query || {}).userId || (params.account || {}).userId || params.payload.userId; const options = { - uri: `${serviceUrls.calendar}/events/${id}`, + uri: `${calendarUri}/events/${id}`, headers: { Authorization: userId, }, @@ -251,11 +250,9 @@ class Service { } update(id, data, params) { - const serviceUrls = this.app.get('services') || {}; - const userId = (params.query || {}).userId || (params.account || {}).userId || params.payload.userId; const options = { - uri: `${serviceUrls.calendar}/events/${id}`, + uri: `${calendarUri}/events/${id}`, method: 'PUT', headers: { Authorization: userId, diff --git a/src/services/consent/services/consentCheck.service.js b/src/services/consent/services/consentCheck.service.js index 4823118b37d..6f380c23592 100644 --- a/src/services/consent/services/consentCheck.service.js +++ b/src/services/consent/services/consentCheck.service.js @@ -4,13 +4,11 @@ const { consentTypes } = require('../model'); const { restrictToCurrentUser } = require('../hooks/consentCheck'); const { userToConsent } = require('../utils/consent'); -const removeQuery = (context) => ({ - ...context, - params: { - ...context.params, - query: {}, - }, -}); +const removeQuery = (context) => { + context.params.query = {}; + + return context; +}; const consentCheckHooks = { before: { diff --git a/src/services/link/index.js b/src/services/link/index.js index 137ada9b61d..38e78a10a5a 100644 --- a/src/services/link/index.js +++ b/src/services/link/index.js @@ -27,7 +27,8 @@ module.exports = function setup() { function redirectToTarget(req, res, next) { if (req.method === 'GET' && !req.query.target) { // capture these requests and issue a redirect - const linkId = req.params.__feathersId; + // const linkId = req.params.__feathersId; + const linkId = req.lookup.params.__id; linkService .get(linkId) .then((data) => { @@ -137,7 +138,7 @@ module.exports = function setup() { const { teamId } = data; if (email) { - const { data: userData } = await app.service('users').find({ query: { email: email } }); + const { data: userData } = await app.service('users').find({ query: { email } }); if (userData && userData[0] && userData[0].importHash) { linkInfo.hash = userData[0].importHash; } else { diff --git a/src/services/oauth2/hooks/index.js b/src/services/oauth2/hooks/index.js index b9162fd2b40..c4a0cac7916 100644 --- a/src/services/oauth2/hooks/index.js +++ b/src/services/oauth2/hooks/index.js @@ -2,10 +2,13 @@ const { authenticate } = require('@feathersjs/authentication'); const { NotFound } = require('@feathersjs/errors'); +const { Configuration } = require('@hpi-schul-cloud/commons'); const { Forbidden, MethodNotAllowed } = require('../../../errors'); const globalHooks = require('../../../hooks'); const Hydra = require('../hydra'); +const webUri = Configuration.get('HOST'); + const properties = 'title="username" style="height: 26px; width: 180px; border: none;"'; const iframeSubject = (pseudonym, url) => ``; @@ -81,7 +84,7 @@ const setIdToken = (hook) => { const name = user.displayName ? user.displayName : `${user.firstName} ${user.lastName}`; hook.data.session = { id_token: { - iframe: iframeSubject(pseudonym, hook.app.settings.services.web), + iframe: iframeSubject(pseudonym, webUri), email: scope.includes('email') ? user.email : undefined, name: scope.includes('profile') ? name : undefined, userId: scope.includes('profile') ? user._id : undefined, diff --git a/src/services/role/index.js b/src/services/role/index.js index 037b4e6dd77..971c2486619 100644 --- a/src/services/role/index.js +++ b/src/services/role/index.js @@ -37,6 +37,7 @@ module.exports = function setup() { app.use('/roles', service(options)); const roleService = app.service('/roles'); + roleService.hooks({ before: hooks.before(), after: hooks.after, diff --git a/src/services/role/services/userPermissions.js b/src/services/role/services/userPermissions.js index e5bde029ce7..b143133408e 100644 --- a/src/services/role/services/userPermissions.js +++ b/src/services/role/services/userPermissions.js @@ -1,4 +1,4 @@ -const { userRoleHooks } = require('./userRoles'); +const { userRolesHooks } = require('./userRoles'); const filterPermissions = (userRoles, schoolPermissions) => { const permissions = []; @@ -33,5 +33,5 @@ class UserPermissions { module.exports = { UserPermissions, - userPermissionsHooks: userRoleHooks, + userPermissionsHooks: userRolesHooks, }; diff --git a/src/services/role/services/userRoles.js b/src/services/role/services/userRoles.js index 801c945623a..97f8bb57c1b 100644 --- a/src/services/role/services/userRoles.js +++ b/src/services/role/services/userRoles.js @@ -3,7 +3,7 @@ const { lookupSchool } = require('../../../hooks'); const { restrictGetToCurrentUser } = require('../hooks/userRoles'); const rolesModel = require('../model'); -const hooks = { +const userRolesHooks = { before: { all: [authenticate('jwt'), lookupSchool], get: [ @@ -51,5 +51,5 @@ class UserRoles { module.exports = { UserRoles, - userRolesHooks: hooks, + userRolesHooks, }; diff --git a/src/services/roster/hooks/index.js b/src/services/roster/hooks/index.js index 8bdcdaa76d7..b9d67e4dfff 100644 --- a/src/services/roster/hooks/index.js +++ b/src/services/roster/hooks/index.js @@ -1,6 +1,9 @@ +const { Configuration } = require('@hpi-schul-cloud/commons/lib'); const { BadRequest } = require('../../../errors'); const oauth2 = require('../../oauth2/hooks'); +const webUri = Configuration.get('HOST'); + module.exports = { /** * Authentication with oauth2 authorization token via Bearer/header from external tool (bettermarks) @@ -68,8 +71,7 @@ module.exports = { if ( users.some( (user) => - user.user_id === - oauth2.getSubject(context.params.tokenInfo.obfuscated_subject, context.app.settings.services.web) || + user.user_id === oauth2.getSubject(context.params.tokenInfo.obfuscated_subject, webUri) || user.user_id === context.params.tokenInfo.obfuscated_subject ) ) diff --git a/src/services/roster/index.js b/src/services/roster/index.js index 182f2e74a4e..da5626aeb88 100644 --- a/src/services/roster/index.js +++ b/src/services/roster/index.js @@ -8,6 +8,8 @@ const { excludeAttributesFromSanitization } = require('../../hooks/sanitizationE const { isValid: isValidObjectId } = require('../../helper/compare').ObjectId; const { ApplicationError } = require('../../errors'); +const webUri = Configuration.get('HOST'); + module.exports = function roster() { const app = this; @@ -58,7 +60,7 @@ module.exports = function roster() { return { data: { user_id: userParam, - username: oauth2.getSubject(pseudonym, app.settings.services.web), + username: oauth2.getSubject(pseudonym, webUri), type: user.roles.map((role) => role.name).some((roleName) => roleName === 'teacher') ? 'teacher' : 'student', }, }; @@ -206,13 +208,13 @@ module.exports = function roster() { students: users.data.map((user) => { return { user_id: user.pseudonym, - username: oauth2.getSubject(user.pseudonym, app.settings.services.web), + username: oauth2.getSubject(user.pseudonym, webUri), }; }), teachers: teachers.data.map((user) => { return { user_id: user.pseudonym, - username: oauth2.getSubject(user.pseudonym, app.settings.services.web), + username: oauth2.getSubject(user.pseudonym, webUri), }; }), }, diff --git a/src/services/school/index.js b/src/services/school/index.js index d963a56a1b9..24e626af831 100644 --- a/src/services/school/index.js +++ b/src/services/school/index.js @@ -15,19 +15,19 @@ module.exports = function schoolServices() { const app = this; app.use('/schools/api', staticContent(path.join(__dirname, '/docs/openapi.yaml'))); - - const options = { - Model: schoolModels.schoolModel, - paginate: { - default: 5, - max: 100, // this is the max currently used in the SHD - }, - lean: { - virtuals: true, - }, - }; - - app.use('/schools', service(options)); + app.use( + '/schools', + service({ + Model: schoolModels.schoolModel, + paginate: { + default: 5, + max: 100, // this is the max currently used in the SHD + }, + lean: { + virtuals: true, + }, + }) + ); const schoolService = app.service('/schools'); schoolService.hooks(hooks); diff --git a/src/services/sync/index.js b/src/services/sync/index.js index bce2e64a9f1..bbdfa1acbc3 100644 --- a/src/services/sync/index.js +++ b/src/services/sync/index.js @@ -54,7 +54,7 @@ module.exports = function setup() { } } - app.use('/sync/userAccount', new UserAccountService()); + app.use('/sync/userAccount', new UserAccountService(), { methods: [] }); app.use('/sync/api', staticContent(path.join(__dirname, '/docs/openapi.yaml'))); app.use('/sync', new SyncService()); diff --git a/src/services/sync/services/UserAccountService.js b/src/services/sync/services/UserAccountService.js index 7d46b64e18a..0b555d49cbe 100644 --- a/src/services/sync/services/UserAccountService.js +++ b/src/services/sync/services/UserAccountService.js @@ -3,15 +3,16 @@ const { Semaphore } = require('async-mutex'); const { UserRepo } = require('../repo'); class UserAccountService { - constructor(options) { - this.options = options || {}; - } - - async setup(app) { + setup(app) { this.app = app; this.lock = new Semaphore(5); } + // Feathers 5: at least one standard service method must be implemented to be considered a service + get() { + return undefined; + } + async createUserAndAccount(inputUser, inputAccount, school) { const user = await UserRepo.createUser(inputUser, school); inputAccount.userId = user._id; diff --git a/test/errors/index.test.js b/test/errors/index.test.js index 0315ba976dc..166c801f503 100644 --- a/test/errors/index.test.js +++ b/test/errors/index.test.js @@ -318,9 +318,9 @@ describe('errors', () => { const err = new Gone(message); expect(err instanceof Error).to.be.true; expect(err instanceof FeathersError).to.be.true; - expect(err.message, 'message should empty string').to.equal(''); - expect(err.code, 'code should undefined').to.be.undefined; - expect(err.type, 'type should undefined').to.be.undefined; + expect(err.message, 'message should be given message').to.equal(message); + expect(err.code).to.equal(410); + expect(err.type).to.equal('FeathersError'); expect(err.className, 'should the name of constructor as lower case notation').to.equal('gone'); expect(err.name, 'should the name of constructor').to.equal('Gone'); expect(err.data, 'should empty object').to.eql({}); diff --git a/test/middleware/legacyForward.integration.test.js b/test/middleware/legacyForward.integration.test.js index 6d7a5faaf67..7a41c571104 100644 --- a/test/middleware/legacyForward.integration.test.js +++ b/test/middleware/legacyForward.integration.test.js @@ -34,7 +34,7 @@ describe('legacy forward', () => { // eslint-disable-next-line global-require app = await appPromise(); - server = app.listen(0); + server = await app.listen(0); return server; }); diff --git a/test/services/account/services/jwtTimerService.test.js b/test/services/account/services/jwtTimerService.test.js index 8996a518fcb..50a9b083b39 100644 --- a/test/services/account/services/jwtTimerService.test.js +++ b/test/services/account/services/jwtTimerService.test.js @@ -45,6 +45,7 @@ describe('jwtTimer service', () => { /* eslint-disable global-require */ redisHelper = require('../../../../src/utils/redis'); const { jwtTimerServiceSetup } = require('../../../../src/services/account/services/jwtTimerService'); + app.unuse('/accounts/jwtTimer'); app.configure(jwtTimerServiceSetup); /* eslint-enable global-require */ @@ -105,6 +106,7 @@ describe('jwtTimer service', () => { /* eslint-disable global-require */ redisHelper = require('../../../../src/utils/redis'); const { jwtTimerServiceSetup } = require('../../../../src/services/account/services/jwtTimerService'); + app.unuse('/accounts/jwtTimer'); app.configure(jwtTimerServiceSetup); /* eslint-enable global-require */ diff --git a/test/services/content/material.test.js b/test/services/content/material.test.js index b846f5418eb..3d1faa798e3 100644 --- a/test/services/content/material.test.js +++ b/test/services/content/material.test.js @@ -14,8 +14,8 @@ describe('material service', () => { before(async () => { app = await appPromise(); - server = await app.listen(0); nestServices = await setupNestServices(app); + server = await app.listen(0); }); after(async () => { @@ -41,10 +41,6 @@ describe('material service', () => { let materialA; let materialB; - before((done) => { - server = app.listen(0, done); - }); - before(async () => { [materialA, materialB] = await Promise.all([ Material.create({ diff --git a/test/services/courses/hooks/index.test.js b/test/services/courses/hooks/index.test.js index 449009c8fbc..182f7da34cd 100644 --- a/test/services/courses/hooks/index.test.js +++ b/test/services/courses/hooks/index.test.js @@ -11,7 +11,7 @@ describe('course hooks', () => { let server; before(async () => { app = await appPromise(); - server = app.listen(0); + server = await app.listen(0); }); after(() => { diff --git a/test/services/courses/services/courseMembers.test.js b/test/services/courses/services/courseMembers.test.js index 024c71bdd3d..b47254d87de 100644 --- a/test/services/courses/services/courseMembers.test.js +++ b/test/services/courses/services/courseMembers.test.js @@ -16,7 +16,7 @@ describe('course scope members service', () => { before(async () => { app = await appPromise(); courseMembersService = app.service('/courses/:scopeId/members'); - server = app.listen(0); + server = await app.listen(0); nestServices = await setupNestServices(app); }); diff --git a/test/services/datasources/datasourceRuns.test.js b/test/services/datasources/datasourceRuns.test.js index b169e92e4dd..06601b206d2 100644 --- a/test/services/datasources/datasourceRuns.test.js +++ b/test/services/datasources/datasourceRuns.test.js @@ -53,6 +53,9 @@ describe('datasourceRuns service', () => { }); mockery.registerMock('./strategies', [MockSyncer, MockSyncerWithData]); datasourceRunsService = app.service('datasourceRuns'); + + app.unuse('/sync/userAccount'); + app.unuse('/sync'); // eslint-disable-next-line global-require const sync = require('../../../src/services/sync'); app.configure(sync); diff --git a/test/services/helpdesk/index.test.js b/test/services/helpdesk/index.test.js index 4b515c6816c..f344cec0df9 100644 --- a/test/services/helpdesk/index.test.js +++ b/test/services/helpdesk/index.test.js @@ -2,8 +2,8 @@ const assert = require('assert'); const { expect } = require('chai'); const sinon = require('sinon'); -const appPromise = require('../../../src/app'); const { Configuration } = require('@hpi-schul-cloud/commons'); +const appPromise = require('../../../src/app'); describe('helpdesk service', function test() { this.timeout(10000); @@ -36,6 +36,7 @@ describe('helpdesk service', function test() { }); after((done) => { + app.unuse('/mails'); app.use('/mails', originalMailService); helpdeskService .remove(testProblem) @@ -115,6 +116,7 @@ describe('helpdesk service', function test() { problemDescription: 'Dies ist die Problembeschreibung 1', replyEmail: 'test@mail.de', }; + app.unuse('/mails'); const mailService = new MockMailService(); app.use('/mails', mailService); await helpdeskService.create(postBody, { account: { userId: '0000d213816abba584714c0a' } }); @@ -129,6 +131,7 @@ describe('helpdesk service', function test() { problemDescription: 'Dies ist die Problembeschreibung 1', replyEmail: 'test@mail.de', }; + app.unuse('/mails'); const mailService = new MockMailService(); app.use('/mails', mailService); const tempScTheme = Configuration.get('SUPPORT_PROBLEM_EMAIL_ADDRESS'); @@ -146,6 +149,7 @@ describe('helpdesk service', function test() { problemDescription: 'Dies ist die Problembeschreibung 1', replyEmail: 'test@mail.de', }; + app.unuse('/mails'); const mailService = new MockMailService(); app.use('/mails', mailService); await helpdeskService.create(postBody, { account: { userId: '0000d213816abba584714c0a' } }); @@ -161,6 +165,7 @@ describe('helpdesk service', function test() { problemDescription: 'Dies ist die Problembeschreibung 2', replyEmail: 'test@mail.de', }; + app.unuse('/mails'); const mailService = new MockMailService(); app.use('/mails', mailService); const tempScTheme = Configuration.get('SUPPORT_WISH_EMAIL_ADDRESS'); diff --git a/test/services/ldap-config/service.integration.test.js b/test/services/ldap-config/service.integration.test.js index 8fc6c455bef..914b22b9b92 100644 --- a/test/services/ldap-config/service.integration.test.js +++ b/test/services/ldap-config/service.integration.test.js @@ -150,25 +150,28 @@ describe('LdapConfigService', () => { function MockLdapService() { return { setup: () => {}, + get: () => {}, getUsers: sinon.fake.resolves(fakeUsers), getClasses: sinon.fake.resolves(fakeClasses), disconnect: sinon.fake.resolves(), }; } - beforeEach(() => { - ldapServiceMock = new MockLdapService(); - app.use('ldap', ldapServiceMock); - }); - before(() => { originalLdapService = app.service('ldap'); }); after(() => { + app.unuse('ldap'); app.use('ldap', originalLdapService); }); + beforeEach(() => { + app.unuse('/ldap'); + ldapServiceMock = new MockLdapService(); + app.use('ldap', ldapServiceMock); + }); + beforeEach(async () => { school = await testObjects.createTestSchool({ systems: [], @@ -223,6 +226,7 @@ describe('LdapConfigService', () => { }); it('should catch common errors', async () => { + app.unuse('ldap'); ldapServiceMock.getUsers = sinon.fake.rejects(new LDAPConnectionError()); app.use('ldap', ldapServiceMock); @@ -287,25 +291,28 @@ describe('LdapConfigService', () => { function MockLdapService() { return { setup: () => {}, + get: () => {}, getUsers: sinon.fake.resolves(fakeUsers), getClasses: sinon.fake.resolves(fakeClasses), disconnect: sinon.fake.resolves(), }; } - beforeEach(() => { - ldapServiceMock = new MockLdapService(); - app.use('ldap', ldapServiceMock); - }); - before(() => { originalLdapService = app.service('ldap'); }); after(() => { + app.unuse('ldap'); app.use('ldap', originalLdapService); }); + beforeEach(() => { + app.unuse('/ldap'); + ldapServiceMock = new MockLdapService(); + app.use('/ldap', ldapServiceMock); + }); + beforeEach(async () => { system = await testObjects.createTestSystem({ type: 'ldap', diff --git a/test/services/ldap/strategies/general.test.js b/test/services/ldap/strategies/general.test.js index 83bf5d779a6..b938717cfad 100644 --- a/test/services/ldap/strategies/general.test.js +++ b/test/services/ldap/strategies/general.test.js @@ -37,16 +37,18 @@ const mockLDAPConfig = { }, }; -const createLDAPUserResult = (props) => ({ - dn: 'uid=max.mustermann.1,ou=users,o=school0,dc=de,dc=example,dc=org', - givenName: 'Max', - sn: 'Mustermann', - uid: 'max.mustermann.1', - uuid: 'ZDg0Y2ZlMjMtZGYwNi00MWNjLTg3YmUtZjI3NjA1NDJhY2Y0', - mail: 'max.mustermann.1@example.org', - memberOf: 'cn=ROLE_STUDENT,ou=roles,o=school0,dc=de,dc=example,dc=org', - ...props, -}); +const createLDAPUserResult = (props) => { + return { + dn: 'uid=max.mustermann.1,ou=users,o=school0,dc=de,dc=example,dc=org', + givenName: 'Max', + sn: 'Mustermann', + uid: 'max.mustermann.1', + uuid: 'ZDg0Y2ZlMjMtZGYwNi00MWNjLTg3YmUtZjI3NjA1NDJhY2Y0', + mail: 'max.mustermann.1@example.org', + memberOf: 'cn=ROLE_STUDENT,ou=roles,o=school0,dc=de,dc=example,dc=org', + ...props, + }; +}; describe('GeneralLDAPStrategy', () => { it('implements AbstractLDAPStrategy', () => { @@ -64,6 +66,7 @@ describe('GeneralLDAPStrategy', () => { }); after(() => { + app.unuse('/ldap'); app.use('/ldap', originalLdapService); }); @@ -89,6 +92,7 @@ describe('GeneralLDAPStrategy', () => { function MockLdapService() { return { setup: () => {}, + get: () => {}, searchCollection: sinon.fake.resolves([ { dn: 'uid=max.mustermann.1,ou=users,o=school0,dc=de,dc=example,dc=org', @@ -139,11 +143,13 @@ describe('GeneralLDAPStrategy', () => { beforeEach(() => { ldapServiceMock = new MockLdapService(); + app.unuse('/ldap'); app.use('/ldap', ldapServiceMock); }); it('should return all users', async () => { - const users = await new GeneralLDAPStrategy(app, mockLDAPConfig).getUsers(); + const instance = new GeneralLDAPStrategy(app, mockLDAPConfig); + const users = await instance.getUsers(); expect(users.length).to.equal(4); }); @@ -184,8 +190,10 @@ describe('GeneralLDAPStrategy', () => { ...mockLDAPConfig, providerOptions: { ...mockLDAPConfig.providerOptions, roleType: 'non-group' }, }; + app.unuse('/ldap'); app.use('/ldap', { setup: () => {}, + get: () => {}, searchCollection: sinon.fake.resolves([ createLDAPUserResult({ role: mockLDAPConfig.providerOptions.roleAttributeNameMapping.roleStudent }), createLDAPUserResult({ role: mockLDAPConfig.providerOptions.roleAttributeNameMapping.roleTeacher }), @@ -199,23 +207,32 @@ describe('GeneralLDAPStrategy', () => { }); it('should assign name defaults if entities lack first names', async () => { - app.use('/ldap', { - setup: () => {}, - searchCollection: sinon.fake.resolves([ - createLDAPUserResult({ - givenName: '', - memberOf: mockLDAPConfig.providerOptions.roleAttributeNameMapping.roleStudent, - }), - createLDAPUserResult({ - givenName: '', - memberOf: mockLDAPConfig.providerOptions.roleAttributeNameMapping.roleTeacher, - }), - createLDAPUserResult({ - givenName: '', - memberOf: mockLDAPConfig.providerOptions.roleAttributeNameMapping.roleAdmin, - }), - ]), - }); + app.unuse('/ldap'); + app.use( + '/ldap', + { + setup: () => {}, + get: () => {}, + searchCollection: sinon.fake.resolves([ + createLDAPUserResult({ + givenName: '', + memberOf: mockLDAPConfig.providerOptions.roleAttributeNameMapping.roleStudent, + }), + createLDAPUserResult({ + givenName: '', + memberOf: mockLDAPConfig.providerOptions.roleAttributeNameMapping.roleTeacher, + }), + createLDAPUserResult({ + givenName: '', + memberOf: mockLDAPConfig.providerOptions.roleAttributeNameMapping.roleAdmin, + }), + ]), + }, + { + // Pass all methods you want to expose + methods: ['searchCollection'], + } + ); const [student, teacher, admin] = await new GeneralLDAPStrategy(app, mockLDAPConfig).getUsers(); expect(student.firstName).to.equal('Schüler:in'); expect(teacher.firstName).to.equal('Lehrkraft'); @@ -227,6 +244,7 @@ describe('GeneralLDAPStrategy', () => { function MockLdapService() { return { setup: () => {}, + get: () => {}, searchCollection: sinon.fake.returns( Promise.resolve([ { @@ -253,6 +271,7 @@ describe('GeneralLDAPStrategy', () => { beforeEach(() => { ldapServiceMock = new MockLdapService(); + app.unuse('/ldap'); app.use('/ldap', ldapServiceMock); }); diff --git a/test/services/ldap/strategies/iserv-idm.test.js b/test/services/ldap/strategies/iserv-idm.test.js index 2aadaf1ea90..adb089e396c 100644 --- a/test/services/ldap/strategies/iserv-idm.test.js +++ b/test/services/ldap/strategies/iserv-idm.test.js @@ -22,6 +22,7 @@ describe('IservIdmLDAPStrategy', () => { }); after(() => { + app.unuse('/ldap'); app.use('/ldap', originalLdapService); }); @@ -29,6 +30,7 @@ describe('IservIdmLDAPStrategy', () => { function MockLdapService() { return { setup: () => {}, + get: () => {}, searchCollection: sinon.fake.returns([ { dn: 'o=Testschule,dc=de', o: 'Testschule' }, { dn: 'o=hvk,dc=schule', description: 'Heinrich-von-Kleist-Schule', o: 'hvk' }, @@ -37,6 +39,7 @@ describe('IservIdmLDAPStrategy', () => { } beforeEach(() => { + app.unuse('/ldap'); ldapServiceMock = new MockLdapService(); app.use('/ldap', ldapServiceMock); }); @@ -86,6 +89,7 @@ describe('IservIdmLDAPStrategy', () => { function MockLdapService() { return { setup: () => {}, + get: () => {}, searchCollection: sinon.fake.returns([ { dn: 'cn=student1,ou=users,o=Testschule,dc=de', @@ -153,6 +157,7 @@ describe('IservIdmLDAPStrategy', () => { } beforeEach(() => { + app.unuse('/ldap'); ldapServiceMock = new MockLdapService(); app.use('/ldap', ldapServiceMock); }); @@ -206,6 +211,7 @@ describe('IservIdmLDAPStrategy', () => { function MockLdapService() { return { setup: () => {}, + get: () => {}, searchCollection: sinon.fake.returns([ { dn: 'cn=klasse9a,ou=groups,o=Testschule,dc=de', @@ -228,6 +234,7 @@ describe('IservIdmLDAPStrategy', () => { } beforeEach(() => { + app.unuse('/ldap'); ldapServiceMock = new MockLdapService(); app.use('/ldap', ldapServiceMock); }); diff --git a/test/services/ldap/strategies/univention.test.js b/test/services/ldap/strategies/univention.test.js index cf6a1dad178..0451e389cd6 100644 --- a/test/services/ldap/strategies/univention.test.js +++ b/test/services/ldap/strategies/univention.test.js @@ -27,6 +27,7 @@ describe('UniventionLDAPStrategy', () => { }); after(() => { + app.unuse('/ldap'); app.use('/ldap', originalLdapService); }); @@ -39,11 +40,13 @@ describe('UniventionLDAPStrategy', () => { function MockLdapService() { return { setup: () => {}, + get: () => {}, searchCollection: sinon.fake.resolves(ldapFakeSchoolSearchResult), }; } beforeEach(() => { + app.unuse('/ldap'); ldapServiceMock = new MockLdapService(); app.use('/ldap', ldapServiceMock); }); @@ -122,6 +125,7 @@ describe('UniventionLDAPStrategy', () => { function MockLdapService() { return { setup: () => {}, + get: () => {}, searchCollection: sinon.fake.resolves([ { dn: 'uid=max1,cn=schueler,cn=users,ou=1,dc=training,dc=ucs', @@ -165,6 +169,7 @@ describe('UniventionLDAPStrategy', () => { } beforeEach(() => { + app.unuse('/ldap'); ldapServiceMock = new MockLdapService(); app.use('/ldap', ldapServiceMock); }); @@ -241,11 +246,13 @@ describe('UniventionLDAPStrategy', () => { function MockLdapService() { return { setup: () => {}, + get: () => {}, searchCollection: sinon.fake.resolves(ldapFakeClassSearchResult), }; } beforeEach(() => { + app.unuse('/ldap'); ldapServiceMock = new MockLdapService(); app.use('/ldap', ldapServiceMock); }); diff --git a/test/services/news/index.test.js b/test/services/news/index.test.js index 3e22ba4e0cc..1110b057dc0 100644 --- a/test/services/news/index.test.js +++ b/test/services/news/index.test.js @@ -4,18 +4,22 @@ const sleep = require('util').promisify(setTimeout); const appPromise = require('../../../src/app'); const { newsModel: News } = require('../../../src/services/news/model'); +const { setupNestServices, closeNestServices } = require('../../utils/setup.nest.services'); describe('news service', () => { let app; - let newsService; + let server; + let nestServices; before(async () => { app = await appPromise(); - newsService = app.service('news'); + nestServices = await setupNestServices(app); + server = await app.listen(0); }); - it('public service has been disabled', () => { - expect(newsService, 'use v3 instead').to.equal(undefined); + after(async () => { + await server.close(); + await closeNestServices(nestServices); }); describe('event handlers', () => { diff --git a/test/services/oauth2/hooks/index.test.js b/test/services/oauth2/hooks/index.test.js index 15f391cc50e..09c1f9ddc0d 100644 --- a/test/services/oauth2/hooks/index.test.js +++ b/test/services/oauth2/hooks/index.test.js @@ -13,7 +13,7 @@ describe('oauth2 token test', () => { before(async () => { app = await appPromise(); - server = app.listen(0); + server = await app.listen(0); nestServices = await setupNestServices(app); createHook = (clientId, userId, scopes) => ({ app, diff --git a/test/services/oauth2/mock.js b/test/services/oauth2/mock.js index f375128705a..deacdcb7b17 100644 --- a/test/services/oauth2/mock.js +++ b/test/services/oauth2/mock.js @@ -63,6 +63,14 @@ describe('oauth2 service mock', function oauthTest() { const o2mock = await oauth2Server({}); app.settings.services.hydra = o2mock.url; + app.unuse('oauth2/baseUrl'); + app.unuse('oauth2/clients'); + app.unuse('oauth2/loginRequest'); + app.unuse('oauth2/logoutRequest'); + app.unuse('oauth2/consentRequest'); + app.unuse('oauth2/introspect'); + app.unuse('oauth2/auth/sessions/consent'); + app.configure(oauth2); server = await app.listen(); nestServices = await setupNestServices(app); diff --git a/test/services/rocketChat/index.test.js b/test/services/rocketChat/index.test.js index 056dd65dc45..78caf281737 100644 --- a/test/services/rocketChat/index.test.js +++ b/test/services/rocketChat/index.test.js @@ -24,7 +24,9 @@ describe('rocket.chat user service', () => { app = await appPromise(); // const rcMock = await rcMockServer({}); const rocketChatService = { - getUserList: () => ({ users: [{ _id: 'someId', username: 'someUsername' }] }), + getUserList: () => { + return { users: [{ _id: 'someId', username: 'someUsername' }] }; + }, }; mockery.enable({ warnOnUnregistered: false, @@ -39,11 +41,17 @@ describe('rocket.chat user service', () => { delete require.cache[require.resolve('../../../src/services/rocketChat/helpers.js')]; delete require.cache[require.resolve('../../../src/services/rocketChat/index.js')]; const rocketChat = require('../../../src/services/rocketChat'); + app = await appPromise(); + + app.unuse('/rocketChat/channel'); + app.unuse('/rocketChat/user'); + app.unuse('/rocketChat/login'); + app.unuse('/rocketChat/logout'); app.configure(rocketChat); rocketChatUserService = app.service('/rocketChat/user'); - server = app.listen(0); + server = await app.listen(0); nestServices = await setupNestServices(app); return server; }); @@ -92,6 +100,10 @@ class NestRocketChatServiceMock { this.app = app; } + get() { + return undefined; + } + async logoutUser(authToken, rcId) { return { authToken, rcId }; } @@ -132,6 +144,10 @@ class RocketChatUserServiceMock { } } + get() { + return undefined; + } + async getOrCreateRocketChatAccount(userId, params) { const rocktChatUserData = { authToken: 'rocketChatToken123', @@ -152,7 +168,7 @@ describe('rocket.chat login service', async () => { before(async () => { app = await appPromise(); - server = app.listen(0); + server = await app.listen(0); nestServices = await setupNestServices(app); rocketChatLoginService = app.service('/rocketChat/login'); @@ -165,7 +181,9 @@ describe('rocket.chat login service', async () => { }); const setupServices = async (RCNestMock, RCUserMock) => { + app.unuse('/nest-rocket-chat'); app.use('/nest-rocket-chat', RCNestMock || new NestRocketChatServiceMock()); + app.unuse('/rocketChat/user'); app.use('/rocketChat/user', RCUserMock || new RocketChatUserServiceMock()); const setupData = await testObjects.setupUser(); return setupData; @@ -222,7 +240,7 @@ describe('rocket.chat logout service', async () => { before(async () => { app = await appPromise(); - server = app.listen(0); + server = await app.listen(0); nestServices = await setupNestServices(app); rocketChatLogoutService = app.service('rocketChat/logout'); @@ -235,7 +253,9 @@ describe('rocket.chat logout service', async () => { }); const setupServices = async (RCNestMock, RCUserMock) => { + app.unuse('/nest-rocket-chat'); app.use('/nest-rocket-chat', RCNestMock || new NestRocketChatServiceMock()); + app.unuse('/rocketChat/user'); app.use('/rocketChat/user', RCUserMock || new RocketChatUserServiceMock()); const setupData = await testObjects.setupUser(); diff --git a/test/services/roster/index.test.js b/test/services/roster/index.test.js index 791ad6b627f..68483007163 100644 --- a/test/services/roster/index.test.js +++ b/test/services/roster/index.test.js @@ -38,7 +38,7 @@ describe('roster service', function oauth() { pseudonymService = app.service('pseudonym'); toolService = app.service('ltiTools'); courseService = app.service('courseModel'); - server = app.listen(0); + server = await app.listen(0); testUser1 = { _id: '0000d231816abba584714c9e' }; // cord carl testToolTemplate = { diff --git a/test/services/school/services/permissions.test.js b/test/services/school/services/permissions.test.js index 135222a94c4..1709d3bc138 100644 --- a/test/services/school/services/permissions.test.js +++ b/test/services/school/services/permissions.test.js @@ -3,12 +3,11 @@ const { Configuration } = require('@hpi-schul-cloud/commons'); const appPromise = require('../../../../src/app'); const { setupNestServices, closeNestServices } = require('../../../utils/setup.nest.services'); const schoolServices = require('../../../../src/services/school/index'); -const testObjects = require('../../helpers/testObjects'); +const testObjects = require('../../helpers/testObjects')(appPromise()); describe('permissons service', () => { let app; let server; - let testHelper; let testSchool; let testUser; let testParams; @@ -17,36 +16,48 @@ describe('permissons service', () => { before(async () => { app = await appPromise(); nestServices = await setupNestServices(app); - testHelper = testObjects(appPromise()); server = await app.listen(0); - testSchool = await testHelper.createTestSchool(); - testUser = await testHelper.createTestUser({ schoolId: testSchool._id, roles: ['administrator'] }); - testParams = await testHelper.generateRequestParamsFromUser(testUser); - testParams.query = {}; - }); - - beforeEach(() => { - delete app.services['school/student/studentlernstorevisibility']; - delete app.services['school/teacher/studentvisibility']; }); - after(async () => { - await testHelper.cleanup(); - await server.close(); await closeNestServices(nestServices); + await server.close(); + }); + + beforeEach(async () => { + testSchool = await testObjects.createTestSchool(); + testUser = await testObjects.createTestUser({ schoolId: testSchool._id, roles: ['administrator'] }); + testParams = await testObjects.generateRequestParamsFromUser(testUser); + testParams.query = {}; + + app.unuse('schools'); + app.unuse('schools/api'); + app.unuse('/schools/:schoolId/maintenance'); + app.unuse('schoolsList'); + app.unuse('schoolsList/api'); + app.unuse('schoolGroup'); + app.unuse('gradeLevels'); + app.unuse('/school/teacher/studentvisibility'); + app.unuse('/school/student/studentlernstorevisibility'); + }); + afterEach(async () => { + await testObjects.cleanup(); }); describe('for STUDENT_LIST permission', () => { it('is not registered if TEACHER_STUDENT_VISIBILITY__IS_CONFIGURABLE is false', async () => { Configuration.set('TEACHER_STUDENT_VISIBILITY__IS_CONFIGURABLE', 'false'); app.configure(schoolServices); - - const service = app.service('/school/teacher/studentvisibility'); - expect(service).to.be.undefined; + try { + const service = app.service('/school/teacher/studentvisibility'); + throw new Error('service should not be registered'); + } catch (error) { + expect(error.message).to.equal(`Can not find service 'school/teacher/studentvisibility'`); + } }); it('changes the STUDENT_LIST permission if TEACHER_STUDENT_VISIBILITY__IS_CONFIGURABLE is true', async () => { Configuration.set('TEACHER_STUDENT_VISIBILITY__IS_CONFIGURABLE', 'true'); + app.configure(schoolServices); const service = app.service('/school/teacher/studentvisibility'); @@ -67,8 +78,12 @@ describe('permissons service', () => { Configuration.set('FEATURE_ADMIN_TOGGLE_STUDENT_LERNSTORE_VIEW_ENABLED', 'false'); app.configure(schoolServices); - const service = app.service('/school/student/studentlernstorevisibility'); - expect(service).to.be.undefined; + try { + const service = app.service('/school/student/studentlernstorevisibility'); + throw new Error('service should not be registered'); + } catch (error) { + expect(error.message).to.equal(`Can not find service 'school/student/studentlernstorevisibility'`); + } }); it('changes the LERNSTORE_VIEW permission if FEATURE_ADMIN_TOGGLE_STUDENT_LERNSTORE_VIEW_ENABLED is true', async () => { diff --git a/test/services/sync/strategies/CSVSyncer/CSVSyncer.integration.test.js b/test/services/sync/strategies/CSVSyncer/CSVSyncer.integration.test.js index 4c5830ddb84..44d52e13220 100644 --- a/test/services/sync/strategies/CSVSyncer/CSVSyncer.integration.test.js +++ b/test/services/sync/strategies/CSVSyncer/CSVSyncer.integration.test.js @@ -472,6 +472,7 @@ describe('CSVSyncer Integration', () => { it('should import five teachers into three existing classes', async () => { const emails = []; + app.unuse('/mails'); app.use( '/mails', new MockEmailService((email) => { @@ -726,6 +727,7 @@ describe('CSVSyncer Integration', () => { }); it('should not be able to send emails', async () => { + app.unuse('/mails'); app.use( '/mails', new MockEmailService(() => { @@ -791,6 +793,7 @@ describe('CSVSyncer Integration', () => { it('should import one user report two failures', async () => { const emails = []; + app.unuse('/mails'); app.use( '/mails', new MockEmailService((email) => { diff --git a/test/services/sync/strategies/TSP/SchoolChange.integration.test.js b/test/services/sync/strategies/TSP/SchoolChange.integration.test.js index d587b4a3119..9364ed6e0e9 100644 --- a/test/services/sync/strategies/TSP/SchoolChange.integration.test.js +++ b/test/services/sync/strategies/TSP/SchoolChange.integration.test.js @@ -20,7 +20,7 @@ describe('SchooolChange API integration tests', () => { before(async () => { app = await appPromise(); - server = app.listen(0); + server = await app.listen(0); nestServices = await setupNestServices(app); nestAccountService = app.service('nest-account-service'); teamService = app.service('teams'); diff --git a/test/services/sync/strategies/TSP/TSP.integration.test.js b/test/services/sync/strategies/TSP/TSP.integration.test.js index 3552ffeca4d..17ef6a9d03a 100644 --- a/test/services/sync/strategies/TSP/TSP.integration.test.js +++ b/test/services/sync/strategies/TSP/TSP.integration.test.js @@ -21,7 +21,7 @@ describe('TSP API integration tests', () => { before(async () => { app = await appPromise(); - server = app.listen(0); + server = await app.listen(0); nestServices = await setupNestServices(app); nestAccountService = app.service('nest-account-service'); }); diff --git a/test/services/teams/hooks/helpers.test.js b/test/services/teams/hooks/helpers.test.js index 3b8293d7cb5..8a5caf39571 100644 --- a/test/services/teams/hooks/helpers.test.js +++ b/test/services/teams/hooks/helpers.test.js @@ -22,8 +22,8 @@ describe('hook helpers', () => { before(async () => { app = await appPromise(); - server = await app.listen(0); nestServices = await setupNestServices(app); + server = await app.listen(0); }); after(async () => { diff --git a/test/services/teams/hooks/index.test.js b/test/services/teams/hooks/index.test.js index 947c2a44380..b1d8ffbfd5c 100644 --- a/test/services/teams/hooks/index.test.js +++ b/test/services/teams/hooks/index.test.js @@ -20,8 +20,8 @@ describe('Team service hook tests.', () => { before(async () => { app = await appPromise(); - server = await app.listen(0); nestServices = await setupNestServices(app); + server = await app.listen(0); }); after(async () => { diff --git a/test/services/user/services/MailRegistrationLink.test.js b/test/services/user/services/MailRegistrationLink.test.js index effa61d77b9..0d71b522985 100644 --- a/test/services/user/services/MailRegistrationLink.test.js +++ b/test/services/user/services/MailRegistrationLink.test.js @@ -12,7 +12,7 @@ describe('MailRegistrationLinkService', () => { before(async () => { app = await appPromise(); mailRegistrationLinkService = app.service('/users/mail/registrationLink'); - server = app.listen(0); + server = await app.listen(0); }); after((done) => { diff --git a/test/services/user/services/QrRegistrationLinks.test.js b/test/services/user/services/QrRegistrationLinks.test.js index 15b02d3445b..a409da20319 100644 --- a/test/services/user/services/QrRegistrationLinks.test.js +++ b/test/services/user/services/QrRegistrationLinks.test.js @@ -167,6 +167,7 @@ describe('qrRegistrationLinks service tests', () => { } catch (err) { expect(err.code).to.equal(400); expect(err.name).to.equal('BadRequest'); + // TODO something changed in the logic of errors? expect(err.message).to.equal('Can not generate QR registration links'); expect(err.errors.message).to.equal('The given role is not supported'); } diff --git a/tsconfig.json b/tsconfig.json index 147df972b6f..576c315cb61 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,7 +21,7 @@ "@shared/*": ["apps/server/src/shared/*"], "@src/*": ["apps/server/src/*"], "@modules/*": ["apps/server/src/modules/*"], - "@infra/*": ["apps/server/src/infra/*"], - }, + "@infra/*": ["apps/server/src/infra/*"] + } } }