From 8ffef549531057af55c310965e28b7f8d749d67c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 12:42:26 +0100 Subject: [PATCH 01/17] Bump @types/passport from 1.0.14 to 1.0.15 (#76) Bumps [@types/passport](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/passport) from 1.0.14 to 1.0.15. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/passport) --- updated-dependencies: - dependency-name: "@types/passport" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Patrick Sachmann --- package-lock.json | 377 +++------------------------------------------- package.json | 2 +- 2 files changed, 22 insertions(+), 357 deletions(-) diff --git a/package-lock.json b/package-lock.json index ed5393656..8c582757f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,6 @@ "connect-redis": "^7.1.0", "express": "^4.18.2", "express-session": "^1.17.3", - "fastify": "^4.18.0", "lodash": "^4.17.21", "lodash-es": "^4.17.21", "nest-commander": "^3.11.0", @@ -53,7 +52,7 @@ "@types/jest": "^29.2.4", "@types/lodash-es": "^4.17.9", "@types/node": "^20.3.1", - "@types/passport": "^1.0.14", + "@types/passport": "^1.0.15", "@types/supertest": "^2.0.11", "@typescript-eslint/eslint-plugin": "^5.13.0", "@typescript-eslint/parser": "^5.0.0", @@ -996,34 +995,6 @@ "node": ">=14" } }, - "node_modules/@fastify/ajv-compiler": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-3.5.0.tgz", - "integrity": "sha512-ebbEtlI7dxXF5ziNdr05mOY8NnDiPB1XvAlLHctRt/Rc+C3LCOVW5imUVX+mhvUhnNzmPBHewUkOFgGlCxgdAA==", - "dependencies": { - "ajv": "^8.11.0", - "ajv-formats": "^2.1.1", - "fast-uri": "^2.0.0" - } - }, - "node_modules/@fastify/deepmerge": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-1.3.0.tgz", - "integrity": "sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==" - }, - "node_modules/@fastify/error": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@fastify/error/-/error-3.4.0.tgz", - "integrity": "sha512-e/mafFwbK3MNqxUcFBLgHhgxsF8UT1m8aj0dAlqEa2nJEgPsRtpHTZ3ObgrgkZ2M1eJHPTwgyUl/tXkvabsZdQ==" - }, - "node_modules/@fastify/fast-json-stringify-compiler": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz", - "integrity": "sha512-aZAXGYo6m22Fk1zZzEUKBvut/CIIQe/BapEORnxiD5Qr0kPHqqI69NtEMCme74h+at72sPhbkb4ZrLd1W3KRLA==", - "dependencies": { - "fast-json-stringify": "^5.7.0" - } - }, "node_modules/@fastify/send": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@fastify/send/-/send-2.1.0.tgz", @@ -2700,9 +2671,9 @@ "dev": true }, "node_modules/@types/passport": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@types/passport/-/passport-1.0.14.tgz", - "integrity": "sha512-D6p2ygR2S7Cq5PO7iUaEIQu/5WrM0tONu6Lxgk0C9r3lafQIlVpWCo3V/KI9To3OqHBxcfQaOeK+8AvwW5RYmw==", + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@types/passport/-/passport-1.0.15.tgz", + "integrity": "sha512-oHOgzPBp5eLI1U/7421qYV/ZySQXMYCBSfRkDe1tQ0YrIbLY/M/76qIXE7Bs7lFyvw1x5QqiNQ9imvh0fQHe9Q==", "dev": true, "dependencies": { "@types/express": "*" @@ -3190,22 +3161,6 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, - "node_modules/abstract-logging": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", - "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==" - }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -3283,6 +3238,7 @@ "version": "8.12.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -3298,6 +3254,7 @@ "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" }, @@ -3445,11 +3402,6 @@ "node": ">= 6" } }, - "node_modules/archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==" - }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -3630,14 +3582,6 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, - "node_modules/atomic-sleep": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", - "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -3650,16 +3594,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/avvio": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/avvio/-/avvio-8.2.1.tgz", - "integrity": "sha512-TAlMYvOuwGyLK3PfBb5WKBXZmXz2fVCgv23d6zZFdle/q3gPjmxBaeuC0pY0Dzs5PWMSgfqqEZkrye19GlDTgw==", - "dependencies": { - "archy": "^1.0.0", - "debug": "^4.0.0", - "fastq": "^1.6.1" - } - }, "node_modules/axios": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", @@ -5634,18 +5568,11 @@ "node": ">= 0.6" } }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "engines": { - "node": ">=6" - } - }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, "engines": { "node": ">=0.8.x" } @@ -5883,20 +5810,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/fast-content-type-parse": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-1.1.0.tgz", - "integrity": "sha512-fBHHqSTFLVnR61C+gltJuE5GkVQMV0S2nqUO8TJ+5Z3qAKG8vAx4FKai1s5jq/inV1+sREynIWSuQ6HgoSXpDQ==" - }, "node_modules/fast-decode-uri-component": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz", - "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==" + "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==", + "optional": true, + "peer": true }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true }, "node_modules/fast-diff": { "version": "1.3.0", @@ -5925,75 +5850,17 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, - "node_modules/fast-json-stringify": { - "version": "5.9.1", - "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-5.9.1.tgz", - "integrity": "sha512-NMrf+uU9UJnTzfxaumMDXK1NWqtPCfGoM9DYIE+ESlaTQqjlANFBy0VAbsm6FB88Mx0nceyi18zTo5kIEUlzxg==", - "dependencies": { - "@fastify/deepmerge": "^1.0.0", - "ajv": "^8.10.0", - "ajv-formats": "^2.1.1", - "fast-deep-equal": "^3.1.3", - "fast-uri": "^2.1.0", - "json-schema-ref-resolver": "^1.0.1", - "rfdc": "^1.2.0" - } - }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, - "node_modules/fast-querystring": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz", - "integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==", - "dependencies": { - "fast-decode-uri-component": "^1.0.1" - } - }, - "node_modules/fast-redact": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.3.0.tgz", - "integrity": "sha512-6T5V1QK1u4oF+ATxs1lWUmlEk6P2T9HqJG3e2DnHOdVgZy2rFJBoEnrIedcTXlkAHU/zKC+7KETJ+KGGKwxgMQ==", - "engines": { - "node": ">=6" - } - }, "node_modules/fast-safe-stringify": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==" }, - "node_modules/fast-uri": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-2.3.0.tgz", - "integrity": "sha512-eel5UKGn369gGEWOqBShmFJWfq/xSJvsgDzgLYC845GneayWvXBf0lJCBn5qTABfewy1ZDPoaR5OZCP+kssfuw==" - }, - "node_modules/fastify": { - "version": "4.24.3", - "resolved": "https://registry.npmjs.org/fastify/-/fastify-4.24.3.tgz", - "integrity": "sha512-6HHJ+R2x2LS3y1PqxnwEIjOTZxFl+8h4kSC/TuDPXtA+v2JnV9yEtOsNSKK1RMD7sIR2y1ZsA4BEFaid/cK5pg==", - "dependencies": { - "@fastify/ajv-compiler": "^3.5.0", - "@fastify/error": "^3.4.0", - "@fastify/fast-json-stringify-compiler": "^4.3.0", - "abstract-logging": "^2.0.1", - "avvio": "^8.2.1", - "fast-content-type-parse": "^1.1.0", - "fast-json-stringify": "^5.8.0", - "find-my-way": "^7.7.0", - "light-my-request": "^5.11.0", - "pino": "^8.16.0", - "process-warning": "^2.2.0", - "proxy-addr": "^2.0.7", - "rfdc": "^1.3.0", - "secure-json-parse": "^2.7.0", - "semver": "^7.5.4", - "toad-cache": "^3.3.0" - } - }, "node_modules/fastify-plugin": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-4.5.1.tgz", @@ -6115,19 +5982,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, - "node_modules/find-my-way": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-7.7.0.tgz", - "integrity": "sha512-+SrHpvQ52Q6W9f3wJoJBbAQULJuNEEQwBvlvYwACDhBTLOTMiQ0HYWh4+vC3OivGP2ENcTI1oKlFA2OepJNjhQ==", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-querystring": "^1.0.0", - "safe-regex2": "^2.0.0" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -7899,18 +7753,11 @@ "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" }, - "node_modules/json-schema-ref-resolver": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-schema-ref-resolver/-/json-schema-ref-resolver-1.0.1.tgz", - "integrity": "sha512-EJAj1pgHc1hxF6vo2Z3s69fMjO1INq6eGHXZ8Z6wCQeldCuwxGK9Sxf4/cScGn3FZubCVUehfWtcDM/PLteCQw==", - "dependencies": { - "fast-deep-equal": "^3.1.3" - } - }, "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -8097,16 +7944,6 @@ "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.46.tgz", "integrity": "sha512-xJqWqMV5hM/6vWj68yqUejkzM9KkYjWFfqimVL4QG4dS5Rij2EXWus/s248x4zUpXeX2gwbLBzQW+aPqUitxIg==" }, - "node_modules/light-my-request": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-5.11.0.tgz", - "integrity": "sha512-qkFCeloXCOMpmEdZ/MV91P8AT4fjwFXWaAFz3lUeStM8RcoM1ks4J/F8r1b3r6y/H4u3ACEJ1T+Gv5bopj7oDA==", - "dependencies": { - "cookie": "^0.5.0", - "process-warning": "^2.0.0", - "set-cookie-parser": "^2.4.1" - } - }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -8735,14 +8572,6 @@ "node": "^10.13.0 || >=12.0.0" } }, - "node_modules/on-exit-leak-free": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", - "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/on-finished": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", @@ -9188,87 +9017,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pino": { - "version": "8.16.1", - "resolved": "https://registry.npmjs.org/pino/-/pino-8.16.1.tgz", - "integrity": "sha512-3bKsVhBmgPjGV9pyn4fO/8RtoVDR8ssW1ev819FsRXlRNgW8gR/9Kx+gCK4UPWd4JjrRDLWpzd/pb1AyWm3MGA==", - "dependencies": { - "atomic-sleep": "^1.0.0", - "fast-redact": "^3.1.1", - "on-exit-leak-free": "^2.1.0", - "pino-abstract-transport": "v1.1.0", - "pino-std-serializers": "^6.0.0", - "process-warning": "^2.0.0", - "quick-format-unescaped": "^4.0.3", - "real-require": "^0.2.0", - "safe-stable-stringify": "^2.3.1", - "sonic-boom": "^3.7.0", - "thread-stream": "^2.0.0" - }, - "bin": { - "pino": "bin.js" - } - }, - "node_modules/pino-abstract-transport": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.1.0.tgz", - "integrity": "sha512-lsleG3/2a/JIWUtf9Q5gUNErBqwIu1tUKTT3dUzaf5DySw9ra1wcqKjJjLX1VTY64Wk1eEOYsVGSaGfCK85ekA==", - "dependencies": { - "readable-stream": "^4.0.0", - "split2": "^4.0.0" - } - }, - "node_modules/pino-abstract-transport/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/pino-abstract-transport/node_modules/readable-stream": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz", - "integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/pino-abstract-transport/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/pino-std-serializers": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", - "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==" - }, "node_modules/pirates": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", @@ -9448,24 +9196,11 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "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", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, - "node_modules/process-warning": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-2.3.0.tgz", - "integrity": "sha512-N6mp1+2jpQr3oCFMz6SeHRGbv6Slb20bRhj4v3xR99HqNToAcOe1MFOp4tytyzOfJn+QtN8Rf7U/h2KAn4kC6g==" - }, "node_modules/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", @@ -9549,6 +9284,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, "engines": { "node": ">=6" } @@ -9602,11 +9338,6 @@ } ] }, - "node_modules/quick-format-unescaped": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", - "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" - }, "node_modules/random-bytes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", @@ -9713,14 +9444,6 @@ "node": ">=8.10.0" } }, - "node_modules/real-require": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", - "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==", - "engines": { - "node": ">= 12.13.0" - } - }, "node_modules/rechoir": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", @@ -9780,6 +9503,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -9850,14 +9574,6 @@ "node": ">=8" } }, - "node_modules/ret": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.2.2.tgz", - "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==", - "engines": { - "node": ">=4" - } - }, "node_modules/retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", @@ -9876,11 +9592,6 @@ "node": ">=0.10.0" } }, - "node_modules/rfdc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" - }, "node_modules/rimraf": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz", @@ -10036,22 +9747,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/safe-regex2": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-2.0.0.tgz", - "integrity": "sha512-PaUSFsUaNNuKwkBijoAPHAK6/eM6VirvyPWlZ7BAQy4D+hCvh4B6lIG+nPdhbFfIbP+gTGBcrdsOaUs0F+ZBOQ==", - "dependencies": { - "ret": "~0.2.0" - } - }, - "node_modules/safe-stable-stringify": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", - "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", - "engines": { - "node": ">=10" - } - }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -10106,15 +9801,11 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, - "node_modules/secure-json-parse": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz", - "integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==" - }, "node_modules/semver": { "version": "7.5.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -10129,6 +9820,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -10139,7 +9831,8 @@ "node_modules/semver/node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "node_modules/send": { "version": "0.18.0", @@ -10205,11 +9898,6 @@ "node": ">= 0.8.0" } }, - "node_modules/set-cookie-parser": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz", - "integrity": "sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==" - }, "node_modules/set-function-name": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", @@ -10320,14 +10008,6 @@ "node": ">=8" } }, - "node_modules/sonic-boom": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.7.0.tgz", - "integrity": "sha512-IudtNvSqA/ObjN97tfgNmOKyDOs4dNcg4cUUsHDebqsgb8wGBBwb31LIgShNO8fye0dFI52X1+tFoKKI6Rq1Gg==", - "dependencies": { - "atomic-sleep": "^1.0.0" - } - }, "node_modules/source-map": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", @@ -10915,14 +10595,6 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "node_modules/thread-stream": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.4.1.tgz", - "integrity": "sha512-d/Ex2iWd1whipbT681JmTINKw0ZwOUBZm7+Gjs64DHuX34mmw8vJL2bFAaNacaW72zYiTJxSHi5abUuOi5nsfg==", - "dependencies": { - "real-require": "^0.2.0" - } - }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -10973,14 +10645,6 @@ "node": ">=8.0" } }, - "node_modules/toad-cache": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.3.0.tgz", - "integrity": "sha512-3oDzcogWGHZdkwrHyvJVpPjA7oNzY6ENOV3PsWJY9XYPZ6INo94Yd47s5may1U+nleBPwDhrRiTPMIvKaa3MQg==", - "engines": { - "node": ">=12" - } - }, "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", @@ -11391,6 +11055,7 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, "dependencies": { "punycode": "^2.1.0" } diff --git a/package.json b/package.json index 69b0608b0..0740d3b5a 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "@types/jest": "^29.2.4", "@types/lodash-es": "^4.17.9", "@types/node": "^20.3.1", - "@types/passport": "^1.0.14", + "@types/passport": "^1.0.15", "@types/supertest": "^2.0.11", "@typescript-eslint/eslint-plugin": "^5.13.0", "@typescript-eslint/parser": "^5.0.0", From f696f525f3e137950200980d94917884e75a321f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:54:35 +0100 Subject: [PATCH 02/17] Bump prettier from 2.8.8 to 3.0.3 (#75) * Bump prettier from 2.8.8 to 3.0.3 Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.0.3. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.0.3) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Updating peer dependency eslint-plugin-prettier * Fixing linter errors --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Patrick Sachmann --- package-lock.json | 384 +++++++++++++++++- package.json | 4 +- src/modules/frontend/auth/oidc.strategy.ts | 5 +- .../frontend/outbound/backend-http.service.ts | 5 +- .../domain/keycloak-admin-client.service.ts | 5 +- .../api/organisation.controller.spec.ts | 5 +- .../domain/organisation.service.spec.ts | 10 +- .../persistence/organisation.repo.ts | 5 +- src/modules/person/api/person.controller.ts | 5 +- src/modules/person/api/personenkontext.uc.ts | 5 +- .../domain/personenkontext.service.spec.ts | 5 +- src/modules/person/persistence/person.repo.ts | 5 +- .../persistence/personenkontext.repo.ts | 5 +- .../rolle/domain/rolle.service.spec.ts | 40 +- src/modules/rolle/domain/rolle.service.ts | 10 +- .../repo/person-rollen-zuweisung.repo.spec.ts | 5 +- .../repo/person-rollen-zuweisung.repo.ts | 5 +- .../rolle/repo/rolle-recht.repo.spec.ts | 10 +- src/modules/rolle/repo/rolle-recht.repo.ts | 5 +- .../rollen-berechtigungs-zuweisung.repo.ts | 5 +- .../rolle/repo/service-provider.repo.spec.ts | 5 +- .../rolle/repo/service-provider.repo.ts | 5 +- 22 files changed, 452 insertions(+), 86 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8c582757f..aa6d05965 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,9 +60,9 @@ "eslint-config-airbnb-typescript": "^17.0.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-jest": "^27.2.1", - "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-prettier": "^5.0.1", "jest": "^29.6.2", - "prettier": "^2.3.2", + "prettier": "^3.0.3", "source-map-support": "^0.5.20", "supertest": "^6.1.3", "testcontainers": "^9.9.0", @@ -2291,6 +2291,32 @@ "npm": ">=5.0.0" } }, + "node_modules/@pkgr/utils": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz", + "integrity": "sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "fast-glob": "^3.3.0", + "is-glob": "^4.0.3", + "open": "^9.1.0", + "picocolors": "^1.0.0", + "tslib": "^2.6.0" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/@pkgr/utils/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, "node_modules/@redis/bloom": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", @@ -3754,6 +3780,15 @@ "tweetnacl": "^0.14.3" } }, + "node_modules/big-integer": { + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -3849,6 +3884,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bplist-parser": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", + "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", + "dev": true, + "dependencies": { + "big-integer": "^1.6.44" + }, + "engines": { + "node": ">= 5.10.0" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -3984,6 +4031,21 @@ "node": ">=10.0.0" } }, + "node_modules/bundle-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-3.0.0.tgz", + "integrity": "sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==", + "dev": true, + "dependencies": { + "run-applescript": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -4644,6 +4706,150 @@ "node": ">=0.10.0" } }, + "node_modules/default-browser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-4.0.0.tgz", + "integrity": "sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==", + "dev": true, + "dependencies": { + "bundle-name": "^3.0.0", + "default-browser-id": "^3.0.0", + "execa": "^7.1.1", + "titleize": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-3.0.0.tgz", + "integrity": "sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==", + "dev": true, + "dependencies": { + "bplist-parser": "^0.2.0", + "untildify": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/execa": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-7.2.0.tgz", + "integrity": "sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.1", + "human-signals": "^4.3.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^3.0.7", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": "^14.18.0 || ^16.14.0 || >=18.0.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/default-browser/node_modules/human-signals": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", + "integrity": "sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==", + "dev": true, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/default-browser/node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/npm-run-path": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", + "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser/node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/defaults": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", @@ -4669,6 +4875,18 @@ "node": ">= 0.4" } }, + "node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/define-properties": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", @@ -5358,21 +5576,29 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", - "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.1.tgz", + "integrity": "sha512-m3u5RnR56asrwV/lDC4GHorlW75DsFfmUcjfCYylTUs85dBRnB7VM6xG8eCMJdeDRnppzmxZVf1GEPJvl1JmNg==", "dev": true, "dependencies": { - "prettier-linter-helpers": "^1.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.5" }, "engines": { - "node": ">=12.0.0" + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/prettier" }, "peerDependencies": { - "eslint": ">=7.28.0", - "prettier": ">=2.0.0" + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "prettier": ">=3.0.0" }, "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, "eslint-config-prettier": { "optional": true } @@ -6832,6 +7058,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -6868,6 +7109,24 @@ "node": ">=0.10.0" } }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-interactive": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", @@ -7035,6 +7294,33 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-wsl/node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is2": { "version": "2.0.9", "resolved": "https://registry.npmjs.org/is2/-/is2-2.0.9.tgz", @@ -8614,6 +8900,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/open": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-9.1.0.tgz", + "integrity": "sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==", + "dev": true, + "dependencies": { + "default-browser": "^4.0.0", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/openid-client": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.6.0.tgz", @@ -9144,15 +9448,15 @@ } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -9652,6 +9956,21 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/run-applescript": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz", + "integrity": "sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==", + "dev": true, + "dependencies": { + "execa": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -10346,6 +10665,22 @@ "node": ">=0.10" } }, + "node_modules/synckit": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", + "integrity": "sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==", + "dev": true, + "dependencies": { + "@pkgr/utils": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -10608,6 +10943,18 @@ "node": ">=8" } }, + "node_modules/titleize": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz", + "integrity": "sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -11021,6 +11368,15 @@ "node": ">= 0.8" } }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/update-browserslist-db": { "version": "1.0.13", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", diff --git a/package.json b/package.json index 0740d3b5a..4db905593 100644 --- a/package.json +++ b/package.json @@ -82,9 +82,9 @@ "eslint-config-airbnb-typescript": "^17.0.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-jest": "^27.2.1", - "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-prettier": "^5.0.1", "jest": "^29.6.2", - "prettier": "^2.3.2", + "prettier": "^3.0.3", "source-map-support": "^0.5.20", "supertest": "^6.1.3", "testcontainers": "^9.9.0", diff --git a/src/modules/frontend/auth/oidc.strategy.ts b/src/modules/frontend/auth/oidc.strategy.ts index 899ad3635..214fb832b 100644 --- a/src/modules/frontend/auth/oidc.strategy.ts +++ b/src/modules/frontend/auth/oidc.strategy.ts @@ -8,7 +8,10 @@ import { OIDC_CLIENT } from './oidc-client.service.js'; @Injectable() export class OpenIdConnectStrategy extends PassportStrategy(Strategy, 'oidc') { - public constructor(@Inject(OIDC_CLIENT) private client: Client, configService: ConfigService) { + public constructor( + @Inject(OIDC_CLIENT) private client: Client, + configService: ConfigService, + ) { const frontendConfig: FrontendConfig = configService.getOrThrow('FRONTEND'); super({ diff --git a/src/modules/frontend/outbound/backend-http.service.ts b/src/modules/frontend/outbound/backend-http.service.ts index 091c074e1..27028c88b 100644 --- a/src/modules/frontend/outbound/backend-http.service.ts +++ b/src/modules/frontend/outbound/backend-http.service.ts @@ -31,7 +31,10 @@ function wrapAxiosError(observable: Observable): Observable { export class BackendHttpService { private backend: string; - public constructor(private httpService: HttpService, config: ConfigService) { + public constructor( + private httpService: HttpService, + config: ConfigService, + ) { this.backend = config.getOrThrow('FRONTEND').BACKEND_ADDRESS; } diff --git a/src/modules/keycloak-administration/domain/keycloak-admin-client.service.ts b/src/modules/keycloak-administration/domain/keycloak-admin-client.service.ts index 17311ede4..ea6c66402 100644 --- a/src/modules/keycloak-administration/domain/keycloak-admin-client.service.ts +++ b/src/modules/keycloak-administration/domain/keycloak-admin-client.service.ts @@ -13,7 +13,10 @@ export class KeycloakAdministrationService { private kcConfig: KeycloakConfig; - public constructor(private readonly kcAdminClient: KeycloakAdminClient, private readonly config: ConfigService) { + public constructor( + private readonly kcAdminClient: KeycloakAdminClient, + private readonly config: ConfigService, + ) { this.kcConfig = this.config.getOrThrow('KEYCLOAK'); this.kcAdminClient.setConfig({ diff --git a/src/modules/organisation/api/organisation.controller.spec.ts b/src/modules/organisation/api/organisation.controller.spec.ts index 3255af0fc..27c007383 100644 --- a/src/modules/organisation/api/organisation.controller.spec.ts +++ b/src/modules/organisation/api/organisation.controller.spec.ts @@ -142,9 +142,8 @@ describe('OrganisationController', () => { organisationUcMock.findAll.mockResolvedValue(mockedPagedResponse); - const result: Paged = await organisationController.findOrganizations( - organisationDto, - ); + const result: Paged = + await organisationController.findOrganizations(organisationDto); expect(result).toEqual(mockedPagedResponse); expect(organisationUcMock.findAll).toHaveBeenCalledTimes(1); diff --git a/src/modules/organisation/domain/organisation.service.spec.ts b/src/modules/organisation/domain/organisation.service.spec.ts index 7ff980ef1..8b806eef6 100644 --- a/src/modules/organisation/domain/organisation.service.spec.ts +++ b/src/modules/organisation/domain/organisation.service.spec.ts @@ -105,9 +105,8 @@ describe('OrganisationService', () => { organisationRepoMock.findBy.mockResolvedValue([organisations, total]); - const result: Paged> = await organisationService.findAllOrganizations( - organisationDo, - ); + const result: Paged> = + await organisationService.findAllOrganizations(organisationDo); expect(result).toEqual({ total: total, @@ -124,9 +123,8 @@ describe('OrganisationService', () => { organisationRepoMock.findBy.mockResolvedValue([[], 0]); - const result: Paged> = await organisationService.findAllOrganizations( - organisationDo, - ); + const result: Paged> = + await organisationService.findAllOrganizations(organisationDo); expect(result.items).toHaveLength(0); expect(result.items).toBeInstanceOf(Array); diff --git a/src/modules/organisation/persistence/organisation.repo.ts b/src/modules/organisation/persistence/organisation.repo.ts index 236503bcc..46ba7468a 100644 --- a/src/modules/organisation/persistence/organisation.repo.ts +++ b/src/modules/organisation/persistence/organisation.repo.ts @@ -9,7 +9,10 @@ import { OrganisationScope } from './organisation.scope.js'; @Injectable() export class OrganisationRepo { - public constructor(private readonly em: EntityManager, @Inject(getMapperToken()) private readonly mapper: Mapper) {} + public constructor( + private readonly em: EntityManager, + @Inject(getMapperToken()) private readonly mapper: Mapper, + ) {} private async create(organisationDo: OrganisationDo): Promise> { const organisation: OrganisationEntity = this.mapper.map(organisationDo, OrganisationDo, OrganisationEntity); diff --git a/src/modules/person/api/person.controller.ts b/src/modules/person/api/person.controller.ts index 78dbcaad5..172c7e7cf 100644 --- a/src/modules/person/api/person.controller.ts +++ b/src/modules/person/api/person.controller.ts @@ -105,9 +105,8 @@ export class PersonController { ); personenkontextDto.personId = pathParams.personId; - const createdPersonenkontext: CreatedPersonenkontextDto = await this.personenkontextUc.createPersonenkontext( - personenkontextDto, - ); + const createdPersonenkontext: CreatedPersonenkontextDto = + await this.personenkontextUc.createPersonenkontext(personenkontextDto); return this.mapper.map(createdPersonenkontext, CreatedPersonenkontextDto, PersonenkontextResponse); } diff --git a/src/modules/person/api/personenkontext.uc.ts b/src/modules/person/api/personenkontext.uc.ts index 97a335a93..2931dc0aa 100644 --- a/src/modules/person/api/personenkontext.uc.ts +++ b/src/modules/person/api/personenkontext.uc.ts @@ -30,9 +30,8 @@ export class PersonenkontextUc { CreatePersonenkontextDto, PersonenkontextDo, ); - const result: Result> = await this.personenkontextService.createPersonenkontext( - personenkontextDo, - ); + const result: Result> = + await this.personenkontextService.createPersonenkontext(personenkontextDo); if (result.ok) { return this.mapper.map(result.value, PersonenkontextDo, CreatedPersonenkontextDto); } diff --git a/src/modules/person/domain/personenkontext.service.spec.ts b/src/modules/person/domain/personenkontext.service.spec.ts index 1c5c67568..0cd0bca49 100644 --- a/src/modules/person/domain/personenkontext.service.spec.ts +++ b/src/modules/person/domain/personenkontext.service.spec.ts @@ -81,9 +81,8 @@ describe('PersonenkontextService', () => { personRepoMock.findById.mockResolvedValueOnce(personDo); personenkontextRepoMock.save.mockResolvedValue(personenkontextDo as unknown as PersonenkontextDo); mapperMock.map.mockReturnValue(personenkontextDo as unknown as Dictionary); - const result: Result> = await personenkontextService.createPersonenkontext( - personenkontextDo, - ); + const result: Result> = + await personenkontextService.createPersonenkontext(personenkontextDo); expect(result).toEqual>>({ ok: true, value: personenkontextDo as unknown as PersonenkontextDo, diff --git a/src/modules/person/persistence/person.repo.ts b/src/modules/person/persistence/person.repo.ts index 3587afb41..840a07d1d 100644 --- a/src/modules/person/persistence/person.repo.ts +++ b/src/modules/person/persistence/person.repo.ts @@ -9,7 +9,10 @@ import { PersonScope } from './person.scope.js'; @Injectable() export class PersonRepo { - public constructor(private readonly em: EntityManager, @Inject(getMapperToken()) private readonly mapper: Mapper) {} + public constructor( + private readonly em: EntityManager, + @Inject(getMapperToken()) private readonly mapper: Mapper, + ) {} public get entityName(): EntityName { return PersonEntity; diff --git a/src/modules/person/persistence/personenkontext.repo.ts b/src/modules/person/persistence/personenkontext.repo.ts index 20f704bfe..ac708f868 100644 --- a/src/modules/person/persistence/personenkontext.repo.ts +++ b/src/modules/person/persistence/personenkontext.repo.ts @@ -8,7 +8,10 @@ import { PersonenkontextEntity } from './personenkontext.entity.js'; @Injectable() export class PersonenkontextRepo { - public constructor(private readonly em: EntityManager, @Inject(getMapperToken()) private readonly mapper: Mapper) {} + public constructor( + private readonly em: EntityManager, + @Inject(getMapperToken()) private readonly mapper: Mapper, + ) {} public async save(personenkontextDo: PersonenkontextDo): Promise>> { if (personenkontextDo.id) { diff --git a/src/modules/rolle/domain/rolle.service.spec.ts b/src/modules/rolle/domain/rolle.service.spec.ts index ad711bc4b..5c939eec0 100644 --- a/src/modules/rolle/domain/rolle.service.spec.ts +++ b/src/modules/rolle/domain/rolle.service.spec.ts @@ -142,9 +142,8 @@ describe('RolleService', () => { array.push(rolleBerechtigungsZuweisung); rolleBerechtigungsZuweisungRepo.findAllRolleBerechtigungsZuweisungByRolle.mockResolvedValue(array); mapperMock.map.mockReturnValue(rolleBerechtigungsZuweisung as unknown as Dictionary); - const result: RolleBerechtigungsZuweisungDo[] = await rolleService.getRolleBerechtigungsZuweisung( - rolle, - ); + const result: RolleBerechtigungsZuweisungDo[] = + await rolleService.getRolleBerechtigungsZuweisung(rolle); expect(result).not.toBeNull(); }); }); @@ -157,9 +156,8 @@ describe('RolleService', () => { DoFactory.createRolleBerechtigungsZuweisung(rolle, serviceProviderZugriffDo, true); rolleBerechtigungsZuweisungRepo.findAllRolleBerechtigungsZuweisungByRolle.mockResolvedValue([]); mapperMock.map.mockReturnValue(rolleBerechtigungsZuweisung as unknown as Dictionary); - const result: RolleBerechtigungsZuweisungDo[] = await rolleService.getRolleBerechtigungsZuweisung( - rolle, - ); + const result: RolleBerechtigungsZuweisungDo[] = + await rolleService.getRolleBerechtigungsZuweisung(rolle); expect(result).toHaveLength(0); }); }); @@ -277,18 +275,16 @@ describe('RolleService', () => { describe('when ServiceProviderZugriff exists', () => { it('should get a ServiceProviderZugriff ', async () => { initServiceProviderTestSuccessEssentials(); - const result: ServiceProviderZugriffDo[] = await rolleService.getServiceProviderZugriffList( - PERSON_ID, - ); + const result: ServiceProviderZugriffDo[] = + await rolleService.getServiceProviderZugriffList(PERSON_ID); expect(result).not.toBeNull(); }); }); describe('when ServiceProviderZugriff does not exist', () => { it('should get an empty array ', async () => { initServiceProviderTestFailEssentials(); - const result: ServiceProviderZugriffDo[] = await rolleService.getServiceProviderZugriffList( - PERSON_ID, - ); + const result: ServiceProviderZugriffDo[] = + await rolleService.getServiceProviderZugriffList(PERSON_ID); expect(result).toHaveLength(0); }); }); @@ -317,9 +313,8 @@ describe('RolleService', () => { initServiceProviderTestSuccessEssentials(); const person: PersonDo = DoFactory.createPerson(true); personRepo.findByKeycloakUserId.mockResolvedValue(person); - const result: ServiceProviderDo[] = await rolleService.getAvailableServiceProvidersByUserSub( - PERSON_ID, - ); + const result: ServiceProviderDo[] = + await rolleService.getAvailableServiceProvidersByUserSub(PERSON_ID); expect(result).not.toBeNull(); }); }); @@ -327,9 +322,8 @@ describe('RolleService', () => { it('should get an empty array ', async () => { initServiceProviderTestFailEssentials(); personRepo.findByKeycloakUserId.mockResolvedValue(null); - const result: ServiceProviderDo[] = await rolleService.getAvailableServiceProvidersByUserSub( - PERSON_ID, - ); + const result: ServiceProviderDo[] = + await rolleService.getAvailableServiceProvidersByUserSub(PERSON_ID); expect(result).toHaveLength(0); }); }); @@ -341,9 +335,8 @@ describe('RolleService', () => { initServiceProviderTestSuccessEssentials(); const person: PersonDo = DoFactory.createPerson(true); personRepo.findByKeycloakUserId.mockResolvedValue(person); - const result: GetServiceProviderInfoDo[] = await rolleService.getServiceProviderInfoListByUserSub( - PERSON_ID, - ); + const result: GetServiceProviderInfoDo[] = + await rolleService.getServiceProviderInfoListByUserSub(PERSON_ID); expect(result).not.toBeNull(); expect(result).not.toHaveLength(0); }); @@ -352,9 +345,8 @@ describe('RolleService', () => { it('should get an empty array ', async () => { initServiceProviderTestFailEssentials(); personRepo.findByKeycloakUserId.mockResolvedValue(null); - const result: GetServiceProviderInfoDo[] = await rolleService.getServiceProviderInfoListByUserSub( - PERSON_ID, - ); + const result: GetServiceProviderInfoDo[] = + await rolleService.getServiceProviderInfoListByUserSub(PERSON_ID); expect(result).toHaveLength(0); }); }); diff --git a/src/modules/rolle/domain/rolle.service.ts b/src/modules/rolle/domain/rolle.service.ts index 2dbe908b6..15f8b7df1 100644 --- a/src/modules/rolle/domain/rolle.service.ts +++ b/src/modules/rolle/domain/rolle.service.ts @@ -71,14 +71,12 @@ export class RolleService { } public async getAvailableServiceProviders(personId: string): Promise[]> { - const serviceProviderZugriffList: ServiceProviderZugriffDo[] = await this.getServiceProviderZugriffList( - personId, - ); + const serviceProviderZugriffList: ServiceProviderZugriffDo[] = + await this.getServiceProviderZugriffList(personId); let serviceProviderList: ServiceProviderDo[] = []; for (const serviceProviderZugriff of serviceProviderZugriffList) { - const serviceProviderForServiceProviderZugriff: ServiceProviderDo[] = await this.getServiceProvider( - serviceProviderZugriff, - ); + const serviceProviderForServiceProviderZugriff: ServiceProviderDo[] = + await this.getServiceProvider(serviceProviderZugriff); serviceProviderList = serviceProviderList.concat(serviceProviderForServiceProviderZugriff); } return serviceProviderList; diff --git a/src/modules/rolle/repo/person-rollen-zuweisung.repo.spec.ts b/src/modules/rolle/repo/person-rollen-zuweisung.repo.spec.ts index 43234818e..d10721766 100644 --- a/src/modules/rolle/repo/person-rollen-zuweisung.repo.spec.ts +++ b/src/modules/rolle/repo/person-rollen-zuweisung.repo.spec.ts @@ -89,9 +89,8 @@ describe('PersonRollenZuweisungRepo', () => { describe('when not found by personId', () => { it('should return null', async () => { - const foundPersonRollenZuweisung: Option[]> = await sut.findAllByPersonId( - '1', - ); + const foundPersonRollenZuweisung: Option[]> = + await sut.findAllByPersonId('1'); expect(foundPersonRollenZuweisung).toHaveLength(0); }); }); diff --git a/src/modules/rolle/repo/person-rollen-zuweisung.repo.ts b/src/modules/rolle/repo/person-rollen-zuweisung.repo.ts index 648aebbfd..a3920953a 100644 --- a/src/modules/rolle/repo/person-rollen-zuweisung.repo.ts +++ b/src/modules/rolle/repo/person-rollen-zuweisung.repo.ts @@ -7,7 +7,10 @@ import { PersonRollenZuweisungDo } from '../domain/person-rollen-zuweisung.do.js @Injectable() export class PersonRollenZuweisungRepo { - public constructor(private readonly em: EntityManager, @Inject(getMapperToken()) private readonly mapper: Mapper) {} + public constructor( + private readonly em: EntityManager, + @Inject(getMapperToken()) private readonly mapper: Mapper, + ) {} public async findAllByPersonId(personId: string): Promise[]> { const query: Record = {}; diff --git a/src/modules/rolle/repo/rolle-recht.repo.spec.ts b/src/modules/rolle/repo/rolle-recht.repo.spec.ts index 915ce2359..1631b8d2f 100644 --- a/src/modules/rolle/repo/rolle-recht.repo.spec.ts +++ b/src/modules/rolle/repo/rolle-recht.repo.spec.ts @@ -88,9 +88,8 @@ describe('RolleRechtRepo', () => { const rolleBerechtigungsZuweisungDo: RolleBerechtigungsZuweisungDo = DoFactory.createRolleBerechtigungsZuweisung(rolleDo, serviceProviderZugriffDo, false); - const foundRolleRecht: RolleRechtDo[] = await sut.findAllRolleRecht( - rolleBerechtigungsZuweisungDo, - ); + const foundRolleRecht: RolleRechtDo[] = + await sut.findAllRolleRecht(rolleBerechtigungsZuweisungDo); expect(foundRolleRecht).not.toBeNull(); expect(foundRolleRecht).toHaveLength(1); }); @@ -103,9 +102,8 @@ describe('RolleRechtRepo', () => { DoFactory.createServiceProviderZugriff(true); const rolleBerechtigungsZuweisungDo: RolleBerechtigungsZuweisungDo = DoFactory.createRolleBerechtigungsZuweisung(rolleDo, serviceProviderZugriffDo, false); - const foundRolleRecht: Option[]> = await sut.findAllRolleRecht( - rolleBerechtigungsZuweisungDo, - ); + const foundRolleRecht: Option[]> = + await sut.findAllRolleRecht(rolleBerechtigungsZuweisungDo); expect(foundRolleRecht).toHaveLength(0); }); }); diff --git a/src/modules/rolle/repo/rolle-recht.repo.ts b/src/modules/rolle/repo/rolle-recht.repo.ts index c3693296a..529b645f1 100644 --- a/src/modules/rolle/repo/rolle-recht.repo.ts +++ b/src/modules/rolle/repo/rolle-recht.repo.ts @@ -10,7 +10,10 @@ import { ServiceProviderZugriffDo } from '../domain/service-provider-zugriff.do. @Injectable() export class RolleRechtRepo { - public constructor(private readonly em: EntityManager, @Inject(getMapperToken()) private readonly mapper: Mapper) {} + public constructor( + private readonly em: EntityManager, + @Inject(getMapperToken()) private readonly mapper: Mapper, + ) {} public async findAllRolleRecht( rolleBerechtigungsZuweisung: RolleBerechtigungsZuweisungDo, diff --git a/src/modules/rolle/repo/rollen-berechtigungs-zuweisung.repo.ts b/src/modules/rolle/repo/rollen-berechtigungs-zuweisung.repo.ts index 4a5190215..e74c2586e 100644 --- a/src/modules/rolle/repo/rollen-berechtigungs-zuweisung.repo.ts +++ b/src/modules/rolle/repo/rollen-berechtigungs-zuweisung.repo.ts @@ -8,7 +8,10 @@ import { RolleDo } from '../domain/rolle.do.js'; @Injectable() export class RollenBerechtigungsZuweisungRepo { - public constructor(private readonly em: EntityManager, @Inject(getMapperToken()) private readonly mapper: Mapper) {} + public constructor( + private readonly em: EntityManager, + @Inject(getMapperToken()) private readonly mapper: Mapper, + ) {} public async findAllRolleBerechtigungsZuweisungByRolle( rolle: RolleDo, diff --git a/src/modules/rolle/repo/service-provider.repo.spec.ts b/src/modules/rolle/repo/service-provider.repo.spec.ts index ae0b8aa88..d34c7083a 100644 --- a/src/modules/rolle/repo/service-provider.repo.spec.ts +++ b/src/modules/rolle/repo/service-provider.repo.spec.ts @@ -83,9 +83,8 @@ describe('ServiceProviderRepo', () => { it('should return null', async () => { const serviceProviderZugriffDo: ServiceProviderZugriffDo = DoFactory.createServiceProviderZugriff(true); - const foundServiceProvider: Option[]> = await sut.findAll( - serviceProviderZugriffDo, - ); + const foundServiceProvider: Option[]> = + await sut.findAll(serviceProviderZugriffDo); expect(foundServiceProvider).toHaveLength(0); }); }); diff --git a/src/modules/rolle/repo/service-provider.repo.ts b/src/modules/rolle/repo/service-provider.repo.ts index 45e569ced..969df705c 100644 --- a/src/modules/rolle/repo/service-provider.repo.ts +++ b/src/modules/rolle/repo/service-provider.repo.ts @@ -8,7 +8,10 @@ import { ServiceProviderEntity } from '../entity/service-provider.entity.js'; @Injectable() export class ServiceProviderRepo { - public constructor(private readonly em: EntityManager, @Inject(getMapperToken()) private readonly mapper: Mapper) {} + public constructor( + private readonly em: EntityManager, + @Inject(getMapperToken()) private readonly mapper: Mapper, + ) {} public async findAll( serviceProviderZugriff: ServiceProviderZugriffDo, From b9ca1c75ebf1cf51b23059f7ebf72e5b8312e97f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 14:29:13 +0100 Subject: [PATCH 03/17] Bump @types/express from 4.17.20 to 4.17.21 (#77) Bumps [@types/express](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/express) from 4.17.20 to 4.17.21. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/express) --- updated-dependencies: - dependency-name: "@types/express" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Patrick Sachmann --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index aa6d05965..993f3c651 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "@nestjs/cli": "^9.0.0", "@nestjs/schematics": "^9.0.0", "@nestjs/testing": "^9.4.2", - "@types/express": "^4.17.13", + "@types/express": "^4.17.21", "@types/express-session": "^1.17.8", "@types/jest": "^29.2.4", "@types/lodash-es": "^4.17.9", @@ -2560,9 +2560,9 @@ "dev": true }, "node_modules/@types/express": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.20.tgz", - "integrity": "sha512-rOaqlkgEvOW495xErXMsmyX3WKBInbhG5eqojXYi3cGUaLoRDlXa5d52fkfWZT963AZ3v2eZ4MbKE6WpDAGVsw==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "dev": true, "dependencies": { "@types/body-parser": "*", diff --git a/package.json b/package.json index 4db905593..f030755f3 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "@nestjs/cli": "^9.0.0", "@nestjs/schematics": "^9.0.0", "@nestjs/testing": "^9.4.2", - "@types/express": "^4.17.13", + "@types/express": "^4.17.21", "@types/express-session": "^1.17.8", "@types/jest": "^29.2.4", "@types/lodash-es": "^4.17.9", From 1afd693061b7b5417c341391f3492f6d8cebc6bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 14:37:51 +0100 Subject: [PATCH 04/17] Bump ts-loader from 9.4.4 to 9.5.0 (#71) Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.4.4 to 9.5.0. - [Release notes](https://github.com/TypeStrong/ts-loader/releases) - [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md) - [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.4.4...v9.5.0) --- updated-dependencies: - dependency-name: ts-loader dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Patrick Sachmann --- package-lock.json | 11 ++++++----- package.json | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 993f3c651..b32669c83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,7 +67,7 @@ "supertest": "^6.1.3", "testcontainers": "^9.9.0", "ts-jest": "^29.1.0", - "ts-loader": "^9.2.3", + "ts-loader": "^9.5.0", "ts-node": "^10.0.0", "typescript": "^5.0.0" }, @@ -11058,15 +11058,16 @@ } }, "node_modules/ts-loader": { - "version": "9.4.4", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.4.tgz", - "integrity": "sha512-MLukxDHBl8OJ5Dk3y69IsKVFRA/6MwzEqBgh+OXMPB/OD01KQuWPFd1WAQP8a5PeSCAxfnkhiuWqfmFJzJQt9w==", + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.0.tgz", + "integrity": "sha512-LLlB/pkB4q9mW2yLdFMnK3dEHbrBjeZTYguaaIfusyojBgAGf5kF+O6KcWqiGzWqHk0LBsoolrp4VftEURhybg==", "dev": true, "dependencies": { "chalk": "^4.1.0", "enhanced-resolve": "^5.0.0", "micromatch": "^4.0.0", - "semver": "^7.3.4" + "semver": "^7.3.4", + "source-map": "^0.7.4" }, "engines": { "node": ">=12.0.0" diff --git a/package.json b/package.json index f030755f3..8eb5a49fd 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "supertest": "^6.1.3", "testcontainers": "^9.9.0", "ts-jest": "^29.1.0", - "ts-loader": "^9.2.3", + "ts-loader": "^9.5.0", "ts-node": "^10.0.0", "typescript": "^5.0.0" } From 3e14ae6b7a350d7b6f1925b2aa08c151cbff2aa7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 14:59:39 +0100 Subject: [PATCH 05/17] Bump @nestjs/swagger from 7.1.13 to 7.1.14 (#74) Bumps [@nestjs/swagger](https://github.com/nestjs/swagger) from 7.1.13 to 7.1.14. - [Release notes](https://github.com/nestjs/swagger/releases) - [Changelog](https://github.com/nestjs/swagger/blob/master/.release-it.json) - [Commits](https://github.com/nestjs/swagger/compare/7.1.13...7.1.14) --- updated-dependencies: - dependency-name: "@nestjs/swagger" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Patrick Sachmann --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index b32669c83..2357c339e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "@nestjs/core": "^9.0.0", "@nestjs/passport": "^10.0.2", "@nestjs/platform-express": "^9.0.0", - "@nestjs/swagger": "^7.0.4", + "@nestjs/swagger": "^7.1.14", "@nestjs/terminus": "^9.0.0", "@s3pweb/keycloak-admin-client-cjs": "^22.0.1", "axios": "^1.5.0", @@ -2120,9 +2120,9 @@ } }, "node_modules/@nestjs/swagger": { - "version": "7.1.13", - "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-7.1.13.tgz", - "integrity": "sha512-aHfW0rDZZKTuPVSkxutBCB16lBy5vrsHVoRF5RvPtH7U2cm4Vf+OnfhxKKuG2g2Xocn9sDL+JAyVlY2VN3ytTw==", + "version": "7.1.14", + "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-7.1.14.tgz", + "integrity": "sha512-2Ol4S6qHeYVVmkshkWBM8E/qkmEqEOUj2QIewr0jLSyo30H7f3v81pJyks6pTLy4PK0LGUXojMvIfFIE3mmGQQ==", "dependencies": { "@nestjs/mapped-types": "2.0.2", "js-yaml": "4.1.0", diff --git a/package.json b/package.json index 8eb5a49fd..e83254fb0 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@nestjs/core": "^9.0.0", "@nestjs/passport": "^10.0.2", "@nestjs/platform-express": "^9.0.0", - "@nestjs/swagger": "^7.0.4", + "@nestjs/swagger": "^7.1.14", "@nestjs/terminus": "^9.0.0", "@s3pweb/keycloak-admin-client-cjs": "^22.0.1", "axios": "^1.5.0", From 62928a8801149ce8544c79fcd6e9e5954ba04fdc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 15:20:24 +0100 Subject: [PATCH 06/17] Bump @nestjs/axios from 3.0.0 to 3.0.1 (#72) Bumps [@nestjs/axios](https://github.com/nestjs/axios) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/nestjs/axios/releases) - [Changelog](https://github.com/nestjs/axios/blob/master/.release-it.json) - [Commits](https://github.com/nestjs/axios/compare/3.0.0...3.0.1) --- updated-dependencies: - dependency-name: "@nestjs/axios" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Patrick Sachmann --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2357c339e..a085793c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@mikro-orm/core": "^5.7.11", "@mikro-orm/nestjs": "^5.1.8", "@mikro-orm/postgresql": "^5.7.11", - "@nestjs/axios": "^3.0.0", + "@nestjs/axios": "^3.0.1", "@nestjs/common": "^9.0.0", "@nestjs/config": "^2.3.2", "@nestjs/core": "^9.0.0", @@ -1845,9 +1845,9 @@ } }, "node_modules/@nestjs/axios": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.0.tgz", - "integrity": "sha512-ULdH03jDWkS5dy9X69XbUVbhC+0pVnrRcj7bIK/ytTZ76w7CgvTZDJqsIyisg3kNOiljRW/4NIjSf3j6YGvl+g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-3.0.1.tgz", + "integrity": "sha512-VlOZhAGDmOoFdsmewn8AyClAdGpKXQQaY1+3PGB+g6ceurGIdTxZgRX3VXc1T6Zs60PedWjg3A82TDOB05mrzQ==", "peerDependencies": { "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", "axios": "^1.3.1", diff --git a/package.json b/package.json index e83254fb0..54ed7511d 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@mikro-orm/core": "^5.7.11", "@mikro-orm/nestjs": "^5.1.8", "@mikro-orm/postgresql": "^5.7.11", - "@nestjs/axios": "^3.0.0", + "@nestjs/axios": "^3.0.1", "@nestjs/common": "^9.0.0", "@nestjs/config": "^2.3.2", "@nestjs/core": "^9.0.0", From fad9ae5bcf729c6f05df3cf9827cfcd44b5b438a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 15:45:48 +0100 Subject: [PATCH 07/17] Bump @nestjs/schematics from 9.2.0 to 10.0.3 (#78) Bumps [@nestjs/schematics](https://github.com/nestjs/schematics) from 9.2.0 to 10.0.3. - [Release notes](https://github.com/nestjs/schematics/releases) - [Changelog](https://github.com/nestjs/schematics/blob/master/.release-it.json) - [Commits](https://github.com/nestjs/schematics/compare/9.2.0...10.0.3) --- updated-dependencies: - dependency-name: "@nestjs/schematics" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: YannickEvers <112076936+YannickEvers@users.noreply.github.com> Co-authored-by: Patrick Sachmann --- package-lock.json | 127 +++++++++++++++++++++++++++++++++++++++++++--- package.json | 2 +- 2 files changed, 121 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index a085793c2..4b27b300b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "@golevelup/ts-jest": "^0.3.7", "@mikro-orm/cli": "^5.7.12", "@nestjs/cli": "^9.0.0", - "@nestjs/schematics": "^9.0.0", + "@nestjs/schematics": "^10.0.3", "@nestjs/testing": "^9.4.2", "@types/express": "^4.17.21", "@types/express-session": "^1.17.8", @@ -1891,6 +1891,21 @@ "node": ">= 12.9.0" } }, + "node_modules/@nestjs/cli/node_modules/@nestjs/schematics": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-9.2.0.tgz", + "integrity": "sha512-wHpNJDPzM6XtZUOB3gW0J6mkFCSJilzCM3XrHI1o0C8vZmFE1snbmkIXNyoi1eV0Nxh1BMymcgz5vIMJgQtTqw==", + "dev": true, + "dependencies": { + "@angular-devkit/core": "16.0.1", + "@angular-devkit/schematics": "16.0.1", + "jsonc-parser": "3.2.0", + "pluralize": "8.0.0" + }, + "peerDependencies": { + "typescript": ">=4.3.5" + } + }, "node_modules/@nestjs/cli/node_modules/commander": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", @@ -2105,18 +2120,76 @@ } }, "node_modules/@nestjs/schematics": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-9.2.0.tgz", - "integrity": "sha512-wHpNJDPzM6XtZUOB3gW0J6mkFCSJilzCM3XrHI1o0C8vZmFE1snbmkIXNyoi1eV0Nxh1BMymcgz5vIMJgQtTqw==", + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-10.0.3.tgz", + "integrity": "sha512-2BRujK0GqGQ7j1Zpz+obVfskDnnOeVKt5aXoSaVngKo8Oczy8uYCY+R547TQB+Kf35epdfFER2pVnQrX3/It5A==", "dev": true, "dependencies": { - "@angular-devkit/core": "16.0.1", - "@angular-devkit/schematics": "16.0.1", + "@angular-devkit/core": "16.2.8", + "@angular-devkit/schematics": "16.2.8", + "comment-json": "4.2.3", "jsonc-parser": "3.2.0", "pluralize": "8.0.0" }, "peerDependencies": { - "typescript": ">=4.3.5" + "typescript": ">=4.8.2" + } + }, + "node_modules/@nestjs/schematics/node_modules/@angular-devkit/core": { + "version": "16.2.8", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-16.2.8.tgz", + "integrity": "sha512-PTGozYvh1Bin5lB15PwcXa26Ayd17bWGLS3H8Rs0s+04mUDvfNofmweaX1LgumWWy3nCUTDuwHxX10M3G0wE2g==", + "dev": true, + "dependencies": { + "ajv": "8.12.0", + "ajv-formats": "2.1.1", + "jsonc-parser": "3.2.0", + "picomatch": "2.3.1", + "rxjs": "7.8.1", + "source-map": "0.7.4" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "peerDependencies": { + "chokidar": "^3.5.2" + }, + "peerDependenciesMeta": { + "chokidar": { + "optional": true + } + } + }, + "node_modules/@nestjs/schematics/node_modules/@angular-devkit/schematics": { + "version": "16.2.8", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-16.2.8.tgz", + "integrity": "sha512-MBiKZOlR9/YMdflALr7/7w/BGAfo/BGTrlkqsIB6rDWV1dYiCgxI+033HsiNssLS6RQyCFx/e7JA2aBBzu9zEg==", + "dev": true, + "dependencies": { + "@angular-devkit/core": "16.2.8", + "jsonc-parser": "3.2.0", + "magic-string": "0.30.1", + "ora": "5.4.1", + "rxjs": "7.8.1" + }, + "engines": { + "node": "^16.14.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/@nestjs/schematics/node_modules/magic-string": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.1.tgz", + "integrity": "sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" } }, "node_modules/@nestjs/swagger": { @@ -3477,6 +3550,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array-timsort": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", + "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", + "dev": true + }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -4405,6 +4484,22 @@ "node": ">= 0.8" } }, + "node_modules/comment-json": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz", + "integrity": "sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==", + "dev": true, + "dependencies": { + "array-timsort": "^1.0.3", + "core-util-is": "^1.0.3", + "esprima": "^4.0.1", + "has-own-prop": "^2.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/compare-versions": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.0.tgz", @@ -6677,6 +6772,15 @@ "node": ">=8" } }, + "node_modules/has-own-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", + "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/has-property-descriptors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", @@ -9794,6 +9898,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", diff --git a/package.json b/package.json index 54ed7511d..e465c3f81 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "@golevelup/ts-jest": "^0.3.7", "@mikro-orm/cli": "^5.7.12", "@nestjs/cli": "^9.0.0", - "@nestjs/schematics": "^9.0.0", + "@nestjs/schematics": "^10.0.3", "@nestjs/testing": "^9.4.2", "@types/express": "^4.17.21", "@types/express-session": "^1.17.8", From fb54ced4270a5134f1e64c936e210cef0b63246b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 15:57:47 +0100 Subject: [PATCH 08/17] Bump @nestjs/config from 2.3.4 to 3.1.1 (#70) Bumps [@nestjs/config](https://github.com/nestjs/config) from 2.3.4 to 3.1.1. - [Release notes](https://github.com/nestjs/config/releases) - [Changelog](https://github.com/nestjs/config/blob/master/.release-it.json) - [Commits](https://github.com/nestjs/config/compare/2.3.4...3.1.1) --- updated-dependencies: - dependency-name: "@nestjs/config" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Patrick Sachmann --- package-lock.json | 26 +++++++------------------- package.json | 2 +- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4b27b300b..23eb91cea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@mikro-orm/postgresql": "^5.7.11", "@nestjs/axios": "^3.0.1", "@nestjs/common": "^9.0.0", - "@nestjs/config": "^2.3.2", + "@nestjs/config": "^3.1.1", "@nestjs/core": "^9.0.0", "@nestjs/passport": "^10.0.2", "@nestjs/platform-express": "^9.0.0", @@ -2008,30 +2008,18 @@ } }, "node_modules/@nestjs/config": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/@nestjs/config/-/config-2.3.4.tgz", - "integrity": "sha512-IGdSF+0F9MJO6dCRTEahdxPz4iVijjtolcFBxnY+2QYM3bXYQvAgzskGZi+WkAFJN/VzR3TEp60gN5sI74GxPA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@nestjs/config/-/config-3.1.1.tgz", + "integrity": "sha512-qu5QlNiJdqQtOsnB6lx4JCXPQ96jkKUsOGd+JXfXwqJqZcOSAq6heNFg0opW4pq4J/VZoNwoo87TNnx9wthnqQ==", "dependencies": { - "dotenv": "16.1.4", + "dotenv": "16.3.1", "dotenv-expand": "10.0.0", "lodash": "4.17.21", "uuid": "9.0.0" }, "peerDependencies": { - "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0", - "reflect-metadata": "^0.1.13", - "rxjs": "^6.0.0 || ^7.2.0" - } - }, - "node_modules/@nestjs/config/node_modules/dotenv": { - "version": "16.1.4", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.1.4.tgz", - "integrity": "sha512-m55RtE8AsPeJBpOIFKihEmqUcoVncQIwo7x9U8ZwLEZw9ZpXboz2c+rvog+jUaJvVrZ5kBOeYQBX5+8Aa/OZQw==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", + "reflect-metadata": "^0.1.13" } }, "node_modules/@nestjs/core": { diff --git a/package.json b/package.json index e465c3f81..f20fe93ea 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@mikro-orm/postgresql": "^5.7.11", "@nestjs/axios": "^3.0.1", "@nestjs/common": "^9.0.0", - "@nestjs/config": "^2.3.2", + "@nestjs/config": "^3.1.1", "@nestjs/core": "^9.0.0", "@nestjs/passport": "^10.0.2", "@nestjs/platform-express": "^9.0.0", From 404e9d33a58f42c871f7e551e195dfcbe1b2f1a4 Mon Sep 17 00:00:00 2001 From: Kristoff Kiefer <31993948+kristoff-kiefer@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:20:21 +0100 Subject: [PATCH 09/17] Pull up node and alpine version as well as libraries (#83) * Pull up node and alpine version * Triggered package update --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ea7719aac..dd622aa29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=node:20.5.1-alpine3.17 +ARG BASE_IMAGE=node:21.1-alpine3.18 FROM $BASE_IMAGE as deployment WORKDIR /app @@ -13,6 +13,7 @@ COPY src/ src/ RUN npm run build FROM $BASE_IMAGE +RUN apk --no-cache upgrade ENV NODE_ENV=prod WORKDIR /app From 0b86c257df853d964d2de42bc50530910e8ec9c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 08:14:46 +0100 Subject: [PATCH 10/17] Bump @faker-js/faker from 8.1.0 to 8.2.0 (#91) Bumps [@faker-js/faker](https://github.com/faker-js/faker) from 8.1.0 to 8.2.0. - [Release notes](https://github.com/faker-js/faker/releases) - [Changelog](https://github.com/faker-js/faker/blob/next/CHANGELOG.md) - [Commits](https://github.com/faker-js/faker/compare/v8.1.0...v8.2.0) --- updated-dependencies: - dependency-name: "@faker-js/faker" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 23eb91cea..61cfef790 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@automapper/classes": "^8.7.7", "@automapper/core": "^8.7.7", "@automapper/nestjs": "^8.7.7", - "@faker-js/faker": "^8.0.2", + "@faker-js/faker": "^8.2.0", "@mikro-orm/core": "^5.7.11", "@mikro-orm/nestjs": "^5.1.8", "@mikro-orm/postgresql": "^5.7.11", @@ -971,9 +971,9 @@ } }, "node_modules/@faker-js/faker": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.1.0.tgz", - "integrity": "sha512-38DT60rumHfBYynif3lmtxMqMqmsOQIxQgEuPZxCk2yUYN0eqWpTACgxi0VpidvsJB8CRxCpvP7B3anK85FjtQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.2.0.tgz", + "integrity": "sha512-VacmzZqVxdWdf9y64lDOMZNDMM/FQdtM9IsaOPKOm2suYwEatb8VkdHqOzXcDnZbk7YDE2BmsJmy/2Hmkn563g==", "funding": [ { "type": "opencollective", diff --git a/package.json b/package.json index f20fe93ea..b0bc000b7 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@automapper/classes": "^8.7.7", "@automapper/core": "^8.7.7", "@automapper/nestjs": "^8.7.7", - "@faker-js/faker": "^8.0.2", + "@faker-js/faker": "^8.2.0", "@mikro-orm/core": "^5.7.11", "@mikro-orm/nestjs": "^5.1.8", "@mikro-orm/postgresql": "^5.7.11", From 00a491cb13f2b46256753ecdb2beba80d2031922 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 08:54:08 +0100 Subject: [PATCH 11/17] Bump @types/express-session from 1.17.9 to 1.17.10 (#89) Bumps [@types/express-session](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/express-session) from 1.17.9 to 1.17.10. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/express-session) --- updated-dependencies: - dependency-name: "@types/express-session" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Patrick Sachmann --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 61cfef790..eee2c5b22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,7 +48,7 @@ "@nestjs/schematics": "^10.0.3", "@nestjs/testing": "^9.4.2", "@types/express": "^4.17.21", - "@types/express-session": "^1.17.8", + "@types/express-session": "^1.17.10", "@types/jest": "^29.2.4", "@types/lodash-es": "^4.17.9", "@types/node": "^20.3.1", @@ -2645,9 +2645,9 @@ } }, "node_modules/@types/express-session": { - "version": "1.17.9", - "resolved": "https://registry.npmjs.org/@types/express-session/-/express-session-1.17.9.tgz", - "integrity": "sha512-yIqficLlTPdloeEPhOVenpOUWILkdaXHUWhTOqFGx9JoSuTgeatNjb97k8VvJehbTk0kUSUAHy5r27PXMga89Q==", + "version": "1.17.10", + "resolved": "https://registry.npmjs.org/@types/express-session/-/express-session-1.17.10.tgz", + "integrity": "sha512-U32bC/s0ejXijw5MAzyaV4tuZopCh/K7fPoUDyNbsRXHvPSeymygYD1RFL99YOLhF5PNOkzswvOTRaVHdL1zMw==", "dev": true, "dependencies": { "@types/express": "*" diff --git a/package.json b/package.json index b0bc000b7..42819fe2e 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "@nestjs/schematics": "^10.0.3", "@nestjs/testing": "^9.4.2", "@types/express": "^4.17.21", - "@types/express-session": "^1.17.8", + "@types/express-session": "^1.17.10", "@types/jest": "^29.2.4", "@types/lodash-es": "^4.17.9", "@types/node": "^20.3.1", From 248250cd23b8514b54b9504e3a054c69434a927c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 07:59:47 +0000 Subject: [PATCH 12/17] Bump prettier from 3.0.3 to 3.1.0 (#87) Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.1.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.0.3...3.1.0) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index eee2c5b22..e8c24e167 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,7 +62,7 @@ "eslint-plugin-jest": "^27.2.1", "eslint-plugin-prettier": "^5.0.1", "jest": "^29.6.2", - "prettier": "^3.0.3", + "prettier": "^3.1.0", "source-map-support": "^0.5.20", "supertest": "^6.1.3", "testcontainers": "^9.9.0", @@ -9540,9 +9540,9 @@ } }, "node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.0.tgz", + "integrity": "sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" diff --git a/package.json b/package.json index 42819fe2e..b3a0a0e57 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "eslint-plugin-jest": "^27.2.1", "eslint-plugin-prettier": "^5.0.1", "jest": "^29.6.2", - "prettier": "^3.0.3", + "prettier": "^3.1.0", "source-map-support": "^0.5.20", "supertest": "^6.1.3", "testcontainers": "^9.9.0", From d05c3e3261de2a29c1c075421120a9fca79deaa9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 09:12:25 +0100 Subject: [PATCH 13/17] Bump eslint-plugin-jest from 27.4.2 to 27.6.0 (#86) Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 27.4.2 to 27.6.0. - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v27.4.2...v27.6.0) --- updated-dependencies: - dependency-name: eslint-plugin-jest dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e8c24e167..466288812 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,7 +59,7 @@ "eslint": "^8.0.1", "eslint-config-airbnb-typescript": "^17.0.0", "eslint-config-prettier": "^8.8.0", - "eslint-plugin-jest": "^27.2.1", + "eslint-plugin-jest": "^27.6.0", "eslint-plugin-prettier": "^5.0.1", "jest": "^29.6.2", "prettier": "^3.1.0", @@ -5634,9 +5634,9 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "27.4.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.4.2.tgz", - "integrity": "sha512-3Nfvv3wbq2+PZlRTf2oaAWXWwbdBejFRBR2O8tAO67o+P8zno+QGbcDYaAXODlreXVg+9gvWhKKmG2rgfb8GEg==", + "version": "27.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.6.0.tgz", + "integrity": "sha512-MTlusnnDMChbElsszJvrwD1dN3x6nZl//s4JD23BxB6MgR66TZlL064su24xEIS3VACfAoHV1vgyMgPw8nkdng==", "dev": true, "dependencies": { "@typescript-eslint/utils": "^5.10.0" diff --git a/package.json b/package.json index b3a0a0e57..9d474fa97 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "eslint": "^8.0.1", "eslint-config-airbnb-typescript": "^17.0.0", "eslint-config-prettier": "^8.8.0", - "eslint-plugin-jest": "^27.2.1", + "eslint-plugin-jest": "^27.6.0", "eslint-plugin-prettier": "^5.0.1", "jest": "^29.6.2", "prettier": "^3.1.0", From 3c7b616e27aa48b12ee3546f8863c7d28792e283 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 08:19:15 +0000 Subject: [PATCH 14/17] Bump @nestjs/swagger from 7.1.14 to 7.1.15 (#85) Bumps [@nestjs/swagger](https://github.com/nestjs/swagger) from 7.1.14 to 7.1.15. - [Release notes](https://github.com/nestjs/swagger/releases) - [Changelog](https://github.com/nestjs/swagger/blob/master/.release-it.json) - [Commits](https://github.com/nestjs/swagger/compare/7.1.14...7.1.15) --- updated-dependencies: - dependency-name: "@nestjs/swagger" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 466288812..3a6549c43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "@nestjs/core": "^9.0.0", "@nestjs/passport": "^10.0.2", "@nestjs/platform-express": "^9.0.0", - "@nestjs/swagger": "^7.1.14", + "@nestjs/swagger": "^7.1.15", "@nestjs/terminus": "^9.0.0", "@s3pweb/keycloak-admin-client-cjs": "^22.0.1", "axios": "^1.5.0", @@ -2060,9 +2060,9 @@ } }, "node_modules/@nestjs/mapped-types": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-2.0.2.tgz", - "integrity": "sha512-V0izw6tWs6fTp9+KiiPUbGHWALy563Frn8X6Bm87ANLRuE46iuBMD5acKBDP5lKL/75QFvrzSJT7HkCbB0jTpg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-2.0.3.tgz", + "integrity": "sha512-40Zdqg98lqoF0+7ThWIZFStxgzisK6GG22+1ABO4kZiGF/Tu2FE+DYLw+Q9D94vcFWizJ+MSjNN4ns9r6hIGxw==", "peerDependencies": { "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", "class-transformer": "^0.4.0 || ^0.5.0", @@ -2181,15 +2181,15 @@ } }, "node_modules/@nestjs/swagger": { - "version": "7.1.14", - "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-7.1.14.tgz", - "integrity": "sha512-2Ol4S6qHeYVVmkshkWBM8E/qkmEqEOUj2QIewr0jLSyo30H7f3v81pJyks6pTLy4PK0LGUXojMvIfFIE3mmGQQ==", + "version": "7.1.15", + "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-7.1.15.tgz", + "integrity": "sha512-ZaAO90R9MQXk4iLQLijIH6jrsllkUSYoh0Su6DECGgu8Y4Q/9LfdESwsZ9nmzr/48aLOu+wrv+cdI5Wr6fLKJw==", "dependencies": { - "@nestjs/mapped-types": "2.0.2", + "@nestjs/mapped-types": "2.0.3", "js-yaml": "4.1.0", "lodash": "4.17.21", "path-to-regexp": "3.2.0", - "swagger-ui-dist": "5.9.0" + "swagger-ui-dist": "5.9.1" }, "peerDependencies": { "@fastify/static": "^6.0.0", @@ -10753,9 +10753,9 @@ } }, "node_modules/swagger-ui-dist": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.9.0.tgz", - "integrity": "sha512-NUHSYoe5XRTk/Are8jPJ6phzBh3l9l33nEyXosM17QInoV95/jng8+PuSGtbD407QoPf93MH3Bkh773OgesJpA==" + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.9.1.tgz", + "integrity": "sha512-5zAx+hUwJb9T3EAntc7TqYkV716CMqG6sZpNlAAMOMWkNXRYxGkN8ADIvD55dQZ10LxN90ZM/TQmN7y1gpICnw==" }, "node_modules/symbol-observable": { "version": "4.0.0", diff --git a/package.json b/package.json index 9d474fa97..b38d326d0 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@nestjs/core": "^9.0.0", "@nestjs/passport": "^10.0.2", "@nestjs/platform-express": "^9.0.0", - "@nestjs/swagger": "^7.1.14", + "@nestjs/swagger": "^7.1.15", "@nestjs/terminus": "^9.0.0", "@s3pweb/keycloak-admin-client-cjs": "^22.0.1", "axios": "^1.5.0", From 559eb3d92cc360e6c37d88273eebf51f5fa18aa0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 09:32:26 +0100 Subject: [PATCH 15/17] Bump nest-commander from 3.11.0 to 3.12.2 (#88) Bumps [nest-commander](https://github.com/jmcdo29/nest-commander/tree/HEAD/pacakges/nest-commander) from 3.11.0 to 3.12.2. - [Release notes](https://github.com/jmcdo29/nest-commander/releases) - [Commits](https://github.com/jmcdo29/nest-commander/commits/nest-commander@3.12.2/pacakges/nest-commander) --- updated-dependencies: - dependency-name: nest-commander dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 122 +++++++++++++++++++++++++++++++++++++++------- package.json | 2 +- 2 files changed, 105 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3a6549c43..40475a55f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "express-session": "^1.17.3", "lodash": "^4.17.21", "lodash-es": "^4.17.21", - "nest-commander": "^3.11.0", + "nest-commander": "^3.12.2", "nest-keycloak-connect": "^1.9.2", "openid-client": "^5.6.0", "passport": "^0.6.0", @@ -1080,12 +1080,29 @@ "node": ">=10" } }, - "node_modules/@golevelup/nestjs-discovery": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@golevelup/nestjs-discovery/-/nestjs-discovery-3.0.0.tgz", - "integrity": "sha512-ZvkXtobTKxXB1LJanP/l6Z/Fing88IMBr3uabQpU2IWjfsstjh02qYDSU2cfD6CSmNldX5ewW5Pd+SdK2lU8Sw==", + "node_modules/@fig/complete-commander": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@fig/complete-commander/-/complete-commander-2.0.1.tgz", + "integrity": "sha512-AbGETely7iwD4F7XHe4g7pW6icWYYqJMdQog8CdEi9syU/av5L0O24BvCfgEeGO6TRPMpC+rFL7ZDJsqRtckOA==", "dependencies": { - "lodash": "^4.17.15" + "prettier": "^2.3.2" + }, + "peerDependencies": { + "commander": "^8.0.0" + } + }, + "node_modules/@fig/complete-commander/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/@golevelup/ts-jest": { @@ -4472,6 +4489,15 @@ "node": ">= 0.8" } }, + "node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "peer": true, + "engines": { + "node": ">= 12" + } + }, "node_modules/comment-json": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz", @@ -6992,6 +7018,7 @@ "version": "8.2.5", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.5.tgz", "integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==", + "dev": true, "dependencies": { "ansi-escapes": "^4.2.1", "chalk": "^4.1.1", @@ -8705,14 +8732,15 @@ "dev": true }, "node_modules/nest-commander": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/nest-commander/-/nest-commander-3.11.0.tgz", - "integrity": "sha512-/i5LiPQh9ldxiML+umybnStB+/WrYBt6vrWxl4JtZHRKHe7MyAHJFDOmVd1U7dO04vfoHyjlHtxqde+eihmteg==", + "version": "3.12.2", + "resolved": "https://registry.npmjs.org/nest-commander/-/nest-commander-3.12.2.tgz", + "integrity": "sha512-iOIVzwepP21fFfU629lxGeWABhDRXfOmJeNsuqmdonx/TEYUpWuPJCPYMKRKOpv/UQj0vf/8hjbzq25VfU+0xQ==", "dependencies": { - "@golevelup/nestjs-discovery": "3.0.0", + "@fig/complete-commander": "^2.0.1", + "@golevelup/nestjs-discovery": "4.0.0", "commander": "11.0.0", - "cosmiconfig": "8.2.0", - "inquirer": "8.2.5" + "cosmiconfig": "8.3.6", + "inquirer": "8.2.6" }, "peerDependencies": { "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", @@ -8720,6 +8748,18 @@ "@types/inquirer": "^8.1.3" } }, + "node_modules/nest-commander/node_modules/@golevelup/nestjs-discovery": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@golevelup/nestjs-discovery/-/nestjs-discovery-4.0.0.tgz", + "integrity": "sha512-iyZLYip9rhVMR0C93vo860xmboRrD5g5F5iEOfpeblGvYSz8ymQrL9RAST7x/Fp3n+TAXSeOLzDIASt+rak68g==", + "dependencies": { + "lodash": "^4.17.21" + }, + "peerDependencies": { + "@nestjs/common": "^10.x", + "@nestjs/core": "^10.x" + } + }, "node_modules/nest-commander/node_modules/commander": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", @@ -8729,13 +8769,13 @@ } }, "node_modules/nest-commander/node_modules/cosmiconfig": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", - "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", + "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", "dependencies": { - "import-fresh": "^3.2.1", + "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", - "parse-json": "^5.0.0", + "parse-json": "^5.2.0", "path-type": "^4.0.0" }, "engines": { @@ -8743,6 +8783,52 @@ }, "funding": { "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/nest-commander/node_modules/inquirer": { + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", + "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/nest-commander/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" } }, "node_modules/nest-keycloak-connect": { @@ -11408,7 +11494,7 @@ "version": "5.2.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", - "dev": true, + "devOptional": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index b38d326d0..c26761fe3 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "express-session": "^1.17.3", "lodash": "^4.17.21", "lodash-es": "^4.17.21", - "nest-commander": "^3.11.0", + "nest-commander": "^3.12.2", "nest-keycloak-connect": "^1.9.2", "openid-client": "^5.6.0", "passport": "^0.6.0", From 13cddb88fe37949f2f64387381ff81776e6c7200 Mon Sep 17 00:00:00 2001 From: Kristoff Kiefer <31993948+kristoff-kiefer@users.noreply.github.com> Date: Tue, 14 Nov 2023 09:49:24 +0100 Subject: [PATCH 16/17] Spsh 141 redis into helm (#61) * Inital Redis template * Inital service * Script to create self signed certificates * Script to copy the certificates * Configure Redis to enable TLS, disable unencrypted * Make config files and scripts available to pods * Introduce init pod and build certificates * Added comments and a little more structure * Changed name to fit with others * Added comments and removed unecessary config params * Add test user * Add password-requirement * Preserve line endings * Corrected ingress to point to BFF * Fixed User-ID * Added timestamp of creation --------- Co-authored-by: DPDS93CT <144817755+DPDS93CT@users.noreply.github.com> --- .gitattributes | 2 + charts/dbildungs-iam/Chart.yaml | 7 ++- .../dev-realm-spsh.json | 22 ++++++- .../charts/dbildungs-iam-redis/Chart.yaml | 23 ++++++++ .../charts/dbildungs-iam-redis/copy-tls.sh | 28 +++++++++ .../charts/dbildungs-iam-redis/gencert.sh | 59 +++++++++++++++++++ .../charts/dbildungs-iam-redis/redis.conf | 8 +++ .../templates/configmap-tls.yaml | 8 +++ .../templates/deployment.yaml | 44 ++++++++++++++ .../templates/service.yaml | 15 +++++ .../charts/dbildungs-iam-redis/values.yaml | 0 charts/dbildungs-iam/values.yaml | 7 ++- 12 files changed, 217 insertions(+), 6 deletions(-) create mode 100644 .gitattributes create mode 100644 charts/dbildungs-iam/charts/dbildungs-iam-redis/Chart.yaml create mode 100644 charts/dbildungs-iam/charts/dbildungs-iam-redis/copy-tls.sh create mode 100644 charts/dbildungs-iam/charts/dbildungs-iam-redis/gencert.sh create mode 100644 charts/dbildungs-iam/charts/dbildungs-iam-redis/redis.conf create mode 100644 charts/dbildungs-iam/charts/dbildungs-iam-redis/templates/configmap-tls.yaml create mode 100644 charts/dbildungs-iam/charts/dbildungs-iam-redis/templates/deployment.yaml create mode 100644 charts/dbildungs-iam/charts/dbildungs-iam-redis/templates/service.yaml create mode 100644 charts/dbildungs-iam/charts/dbildungs-iam-redis/values.yaml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..99d5dc977 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +*.sh text eol=lf +redis.conf eol=lf \ No newline at end of file diff --git a/charts/dbildungs-iam/Chart.yaml b/charts/dbildungs-iam/Chart.yaml index 4a944d980..df8cd9028 100644 --- a/charts/dbildungs-iam/Chart.yaml +++ b/charts/dbildungs-iam/Chart.yaml @@ -1,11 +1,16 @@ apiVersion: v2 name: dbildungs-iam -version: 0.1.1 +version: 0.2.0 description: dBildungs-IAM type: application dependencies: + # In non-test-deployments we expect keycloak to be provided for us thus it needs to be enabled - name: dbildungs-iam-keycloak-dev version: "*" condition: keycloakEnabled + # In non-test-deployments we expect redis to be provided for us thus it needs to be enabled + - name: dbildungs-iam-redis + version: latest + condition: redisEnabled diff --git a/charts/dbildungs-iam/charts/dbildungs-iam-keycloak-dev/dev-realm-spsh.json b/charts/dbildungs-iam/charts/dbildungs-iam-keycloak-dev/dev-realm-spsh.json index 32dcfcb4b..83dfa1415 100644 --- a/charts/dbildungs-iam/charts/dbildungs-iam-keycloak-dev/dev-realm-spsh.json +++ b/charts/dbildungs-iam/charts/dbildungs-iam-keycloak-dev/dev-realm-spsh.json @@ -467,6 +467,22 @@ ], "notBefore": 0, "groups": [] + }, + { + "id": "22207262-196f-4995-8011-6830091ebdca", + "username": "test", + "createdTimestamp": 1697087666332, + "enabled": true, + "emailVerified": true, + "firstName": "Testus", + "lastName": "Experimentus", + "email": "testuser@example.com", + "credentials": [ + { + "type": "password", + "value": "test" + } + ] } ], "scopeMappings": [ @@ -778,7 +794,6 @@ "enabled": true, "alwaysDisplayInConsole": false, "clientAuthenticatorType": "client-secret", - "secret": "YDp6fYkbUcj4ZkyAOnbAHGQ9O72htc5M", "redirectUris": [ "/*" ], @@ -791,14 +806,15 @@ "standardFlowEnabled": true, "implicitFlowEnabled": false, "directAccessGrantsEnabled": true, - "serviceAccountsEnabled": true, - "publicClient": false, + "serviceAccountsEnabled": false, + "publicClient": true, "frontchannelLogout": true, "protocol": "openid-connect", "attributes": { "oidc.ciba.grant.enabled": "false", "client.secret.creation.time": "1696586327", "backchannel.logout.session.required": "true", + "post.logout.redirect.uris": "+", "oauth2.device.authorization.grant.enabled": "false", "display.on.consent.screen": "false", "backchannel.logout.revoke.offline.tokens": "false" diff --git a/charts/dbildungs-iam/charts/dbildungs-iam-redis/Chart.yaml b/charts/dbildungs-iam/charts/dbildungs-iam-redis/Chart.yaml new file mode 100644 index 000000000..9e9a94dcf --- /dev/null +++ b/charts/dbildungs-iam/charts/dbildungs-iam-redis/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +name: dbildungs-iam-redis +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +appVersion: 1.16.0 diff --git a/charts/dbildungs-iam/charts/dbildungs-iam-redis/copy-tls.sh b/charts/dbildungs-iam/charts/dbildungs-iam-redis/copy-tls.sh new file mode 100644 index 000000000..6d4261f91 --- /dev/null +++ b/charts/dbildungs-iam/charts/dbildungs-iam-redis/copy-tls.sh @@ -0,0 +1,28 @@ +#!/bin/bash +STAGING_DIR="/staging" +MOUNTED_FILES_DIR="/tls" +CONFIG_DIR=/data/tls + +# Setup working environment + +mkdir -p $STAGING_DIR +mkdir -p $CONFIG_DIR +# Copy generator script +cp -v $MOUNTED_FILES_DIR/gencert.sh /staging + +# Begin Bracket +pushd $STAGING_DIR || exit 1 + +chmod ugo+x gencert.sh +./gencert.sh + +# We have generated our certificates, now we put them in their right place +cp -v tls/redis.crt tls/redis.key tls/ca.crt $CONFIG_DIR +# Pre-Made config, correct certs and disabling of non-tls included +cp -v $MOUNTED_FILES_DIR/redis.conf $CONFIG_DIR + +# End Bracket +popd || exit 1 + +# $CONFIG_DIR remains behind, that is the point of this script, Staging is cleaned away +rm -rf $STAGING_DIR \ No newline at end of file diff --git a/charts/dbildungs-iam/charts/dbildungs-iam-redis/gencert.sh b/charts/dbildungs-iam/charts/dbildungs-iam-redis/gencert.sh new file mode 100644 index 000000000..2c20c4f72 --- /dev/null +++ b/charts/dbildungs-iam/charts/dbildungs-iam-redis/gencert.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# COPIED/MODIFIED from the redis server gen-certs util + +# Generate some test certificates which are used by the regression test suite: +# +# tls/ca.{crt,key} Self signed CA certificate. +# tls/redis.{crt,key} A certificate with no key usage/policy restrictions. +# tls/client.{crt,key} A certificate restricted for SSL client usage. +# tls/server.{crt,key} A certificate restricted for SSL server usage. +# tls/redis.dh DH Params file. + +generate_cert() { + local name=$1 + local cn="$2" + local opts="$3" + + local keyfile=tls/${name}.key + local certfile=tls/${name}.crt + + [ -f $keyfile ] || openssl genrsa -out $keyfile 2048 + openssl req \ + -new -sha256 \ + -subj "/O=Redis Test/CN=$cn" \ + -key $keyfile | \ + openssl x509 \ + -req -sha256 \ + -CA tls/ca.crt \ + -CAkey tls/ca.key \ + -CAserial tls/ca.txt \ + -CAcreateserial \ + -days 365 \ + $opts \ + -out $certfile +} + +mkdir -p tls +[ -f tls/ca.key ] || openssl genrsa -out tls/ca.key 4096 +openssl req \ + -x509 -new -nodes -sha256 \ + -key tls/ca.key \ + -days 3650 \ + -subj '/O=Redis Test/CN=Certificate Authority' \ + -out tls/ca.crt + +cat > tls/openssl.cnf <<_END_ +[ server_cert ] +keyUsage = digitalSignature, keyEncipherment +nsCertType = server +[ client_cert ] +keyUsage = digitalSignature, keyEncipherment +nsCertType = client +_END_ + +generate_cert server "Server-only" "-extfile tls/openssl.cnf -extensions server_cert" +generate_cert client "Client-only" "-extfile tls/openssl.cnf -extensions client_cert" +generate_cert redis "Generic-cert" + +[ -f tls/redis.dh ] || openssl dhparam -out tls/redis.dh 2048 \ No newline at end of file diff --git a/charts/dbildungs-iam/charts/dbildungs-iam-redis/redis.conf b/charts/dbildungs-iam/charts/dbildungs-iam-redis/redis.conf new file mode 100644 index 000000000..d8f7b92de --- /dev/null +++ b/charts/dbildungs-iam/charts/dbildungs-iam-redis/redis.conf @@ -0,0 +1,8 @@ +tls-cert-file /data/tls/redis.crt +tls-key-file /data/tls/redis.key +tls-ca-cert-file /data/tls/ca.crt + +requirepass password + +tls-port 6379 +port 0 \ No newline at end of file diff --git a/charts/dbildungs-iam/charts/dbildungs-iam-redis/templates/configmap-tls.yaml b/charts/dbildungs-iam/charts/dbildungs-iam-redis/templates/configmap-tls.yaml new file mode 100644 index 000000000..aea95d149 --- /dev/null +++ b/charts/dbildungs-iam/charts/dbildungs-iam-redis/templates/configmap-tls.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: dbiam-redis-tls-config +data: +{{(.Files.Glob "gencert.sh").AsConfig | indent 2}} +{{(.Files.Glob "copy-tls.sh").AsConfig | indent 2}} +{{(.Files.Glob "redis.conf").AsConfig | indent 2}} \ No newline at end of file diff --git a/charts/dbildungs-iam/charts/dbildungs-iam-redis/templates/deployment.yaml b/charts/dbildungs-iam/charts/dbildungs-iam-redis/templates/deployment.yaml new file mode 100644 index 000000000..662dc3c1b --- /dev/null +++ b/charts/dbildungs-iam/charts/dbildungs-iam-redis/templates/deployment.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dbiam-server-redis-deployment + labels: + app.kubernetes.io/name: dbildungs-iam +spec: + selector: + matchLabels: + layer: dbildungs-iam-redis + replicas: 1 + template: + metadata: + name: dbildungs-iam-redis + labels: + layer: dbildungs-iam-redis + spec: + initContainers: + - name: copy-tls-data + image: alpine + command: ["/bin/sh","-c", "apk add --no-cache openssl bash;/bin/bash /tls/copy-tls.sh"] + volumeMounts: + - mountPath: "/tls" + name: tls-data + - mountPath: "/data" + name: data + containers: + - name: redis + image: redis:7.2.2 + volumeMounts: + - mountPath: "/data" + name: data + ports: + - name: redis-port + containerPort: 6379 + hostPort: 6379 + args: + - "/data/tls/redis.conf" + volumes: + - name: tls-data + configMap: + name: dbiam-redis-tls-config + - name: data + emptyDir: {} \ No newline at end of file diff --git a/charts/dbildungs-iam/charts/dbildungs-iam-redis/templates/service.yaml b/charts/dbildungs-iam/charts/dbildungs-iam-redis/templates/service.yaml new file mode 100644 index 000000000..215def17b --- /dev/null +++ b/charts/dbildungs-iam/charts/dbildungs-iam-redis/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis-service + labels: + app.kubernetes.io/name: dbiam-server +spec: + type: ClusterIP + ports: + - port: 6379 + targetPort: redis-port + protocol: TCP + name: redis-port + selector: + layer: dbildungs-iam-redis diff --git a/charts/dbildungs-iam/charts/dbildungs-iam-redis/values.yaml b/charts/dbildungs-iam/charts/dbildungs-iam-redis/values.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/charts/dbildungs-iam/values.yaml b/charts/dbildungs-iam/values.yaml index ba1ed691e..27ef292ec 100644 --- a/charts/dbildungs-iam/values.yaml +++ b/charts/dbildungs-iam/values.yaml @@ -1,4 +1,4 @@ -dbildungsIamContainer: "ghcr.io/dbildungsplattform/dbildungs-iam-server/feature/bff_to_helm:latest" +dbildungsIamContainer: "ghcr.io/dbildungsplattform/dbildungs-iam-server:kc_healthprobe" dbildungsIamExternalPort: 80 dbildungsIamCpuMax: 2 @@ -25,4 +25,7 @@ enableServiceMonitor: false # Both of these are disabled as to make them intentional keycloakEnabled: false dbildungs-iam-keycloak-dev: - keycloakPublic: false \ No newline at end of file + keycloakPublic: false + +# do we use a development redis? +redisEnabled: false From b92837e8e9c0bd9b0aefe25cda88ce048561697e Mon Sep 17 00:00:00 2001 From: mkreuzkam-cap <144103168+mkreuzkam-cap@users.noreply.github.com> Date: Tue, 14 Nov 2023 10:44:47 +0100 Subject: [PATCH 17/17] EW-525: Add GET /personenkontexte endpoint (#82) * Add endpoint GET /api/personenkontexte to get all Personenkontexte (supports filters and pagination) * /api/person/{personId}/personenkontexte now also supports pagination * Add PersonenkontextScope and use it in findAll for Personenkontexte * Use SichtfreigabeType instead of boolean in personenkontext entity and DO (requires re-initializing the database) --- .../person/api/created-personenkontext.dto.ts | 3 +- .../person/api/find-personendatensatz.dto.ts | 2 +- .../person/api/find-personenkontext.dto.ts | 8 +-- .../api/person-api.mapper.profile.spec.ts | 26 +++---- .../person/api/person-api.mapper.profile.ts | 59 +++++++--------- src/modules/person/api/person-id.response.ts | 12 ++++ .../person/api/person.controller.spec.ts | 40 ++++++----- src/modules/person/api/person.controller.ts | 34 +++++---- src/modules/person/api/person.uc.spec.ts | 22 +++--- src/modules/person/api/person.uc.ts | 21 +++--- .../person/api/personen-query.param.spec.ts | 5 +- .../person/api/personen-query.param.ts | 10 +-- .../api/personenkontext-query.params.spec.ts | 3 +- .../api/personenkontext-query.params.ts | 14 ++-- .../api/personenkontext.controller.spec.ts | 63 +++++++++++++++-- .../person/api/personenkontext.controller.ts | 44 +++++++++++- src/modules/person/api/personenkontext.dto.ts | 6 +- .../person/api/personenkontext.response.ts | 3 +- .../person/api/personenkontext.uc.spec.ts | 30 ++++---- src/modules/person/api/personenkontext.uc.ts | 29 +++++--- .../api/personenkontextdatensatz.response.ts | 14 ++++ .../person/domain/personenkontext.do.ts | 6 +- .../person/domain/personenkontext.enums.ts | 5 ++ .../domain/personenkontext.service.spec.ts | 35 ++++++---- .../person/domain/personenkontext.service.ts | 30 ++++++-- .../persistence/personenkontext.entity.ts | 8 +-- .../personenkontext.repo.integration-spec.ts | 29 ++++---- .../persistence/personenkontext.repo.ts | 30 ++------ .../personenkontext.scope.integration-spec.ts | 69 +++++++++++++++++++ .../persistence/personenkontext.scope.ts | 34 +++++++++ test/utils/do-factory.ts | 9 ++- 31 files changed, 475 insertions(+), 228 deletions(-) create mode 100644 src/modules/person/api/person-id.response.ts create mode 100644 src/modules/person/api/personenkontextdatensatz.response.ts create mode 100644 src/modules/person/persistence/personenkontext.scope.integration-spec.ts create mode 100644 src/modules/person/persistence/personenkontext.scope.ts diff --git a/src/modules/person/api/created-personenkontext.dto.ts b/src/modules/person/api/created-personenkontext.dto.ts index 0a9f04331..7d135cac6 100644 --- a/src/modules/person/api/created-personenkontext.dto.ts +++ b/src/modules/person/api/created-personenkontext.dto.ts @@ -1,8 +1,7 @@ import { AutoMap } from '@automapper/classes'; -import { Jahrgangsstufe, Personenstatus, Rolle } from '../domain/personenkontext.enums.js'; +import { Jahrgangsstufe, Personenstatus, Rolle, SichtfreigabeType } from '../domain/personenkontext.enums.js'; import { CreatedPersonenkontextOrganisationDto } from './created-personenkontext-organisation.dto.js'; import { LoeschungDto } from './loeschung.dto.js'; -import { SichtfreigabeType } from './personen-query.param.js'; export class CreatedPersonenkontextDto { @AutoMap() diff --git a/src/modules/person/api/find-personendatensatz.dto.ts b/src/modules/person/api/find-personendatensatz.dto.ts index 16eee1f92..c47355efc 100644 --- a/src/modules/person/api/find-personendatensatz.dto.ts +++ b/src/modules/person/api/find-personendatensatz.dto.ts @@ -1,6 +1,6 @@ import { AutoMap } from '@automapper/classes'; import { PagedDto } from '../../../shared/paging/index.js'; -import { SichtfreigabeType } from './personen-query.param.js'; +import { SichtfreigabeType } from '../domain/personenkontext.enums.js'; export class FindPersonendatensatzDto extends PagedDto { @AutoMap() diff --git a/src/modules/person/api/find-personenkontext.dto.ts b/src/modules/person/api/find-personenkontext.dto.ts index 2074e975a..e1500bc42 100644 --- a/src/modules/person/api/find-personenkontext.dto.ts +++ b/src/modules/person/api/find-personenkontext.dto.ts @@ -1,10 +1,10 @@ import { AutoMap } from '@automapper/classes'; -import { Rolle, Personenstatus } from '../domain/personenkontext.enums.js'; -import { SichtfreigabeType } from './personen-query.param.js'; +import { PagedDto } from '../../../shared/paging/paged.dto.js'; +import { Personenstatus, Rolle, SichtfreigabeType } from '../domain/personenkontext.enums.js'; -export class FindPersonenkontextDto { +export class FindPersonenkontextDto extends PagedDto { @AutoMap() - public personId!: string; + public personId?: string; @AutoMap() public readonly referrer?: string; diff --git a/src/modules/person/api/person-api.mapper.profile.spec.ts b/src/modules/person/api/person-api.mapper.profile.spec.ts index 7d2f90964..db2390385 100644 --- a/src/modules/person/api/person-api.mapper.profile.spec.ts +++ b/src/modules/person/api/person-api.mapper.profile.spec.ts @@ -4,11 +4,11 @@ import { faker } from '@faker-js/faker'; import { Test, TestingModule } from '@nestjs/testing'; import { DoFactory, MapperTestModule } from '../../../../test/utils/index.js'; import { MappingError } from '../../../shared/error/index.js'; -import { CreatePersonDto } from './create-person.dto.js'; import { PersonDo } from '../domain/person.do.js'; import { PersonenkontextDo } from '../domain/personenkontext.do.js'; -import { Jahrgangsstufe, Personenstatus, Rolle } from '../domain/personenkontext.enums.js'; +import { Jahrgangsstufe, Personenstatus, Rolle, SichtfreigabeType } from '../domain/personenkontext.enums.js'; import { CreatePersonBodyParams } from './create-person.body.params.js'; +import { CreatePersonDto } from './create-person.dto.js'; import { CreatePersonenkontextBodyParams } from './create-personenkontext.body.params.js'; import { CreatePersonenkontextDto } from './create-personenkontext.dto.js'; import { CreatedPersonenkontextDto } from './created-personenkontext.dto.js'; @@ -17,19 +17,19 @@ import { FindPersonenkontextByIdParams } from './find-personenkontext-by-id.para import { FindPersonenkontextDto } from './find-personenkontext.dto.js'; import { LoeschungDto } from './loeschung.dto.js'; import { LoeschungResponse } from './loeschung.response.js'; -import { PersonApiMapperProfile, personVisibilityToBooleanConverter } from './person-api.mapper.profile.js'; +import { PersonApiMapperProfile } from './person-api.mapper.profile.js'; import { PersonBirthParams } from './person-birth.params.js'; import { PersonGeburtDto } from './person-geburt.dto.js'; import { PersonNameDto } from './person-name.dto.js'; import { PersonNameParams } from './person-name.params.js'; import { PersonDto } from './person.dto.js'; import { PersonResponse } from './person.response.js'; -import { SichtfreigabeType } from './personen-query.param.js'; import { PersonendatensatzDto } from './personendatensatz.dto.js'; import { PersonendatensatzResponse } from './personendatensatz.response.js'; import { PersonenkontextQueryParams } from './personenkontext-query.params.js'; import { PersonenkontextDto } from './personenkontext.dto.js'; import { PersonenkontextResponse } from './personenkontext.response.js'; +import { PersonenkontextdatensatzResponse } from './personenkontextdatensatz.response.js'; describe('PersonApiMapperProfile', () => { let module: TestingModule; @@ -51,18 +51,6 @@ describe('PersonApiMapperProfile', () => { expect(sut).toBeDefined(); }); - describe('personVisibilityToBooleanConverter', () => { - describe('when converting Visibility type to boolean', () => { - it('should convert VisibilityType.JA to true', () => { - expect(personVisibilityToBooleanConverter.convert(SichtfreigabeType.JA)).toBe(true); - }); - - it('should convert VisibilityType.NEIN to false', () => { - expect(personVisibilityToBooleanConverter.convert(SichtfreigabeType.NEIN)).toBe(false); - }); - }); - }); - describe('when mapper is initialized', () => { it('should map CreatePersonBodyParams to CreatePersonDTO', () => { const params: CreatePersonBodyParams = { @@ -205,5 +193,11 @@ describe('PersonApiMapperProfile', () => { sut.map({} as PersonendatensatzDto, PersonendatensatzDto, PersonendatensatzResponse), ).not.toThrowError(MappingError); }); + + it('should map PersonenkontextDto to PersonenkontextdatensatzResponse', () => { + expect(() => + sut.map({} as PersonenkontextDto, PersonenkontextDto, PersonenkontextdatensatzResponse), + ).not.toThrowError(MappingError); + }); }); }); diff --git a/src/modules/person/api/person-api.mapper.profile.ts b/src/modules/person/api/person-api.mapper.profile.ts index 96ce9d358..dd3b32164 100644 --- a/src/modules/person/api/person-api.mapper.profile.ts +++ b/src/modules/person/api/person-api.mapper.profile.ts @@ -1,21 +1,12 @@ -import { - Converter, - Mapper, - MappingProfile, - convertUsing, - createMap, - forMember, - ignore, - mapFrom, -} from '@automapper/core'; +import { Mapper, MappingProfile, createMap, forMember, ignore, mapFrom } from '@automapper/core'; import { AutomapperProfile, getMapperToken } from '@automapper/nestjs'; import { Inject, Injectable } from '@nestjs/common'; import { UserDo } from '../../keycloak-administration/index.js'; import { OrganisationDo } from '../../organisation/domain/organisation.do.js'; -import { CreatePersonDto } from './create-person.dto.js'; import { PersonDo } from '../domain/person.do.js'; import { PersonenkontextDo } from '../domain/personenkontext.do.js'; import { CreatePersonBodyParams } from './create-person.body.params.js'; +import { CreatePersonDto } from './create-person.dto.js'; import { CreatePersonenkontextBodyParams } from './create-personenkontext.body.params.js'; import { CreatePersonenkontextDto } from './create-personenkontext.dto.js'; import { CreatedPersonenkontextOrganisationDto } from './created-personenkontext-organisation.dto.js'; @@ -28,28 +19,18 @@ import { LoeschungDto } from './loeschung.dto.js'; import { LoeschungResponse } from './loeschung.response.js'; import { PersonBirthParams } from './person-birth.params.js'; import { PersonGeburtDto } from './person-geburt.dto.js'; +import { PersonIdResponse } from './person-id.response.js'; import { PersonNameDto } from './person-name.dto.js'; import { PersonNameParams } from './person-name.params.js'; import { PersonDto } from './person.dto.js'; import { PersonResponse } from './person.response.js'; -import { PersonenQueryParams, SichtfreigabeType } from './personen-query.param.js'; +import { PersonenQueryParams } from './personen-query.param.js'; import { PersonendatensatzDto } from './personendatensatz.dto.js'; import { PersonendatensatzResponse } from './personendatensatz.response.js'; import { PersonenkontextQueryParams } from './personenkontext-query.params.js'; import { PersonenkontextDto } from './personenkontext.dto.js'; import { PersonenkontextResponse } from './personenkontext.response.js'; - -export const personVisibilityToBooleanConverter: Converter = { - convert(source: SichtfreigabeType) { - switch (source) { - case SichtfreigabeType.JA: - return true; - case SichtfreigabeType.NEIN: - default: - return false; - } - }, -}; +import { PersonenkontextdatensatzResponse } from './personenkontextdatensatz.response.js'; @Injectable() export class PersonApiMapperProfile extends AutomapperProfile { @@ -241,6 +222,7 @@ export class PersonApiMapperProfile extends AutomapperProfile { forMember((dest: PersonenkontextDo) => dest.organisation, ignore()), forMember((dest: PersonenkontextDo) => dest.loeschungZeitpunkt, ignore()), forMember((dest: PersonenkontextDo) => dest.revision, ignore()), + forMember((dest: PersonenkontextDo) => dest.sichtfreigabe, ignore()), ); createMap( @@ -248,7 +230,7 @@ export class PersonApiMapperProfile extends AutomapperProfile { PersonenkontextDo, CreatedPersonenkontextDto, forMember( - (dest: PersonenkontextDto) => dest.loeschung, + (dest: CreatedPersonenkontextDto) => dest.loeschung, mapFrom((src: PersonenkontextDo) => src.loeschungZeitpunkt ? new LoeschungDto({ zeitpunkt: src.loeschungZeitpunkt }) : undefined, ), @@ -280,17 +262,6 @@ export class PersonApiMapperProfile extends AutomapperProfile { forMember((dest: PersonenkontextDo) => dest.id, ignore()), forMember((dest: PersonenkontextDo) => dest.createdAt, ignore()), forMember((dest: PersonenkontextDo) => dest.updatedAt, ignore()), - forMember( - (dest: PersonenkontextDo) => dest.id, - mapFrom((src: FindPersonenkontextDto) => src.personId), - ), - forMember( - (dest: PersonenkontextDo) => dest.sichtfreigabe, - convertUsing( - personVisibilityToBooleanConverter, - (src: FindPersonenkontextDto) => src.sichtfreigabe, - ), - ), ); createMap(mapper, FindPersonenkontextByIdParams, FindPersonenkontextByIdDto); @@ -365,6 +336,22 @@ export class PersonApiMapperProfile extends AutomapperProfile { createMap(mapper, PersonGeburtDto, PersonBirthParams); createMap(mapper, PersonendatensatzDto, PersonendatensatzResponse); + + createMap( + mapper, + PersonenkontextDto, + PersonenkontextdatensatzResponse, + forMember( + (dest: PersonenkontextdatensatzResponse) => dest.person, + mapFrom((src: PersonenkontextDto) => new PersonIdResponse({ id: src.personId })), + ), + forMember( + (dest: PersonenkontextdatensatzResponse) => dest.personenkontexte, + mapFrom((src: PersonenkontextDto) => [ + mapper.map(src, PersonenkontextDto, PersonenkontextResponse), + ]), + ), + ); }; } } diff --git a/src/modules/person/api/person-id.response.ts b/src/modules/person/api/person-id.response.ts new file mode 100644 index 000000000..6e029a018 --- /dev/null +++ b/src/modules/person/api/person-id.response.ts @@ -0,0 +1,12 @@ +import { AutoMap } from '@automapper/classes'; +import { ApiProperty } from '@nestjs/swagger'; + +export class PersonIdResponse { + @AutoMap() + @ApiProperty() + public id!: string; + + public constructor(props: Readonly) { + Object.assign(this, props); + } +} diff --git a/src/modules/person/api/person.controller.spec.ts b/src/modules/person/api/person.controller.spec.ts index de1d98a5c..65c32a7d0 100644 --- a/src/modules/person/api/person.controller.spec.ts +++ b/src/modules/person/api/person.controller.spec.ts @@ -1,27 +1,27 @@ import { faker } from '@faker-js/faker'; import { DeepMocked, createMock } from '@golevelup/ts-jest'; +import { HttpException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { MapperTestModule } from '../../../../test/utils/index.js'; +import { Paged, PagedResponse } from '../../../shared/paging/index.js'; +import { Geschlecht, Vertrauensstufe } from '../domain/person.enums.js'; +import { Jahrgangsstufe, Personenstatus, Rolle, SichtfreigabeType } from '../domain/personenkontext.enums.js'; import { CreatePersonBodyParams } from './create-person.body.params.js'; +import { CreatePersonenkontextBodyParams } from './create-personenkontext.body.params.js'; +import { CreatedPersonenkontextDto } from './created-personenkontext.dto.js'; import { PersonApiMapperProfile } from './person-api.mapper.profile.js'; +import { PersonBirthParams } from './person-birth.params.js'; +import { PersonByIdParams } from './person-by-id.param.js'; import { PersonController } from './person.controller.js'; +import { PersonDto } from './person.dto.js'; import { PersonUc } from './person.uc.js'; -import { PersonByIdParams } from './person-by-id.param.js'; -import { HttpException } from '@nestjs/common'; -import { PersonenQueryParams, SichtfreigabeType } from './personen-query.param.js'; -import { PersonBirthParams } from './person-birth.params.js'; -import { Geschlecht, Vertrauensstufe } from '../domain/person.enums.js'; +import { PersonenQueryParams } from './personen-query.param.js'; +import { PersonendatensatzDto } from './personendatensatz.dto.js'; import { PersonendatensatzResponse } from './personendatensatz.response.js'; -import { PersonenkontextUc } from './personenkontext.uc.js'; -import { CreatePersonenkontextBodyParams } from './create-personenkontext.body.params.js'; -import { CreatedPersonenkontextDto } from './created-personenkontext.dto.js'; -import { Jahrgangsstufe, Personenstatus, Rolle } from '../domain/personenkontext.enums.js'; -import { PagedResponse } from '../../../shared/paging/index.js'; -import { PersonenkontextResponse } from './personenkontext.response.js'; import { PersonenkontextQueryParams } from './personenkontext-query.params.js'; -import { PersonendatensatzDto } from './personendatensatz.dto.js'; -import { PersonDto } from './person.dto.js'; import { PersonenkontextDto } from './personenkontext.dto.js'; +import { PersonenkontextResponse } from './personenkontext.response.js'; +import { PersonenkontextUc } from './personenkontext.uc.js'; describe('PersonController', () => { let module: TestingModule; @@ -226,6 +226,7 @@ describe('PersonController', () => { }; const personenkontextResponse: PersonenkontextDto = { id: faker.string.uuid(), + personId: faker.string.uuid(), organisation: { id: faker.string.uuid(), }, @@ -237,18 +238,23 @@ describe('PersonController', () => { personenstatus: Personenstatus.AKTIV, loeschung: { zeitpunkt: faker.date.past() }, }; - const personenkontextDtos: PersonenkontextDto[] = [personenkontextResponse]; + const personenkontextDtos: Paged = { + items: [personenkontextResponse], + total: 1, + offset: 0, + limit: 1, + }; personenkontextUcMock.findAll.mockResolvedValue(personenkontextDtos); - const result: PersonenkontextResponse[] = await personController.findPersonenkontexte( + const result: PagedResponse = await personController.findPersonenkontexte( pathParams, queryParams, ); expect(personenkontextUcMock.findAll).toHaveBeenCalledTimes(1); - expect(result.length).toBe(1); - expect(result[0]?.id).toBe(personenkontextDtos[0]?.id); + expect(result.items.length).toBe(1); + expect(result.items[0]?.id).toBe(personenkontextDtos.items[0]?.id); }); }); }); diff --git a/src/modules/person/api/person.controller.ts b/src/modules/person/api/person.controller.ts index 172c7e7cf..8d0e7c752 100644 --- a/src/modules/person/api/person.controller.ts +++ b/src/modules/person/api/person.controller.ts @@ -4,14 +4,14 @@ import { Body, Controller, Get, - Inject, - Post, - Param, + HttpCode, HttpException, HttpStatus, - Query, - HttpCode, + Inject, + Param, Patch, + Post, + Query, UseInterceptors, } from '@nestjs/common'; import { @@ -27,9 +27,10 @@ import { } from '@nestjs/swagger'; import { Public } from 'nest-keycloak-connect'; import { Paged, PagedResponse, PagingHeadersObject } from '../../../shared/paging/index.js'; +import { ResultInterceptor } from '../../../shared/util/result-interceptor.js'; import { PersonUc } from '../api/person.uc.js'; -import { CreatePersonDto } from './create-person.dto.js'; import { CreatePersonBodyParams } from './create-person.body.params.js'; +import { CreatePersonDto } from './create-person.dto.js'; import { CreatePersonenkontextBodyParams } from './create-personenkontext.body.params.js'; import { CreatePersonenkontextDto } from './create-personenkontext.dto.js'; import { CreatedPersonenkontextDto } from './created-personenkontext.dto.js'; @@ -40,10 +41,9 @@ import { PersonenQueryParams } from './personen-query.param.js'; import { PersonendatensatzDto } from './personendatensatz.dto.js'; import { PersonendatensatzResponse } from './personendatensatz.response.js'; import { PersonenkontextQueryParams } from './personenkontext-query.params.js'; +import { PersonenkontextDto } from './personenkontext.dto.js'; import { PersonenkontextResponse } from './personenkontext.response.js'; import { PersonenkontextUc } from './personenkontext.uc.js'; -import { ResultInterceptor } from '../../../shared/util/result-interceptor.js'; -import { PersonenkontextDto } from './personenkontext.dto.js'; @ApiTags('personen') @Controller({ path: 'personen' }) @@ -111,7 +111,7 @@ export class PersonController { } @Get(':personId/personenkontexte') - @ApiOkResponse({ description: 'The personenkontexte were successfully pulled.' }) + @ApiOkResponse({ description: 'The personenkontexte were successfully pulled.', headers: PagingHeadersObject }) @ApiUnauthorizedResponse({ description: 'Not authorized to get personenkontexte.' }) @ApiForbiddenResponse({ description: 'Insufficient permissions to get personenkontexte.' }) @ApiNotFoundResponse({ description: 'No personenkontexte were found.' }) @@ -119,7 +119,7 @@ export class PersonController { public async findPersonenkontexte( @Param() pathParams: PersonByIdParams, @Query() queryParams: PersonenkontextQueryParams, - ): Promise { + ): Promise> { const findPersonenkontextDto: FindPersonenkontextDto = this.mapper.map( queryParams, PersonenkontextQueryParams, @@ -128,15 +128,21 @@ export class PersonController { findPersonenkontextDto.personId = pathParams.personId; - const personenkontextDtos: PersonenkontextDto[] = await this.personenkontextUc.findAll(findPersonenkontextDto); + const personenkontextDtos: Paged = + await this.personenkontextUc.findAll(findPersonenkontextDto); // AI next 5 lines - const response: PersonenkontextResponse[] = this.mapper.mapArray( - personenkontextDtos, + const responseItems: PersonenkontextResponse[] = this.mapper.mapArray( + personenkontextDtos.items, PersonenkontextDto, PersonenkontextResponse, ); - return response; + return new PagedResponse({ + items: responseItems, + offset: personenkontextDtos.offset, + limit: personenkontextDtos.limit, + total: personenkontextDtos.total, + }); } @Get() diff --git a/src/modules/person/api/person.uc.spec.ts b/src/modules/person/api/person.uc.spec.ts index 0df02b50c..6dad575b6 100644 --- a/src/modules/person/api/person.uc.spec.ts +++ b/src/modules/person/api/person.uc.spec.ts @@ -5,14 +5,14 @@ import { DoFactory, MapperTestModule } from '../../../../test/utils/index.js'; import { EntityNotFoundError, KeycloakClientError, PersonAlreadyExistsError } from '../../../shared/error/index.js'; import { Paged } from '../../../shared/paging/index.js'; import { KeycloakUserService } from '../../keycloak-administration/index.js'; -import { CreatePersonDto } from './create-person.dto.js'; import { PersonDo } from '../domain/person.do.js'; import { PersonService } from '../domain/person.service.js'; +import { SichtfreigabeType } from '../domain/personenkontext.enums.js'; import { PersonenkontextService } from '../domain/personenkontext.service.js'; +import { CreatePersonDto } from './create-person.dto.js'; import { FindPersonendatensatzDto } from './find-personendatensatz.dto.js'; import { PersonApiMapperProfile } from './person-api.mapper.profile.js'; import { PersonUc } from './person.uc.js'; -import { SichtfreigabeType } from './personen-query.param.js'; import { PersonendatensatzDto } from './personendatensatz.dto.js'; describe('PersonUc', () => { @@ -131,8 +131,10 @@ describe('PersonUc', () => { }); personenkontextServiceMock.findAllPersonenkontexte.mockResolvedValue({ - ok: true, - value: [DoFactory.createPersonenkontext(true)], + items: [DoFactory.createPersonenkontext(true)], + total: 1, + limit: 1, + offset: 0, }); await expect(personUc.findPersonById(id)).resolves.not.toThrow(); expect(personenkontextServiceMock.findAllPersonenkontexte).toHaveBeenCalledTimes(1); @@ -157,8 +159,10 @@ describe('PersonUc', () => { }); personenkontextServiceMock.findAllPersonenkontexte.mockResolvedValue({ - ok: false, - error: new EntityNotFoundError('Personenkontext'), + items: [], + total: 0, + limit: 0, + offset: 0, }); await expect(personUc.findPersonById(id)).resolves.not.toThrow(); expect(personenkontextServiceMock.findAllPersonenkontexte).toHaveBeenCalledTimes(1); @@ -186,8 +190,10 @@ describe('PersonUc', () => { personServiceMock.findAllPersons.mockResolvedValue(persons); personenkontextServiceMock.findAllPersonenkontexte.mockResolvedValue({ - ok: true, - value: [DoFactory.createPersonenkontext(true)], + items: [DoFactory.createPersonenkontext(true)], + total: 1, + limit: 1, + offset: 0, }); const result: Paged = await personUc.findAll(personDTO); diff --git a/src/modules/person/api/person.uc.ts b/src/modules/person/api/person.uc.ts index 36438267d..b1ebf1e4d 100644 --- a/src/modules/person/api/person.uc.ts +++ b/src/modules/person/api/person.uc.ts @@ -1,18 +1,17 @@ import { Mapper } from '@automapper/core'; import { getMapperToken } from '@automapper/nestjs'; import { Inject, Injectable } from '@nestjs/common'; -import { DomainError } from '../../../shared/error/domain.error.js'; import { Paged } from '../../../shared/paging/index.js'; import { KeycloakUserService, UserDo } from '../../keycloak-administration/index.js'; -import { CreatePersonDto } from './create-person.dto.js'; import { PersonDo } from '../domain/person.do.js'; import { PersonService } from '../domain/person.service.js'; import { PersonenkontextDo } from '../domain/personenkontext.do.js'; +import { SichtfreigabeType } from '../domain/personenkontext.enums.js'; import { PersonenkontextService } from '../domain/personenkontext.service.js'; +import { CreatePersonDto } from './create-person.dto.js'; import { FindPersonendatensatzDto } from './find-personendatensatz.dto.js'; import { FindPersonenkontextDto } from './find-personenkontext.dto.js'; import { PersonDto } from './person.dto.js'; -import { SichtfreigabeType } from './personen-query.param.js'; import { PersonendatensatzDto } from './personendatensatz.dto.js'; import { PersonenkontextDto } from './personenkontext.dto.js'; @@ -126,17 +125,15 @@ export class PersonUc { personId: personId, sichtfreigabe: sichtfreigabe, }; - const result: Result[], DomainError> = - await this.personenkontextService.findAllPersonenkontexte( - this.mapper.map(personenkontextFilter, FindPersonenkontextDto, PersonenkontextDo), - ); - if (!result.ok) { - return []; - } + const result: Paged> = await this.personenkontextService.findAllPersonenkontexte( + this.mapper.map(personenkontextFilter, FindPersonenkontextDto, PersonenkontextDo), + ); - const personenkontextDtos: PersonenkontextDto[] = result.value.map((personenkontext: PersonenkontextDo) => - this.mapper.map(personenkontext, PersonenkontextDo, PersonenkontextDto), + const personenkontextDtos: PersonenkontextDto[] = this.mapper.mapArray( + result.items, + PersonenkontextDo, + PersonenkontextDto, ); return personenkontextDtos; diff --git a/src/modules/person/api/personen-query.param.spec.ts b/src/modules/person/api/personen-query.param.spec.ts index 678ac6e7b..29a4ff25c 100644 --- a/src/modules/person/api/personen-query.param.spec.ts +++ b/src/modules/person/api/personen-query.param.spec.ts @@ -1,7 +1,8 @@ +import { faker } from '@faker-js/faker'; import { plainToInstance } from 'class-transformer'; import 'reflect-metadata'; -import { PersonenQueryParams, SichtfreigabeType } from './personen-query.param.js'; -import { faker } from '@faker-js/faker'; +import { SichtfreigabeType } from '../domain/personenkontext.enums.js'; +import { PersonenQueryParams } from './personen-query.param.js'; describe('PersonenQueryParam', () => { const referenceParams: PersonenQueryParams = { diff --git a/src/modules/person/api/personen-query.param.ts b/src/modules/person/api/personen-query.param.ts index 895d22f01..080be1701 100644 --- a/src/modules/person/api/personen-query.param.ts +++ b/src/modules/person/api/personen-query.param.ts @@ -1,12 +1,8 @@ +import { AutoMap } from '@automapper/classes'; import { ApiProperty } from '@nestjs/swagger'; import { IsEnum, IsOptional, IsString } from 'class-validator'; -import { AutoMap } from '@automapper/classes'; import { PagedQueryParams } from '../../../shared/paging/index.js'; - -export enum SichtfreigabeType { - JA = 'ja', - NEIN = 'nein', -} +import { SichtfreigabeType } from '../domain/personenkontext.enums.js'; export class PersonenQueryParams extends PagedQueryParams { @AutoMap() @@ -36,7 +32,7 @@ export class PersonenQueryParams extends PagedQueryParams { }) public readonly vorname?: string; - @AutoMap() + @AutoMap(() => String) @IsOptional() @IsEnum(SichtfreigabeType) @ApiProperty({ diff --git a/src/modules/person/api/personenkontext-query.params.spec.ts b/src/modules/person/api/personenkontext-query.params.spec.ts index 14ca3b8c5..1477fea51 100644 --- a/src/modules/person/api/personenkontext-query.params.spec.ts +++ b/src/modules/person/api/personenkontext-query.params.spec.ts @@ -1,8 +1,7 @@ import { plainToInstance } from 'class-transformer'; import 'reflect-metadata'; +import { Personenstatus, Rolle, SichtfreigabeType } from '../domain/personenkontext.enums.js'; import { PersonenkontextQueryParams } from './personenkontext-query.params.js'; -import { SichtfreigabeType } from './personen-query.param.js'; -import { Personenstatus, Rolle } from '../domain/personenkontext.enums.js'; describe('PersonenkontextQueryParams', () => { const referenceParams: PersonenkontextQueryParams = { diff --git a/src/modules/person/api/personenkontext-query.params.ts b/src/modules/person/api/personenkontext-query.params.ts index 310ea1dc4..10ce9b852 100644 --- a/src/modules/person/api/personenkontext-query.params.ts +++ b/src/modules/person/api/personenkontext-query.params.ts @@ -1,10 +1,10 @@ import { AutoMap } from '@automapper/classes'; import { ApiProperty } from '@nestjs/swagger'; import { IsEnum, IsOptional, IsString } from 'class-validator'; -import { Personenstatus, Rolle } from '../domain/personenkontext.enums.js'; -import { SichtfreigabeType } from './personen-query.param.js'; +import { PagedQueryParams } from '../../../shared/paging/paged.query.params.js'; +import { Personenstatus, Rolle, SichtfreigabeType } from '../domain/personenkontext.enums.js'; -export class PersonenkontextQueryParams { +export class PersonenkontextQueryParams extends PagedQueryParams { @AutoMap() @IsOptional() @IsString() @@ -14,25 +14,27 @@ export class PersonenkontextQueryParams { }) public readonly referrer?: string; - @AutoMap() + @AutoMap(() => String) @IsOptional() @IsEnum(Rolle) @ApiProperty({ required: false, nullable: true, + enum: Rolle, }) public readonly rolle?: Rolle; - @AutoMap() + @AutoMap(() => String) @IsOptional() @IsEnum(Personenstatus) @ApiProperty({ required: false, nullable: true, + enum: Personenstatus, }) public readonly personenstatus?: Personenstatus; - @AutoMap() + @AutoMap(() => String) @IsOptional() @IsEnum(SichtfreigabeType) @ApiProperty({ diff --git a/src/modules/person/api/personenkontext.controller.spec.ts b/src/modules/person/api/personenkontext.controller.spec.ts index c90caeae1..98dc3fc1c 100644 --- a/src/modules/person/api/personenkontext.controller.spec.ts +++ b/src/modules/person/api/personenkontext.controller.spec.ts @@ -1,16 +1,22 @@ import { faker } from '@faker-js/faker'; import { DeepMocked, createMock } from '@golevelup/ts-jest'; +import { HttpException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { MapperTestModule } from '../../../../test/utils/index.js'; -import { PersonenkontextController } from './personenkontext.controller.js'; -import { PersonenkontextUc } from './personenkontext.uc.js'; +import { EntityNotFoundError } from '../../../shared/error/entity-not-found.error.js'; +import { Paged } from '../../../shared/paging/paged.js'; +import { PagedResponse } from '../../../shared/paging/paged.response.js'; +import { Jahrgangsstufe, Personenstatus, Rolle, SichtfreigabeType } from '../domain/personenkontext.enums.js'; import { FindPersonenkontextByIdParams } from './find-personenkontext-by-id.params.js'; import { PersonApiMapperProfile } from './person-api.mapper.profile.js'; -import { PersonendatensatzResponse } from './personendatensatz.response.js'; -import { PersonendatensatzDto } from './personendatensatz.dto.js'; import { PersonDto } from './person.dto.js'; -import { EntityNotFoundError } from '../../../shared/error/entity-not-found.error.js'; -import { HttpException } from '@nestjs/common'; +import { PersonendatensatzDto } from './personendatensatz.dto.js'; +import { PersonendatensatzResponse } from './personendatensatz.response.js'; +import { PersonenkontextQueryParams } from './personenkontext-query.params.js'; +import { PersonenkontextController } from './personenkontext.controller.js'; +import { PersonenkontextDto } from './personenkontext.dto.js'; +import { PersonenkontextUc } from './personenkontext.uc.js'; +import { PersonenkontextdatensatzResponse } from './personenkontextdatensatz.response.js'; describe('PersonenkontextController', () => { let module: TestingModule; @@ -87,4 +93,49 @@ describe('PersonenkontextController', () => { }); }); }); + + describe('findPersonenkontexte', () => { + describe('when finding personenkontexte', () => { + it('should return personenkontext', async () => { + const queryParams: PersonenkontextQueryParams = { + referrer: 'referrer', + sichtfreigabe: SichtfreigabeType.JA, + personenstatus: Personenstatus.AKTIV, + rolle: Rolle.LERNENDER, + offset: 0, + limit: 10, + }; + const personenkontext: PersonenkontextDto = { + id: faker.string.uuid(), + personId: faker.string.uuid(), + mandant: faker.string.uuid(), + referrer: queryParams.referrer, + sichtfreigabe: queryParams.sichtfreigabe, + rolle: queryParams.rolle ?? Rolle.LERNENDER, + jahrgangsstufe: Jahrgangsstufe.JAHRGANGSSTUFE_1, + personenstatus: Personenstatus.AKTIV, + organisation: { + id: faker.string.uuid(), + }, + revision: '1', + }; + const personenkontexte: Paged = { + offset: queryParams.offset ?? 0, + limit: queryParams.limit ?? 1, + total: 1, + items: [personenkontext], + }; + personenkontextUcMock.findAll.mockResolvedValue(personenkontexte); + + const result: PagedResponse = + await sut.findPersonenkontexte(queryParams); + + expect(personenkontextUcMock.findAll).toBeCalledTimes(1); + expect(result.items.length).toBe(1); + expect(result.items[0]?.person.id).toBe(personenkontext.personId); + expect(result.items[0]?.personenkontexte.length).toBe(1); + expect(result.items[0]?.personenkontexte[0]?.id).toBe(personenkontext.id); + }); + }); + }); }); diff --git a/src/modules/person/api/personenkontext.controller.ts b/src/modules/person/api/personenkontext.controller.ts index 8a9b7645c..a8661d2e8 100644 --- a/src/modules/person/api/personenkontext.controller.ts +++ b/src/modules/person/api/personenkontext.controller.ts @@ -1,6 +1,6 @@ import { Mapper } from '@automapper/core'; import { getMapperToken } from '@automapper/nestjs'; -import { Controller, Get, HttpException, HttpStatus, Inject, Param } from '@nestjs/common'; +import { Controller, Get, HttpException, HttpStatus, Inject, Param, Query } from '@nestjs/common'; import { ApiBadRequestResponse, ApiForbiddenResponse, @@ -12,11 +12,18 @@ import { } from '@nestjs/swagger'; import { Public } from 'nest-keycloak-connect'; import { EntityNotFoundError } from '../../../shared/error/entity-not-found.error.js'; +import { Paged } from '../../../shared/paging/paged.js'; +import { PagedResponse } from '../../../shared/paging/paged.response.js'; import { FindPersonenkontextByIdDto } from './find-personenkontext-by-id.dto.js'; import { FindPersonenkontextByIdParams } from './find-personenkontext-by-id.params.js'; +import { FindPersonenkontextDto } from './find-personenkontext.dto.js'; import { PersonendatensatzDto } from './personendatensatz.dto.js'; import { PersonendatensatzResponse } from './personendatensatz.response.js'; +import { PersonenkontextQueryParams } from './personenkontext-query.params.js'; +import { PersonenkontextDto } from './personenkontext.dto.js'; import { PersonenkontextUc } from './personenkontext.uc.js'; +import { PersonenkontextdatensatzResponse } from './personenkontextdatensatz.response.js'; +import { PagingHeadersObject } from '../../../shared/paging/paging.enums.js'; @Public() @ApiTags('personenkontexte') @@ -62,4 +69,39 @@ export class PersonenkontextController { throw error; } } + + @Get() + @ApiOkResponse({ + description: 'The personenkontexte were successfully returned.', + type: [PersonendatensatzResponse], + headers: PagingHeadersObject, + }) + @ApiBadRequestResponse({ description: 'Request has wrong format.' }) + @ApiUnauthorizedResponse({ description: 'Request is not authorized.' }) + @ApiNotFoundResponse({ description: 'The personenkontexte were not found.' }) + @ApiForbiddenResponse({ description: 'Insufficient permissions to perform operation.' }) + @ApiInternalServerErrorResponse({ description: 'An internal server error occurred.' }) + public async findPersonenkontexte( + @Query() queryParams: PersonenkontextQueryParams, + ): Promise> { + const findPersonenkontextDto: FindPersonenkontextDto = this.mapper.map( + queryParams, + PersonenkontextQueryParams, + FindPersonenkontextDto, + ); + const result: Paged = await this.personenkontextUc.findAll(findPersonenkontextDto); + const responseItems: PersonenkontextdatensatzResponse[] = this.mapper.mapArray( + result.items, + PersonenkontextDto, + PersonenkontextdatensatzResponse, + ); + const response: PagedResponse = new PagedResponse({ + items: responseItems, + total: result.total, + offset: result.offset, + limit: result.limit, + }); + + return response; + } } diff --git a/src/modules/person/api/personenkontext.dto.ts b/src/modules/person/api/personenkontext.dto.ts index f5c10aac0..6aa703656 100644 --- a/src/modules/person/api/personenkontext.dto.ts +++ b/src/modules/person/api/personenkontext.dto.ts @@ -1,13 +1,15 @@ import { AutoMap } from '@automapper/classes'; -import { Rolle, Personenstatus, Jahrgangsstufe } from '../domain/personenkontext.enums.js'; +import { Jahrgangsstufe, Personenstatus, Rolle, SichtfreigabeType } from '../domain/personenkontext.enums.js'; import { CreatedPersonenkontextOrganisationDto } from './created-personenkontext-organisation.dto.js'; -import { SichtfreigabeType } from './personen-query.param.js'; import { LoeschungDto } from './loeschung.dto.js'; export class PersonenkontextDto { @AutoMap() public readonly id!: string; + @AutoMap() + public readonly personId!: string; + @AutoMap() public readonly referrer?: string; diff --git a/src/modules/person/api/personenkontext.response.ts b/src/modules/person/api/personenkontext.response.ts index e4bb47959..c3bc49538 100644 --- a/src/modules/person/api/personenkontext.response.ts +++ b/src/modules/person/api/personenkontext.response.ts @@ -1,9 +1,8 @@ import { AutoMap } from '@automapper/classes'; import { ApiProperty } from '@nestjs/swagger'; -import { Jahrgangsstufe, Personenstatus, Rolle } from '../domain/personenkontext.enums.js'; +import { Jahrgangsstufe, Personenstatus, Rolle, SichtfreigabeType } from '../domain/personenkontext.enums.js'; import { CreatedPersonenkontextOrganisationDto } from './created-personenkontext-organisation.dto.js'; import { LoeschungResponse } from './loeschung.response.js'; -import { SichtfreigabeType } from './personen-query.param.js'; export class PersonenkontextResponse { @AutoMap() diff --git a/src/modules/person/api/personenkontext.uc.spec.ts b/src/modules/person/api/personenkontext.uc.spec.ts index d4b612e46..3fc8995a7 100644 --- a/src/modules/person/api/personenkontext.uc.spec.ts +++ b/src/modules/person/api/personenkontext.uc.spec.ts @@ -2,20 +2,19 @@ import { faker } from '@faker-js/faker'; import { DeepMocked, createMock } from '@golevelup/ts-jest'; import { Test, TestingModule } from '@nestjs/testing'; import { DoFactory, MapperTestModule } from '../../../../test/utils/index.js'; -import { DomainError } from '../../../shared/error/domain.error.js'; import { EntityCouldNotBeCreated } from '../../../shared/error/entity-could-not-be-created.error.js'; import { EntityNotFoundError } from '../../../shared/error/entity-not-found.error.js'; +import { Paged } from '../../../shared/paging/paged.js'; import { PersonDo } from '../domain/person.do.js'; import { PersonService } from '../domain/person.service.js'; import { PersonenkontextDo } from '../domain/personenkontext.do.js'; -import { Personenstatus, Rolle } from '../domain/personenkontext.enums.js'; +import { Personenstatus, Rolle, SichtfreigabeType } from '../domain/personenkontext.enums.js'; import { PersonenkontextService } from '../domain/personenkontext.service.js'; import { CreatePersonenkontextDto } from './create-personenkontext.dto.js'; import { CreatedPersonenkontextDto } from './created-personenkontext.dto.js'; import { FindPersonenkontextByIdDto } from './find-personenkontext-by-id.dto.js'; import { FindPersonenkontextDto } from './find-personenkontext.dto.js'; import { PersonApiMapperProfile } from './person-api.mapper.profile.js'; -import { SichtfreigabeType } from './personen-query.param.js'; import { PersonenkontextDto } from './personenkontext.dto.js'; import { PersonenkontextUc } from './personenkontext.uc.js'; @@ -107,15 +106,17 @@ describe('PersonenkontextUc', () => { const secondPersonenkontext: PersonenkontextDo = DoFactory.createPersonenkontext(true); const personenkontexte: PersonenkontextDo[] = [firstPersonenkontext, secondPersonenkontext]; personenkontextServiceMock.findAllPersonenkontexte.mockResolvedValue({ - ok: true, - value: personenkontexte, + items: personenkontexte, + total: personenkontexte.length, + limit: personenkontexte.length, + offset: 0, }); - const result: PersonenkontextDto[] = await sut.findAll(findPersonenkontextDto); - expect(result).toHaveLength(2); + const result: Paged = await sut.findAll(findPersonenkontextDto); + expect(result.items).toHaveLength(2); }); - it('should throw EntityNotFoundError when no matching persons are found', async () => { + it('should return empty array when no matching persons are found', async () => { const findPersonenkontextDto: FindPersonenkontextDto = { personId: faker.string.uuid(), referrer: 'referrer', @@ -124,12 +125,17 @@ describe('PersonenkontextUc', () => { rolle: Rolle.LERNENDER, }; - const emptyResult: Result[], DomainError> = { - ok: false, - error: new EntityNotFoundError('Personenkontext'), + const emptyResult: Paged> = { + items: [], + total: 0, + limit: 0, + offset: 0, }; personenkontextServiceMock.findAllPersonenkontexte.mockResolvedValue(emptyResult); - await expect(sut.findAll(findPersonenkontextDto)).rejects.toThrow(EntityNotFoundError); + + const result: Paged = await sut.findAll(findPersonenkontextDto); + + expect(result.items).toHaveLength(0); }); }); }); diff --git a/src/modules/person/api/personenkontext.uc.ts b/src/modules/person/api/personenkontext.uc.ts index 2931dc0aa..f20078de3 100644 --- a/src/modules/person/api/personenkontext.uc.ts +++ b/src/modules/person/api/personenkontext.uc.ts @@ -1,7 +1,7 @@ import { Mapper } from '@automapper/core'; import { getMapperToken } from '@automapper/nestjs'; import { Inject, Injectable } from '@nestjs/common'; -import { DomainError } from '../../../shared/error/domain.error.js'; +import { Paged } from '../../../shared/paging/paged.js'; import { PersonDo } from '../domain/person.do.js'; import { PersonService } from '../domain/person.service.js'; import { PersonenkontextDo } from '../domain/personenkontext.do.js'; @@ -38,24 +38,31 @@ export class PersonenkontextUc { throw result.error; } - // TODO refactor after EW-561 is done - public async findAll(findPersonenkontextDto: FindPersonenkontextDto): Promise { + public async findAll(findPersonenkontextDto: FindPersonenkontextDto): Promise> { const personenkontextDo: PersonenkontextDo = this.mapper.map( findPersonenkontextDto, FindPersonenkontextDto, PersonenkontextDo, ); - const result: Result[], DomainError> = - await this.personenkontextService.findAllPersonenkontexte(personenkontextDo); - if (!result.ok) { - throw result.error; - } + const result: Paged> = await this.personenkontextService.findAllPersonenkontexte( + personenkontextDo, + findPersonenkontextDto.offset, + findPersonenkontextDto.limit, + ); - const personenkontexte: PersonenkontextDto[] = result.value.map((personenkontext: PersonenkontextDo) => - this.mapper.map(personenkontext, PersonenkontextDo, PersonenkontextDto), + const personenkontexte: PersonenkontextDto[] = this.mapper.mapArray( + result.items, + PersonenkontextDo, + PersonenkontextDto, ); - return personenkontexte; + + return { + total: result.total, + offset: result.offset, + limit: result.limit, + items: personenkontexte, + }; } public async findPersonenkontextById(dto: FindPersonenkontextByIdDto): Promise { diff --git a/src/modules/person/api/personenkontextdatensatz.response.ts b/src/modules/person/api/personenkontextdatensatz.response.ts new file mode 100644 index 000000000..ae591f35a --- /dev/null +++ b/src/modules/person/api/personenkontextdatensatz.response.ts @@ -0,0 +1,14 @@ +import { AutoMap } from '@automapper/classes'; +import { ApiProperty } from '@nestjs/swagger'; +import { PersonIdResponse } from './person-id.response.js'; +import { PersonenkontextResponse } from './personenkontext.response.js'; + +export class PersonenkontextdatensatzResponse { + @AutoMap(() => PersonIdResponse) + @ApiProperty({ type: PersonIdResponse }) + public person!: PersonIdResponse; + + @AutoMap(() => [PersonenkontextResponse]) + @ApiProperty({ type: [PersonenkontextResponse] }) + public personenkontexte!: PersonenkontextResponse[]; +} diff --git a/src/modules/person/domain/personenkontext.do.ts b/src/modules/person/domain/personenkontext.do.ts index dba5a534e..0ab592d9f 100644 --- a/src/modules/person/domain/personenkontext.do.ts +++ b/src/modules/person/domain/personenkontext.do.ts @@ -1,7 +1,7 @@ import { AutoMap } from '@automapper/classes'; import { DoBase } from '../../../shared/types/index.js'; import { OrganisationDo } from '../../organisation/domain/organisation.do.js'; -import { Jahrgangsstufe, Personenstatus, Rolle } from './personenkontext.enums.js'; +import { Jahrgangsstufe, Personenstatus, Rolle, SichtfreigabeType } from './personenkontext.enums.js'; export class PersonenkontextDo implements DoBase { /** @@ -40,8 +40,8 @@ export class PersonenkontextDo implements DoBase String) public jahrgangsstufe?: Jahrgangsstufe; - @AutoMap() - public sichtfreigabe?: boolean = false; + @AutoMap(() => String) + public sichtfreigabe?: SichtfreigabeType; @AutoMap(() => Date) public loeschungZeitpunkt?: Date; diff --git a/src/modules/person/domain/personenkontext.enums.ts b/src/modules/person/domain/personenkontext.enums.ts index 70391841e..810e35b7f 100644 --- a/src/modules/person/domain/personenkontext.enums.ts +++ b/src/modules/person/domain/personenkontext.enums.ts @@ -23,3 +23,8 @@ export enum Rolle { ORGANISATIONSLEITUNG = 'LEIT', SYSTEMADMINISTRATOR = 'SYSADMIN', } + +export enum SichtfreigabeType { + JA = 'ja', + NEIN = 'nein', +} diff --git a/src/modules/person/domain/personenkontext.service.spec.ts b/src/modules/person/domain/personenkontext.service.spec.ts index 0cd0bca49..b82ca5e83 100644 --- a/src/modules/person/domain/personenkontext.service.spec.ts +++ b/src/modules/person/domain/personenkontext.service.spec.ts @@ -5,12 +5,13 @@ import { Test, TestingModule } from '@nestjs/testing'; import { DoFactory } from '../../../../test/utils/do-factory.js'; import { DomainError } from '../../../shared/error/domain.error.js'; import { EntityCouldNotBeCreated } from '../../../shared/error/entity-could-not-be-created.error.js'; +import { EntityNotFoundError } from '../../../shared/error/entity-not-found.error.js'; +import { Paged } from '../../../shared/paging/paged.js'; import { PersonRepo } from '../persistence/person.repo.js'; import { PersonenkontextRepo } from '../persistence/personenkontext.repo.js'; +import { PersonDo } from './person.do.js'; import { PersonenkontextDo } from './personenkontext.do.js'; import { PersonenkontextService } from './personenkontext.service.js'; -import { EntityNotFoundError } from '../../../shared/error/entity-not-found.error.js'; -import { PersonDo } from './person.do.js'; describe('PersonenkontextService', () => { let module: TestingModule; @@ -118,16 +119,20 @@ describe('PersonenkontextService', () => { personenkontext1 as unknown as PersonenkontextDo, personenkontext2 as unknown as PersonenkontextDo, ]; - personenkontextRepoMock.findAll.mockResolvedValue(personenkontexte); + personenkontextRepoMock.findBy.mockResolvedValue([personenkontexte, personenkontexte.length]); mapperMock.map.mockReturnValue(personenkontexte as unknown as Dictionary); const personenkontextDoWithQueryParam: PersonenkontextDo = DoFactory.createPersonenkontext(false); - const result: Result[], DomainError> = - await personenkontextService.findAllPersonenkontexte(personenkontextDoWithQueryParam); - expect(result).toEqual[], DomainError>>({ - ok: true, - value: personenkontexte, + const result: Paged> = await personenkontextService.findAllPersonenkontexte( + personenkontextDoWithQueryParam, + ); + + expect(result).toEqual>>({ + items: personenkontexte, + total: personenkontexte.length, + offset: 0, + limit: personenkontexte.length, }); }); }); @@ -135,13 +140,17 @@ describe('PersonenkontextService', () => { describe('When no personenkontexte are found', () => { it('should return a result with an empty array', async () => { const personenkontext: PersonenkontextDo = DoFactory.createPersonenkontext(false); - personenkontextRepoMock.findAll.mockResolvedValue([]); + personenkontextRepoMock.findBy.mockResolvedValue([[], 0]); mapperMock.map.mockReturnValue(personenkontext as unknown as Dictionary); - const result: Result[], DomainError> = + + const result: Paged> = await personenkontextService.findAllPersonenkontexte(personenkontext); - expect(result).toEqual[], DomainError>>({ - ok: true, - value: [], + + expect(result).toEqual>>({ + items: [], + total: 0, + offset: 0, + limit: 0, }); }); }); diff --git a/src/modules/person/domain/personenkontext.service.ts b/src/modules/person/domain/personenkontext.service.ts index 89eff0b82..bd7e47e83 100644 --- a/src/modules/person/domain/personenkontext.service.ts +++ b/src/modules/person/domain/personenkontext.service.ts @@ -1,10 +1,13 @@ import { Injectable } from '@nestjs/common'; import { EntityCouldNotBeCreated } from '../../../shared/error/entity-could-not-be-created.error.js'; import { DomainError, EntityNotFoundError } from '../../../shared/error/index.js'; +import { Paged } from '../../../shared/paging/paged.js'; +import { ScopeOrder } from '../../../shared/persistence/scope.enums.js'; import { PersonRepo } from '../persistence/person.repo.js'; import { PersonenkontextRepo } from '../persistence/personenkontext.repo.js'; -import { PersonenkontextDo } from './personenkontext.do.js'; +import { PersonenkontextScope } from '../persistence/personenkontext.scope.js'; import { PersonDo } from './person.do.js'; +import { PersonenkontextDo } from './personenkontext.do.js'; @Injectable() export class PersonenkontextService { @@ -30,10 +33,29 @@ export class PersonenkontextService { public async findAllPersonenkontexte( personenkontextDo: PersonenkontextDo, - ): Promise[], DomainError>> { - const personenkontexte: PersonenkontextDo[] = await this.personenkontextRepo.findAll(personenkontextDo); + offset?: number, + limit?: number, + ): Promise>> { + const scope: PersonenkontextScope = new PersonenkontextScope() + .findBy({ + personId: personenkontextDo.personId, + referrer: personenkontextDo.referrer, + rolle: personenkontextDo.rolle, + personenstatus: personenkontextDo.personenstatus, + sichtfreigabe: personenkontextDo.sichtfreigabe, + }) + .sortBy('id', ScopeOrder.ASC) + .paged(offset, limit); + + const [personenkontexte, total]: Counted> = + await this.personenkontextRepo.findBy(scope); - return { ok: true, value: personenkontexte }; + return { + offset: offset ?? 0, + limit: limit ?? total, + total, + items: personenkontexte, + }; } public async findPersonenkontextById(id: string): Promise, DomainError>> { diff --git a/src/modules/person/persistence/personenkontext.entity.ts b/src/modules/person/persistence/personenkontext.entity.ts index 04cd09eef..fb47842ab 100644 --- a/src/modules/person/persistence/personenkontext.entity.ts +++ b/src/modules/person/persistence/personenkontext.entity.ts @@ -1,7 +1,7 @@ import { AutoMap } from '@automapper/classes'; import { DateTimeType, Entity, Enum, Property } from '@mikro-orm/core'; import { TimestampedEntity } from '../../../persistence/timestamped.entity.js'; -import { Rolle, Personenstatus, Jahrgangsstufe } from '../domain/personenkontext.enums.js'; +import { Jahrgangsstufe, Personenstatus, Rolle, SichtfreigabeType } from '../domain/personenkontext.enums.js'; @Entity({ tableName: 'personenkontext' }) export class PersonenkontextEntity extends TimestampedEntity { @@ -39,9 +39,9 @@ export class PersonenkontextEntity extends TimestampedEntity Jahrgangsstufe }) public jahrgangsstufe?: Jahrgangsstufe; - @AutoMap() - @Property({ nullable: true }) - public sichtfreigabe?: boolean = false; + @AutoMap(() => String) + @Property({ nullable: true, default: SichtfreigabeType.NEIN }) + public sichtfreigabe?: SichtfreigabeType; @AutoMap(() => Date) @Property({ nullable: true, type: DateTimeType }) diff --git a/src/modules/person/persistence/personenkontext.repo.integration-spec.ts b/src/modules/person/persistence/personenkontext.repo.integration-spec.ts index d8ba998b7..a96616371 100644 --- a/src/modules/person/persistence/personenkontext.repo.integration-spec.ts +++ b/src/modules/person/persistence/personenkontext.repo.integration-spec.ts @@ -12,11 +12,12 @@ import { } from '../../../../test/utils/index.js'; import { PersonDo } from '../domain/person.do.js'; import { PersonenkontextDo } from '../domain/personenkontext.do.js'; -import { Personenstatus, Rolle } from '../domain/personenkontext.enums.js'; +import { Personenstatus, Rolle, SichtfreigabeType } from '../domain/personenkontext.enums.js'; import { PersonPersistenceMapperProfile } from './person-persistence.mapper.profile.js'; import { PersonEntity } from './person.entity.js'; import { PersonenkontextEntity } from './personenkontext.entity.js'; import { PersonenkontextRepo } from './personenkontext.repo.js'; +import { PersonenkontextScope } from './personenkontext.scope.js'; describe('PersonenkontextRepo', () => { let module: TestingModule; @@ -111,14 +112,14 @@ describe('PersonenkontextRepo', () => { }); }); - describe('findAll', () => { + describe('findBy', () => { describe('When personenkontext for person exists', () => { it('should find all personenkontexte for this person', async () => { const props: Partial> = { referrer: 'referrer', personenstatus: Personenstatus.AKTIV, rolle: Rolle.LERNENDER, - sichtfreigabe: false, + sichtfreigabe: SichtfreigabeType.NEIN, }; const person1Id: string = faker.string.uuid(); const personenkontextDo1: PersonenkontextDo = DoFactory.createPersonenkontext(false, { @@ -129,15 +130,15 @@ describe('PersonenkontextRepo', () => { await em.persistAndFlush(mapper.map(personenkontextDo1, PersonenkontextDo, PersonenkontextEntity)); await em.persistAndFlush(mapper.map(personenkontextDo2, PersonenkontextDo, PersonenkontextEntity)); - const personenkontextDoFromQueryParam: PersonenkontextDo = DoFactory.createPersonenkontext( - false, - { - ...props, + const [result]: Counted> = await sut.findBy( + new PersonenkontextScope().findBy({ + referrer: 'referrer', + personenstatus: Personenstatus.AKTIV, + rolle: Rolle.LERNENDER, + sichtfreigabe: SichtfreigabeType.NEIN, personId: person1Id, - }, + }), ); - - const result: PersonenkontextDo[] = await sut.findAll(personenkontextDoFromQueryParam); expect(result).not.toBeNull(); expect(result).toHaveLength(1); await expect(em.find(PersonenkontextEntity, {})).resolves.toHaveLength(2); @@ -146,12 +147,8 @@ describe('PersonenkontextRepo', () => { describe('When no personenkontext matches', () => { it('should return an empty list', async () => { - const props: Partial> = {}; - const personenkontextDoFromQueryParam: PersonenkontextDo = DoFactory.createPersonenkontext( - false, - props, - ); - const result: PersonenkontextDo[] = await sut.findAll(personenkontextDoFromQueryParam); + const [result]: Counted> = await sut.findBy(new PersonenkontextScope()); + expect(result).not.toBeNull(); expect(result).toHaveLength(0); await expect(em.find(PersonenkontextEntity, {})).resolves.toHaveLength(0); diff --git a/src/modules/person/persistence/personenkontext.repo.ts b/src/modules/person/persistence/personenkontext.repo.ts index ac708f868..8cca74185 100644 --- a/src/modules/person/persistence/personenkontext.repo.ts +++ b/src/modules/person/persistence/personenkontext.repo.ts @@ -5,6 +5,7 @@ import { EntityManager } from '@mikro-orm/postgresql'; import { Inject, Injectable } from '@nestjs/common'; import { PersonenkontextDo } from '../domain/personenkontext.do.js'; import { PersonenkontextEntity } from './personenkontext.entity.js'; +import { PersonenkontextScope } from './personenkontext.scope.js'; @Injectable() export class PersonenkontextRepo { @@ -20,32 +21,11 @@ export class PersonenkontextRepo { return this.create(personenkontextDo); } - // TODO refactor after EW-561 is done, use Scope - public async findAll(personenkontextDo: PersonenkontextDo): Promise[]> { - const query: Record = {}; + public async findBy(scope: PersonenkontextScope): Promise>> { + const [entities, total]: Counted = await scope.executeQuery(this.em); + const dos: PersonenkontextDo[] = this.mapper.mapArray(entities, PersonenkontextEntity, PersonenkontextDo); - query['personId'] = personenkontextDo.personId; - - if (personenkontextDo.referrer) { - query['referrer'] = personenkontextDo.referrer; - } - - if (personenkontextDo.rolle) { - query['rolle'] = personenkontextDo.rolle; - } - - if (personenkontextDo.personenstatus) { - query['personenstatus'] = personenkontextDo.personenstatus; - } - - if (personenkontextDo.sichtfreigabe !== undefined) { - query['sichtfreigabe'] = personenkontextDo.sichtfreigabe; - } - - const result: PersonenkontextEntity[] = await this.em.find(PersonenkontextEntity, query); - return result.map((person: PersonenkontextEntity) => - this.mapper.map(person, PersonenkontextEntity, PersonenkontextDo), - ); + return [dos, total]; } public async findById(id: string): Promise>> { diff --git a/src/modules/person/persistence/personenkontext.scope.integration-spec.ts b/src/modules/person/persistence/personenkontext.scope.integration-spec.ts new file mode 100644 index 000000000..05d2e52c4 --- /dev/null +++ b/src/modules/person/persistence/personenkontext.scope.integration-spec.ts @@ -0,0 +1,69 @@ +import { Mapper } from '@automapper/core'; +import { getMapperToken } from '@automapper/nestjs'; +import { MikroORM } from '@mikro-orm/core'; +import { EntityManager } from '@mikro-orm/postgresql'; +import { Test, TestingModule } from '@nestjs/testing'; +import { + ConfigTestModule, + DEFAULT_TIMEOUT_FOR_TESTCONTAINERS, + DatabaseTestModule, + DoFactory, + MapperTestModule, +} from '../../../../test/utils/index.js'; +import { ScopeOrder } from '../../../shared/persistence/scope.enums.js'; +import { PersonenkontextDo } from '../domain/personenkontext.do.js'; +import { PersonPersistenceMapperProfile } from './person-persistence.mapper.profile.js'; +import { PersonenkontextEntity } from './personenkontext.entity.js'; +import { PersonenkontextScope } from './personenkontext.scope.js'; + +describe('PersonenkontextScope', () => { + let module: TestingModule; + let orm: MikroORM; + let em: EntityManager; + let mapper: Mapper; + + beforeAll(async () => { + module = await Test.createTestingModule({ + imports: [ConfigTestModule, DatabaseTestModule.forRoot({ isDatabaseRequired: true }), MapperTestModule], + providers: [PersonPersistenceMapperProfile], + }).compile(); + orm = module.get(MikroORM); + em = module.get(EntityManager); + mapper = module.get(getMapperToken()); + + await DatabaseTestModule.setupDatabase(orm); + }, DEFAULT_TIMEOUT_FOR_TESTCONTAINERS); + + afterAll(async () => { + await module.close(); + }); + + beforeEach(async () => { + await DatabaseTestModule.clearDatabase(orm); + }); + + describe('findBy', () => { + describe('when filtering for personenkontexte', () => { + beforeEach(async () => { + const dos: PersonenkontextDo[] = DoFactory.createMany( + 30, + false, + DoFactory.createPersonenkontext, + ); + + await em.persistAndFlush(mapper.mapArray(dos, PersonenkontextDo, PersonenkontextEntity)); + }); + + it('should return found personenkontexte', async () => { + const scope: PersonenkontextScope = new PersonenkontextScope() + .findBy({ referrer: 'referrer' }) + .sortBy('id', ScopeOrder.ASC) + .paged(10, 10); + const [personenkontext, total]: Counted = await scope.executeQuery(em); + + expect(total).toBe(30); + expect(personenkontext).toHaveLength(10); + }); + }); + }); +}); diff --git a/src/modules/person/persistence/personenkontext.scope.ts b/src/modules/person/persistence/personenkontext.scope.ts new file mode 100644 index 000000000..010aff79c --- /dev/null +++ b/src/modules/person/persistence/personenkontext.scope.ts @@ -0,0 +1,34 @@ +import { EntityName } from '@mikro-orm/core'; +import { ScopeBase } from '../../../shared/persistence/scope-base.js'; +import { ScopeOperator } from '../../../shared/persistence/scope.enums.js'; +import { Personenstatus, Rolle, SichtfreigabeType } from '../domain/personenkontext.enums.js'; +import { PersonenkontextEntity } from './personenkontext.entity.js'; + +type FindProps = { + personId: string; + referrer: string; + rolle: Rolle; + personenstatus: Personenstatus; + sichtfreigabe: SichtfreigabeType; +}; + +export class PersonenkontextScope extends ScopeBase { + public override get entityName(): EntityName { + return PersonenkontextEntity; + } + + public findBy(findProps: Findable, operator: ScopeOperator = ScopeOperator.AND): this { + this.findByInternal( + { + personId: findProps.personId, + referrer: findProps.referrer, + rolle: findProps.rolle, + personenstatus: findProps.personenstatus, + sichtfreigabe: findProps.sichtfreigabe, + }, + operator, + ); + + return this; + } +} diff --git a/test/utils/do-factory.ts b/test/utils/do-factory.ts index 078400ead..fc8a6d951 100644 --- a/test/utils/do-factory.ts +++ b/test/utils/do-factory.ts @@ -4,7 +4,12 @@ import { OrganisationDo } from '../../src/modules/organisation/domain/organisati import { OrganisationsTyp } from '../../src/modules/organisation/domain/organisation.enum.js'; import { PersonDo } from '../../src/modules/person/domain/person.do.js'; import { PersonenkontextDo } from '../../src/modules/person/domain/personenkontext.do.js'; -import { Jahrgangsstufe, Personenstatus, Rolle } from '../../src/modules/person/domain/personenkontext.enums.js'; +import { + Jahrgangsstufe, + Personenstatus, + Rolle, + SichtfreigabeType, +} from '../../src/modules/person/domain/personenkontext.enums.js'; import { PersonRollenZuweisungDo } from '../../src/modules/rolle/domain/person-rollen-zuweisung.do.js'; import { RolleBerechtigungsZuweisungDo } from '../../src/modules/rolle/domain/rolle-berechtigungs-zuweisung.do.js'; import { RolleRechtDo } from '../../src/modules/rolle/domain/rolle-recht.do.js'; @@ -91,7 +96,7 @@ export class DoFactory { jahrgangsstufe: Jahrgangsstufe.JAHRGANGSSTUFE_1, personenstatus: Personenstatus.AKTIV, referrer: 'referrer', - sichtfreigabe: true, + sichtfreigabe: SichtfreigabeType.JA, loeschungZeitpunkt: faker.date.anytime(), };