From 06445a42d53512965d954687cba9fd56830ebb28 Mon Sep 17 00:00:00 2001 From: Vins Date: Mon, 26 Jun 2023 09:42:08 +0200 Subject: [PATCH 01/11] Remove weback config + npm i sharp --- next.config.js | 20 +-- package-lock.json | 414 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 1 + 3 files changed, 424 insertions(+), 11 deletions(-) diff --git a/next.config.js b/next.config.js index 6a80175b..b1ed70a2 100644 --- a/next.config.js +++ b/next.config.js @@ -13,16 +13,16 @@ const nextConfig = { NEXT_PUBLIC_IDNOT_AUTHORIZE_ENDPOINT: process.env.NEXT_PUBLIC_IDNOT_AUTHORIZE_ENDPOINT, NEXT_PUBLIC_IDNOT_CLIENT_ID: process.env.NEXT_PUBLIC_IDNOT_CLIENT_ID, }, - webpack: config => { - config.node = { - fs: 'empty', - child_process: 'empty', - net: 'empty', - dns: 'empty', - tls: 'empty', - }; - return config; - }, + // webpack: config => { + // config.node = { + // fs: 'empty', + // child_process: 'empty', + // net: 'empty', + // dns: 'empty', + // tls: 'empty', + // }; + // return config; + // }, }; module.exports = nextConfig; diff --git a/package-lock.json b/package-lock.json index f10b3e4e..f84c230d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,13 +21,14 @@ "eslint": "8.36.0", "eslint-config-next": "13.2.4", "form-data": "^4.0.0", - "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.47", + "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.52", "next": "13.2.4", "prettier": "^2.8.7", "react": "18.2.0", "react-dom": "18.2.0", "react-select": "^5.7.2", "sass": "^1.59.2", + "sharp": "^0.32.1", "typescript": "4.9.5" } }, @@ -1286,6 +1287,25 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/big-integer": { "version": "1.6.51", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", @@ -1302,6 +1322,16 @@ "node": ">=8" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "node_modules/bplist-parser": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", @@ -1333,6 +1363,29 @@ "node": ">=8" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "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.1.13" + } + }, "node_modules/bundle-name": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-3.0.0.tgz", @@ -1438,6 +1491,11 @@ "node": ">= 6" } }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, "node_modules/class-transformer": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz", @@ -1471,6 +1529,18 @@ "node": ">=6" } }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1487,6 +1557,15 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -1576,6 +1655,20 @@ } } }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/deep-equal": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.1.tgz", @@ -1604,6 +1697,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -1675,6 +1776,14 @@ "node": ">=0.4.0" } }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "engines": { + "node": ">=8" + } + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -1719,6 +1828,14 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/enhanced-resolve": { "version": "5.14.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.0.tgz", @@ -2298,6 +2415,14 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "engines": { + "node": ">=6" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2427,6 +2552,11 @@ "node": ">= 6" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2522,6 +2652,11 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" + }, "node_modules/glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -2726,6 +2861,25 @@ "node": ">=14.18.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/ignore": { "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", @@ -2776,6 +2930,11 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, "node_modules/internal-slot": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", @@ -3359,6 +3518,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -3378,6 +3548,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -3400,6 +3575,11 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -3460,6 +3640,22 @@ } } }, + "node_modules/node-abi": { + "version": "3.45.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.45.0.tgz", + "integrity": "sha512-iwXuFrMAcFVi/ZoZiqq8BzAdsLw9kxDfTC0HMyjXfSL/6CSDAGD5UmR7azrAgWV1zKYq7dUUMj4owusBWKLsiQ==", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", + "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==" + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -3793,6 +3989,31 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/prebuild-install": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", + "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -3830,6 +4051,15 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "node_modules/punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", @@ -3857,6 +4087,28 @@ } ] }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/react": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", @@ -3920,6 +4172,19 @@ "react-dom": ">=16.6.0" } }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -4122,6 +4387,25 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/safe-regex-test": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", @@ -4173,6 +4457,28 @@ "node": ">=10" } }, + "node_modules/sharp": { + "version": "0.32.1", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.1.tgz", + "integrity": "sha512-kQTFtj7ldpUqSe8kDxoGLZc1rnMFU0AO2pqbX6pLy3b7Oj8ivJIdoKNwxHVQG2HN6XpHPJqCSM2nsma2gOXvOg==", + "hasInstallScript": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.1", + "node-addon-api": "^6.1.0", + "prebuild-install": "^7.1.1", + "semver": "^7.5.0", + "simple-get": "^4.0.1", + "tar-fs": "^2.1.1", + "tunnel-agent": "^0.6.0" + }, + "engines": { + "node": ">=14.15.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -4210,6 +4516,62 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "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": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -4245,6 +4607,14 @@ "node": ">= 0.4" } }, + "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/string.prototype.matchall": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz", @@ -4418,6 +4788,32 @@ "node": ">=6" } }, + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -4488,6 +4884,17 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -4578,6 +4985,11 @@ } } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, "node_modules/validator": { "version": "13.9.0", "resolved": "https://registry.npmjs.org/validator/-/validator-13.9.0.tgz", diff --git a/package.json b/package.json index e53efd8f..347e83a5 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "react-dom": "18.2.0", "react-select": "^5.7.2", "sass": "^1.59.2", + "sharp": "^0.32.1", "typescript": "4.9.5" } } From f1ede4c2fab0d0e7bb64b0f3188262358deb5817 Mon Sep 17 00:00:00 2001 From: Vins Date: Wed, 5 Jul 2023 17:09:46 +0200 Subject: [PATCH 02/11] UserStore --- package-lock.json | 506 ++++++++++++------------------- package.json | 2 +- src/front/Api/Auth/IdNot/User.ts | 38 +++ src/front/Stores/UserStore.ts | 56 ++++ 4 files changed, 283 insertions(+), 319 deletions(-) create mode 100644 src/front/Api/Auth/IdNot/User.ts create mode 100644 src/front/Stores/UserStore.ts diff --git a/package-lock.json b/package-lock.json index f84c230d..2629b40b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "eslint": "8.36.0", "eslint-config-next": "13.2.4", "form-data": "^4.0.0", - "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.52", + "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.54", "next": "13.2.4", "prettier": "^2.8.7", "react": "18.2.0", @@ -33,49 +33,49 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", - "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz", - "integrity": "sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", + "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", "dependencies": { - "@babel/types": "^7.21.4" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz", - "integrity": "sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -148,9 +148,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", - "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", + "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", "dependencies": { "regenerator-runtime": "^0.13.11" }, @@ -159,12 +159,12 @@ } }, "node_modules/@babel/types": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.5.tgz", - "integrity": "sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", + "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dependencies": { - "@babel/helper-string-parser": "^7.21.5", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", "to-fast-properties": "^2.0.0" }, "engines": { @@ -220,9 +220,9 @@ "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" }, "node_modules/@emotion/react": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.0.tgz", - "integrity": "sha512-ZSK3ZJsNkwfjT3JpDAWJZlrGD81Z3ytNDsxw1LKq1o+xkmO5pnWfr6gmCC8gHEFf3nSSX/09YrG67jybNPxSUw==", + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.1.tgz", + "integrity": "sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==", "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.11.0", @@ -357,22 +357,22 @@ } }, "node_modules/@floating-ui/core": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.2.6.tgz", - "integrity": "sha512-EvYTiXet5XqweYGClEmpu3BoxmsQ4hkj3QaYA6qEnigCWffTP3vNRwBReTdrwDwo7OoJ3wM8Uoe9Uk4n+d4hfg==" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.3.1.tgz", + "integrity": "sha512-Bu+AMaXNjrpjh41znzHqaz3r2Nr8hHuHZT6V2LBKMhyMl0FgKA62PNYbqnfgmzOhoWZj70Zecisbo4H1rotP5g==" }, "node_modules/@floating-ui/dom": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.2.7.tgz", - "integrity": "sha512-DyqylONj1ZaBnzj+uBnVfzdjjCkFCL2aA9ESHLyUOGSqb03RpbLMImP1ekIQXYs4KLk9jAjJfZAU8hXfWSahEg==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.4.2.tgz", + "integrity": "sha512-VKmvHVatWnewmGGy+7Mdy4cTJX71Pli6v/Wjb5RQBuq5wjUYx+Ef+kRThi8qggZqDgD8CogCpqhRoVp3+yQk+g==", "dependencies": { - "@floating-ui/core": "^1.2.6" + "@floating-ui/core": "^1.3.1" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", + "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", @@ -400,15 +400,15 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" }, "node_modules/@mui/base": { - "version": "5.0.0-beta.0", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.0.tgz", - "integrity": "sha512-ap+juKvt8R8n3cBqd/pGtZydQ4v2I/hgJKnvJRGjpSh3RvsvnDHO4rXov8MHQlH6VqpOekwgilFLGxMZjNTucA==", + "version": "5.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.5.tgz", + "integrity": "sha512-vy3TWLQYdGNecTaufR4wDNQFV2WEg6wRPi6BVbx6q1vP3K1mbxIn1+XOqOzfYBXjFHvMx0gZAo2TgWbaqfgvAA==", "dependencies": { - "@babel/runtime": "^7.21.0", - "@emotion/is-prop-valid": "^1.2.0", + "@babel/runtime": "^7.22.5", + "@emotion/is-prop-valid": "^1.2.1", "@mui/types": "^7.2.4", - "@mui/utils": "^5.12.3", - "@popperjs/core": "^2.11.7", + "@mui/utils": "^5.13.6", + "@popperjs/core": "^2.11.8", "clsx": "^1.2.1", "prop-types": "^15.8.1", "react-is": "^18.2.0" @@ -432,25 +432,25 @@ } }, "node_modules/@mui/core-downloads-tracker": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.13.0.tgz", - "integrity": "sha512-5nXz2k8Rv2ZjtQY6kXirJVyn2+ODaQuAJmXSJtLDUQDKWp3PFUj6j3bILqR0JGOs9R5ejgwz3crLKsl6GwjwkQ==", + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.13.4.tgz", + "integrity": "sha512-yFrMWcrlI0TqRN5jpb6Ma9iI7sGTHpytdzzL33oskFHNQ8UgrtPas33Y1K7sWAMwCrr1qbWDrOHLAQG4tAzuSw==", "funding": { "type": "opencollective", "url": "https://opencollective.com/mui" } }, "node_modules/@mui/material": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.13.0.tgz", - "integrity": "sha512-ckS+9tCpAzpdJdaTF+btF0b6mF9wbXg/EVKtnoAWYi0UKXoXBAVvEUMNpLGA5xdpCdf+A6fPbVUEHs9TsfU+Yw==", + "version": "5.13.6", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.13.6.tgz", + "integrity": "sha512-/c2ZApeQm2sTYdQXjqEnldaBMBcUEiyu2VRS6bS39ZeNaAcCLBQbYocLR46R+f0S5dgpBzB0T4AsOABPOFYZ5Q==", "dependencies": { - "@babel/runtime": "^7.21.0", - "@mui/base": "5.0.0-beta.0", - "@mui/core-downloads-tracker": "^5.13.0", - "@mui/system": "^5.12.3", + "@babel/runtime": "^7.22.5", + "@mui/base": "5.0.0-beta.5", + "@mui/core-downloads-tracker": "^5.13.4", + "@mui/system": "^5.13.6", "@mui/types": "^7.2.4", - "@mui/utils": "^5.12.3", + "@mui/utils": "^5.13.6", "@types/react-transition-group": "^4.4.6", "clsx": "^1.2.1", "csstype": "^3.1.2", @@ -485,12 +485,12 @@ } }, "node_modules/@mui/private-theming": { - "version": "5.12.3", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.12.3.tgz", - "integrity": "sha512-o1e7Z1Bp27n4x2iUHhegV4/Jp6H3T6iBKHJdLivS5GbwsuAE/5l4SnZ+7+K+e5u9TuhwcAKZLkjvqzkDe8zqfA==", + "version": "5.13.1", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.13.1.tgz", + "integrity": "sha512-HW4npLUD9BAkVppOUZHeO1FOKUJWAwbpy0VQoGe3McUYTlck1HezGHQCfBQ5S/Nszi7EViqiimECVl9xi+/WjQ==", "dependencies": { "@babel/runtime": "^7.21.0", - "@mui/utils": "^5.12.3", + "@mui/utils": "^5.13.1", "prop-types": "^15.8.1" }, "engines": { @@ -511,12 +511,12 @@ } }, "node_modules/@mui/styled-engine": { - "version": "5.12.3", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.12.3.tgz", - "integrity": "sha512-AhZtiRyT8Bjr7fufxE/mLS+QJ3LxwX1kghIcM2B2dvJzSSg9rnIuXDXM959QfUVIM3C8U4x3mgVoPFMQJvc4/g==", + "version": "5.13.2", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.13.2.tgz", + "integrity": "sha512-VCYCU6xVtXOrIN8lcbuPmoG+u7FYuOERG++fpY74hPpEWkyFQG97F+/XfTQVYzlR2m7nPjnwVUgATcTCMEaMvw==", "dependencies": { "@babel/runtime": "^7.21.0", - "@emotion/cache": "^11.10.8", + "@emotion/cache": "^11.11.0", "csstype": "^3.1.2", "prop-types": "^15.8.1" }, @@ -542,15 +542,15 @@ } }, "node_modules/@mui/system": { - "version": "5.12.3", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.12.3.tgz", - "integrity": "sha512-JB/6sypHqeJCqwldWeQ1MKkijH829EcZAKKizxbU2MJdxGG5KSwZvTBa5D9qiJUA1hJFYYupjiuy9ZdJt6rV6w==", + "version": "5.13.6", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.13.6.tgz", + "integrity": "sha512-G3Xr28uLqU3DyF6r2LQkHGw/ku4P0AHzlKVe7FGXOPl7X1u+hoe2xxj8Vdiq/69II/mh9OP21i38yBWgWb7WgQ==", "dependencies": { - "@babel/runtime": "^7.21.0", - "@mui/private-theming": "^5.12.3", - "@mui/styled-engine": "^5.12.3", + "@babel/runtime": "^7.22.5", + "@mui/private-theming": "^5.13.1", + "@mui/styled-engine": "^5.13.2", "@mui/types": "^7.2.4", - "@mui/utils": "^5.12.3", + "@mui/utils": "^5.13.6", "clsx": "^1.2.1", "csstype": "^3.1.2", "prop-types": "^15.8.1" @@ -594,13 +594,13 @@ } }, "node_modules/@mui/utils": { - "version": "5.12.3", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.12.3.tgz", - "integrity": "sha512-D/Z4Ub3MRl7HiUccid7sQYclTr24TqUAQFFlxHQF8FR177BrCTQ0JJZom7EqYjZCdXhwnSkOj2ph685MSKNtIA==", + "version": "5.13.6", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.13.6.tgz", + "integrity": "sha512-ggNlxl5NPSbp+kNcQLmSig6WVB0Id+4gOxhx644987v4fsji+CSXc+MFYLocFB/x4oHtzCUlSzbVHlJfP/fXoQ==", "dependencies": { - "@babel/runtime": "^7.21.0", + "@babel/runtime": "^7.22.5", "@types/prop-types": "^15.7.5", - "@types/react-is": "^16.7.1 || ^17.0.0", + "@types/react-is": "^18.2.0", "prop-types": "^15.8.1", "react-is": "^18.2.0" }, @@ -856,9 +856,9 @@ } }, "node_modules/@pkgr/utils": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.0.tgz", - "integrity": "sha512-2OCURAmRtdlL8iUDTypMrrxfwe8frXTeXaxGsVOaYtc/wrUyk8Z/0OBetM7cdlsy7ZFWlMX72VogKeh+A4Xcjw==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.1.tgz", + "integrity": "sha512-JOqwkgFEyi+OROIyq7l4Jy28h/WwhDnG/cPkXG2Z1iFbubB6jsHW1NDvmyOzTBxHr3yg68YGirmh1JUgMqa+9w==", "dependencies": { "cross-spawn": "^7.0.3", "fast-glob": "^3.2.12", @@ -875,18 +875,18 @@ } }, "node_modules/@popperjs/core": { - "version": "2.11.7", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.7.tgz", - "integrity": "sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw==", + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" } }, "node_modules/@rushstack/eslint-patch": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.2.0.tgz", - "integrity": "sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==" + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.3.2.tgz", + "integrity": "sha512-V+MvGwaHH03hYhY+k6Ef/xKd6RYlc4q8WBx+2ANmipHJcKuktNcI/NgEsJgdSUF6Lw32njT6OnrRsKYCdgHjYw==" }, "node_modules/@swc/helpers": { "version": "0.4.14", @@ -935,21 +935,11 @@ } }, "node_modules/@types/react-is": { - "version": "17.0.4", - "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-17.0.4.tgz", - "integrity": "sha512-FLzd0K9pnaEvKz4D1vYxK9JmgQPiGk1lu23o1kqGsLeT0iPbRSF7b76+S5T9fD8aRa0B8bY7I/3DebEj+1ysBA==", + "version": "18.2.1", + "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-18.2.1.tgz", + "integrity": "sha512-wyUkmaaSZEzFZivD8F2ftSyAfk6L+DfFliVj/mYdOXbVjRcS87fQJLTnhk6dRZPuJjI+9g6RZJO4PNCngUrmyw==", "dependencies": { - "@types/react": "^17" - } - }, - "node_modules/@types/react-is/node_modules/@types/react": { - "version": "17.0.59", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.59.tgz", - "integrity": "sha512-gSON5zWYIGyoBcycCE75E9+r6dCC2dHdsrVkOEiIYNU5+Q28HcBAuqvDuxHcCbMfHBHdeT5Tva/AFn3rnMKE4g==", - "dependencies": { - "@types/prop-types": "*", - "@types/scheduler": "*", - "csstype": "^3.0.2" + "@types/react": "*" } }, "node_modules/@types/react-transition-group": { @@ -971,13 +961,13 @@ "integrity": "sha512-aqayTNmeWrZcvnG2MG9eGYI6b7S5fl+yKgPs6bAjOTwPS316R5SxBGKvtSExfyoJU7pIeHJfsHI0Ji41RVMkvQ==" }, "node_modules/@typescript-eslint/parser": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.5.tgz", - "integrity": "sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw==", + "version": "5.60.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.60.0.tgz", + "integrity": "sha512-jBONcBsDJ9UoTWrARkRRCgDz6wUggmH5RpQVlt7BimSwaTkTjwypGzKORXbR4/2Hqjk9hgwlon2rVQAjWNpkyQ==", "dependencies": { - "@typescript-eslint/scope-manager": "5.59.5", - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/typescript-estree": "5.59.5", + "@typescript-eslint/scope-manager": "5.60.0", + "@typescript-eslint/types": "5.60.0", + "@typescript-eslint/typescript-estree": "5.60.0", "debug": "^4.3.4" }, "engines": { @@ -997,12 +987,12 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz", - "integrity": "sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A==", + "version": "5.60.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.60.0.tgz", + "integrity": "sha512-hakuzcxPwXi2ihf9WQu1BbRj1e/Pd8ZZwVTG9kfbxAMZstKz8/9OoexIwnmLzShtsdap5U/CoQGRCWlSuPbYxQ==", "dependencies": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5" + "@typescript-eslint/types": "5.60.0", + "@typescript-eslint/visitor-keys": "5.60.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1013,9 +1003,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.5.tgz", - "integrity": "sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w==", + "version": "5.60.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.60.0.tgz", + "integrity": "sha512-ascOuoCpNZBccFVNJRSC6rPq4EmJ2NkuoKnd6LDNyAQmdDnziAtxbCGWCbefG1CNzmDvd05zO36AmB7H8RzKPA==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -1025,12 +1015,12 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz", - "integrity": "sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg==", + "version": "5.60.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.60.0.tgz", + "integrity": "sha512-R43thAuwarC99SnvrBmh26tc7F6sPa2B3evkXp/8q954kYL6Ro56AwASYWtEEi+4j09GbiNAHqYwNNZuNlARGQ==", "dependencies": { - "@typescript-eslint/types": "5.59.5", - "@typescript-eslint/visitor-keys": "5.59.5", + "@typescript-eslint/types": "5.60.0", + "@typescript-eslint/visitor-keys": "5.60.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1051,11 +1041,11 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.5", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz", - "integrity": "sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA==", + "version": "5.60.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.60.0.tgz", + "integrity": "sha512-wm9Uz71SbCyhUKgcaPRauBdTegUyY/ZWl8gLwD/i/ybJqscrrdVSFImpvUz16BLPChIeKBK5Fa9s6KDQjsjyWw==", "dependencies": { - "@typescript-eslint/types": "5.59.5", + "@typescript-eslint/types": "5.60.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -1067,9 +1057,9 @@ } }, "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz", + "integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==", "bin": { "acorn": "bin/acorn" }, @@ -1140,11 +1130,11 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/aria-query": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", - "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", "dependencies": { - "deep-equal": "^2.0.5" + "dequal": "^2.0.3" } }, "node_modules/array-buffer-byte-length": { @@ -1253,19 +1243,19 @@ } }, "node_modules/axe-core": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.0.tgz", - "integrity": "sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ==", + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.2.tgz", + "integrity": "sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g==", "engines": { "node": ">=4" } }, "node_modules/axobject-query": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", - "integrity": "sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", + "integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==", "dependencies": { - "deep-equal": "^2.0.5" + "dequal": "^2.0.3" } }, "node_modules/babel-plugin-macros": { @@ -1421,9 +1411,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001486", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001486.tgz", - "integrity": "sha512-uv7/gXuHi10Whlj0pp5q/tsK/32J2QSqVRKQhs2j8VsDCjgyruAh/eEXHF822VqO9yT6iZKw3nRwZRSPBE9OQg==", + "version": "1.0.30001508", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001508.tgz", + "integrity": "sha512-sdQZOJdmt3GJs1UMNpCCCyeuS2IEGLXnHyAo9yIO5JJDjbjoVRij4M1qep6P6gFpptD1PqIYgzM+gwJbOi92mw==", "funding": [ { "type": "opencollective", @@ -1669,34 +1659,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/deep-equal": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.1.tgz", - "integrity": "sha512-lKdkdV6EOGoVn65XaOsPdH4rMxTZOnmFyuIkMjM1i5HHCbfjC97dawgTAy0deYNfuqUqW+Q5VrVaQYtUpSd6yQ==", - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", - "es-get-iterator": "^1.1.3", - "get-intrinsic": "^1.2.0", - "is-arguments": "^1.1.1", - "is-array-buffer": "^3.0.2", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "isarray": "^2.0.5", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.0", - "side-channel": "^1.0.4", - "which-boxed-primitive": "^1.0.2", - "which-collection": "^1.0.1", - "which-typed-array": "^1.1.9" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -1776,6 +1738,14 @@ "node": ">=0.4.0" } }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "engines": { + "node": ">=6" + } + }, "node_modules/detect-libc": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", @@ -1816,11 +1786,14 @@ } }, "node_modules/dotenv": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", - "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", + "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/motdotla/dotenv?sponsor=1" } }, "node_modules/emoji-regex": { @@ -1837,9 +1810,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.0.tgz", - "integrity": "sha512-+DCows0XNwLDcUhbFJPdlQEVnT2zXlCv7hPxemTz86/O+B/hCQ+mb7ydkPKiflpVraqLPCAfu7lDy+hBXueojw==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", + "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -1903,25 +1876,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-get-iterator": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", - "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "has-symbols": "^1.0.3", - "is-arguments": "^1.1.1", - "is-map": "^2.0.2", - "is-set": "^2.0.2", - "is-string": "^1.0.7", - "isarray": "^2.0.5", - "stop-iteration-iterator": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/es-set-tostringtag": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", @@ -2095,9 +2049,9 @@ } }, "node_modules/eslint-import-resolver-typescript/node_modules/globby": { - "version": "13.1.4", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.4.tgz", - "integrity": "sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==", + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.0.tgz", + "integrity": "sha512-jWsQfayf13NvqKUIL3Ta+CIqMnvlaIDFveWE/dpOZ9+3AMEJozsxDvKA02zync9UuvOM8rOXzsD5GqKP4OnWPQ==", "dependencies": { "dir-glob": "^3.0.1", "fast-glob": "^3.2.11", @@ -2606,12 +2560,13 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" }, "funding": { @@ -2645,9 +2600,12 @@ } }, "node_modules/get-tsconfig": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.5.0.tgz", - "integrity": "sha512-MjhiaIWCJ1sAU4pIQ5i5OfOuHHxVo1oYeNsWTON7jxYkod8pHocXeh+SSbmu5OZZZK73B6cbJ2XADzXehLyovQ==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.6.0.tgz", + "integrity": "sha512-lgbo68hHTQnFddybKbbs/RDRJnJT5YyGy2kQzVwbq+g67X73i+5MVTval34QxGkOe9X5Ujf1UYpCaphLyltjEg==", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, "funding": { "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } @@ -2948,21 +2906,6 @@ "node": ">= 0.4" } }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-array-buffer": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", @@ -3030,9 +2973,9 @@ } }, "node_modules/is-core-module": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", - "integrity": "sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==", + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", "dependencies": { "has": "^1.0.3" }, @@ -3104,14 +3047,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-negative-zero": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", @@ -3168,14 +3103,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-set": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-shared-array-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", @@ -3244,14 +3171,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-weakmap": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", - "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", @@ -3263,18 +3182,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-weakset": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", - "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" - }, - "funding": { - "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", @@ -3300,20 +3207,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/js-sdsl": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", - "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.1.tgz", + "integrity": "sha512-6Gsx8R0RucyePbWqPssR8DyfuXmLBooYN5cZFZKjHGnQuaf7pEzhtpceagJxVu4LqhYY5EYA7nko3FmeHZ1KbA==", "funding": { "type": "opencollective", "url": "https://opencollective.com/js-sdsl" @@ -3387,7 +3289,7 @@ } }, "node_modules/le-coffre-resources": { - "resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#467b34a484adbd6dfa3fd6082bb7677f6178da51", + "resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#16c30e06af8241bf6fef6ec8083da9bf434048df", "license": "MIT", "dependencies": { "class-transformer": "^0.5.1", @@ -3408,9 +3310,9 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.10.30", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.30.tgz", - "integrity": "sha512-PLGc+xfrQrkya/YK2/5X+bPpxRmyJBHM+xxz9krUdSgk4Vs2ZwxX5/Ow0lv3r9PDlDtNWb4u+it8MY5rZ0IyGw==" + "version": "1.10.36", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.36.tgz", + "integrity": "sha512-NCPWES1poiS4NSzIS49mxHM5hCkSWov8wFICRKfL9narzimqAXlnAgNloHCt0BukZHbWt8TIStCdzLy7LXBYpQ==" }, "node_modules/lines-and-columns": { "version": "1.2.4", @@ -3705,21 +3607,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object-is": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -4246,6 +4133,14 @@ "node": ">=4" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -4420,9 +4315,9 @@ } }, "node_modules/sass": { - "version": "1.62.1", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.62.1.tgz", - "integrity": "sha512-NHpxIzN29MXvWiuswfc1W3I0N8SXBd8UR26WntmDlRYf0bSADnwnOjsyMZ3lMezSlArD33Vs3YFhp7dWvL770A==", + "version": "1.63.6", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.63.6.tgz", + "integrity": "sha512-MJuxGMHzaOW7ipp+1KdELtqKbfAWbH7OLIdoSMnVe3EXPMTmxTmlaZDCTsgIpPCs3w99lLo9/zDKkOrJuT5byw==", "dependencies": { "chokidar": ">=3.0.0 <4.0.0", "immutable": "^4.0.0", @@ -4444,9 +4339,9 @@ } }, "node_modules/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -4596,17 +4491,6 @@ "node": ">=0.10.0" } }, - "node_modules/stop-iteration-iterator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", - "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", - "dependencies": { - "internal-slot": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -4861,9 +4745,9 @@ } }, "node_modules/tslib": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", - "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", + "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -5027,20 +4911,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/which-collection": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", - "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", - "dependencies": { - "is-map": "^2.0.1", - "is-set": "^2.0.1", - "is-weakmap": "^2.0.1", - "is-weakset": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/which-typed-array": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", diff --git a/package.json b/package.json index 347e83a5..bbd303f8 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "eslint": "8.36.0", "eslint-config-next": "13.2.4", "form-data": "^4.0.0", - "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.52", + "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.54", "next": "13.2.4", "prettier": "^2.8.7", "react": "18.2.0", diff --git a/src/front/Api/Auth/IdNot/User.ts b/src/front/Api/Auth/IdNot/User.ts new file mode 100644 index 00000000..c27a3239 --- /dev/null +++ b/src/front/Api/Auth/IdNot/User.ts @@ -0,0 +1,38 @@ +import BaseApiService from "@Front/Api/BaseApiService"; + +export default class User extends BaseApiService { + private static instance: User; + private readonly baseURl = this.getBaseUrl().concat("/idnot/user"); + + private constructor() { + super(); + } + + public static getInstance() { + if (!this.instance) { + return new User(); + } else { + return this.instance; + } + } + + public async login(uid: string) { + const url = new URL(this.baseURl.concat("/login/").concat(uid)); + try { + return await this.postRequest(url); + } catch (err) { + this.onError(err); + return Promise.reject(err); + } + } + + public async refreshToken() { + const url = new URL(this.baseURl.concat("/refresh-token")); + try { + return await this.getRequest(url); + } catch (err) { + this.onError(err); + return Promise.reject(err); + } + } +} diff --git a/src/front/Stores/UserStore.ts b/src/front/Stores/UserStore.ts new file mode 100644 index 00000000..1e1b2245 --- /dev/null +++ b/src/front/Stores/UserStore.ts @@ -0,0 +1,56 @@ +"use client"; + +import User from "@Front/Api/Auth/IdNot/User"; +import EventEmitter from "@Front/Services/EventEmitter"; + +export default class UserStore { + public static readonly instance = new this(); + protected readonly event = new EventEmitter(); + public accessToken: string | null = null; + public refreshToken: string | null = null; + + private constructor() {} + + public isConnected(): boolean { + return !!this.accessToken; + } + + public async connect(idnotUid: string) { + try { + //call connection function + const user: any = await User.getInstance().login(idnotUid); + + //Save tokens in local storage + localStorage.setItem("leCoffreAccessToken", user.accessToken); + localStorage.setItem("leCoffreRefreshToken", user.refreshToken); + + this.event.emit("connection", this.accessToken); + } catch (error) { + console.error(error); + return false; + } + return true; + } + + public async disconnect() { + try { + localStorage.removeItem("leCoffreAccessToken"); + localStorage.removeItem("leCoffreRefreshToken"); + + // this.userAddress = null; + // this.event.emit("disconnection", this.accessToken); + } catch (error) { + console.error(error); + } + } + + public onDisconnect(callback: (userAddress: string) => void): () => void { + this.event.on("disconnection", callback); + return () => this.event.off("disconnection", callback); + } + + public onConnect(callback: (userAddress: string) => void): () => void { + this.event.on("connection", callback); + return () => this.event.off("connection", callback); + } +} From 91d1c0b5e8eef39c5ab9fd0e91a7f1262ec3e577 Mon Sep 17 00:00:00 2001 From: Vins Date: Wed, 5 Jul 2023 17:12:00 +0200 Subject: [PATCH 03/11] disconect event --- src/front/Stores/UserStore.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/front/Stores/UserStore.ts b/src/front/Stores/UserStore.ts index 1e1b2245..74359ea0 100644 --- a/src/front/Stores/UserStore.ts +++ b/src/front/Stores/UserStore.ts @@ -37,8 +37,7 @@ export default class UserStore { localStorage.removeItem("leCoffreAccessToken"); localStorage.removeItem("leCoffreRefreshToken"); - // this.userAddress = null; - // this.event.emit("disconnection", this.accessToken); + this.event.emit("disconnection", this.accessToken); } catch (error) { console.error(error); } From a2b3c1593376d4d098f0b9727eeca811b2732dbf Mon Sep 17 00:00:00 2001 From: Vins Date: Thu, 6 Jul 2023 11:22:35 +0200 Subject: [PATCH 04/11] Cookie gestion + UserStore editing cookies --- .../Services/CookieService/CookieService.ts | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/front/Services/CookieService/CookieService.ts diff --git a/src/front/Services/CookieService/CookieService.ts b/src/front/Services/CookieService/CookieService.ts new file mode 100644 index 00000000..0f2f33cc --- /dev/null +++ b/src/front/Services/CookieService/CookieService.ts @@ -0,0 +1,44 @@ +export default class CookieService { + private static instance: CookieService; + private constructor() {} + + public static getInstance() { + return (this.instance ??= new this()); + } + + /** + * @description : set a cookie with a name and a value that expire in 7 days + * @throws {Error} If the name or the value is empty + */ + public setCookie(name: string, value: string) { + if (!name || !value) throw new Error("Cookie name or value is empty"); + const date = new Date(); + + // Set it expire in 7 days + date.setTime(date.getTime() + 7 * 24 * 60 * 60 * 1000); + + // Set it + document.cookie = name + "=" + value + "; expires=" + date.toUTCString() + "; path=/"; + } + + public getCookie(name: string) { + const value = "; " + document.cookie; + const parts = value.split("; " + name + "="); + + if (parts.length == 2) { + return parts.pop()!.split(";").shift(); + } + + return; + } + + public deleteCookie(name: string) { + const date = new Date(); + + // Set it expire in -1 days + date.setTime(date.getTime() + -1 * 24 * 60 * 60 * 1000); + + // Set it + document.cookie = name + "=; expires=" + date.toUTCString() + "; path=/"; + } +} From 189bc52a57f342d5a7b7f9426fe64a3c40d25dd7 Mon Sep 17 00:00:00 2001 From: Vins Date: Thu, 6 Jul 2023 14:46:13 +0200 Subject: [PATCH 05/11] Added cookie --- src/front/Stores/UserStore.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/front/Stores/UserStore.ts b/src/front/Stores/UserStore.ts index 74359ea0..c4bf3a1a 100644 --- a/src/front/Stores/UserStore.ts +++ b/src/front/Stores/UserStore.ts @@ -1,6 +1,7 @@ "use client"; import User from "@Front/Api/Auth/IdNot/User"; +import CookieService from "@Front/Services/CookieService/CookieService"; import EventEmitter from "@Front/Services/EventEmitter"; export default class UserStore { @@ -20,9 +21,9 @@ export default class UserStore { //call connection function const user: any = await User.getInstance().login(idnotUid); - //Save tokens in local storage - localStorage.setItem("leCoffreAccessToken", user.accessToken); - localStorage.setItem("leCoffreRefreshToken", user.refreshToken); + //Save tokens in cookies + CookieService.getInstance().setCookie("leCoffreAccessToken", user.accessToken); + CookieService.getInstance().setCookie("leCoffreRefreshToken", user.refreshToken); this.event.emit("connection", this.accessToken); } catch (error) { @@ -34,8 +35,9 @@ export default class UserStore { public async disconnect() { try { - localStorage.removeItem("leCoffreAccessToken"); - localStorage.removeItem("leCoffreRefreshToken"); + //Remove tokens from cookies + CookieService.getInstance().deleteCookie("leCoffreAccessToken"); + CookieService.getInstance().deleteCookie("leCoffreRefreshToken"); this.event.emit("disconnection", this.accessToken); } catch (error) { From 4d7490cbbd8124963e5ff832669c6692125bcca1 Mon Sep 17 00:00:00 2001 From: Vins Date: Fri, 7 Jul 2023 10:57:40 +0200 Subject: [PATCH 06/11] Refresh token --- package-lock.json | 6 +++ package.json | 1 + src/front/Api/Auth/IdNot/User.ts | 4 +- src/front/Api/BaseApiService.ts | 23 ++++----- src/front/Components/Layouts/Login/index.tsx | 23 ++++++--- src/front/Services/JwtService/JwtService.ts | 52 ++++++++++++++++++++ 6 files changed, 88 insertions(+), 21 deletions(-) create mode 100644 src/front/Services/JwtService/JwtService.ts diff --git a/package-lock.json b/package-lock.json index 2629b40b..25d608c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "eslint": "8.36.0", "eslint-config-next": "13.2.4", "form-data": "^4.0.0", + "jwt-decode": "^3.1.2", "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.54", "next": "13.2.4", "prettier": "^2.8.7", @@ -3275,6 +3276,11 @@ "node": ">=4.0" } }, + "node_modules/jwt-decode": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", + "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==" + }, "node_modules/language-subtag-registry": { "version": "0.3.22", "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz", diff --git a/package.json b/package.json index bbd303f8..4af186ba 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "eslint": "8.36.0", "eslint-config-next": "13.2.4", "form-data": "^4.0.0", + "jwt-decode": "^3.1.2", "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.54", "next": "13.2.4", "prettier": "^2.8.7", diff --git a/src/front/Api/Auth/IdNot/User.ts b/src/front/Api/Auth/IdNot/User.ts index c27a3239..7e1643fc 100644 --- a/src/front/Api/Auth/IdNot/User.ts +++ b/src/front/Api/Auth/IdNot/User.ts @@ -26,10 +26,10 @@ export default class User extends BaseApiService { } } - public async refreshToken() { + public async refreshToken(refreshToken: string): Promise<{ accessToken: string }> { const url = new URL(this.baseURl.concat("/refresh-token")); try { - return await this.getRequest(url); + return await this.postRequest(url, {}, refreshToken); } catch (err) { this.onError(err); return Promise.reject(err); diff --git a/src/front/Api/BaseApiService.ts b/src/front/Api/BaseApiService.ts index 166621bc..67bd7b60 100644 --- a/src/front/Api/BaseApiService.ts +++ b/src/front/Api/BaseApiService.ts @@ -20,12 +20,13 @@ export default abstract class BaseApiService { return BaseApiService.baseUrl; } - protected buildHeaders(contentType: ContentType) { + protected buildHeaders(contentType: ContentType, token?: string) { const headers = new Headers(); if (contentType === ContentType.JSON) { headers.set("Content-Type", contentType); } + if (token) headers.set("Authorization", `Bearer ${token}`); return headers; } @@ -33,21 +34,21 @@ export default abstract class BaseApiService { return JSON.stringify(body); } - protected async getRequest(url: URL) { + protected async getRequest(url: URL, token?: string) { const request = async () => await fetch(url, { method: "GET", - headers: this.buildHeaders(ContentType.JSON), + headers: this.buildHeaders(ContentType.JSON, token), }); return this.sendRequest(request); } - protected async postRequest(url: URL, body: { [key: string]: unknown } = {}) { + protected async postRequest(url: URL, body: { [key: string]: unknown } = {}, token?: string) { return this.sendRequest( async () => await fetch(url, { method: "POST", - headers: this.buildHeaders(ContentType.JSON), + headers: this.buildHeaders(ContentType.JSON, token), body: this.buildBody(body), }), ); @@ -64,11 +65,11 @@ export default abstract class BaseApiService { ); } - protected async putRequest(url: URL, body: { [key: string]: unknown } = {}) { + protected async putRequest(url: URL, body: { [key: string]: unknown } = {}, token?: string) { const request = async () => await fetch(url, { method: "PUT", - headers: this.buildHeaders(ContentType.JSON), + headers: this.buildHeaders(ContentType.JSON, token), body: this.buildBody(body), }); @@ -86,22 +87,22 @@ export default abstract class BaseApiService { return this.sendRequest(request); } - protected async deleteRequest(url: URL, body: { [key: string]: unknown } = {}) { + protected async deleteRequest(url: URL, body: { [key: string]: unknown } = {}, token?: string) { const request = async () => await fetch(url, { method: "DELETE", - headers: this.buildHeaders(ContentType.JSON), + headers: this.buildHeaders(ContentType.JSON, token), body: this.buildBody(body), }); return this.sendRequest(request); } - protected async putFormDataRequest(url: URL, body: FormData) { + protected async putFormDataRequest(url: URL, body: FormData, token?: string) { const request = async () => await fetch(url, { method: "PUT", - headers: this.buildHeaders(ContentType.FORM_DATA), + headers: this.buildHeaders(ContentType.FORM_DATA, token), body, }); diff --git a/src/front/Components/Layouts/Login/index.tsx b/src/front/Components/Layouts/Login/index.tsx index d404a76e..a37176d2 100644 --- a/src/front/Components/Layouts/Login/index.tsx +++ b/src/front/Components/Layouts/Login/index.tsx @@ -6,8 +6,10 @@ import CoffreIcon from "@Assets/Icons/coffre.svg"; import LandingImage from "./landing-connect.jpeg"; import Image from "next/image"; import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoubleSidePage"; -import { FrontendVariables } from "@Front/Config/VariablesFront"; +// import { FrontendVariables } from "@Front/Config/VariablesFront"; import idNoteLogo from "@Assets/Icons/id-note-logo.svg"; +import UserStore from "@Front/Stores/UserStore"; +import JwtService from "@Front/Services/JwtService/JwtService"; export default class LoginClass extends BasePage { public override render(): JSX.Element { @@ -30,12 +32,17 @@ export default class LoginClass extends BasePage { ); } - private redirectUserOnConnection() { - const variables = FrontendVariables.getInstance(); - const baseFronturl = variables.BACK_API_PROTOCOL + variables.FRONT_APP_HOST; - const authorizeEndPoint = variables.IDNOT_AUTHORIZE_ENDPOINT; - const clientId = variables.IDNOT_CLIENT_ID; - const url = `${authorizeEndPoint}?client_id=${clientId}&redirect_uri=${baseFronturl}/authorized-client&scope=openid,profile,offline_access&response_type=code`; - window.location.assign(url); + private async redirectUserOnConnection() { + // const variables = FrontendVariables.getInstance(); + // const baseFronturl = variables.BACK_API_PROTOCOL + variables.FRONT_APP_HOST; + + await UserStore.instance.connect("A1QAuhlImn"); + await JwtService.getInstance().checkJwt(); + // window.location.assign("http://localhost:3000" + "/folders"); + + // const authorizeEndPoint = variables.IDNOT_AUTHORIZE_ENDPOINT; + // const clientId = variables.IDNOT_CLIENT_ID; + // const url = `${authorizeEndPoint}?client_id=${clientId}&redirect_uri=${baseFronturl}/authorized-client&scope=openid,profile,offline_access&response_type=code`; + // window.location.assign(url); } } diff --git a/src/front/Services/JwtService/JwtService.ts b/src/front/Services/JwtService/JwtService.ts new file mode 100644 index 00000000..5e1fd2b6 --- /dev/null +++ b/src/front/Services/JwtService/JwtService.ts @@ -0,0 +1,52 @@ +import jwt_decode from "jwt-decode"; +import CookieService from "../CookieService/CookieService"; +import User from "@Front/Api/Auth/IdNot/User"; + +enum PROVIDER_OPENID { + idNot = "idNot", +} + +interface IUserJwtPayload { + userId: string; + openId: { + providerName: PROVIDER_OPENID; + userId: string | number; + }; + office_Id: string; + role: string; + rules: string[]; + exp: number; +} + +export default class JwtService { + private static instance: JwtService; + private constructor() {} + + public static getInstance() { + return (this.instance ??= new this()); + } + + /** + * @description : set a cookie with a name and a value that expire in 7 days + * @throws {Error} If the name or the value is empty + */ + public async checkJwt() { + const accessToken = CookieService.getInstance().getCookie("leCoffreAccessToken"); + + if (!accessToken) return; + const decodedToken: IUserJwtPayload = jwt_decode(accessToken); + + const now = Math.floor(Date.now() / 1000); + + if (decodedToken.exp < now) { + const refreshToken = CookieService.getInstance().getCookie("leCoffreRefreshToken"); + + if (!refreshToken) return; + const newAccessToken: { accessToken: string } = await User.getInstance().refreshToken(refreshToken); + + if (newAccessToken) { + CookieService.getInstance().setCookie("leCoffreAccessToken", newAccessToken.accessToken); + } + } + } +} From dcb8d299dd1eead71bcf5ff49e7c99426ead9806 Mon Sep 17 00:00:00 2001 From: Vins Date: Mon, 10 Jul 2023 14:12:20 +0200 Subject: [PATCH 07/11] fix --- src/front/Components/Layouts/Login/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/front/Components/Layouts/Login/index.tsx b/src/front/Components/Layouts/Login/index.tsx index a37176d2..216e3385 100644 --- a/src/front/Components/Layouts/Login/index.tsx +++ b/src/front/Components/Layouts/Login/index.tsx @@ -37,7 +37,7 @@ export default class LoginClass extends BasePage { // const baseFronturl = variables.BACK_API_PROTOCOL + variables.FRONT_APP_HOST; await UserStore.instance.connect("A1QAuhlImn"); - await JwtService.getInstance().checkJwt(); + // await JwtService.getInstance().checkJwt(); // window.location.assign("http://localhost:3000" + "/folders"); // const authorizeEndPoint = variables.IDNOT_AUTHORIZE_ENDPOINT; From de851859e67108664553152fa60352a13c8cae6a Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Mon, 10 Jul 2023 14:59:55 +0200 Subject: [PATCH 08/11] :sparkles: Fixing package json --- package-lock.json | 234 +++++++++--------- package.json | 2 +- .../LeCoffreApi/SuperAdmin/Folders/Folders.ts | 2 +- 3 files changed, 120 insertions(+), 118 deletions(-) diff --git a/package-lock.json b/package-lock.json index 25d608c6..520b5590 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "eslint-config-next": "13.2.4", "form-data": "^4.0.0", "jwt-decode": "^3.1.2", - "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.54", + "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.55", "next": "13.2.4", "prettier": "^2.8.7", "react": "18.2.0", @@ -33,6 +33,14 @@ "typescript": "4.9.5" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@babel/code-frame": { "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", @@ -149,9 +157,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", - "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.6.tgz", + "integrity": "sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==", "dependencies": { "regenerator-runtime": "^0.13.11" }, @@ -328,13 +336,13 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz", - "integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", + "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.5.2", + "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -363,9 +371,9 @@ "integrity": "sha512-Bu+AMaXNjrpjh41znzHqaz3r2Nr8hHuHZT6V2LBKMhyMl0FgKA62PNYbqnfgmzOhoWZj70Zecisbo4H1rotP5g==" }, "node_modules/@floating-ui/dom": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.4.2.tgz", - "integrity": "sha512-VKmvHVatWnewmGGy+7Mdy4cTJX71Pli6v/Wjb5RQBuq5wjUYx+Ef+kRThi8qggZqDgD8CogCpqhRoVp3+yQk+g==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.4.4.tgz", + "integrity": "sha512-21hhDEPOiWkGp0Ys4Wi6Neriah7HweToKra626CIK712B5m9qkdz54OP9gVldUg+URnBTpv/j/bi/skmGdstXQ==", "dependencies": { "@floating-ui/core": "^1.3.1" } @@ -401,14 +409,14 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" }, "node_modules/@mui/base": { - "version": "5.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.5.tgz", - "integrity": "sha512-vy3TWLQYdGNecTaufR4wDNQFV2WEg6wRPi6BVbx6q1vP3K1mbxIn1+XOqOzfYBXjFHvMx0gZAo2TgWbaqfgvAA==", + "version": "5.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.6.tgz", + "integrity": "sha512-jcHy6HwOX7KzRhRtL8nvIvUlxvLx2Fl6NMRCyUSQSvMTyfou9kndekz0H4HJaXvG1Y4WEifk23RYedOlrD1kEQ==", "dependencies": { "@babel/runtime": "^7.22.5", "@emotion/is-prop-valid": "^1.2.1", "@mui/types": "^7.2.4", - "@mui/utils": "^5.13.6", + "@mui/utils": "^5.13.7", "@popperjs/core": "^2.11.8", "clsx": "^1.2.1", "prop-types": "^15.8.1", @@ -433,25 +441,25 @@ } }, "node_modules/@mui/core-downloads-tracker": { - "version": "5.13.4", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.13.4.tgz", - "integrity": "sha512-yFrMWcrlI0TqRN5jpb6Ma9iI7sGTHpytdzzL33oskFHNQ8UgrtPas33Y1K7sWAMwCrr1qbWDrOHLAQG4tAzuSw==", + "version": "5.13.7", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.13.7.tgz", + "integrity": "sha512-/suIo4WoeL/OyO3KUsFVpdOmKiSAr6NpWXmQ4WLSxwKrTiha1FJxM6vwAki5W/5kR9WnVLw5E8JC4oHHsutT8w==", "funding": { "type": "opencollective", "url": "https://opencollective.com/mui" } }, "node_modules/@mui/material": { - "version": "5.13.6", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.13.6.tgz", - "integrity": "sha512-/c2ZApeQm2sTYdQXjqEnldaBMBcUEiyu2VRS6bS39ZeNaAcCLBQbYocLR46R+f0S5dgpBzB0T4AsOABPOFYZ5Q==", + "version": "5.13.7", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.13.7.tgz", + "integrity": "sha512-+n453jDDm88zZM3b5YK29nZ7gXY+s+rryH9ovDbhmfSkOlFtp+KSqbXy5cTaC/UlDqDM7sYYJGq8BmJov3v9Tg==", "dependencies": { "@babel/runtime": "^7.22.5", - "@mui/base": "5.0.0-beta.5", - "@mui/core-downloads-tracker": "^5.13.4", - "@mui/system": "^5.13.6", + "@mui/base": "5.0.0-beta.6", + "@mui/core-downloads-tracker": "^5.13.7", + "@mui/system": "^5.13.7", "@mui/types": "^7.2.4", - "@mui/utils": "^5.13.6", + "@mui/utils": "^5.13.7", "@types/react-transition-group": "^4.4.6", "clsx": "^1.2.1", "csstype": "^3.1.2", @@ -486,12 +494,12 @@ } }, "node_modules/@mui/private-theming": { - "version": "5.13.1", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.13.1.tgz", - "integrity": "sha512-HW4npLUD9BAkVppOUZHeO1FOKUJWAwbpy0VQoGe3McUYTlck1HezGHQCfBQ5S/Nszi7EViqiimECVl9xi+/WjQ==", + "version": "5.13.7", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.13.7.tgz", + "integrity": "sha512-qbSr+udcij5F9dKhGX7fEdx2drXchq7htLNr2Qg2Ma+WJ6q0ERlEqGSBiPiVDJkptcjeVL4DGmcf1wl5+vD4EA==", "dependencies": { - "@babel/runtime": "^7.21.0", - "@mui/utils": "^5.13.1", + "@babel/runtime": "^7.22.5", + "@mui/utils": "^5.13.7", "prop-types": "^15.8.1" }, "engines": { @@ -543,15 +551,15 @@ } }, "node_modules/@mui/system": { - "version": "5.13.6", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.13.6.tgz", - "integrity": "sha512-G3Xr28uLqU3DyF6r2LQkHGw/ku4P0AHzlKVe7FGXOPl7X1u+hoe2xxj8Vdiq/69II/mh9OP21i38yBWgWb7WgQ==", + "version": "5.13.7", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.13.7.tgz", + "integrity": "sha512-7R2KdI6vr8KtnauEfg9e9xQmPk6Gg/1vGNiALYyhSI+cYztxN6WmlSqGX4bjWn/Sygp1TUE1jhFEgs7MWruhkQ==", "dependencies": { "@babel/runtime": "^7.22.5", - "@mui/private-theming": "^5.13.1", + "@mui/private-theming": "^5.13.7", "@mui/styled-engine": "^5.13.2", "@mui/types": "^7.2.4", - "@mui/utils": "^5.13.6", + "@mui/utils": "^5.13.7", "clsx": "^1.2.1", "csstype": "^3.1.2", "prop-types": "^15.8.1" @@ -595,13 +603,13 @@ } }, "node_modules/@mui/utils": { - "version": "5.13.6", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.13.6.tgz", - "integrity": "sha512-ggNlxl5NPSbp+kNcQLmSig6WVB0Id+4gOxhx644987v4fsji+CSXc+MFYLocFB/x4oHtzCUlSzbVHlJfP/fXoQ==", + "version": "5.13.7", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.13.7.tgz", + "integrity": "sha512-/3BLptG/q0u36eYED7Nhf4fKXmcKb6LjjT7ZMwhZIZSdSxVqDqSTmATW3a56n3KEPQUXCU9TpxAfCBQhs6brVA==", "dependencies": { "@babel/runtime": "^7.22.5", "@types/prop-types": "^15.7.5", - "@types/react-is": "^18.2.0", + "@types/react-is": "^18.2.1", "prop-types": "^15.8.1", "react-is": "^18.2.0" }, @@ -857,16 +865,16 @@ } }, "node_modules/@pkgr/utils": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.1.tgz", - "integrity": "sha512-JOqwkgFEyi+OROIyq7l4Jy28h/WwhDnG/cPkXG2Z1iFbubB6jsHW1NDvmyOzTBxHr3yg68YGirmh1JUgMqa+9w==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.4.2.tgz", + "integrity": "sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==", "dependencies": { "cross-spawn": "^7.0.3", - "fast-glob": "^3.2.12", + "fast-glob": "^3.3.0", "is-glob": "^4.0.3", "open": "^9.1.0", "picocolors": "^1.0.0", - "tslib": "^2.5.0" + "tslib": "^2.6.0" }, "engines": { "node": "^12.20.0 || ^14.18.0 || >=16.0.0" @@ -962,13 +970,13 @@ "integrity": "sha512-aqayTNmeWrZcvnG2MG9eGYI6b7S5fl+yKgPs6bAjOTwPS316R5SxBGKvtSExfyoJU7pIeHJfsHI0Ji41RVMkvQ==" }, "node_modules/@typescript-eslint/parser": { - "version": "5.60.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.60.0.tgz", - "integrity": "sha512-jBONcBsDJ9UoTWrARkRRCgDz6wUggmH5RpQVlt7BimSwaTkTjwypGzKORXbR4/2Hqjk9hgwlon2rVQAjWNpkyQ==", + "version": "5.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.61.0.tgz", + "integrity": "sha512-yGr4Sgyh8uO6fSi9hw3jAFXNBHbCtKKFMdX2IkT3ZqpKmtAq3lHS4ixB/COFuAIJpwl9/AqF7j72ZDWYKmIfvg==", "dependencies": { - "@typescript-eslint/scope-manager": "5.60.0", - "@typescript-eslint/types": "5.60.0", - "@typescript-eslint/typescript-estree": "5.60.0", + "@typescript-eslint/scope-manager": "5.61.0", + "@typescript-eslint/types": "5.61.0", + "@typescript-eslint/typescript-estree": "5.61.0", "debug": "^4.3.4" }, "engines": { @@ -988,12 +996,12 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.60.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.60.0.tgz", - "integrity": "sha512-hakuzcxPwXi2ihf9WQu1BbRj1e/Pd8ZZwVTG9kfbxAMZstKz8/9OoexIwnmLzShtsdap5U/CoQGRCWlSuPbYxQ==", + "version": "5.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.61.0.tgz", + "integrity": "sha512-W8VoMjoSg7f7nqAROEmTt6LoBpn81AegP7uKhhW5KzYlehs8VV0ZW0fIDVbcZRcaP3aPSW+JZFua+ysQN+m/Nw==", "dependencies": { - "@typescript-eslint/types": "5.60.0", - "@typescript-eslint/visitor-keys": "5.60.0" + "@typescript-eslint/types": "5.61.0", + "@typescript-eslint/visitor-keys": "5.61.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1004,9 +1012,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.60.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.60.0.tgz", - "integrity": "sha512-ascOuoCpNZBccFVNJRSC6rPq4EmJ2NkuoKnd6LDNyAQmdDnziAtxbCGWCbefG1CNzmDvd05zO36AmB7H8RzKPA==", + "version": "5.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.61.0.tgz", + "integrity": "sha512-ldyueo58KjngXpzloHUog/h9REmHl59G1b3a5Sng1GfBo14BkS3ZbMEb3693gnP1k//97lh7bKsp6/V/0v1veQ==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -1016,12 +1024,12 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.60.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.60.0.tgz", - "integrity": "sha512-R43thAuwarC99SnvrBmh26tc7F6sPa2B3evkXp/8q954kYL6Ro56AwASYWtEEi+4j09GbiNAHqYwNNZuNlARGQ==", + "version": "5.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.61.0.tgz", + "integrity": "sha512-Fud90PxONnnLZ36oR5ClJBLTLfU4pIWBmnvGwTbEa2cXIqj70AEDEmOmpkFComjBZ/037ueKrOdHuYmSFVD7Rw==", "dependencies": { - "@typescript-eslint/types": "5.60.0", - "@typescript-eslint/visitor-keys": "5.60.0", + "@typescript-eslint/types": "5.61.0", + "@typescript-eslint/visitor-keys": "5.61.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1042,11 +1050,11 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.60.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.60.0.tgz", - "integrity": "sha512-wm9Uz71SbCyhUKgcaPRauBdTegUyY/ZWl8gLwD/i/ybJqscrrdVSFImpvUz16BLPChIeKBK5Fa9s6KDQjsjyWw==", + "version": "5.61.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.61.0.tgz", + "integrity": "sha512-50XQ5VdbWrX06mQXhy93WywSFZZGsv3EOjq+lqp6WC2t+j3mb6A9xYVdrRxafvK88vg9k9u+CT4l6D8PEatjKg==", "dependencies": { - "@typescript-eslint/types": "5.60.0", + "@typescript-eslint/types": "5.61.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -1058,9 +1066,9 @@ } }, "node_modules/acorn": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.9.0.tgz", - "integrity": "sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "bin": { "acorn": "bin/acorn" }, @@ -1412,9 +1420,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001508", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001508.tgz", - "integrity": "sha512-sdQZOJdmt3GJs1UMNpCCCyeuS2IEGLXnHyAo9yIO5JJDjbjoVRij4M1qep6P6gFpptD1PqIYgzM+gwJbOi92mw==", + "version": "1.0.30001514", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001514.tgz", + "integrity": "sha512-ENcIpYBmwAAOm/V2cXgM7rZUrKKaqisZl4ZAI520FIkqGXUxJjmaIssbRW5HVVR5tyV6ygTLIm15aU8LUmQSaQ==", "funding": [ { "type": "opencollective", @@ -2050,13 +2058,13 @@ } }, "node_modules/eslint-import-resolver-typescript/node_modules/globby": { - "version": "13.2.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.0.tgz", - "integrity": "sha512-jWsQfayf13NvqKUIL3Ta+CIqMnvlaIDFveWE/dpOZ9+3AMEJozsxDvKA02zync9UuvOM8rOXzsD5GqKP4OnWPQ==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", "dependencies": { "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", "merge2": "^1.4.1", "slash": "^4.0.0" }, @@ -2295,11 +2303,11 @@ } }, "node_modules/espree": { - "version": "9.5.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz", - "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz", + "integrity": "sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A==", "dependencies": { - "acorn": "^8.8.0", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.4.1" }, @@ -2384,9 +2392,9 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", + "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -2601,9 +2609,9 @@ } }, "node_modules/get-tsconfig": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.6.0.tgz", - "integrity": "sha512-lgbo68hHTQnFddybKbbs/RDRJnJT5YyGy2kQzVwbq+g67X73i+5MVTval34QxGkOe9X5Ujf1UYpCaphLyltjEg==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.6.2.tgz", + "integrity": "sha512-E5XrT4CbbXcXWy+1jChlZmrmCwd5KGx502kDCXJJ7y898TtWW9FwoG5HfOLVRKmlmDGkWN2HM9Ho+/Y8F0sJDg==", "dependencies": { "resolve-pkg-maps": "^1.0.0" }, @@ -3265,12 +3273,14 @@ } }, "node_modules/jsx-ast-utils": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz", - "integrity": "sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.4.tgz", + "integrity": "sha512-fX2TVdCViod6HwKEtSWGHs57oFhVfCMwieb9PuRDgjDPh5XeqJiHFFFJCHxU5cnTc3Bu/GRL+kPiFmw8XWOfKw==", "dependencies": { - "array-includes": "^3.1.5", - "object.assign": "^4.1.3" + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" }, "engines": { "node": ">=4.0" @@ -3295,7 +3305,7 @@ } }, "node_modules/le-coffre-resources": { - "resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#16c30e06af8241bf6fef6ec8083da9bf434048df", + "resolved": "git+ssh://git@github.com/smart-chain-fr/leCoffre-resources.git#10eab2b6bde5cd085509b8510808477caff37a1e", "license": "MIT", "dependencies": { "class-transformer": "^0.5.1", @@ -3316,9 +3326,9 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.10.36", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.36.tgz", - "integrity": "sha512-NCPWES1poiS4NSzIS49mxHM5hCkSWov8wFICRKfL9narzimqAXlnAgNloHCt0BukZHbWt8TIStCdzLy7LXBYpQ==" + "version": "1.10.37", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.37.tgz", + "integrity": "sha512-Z10PCaOCiAxbUxLyR31DNeeNugSVP6iv/m7UrSKS5JHziEMApJtgku4e9Q69pzzSC9LnQiM09sqsGf2ticZnMw==" }, "node_modules/lines-and-columns": { "version": "1.2.4", @@ -3735,16 +3745,16 @@ } }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -4345,9 +4355,9 @@ } }, "node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -4751,9 +4761,9 @@ } }, "node_modules/tslib": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", - "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", + "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -4936,14 +4946,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 4af186ba..0f92b572 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "eslint-config-next": "13.2.4", "form-data": "^4.0.0", "jwt-decode": "^3.1.2", - "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.54", + "le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.55", "next": "13.2.4", "prettier": "^2.8.7", "react": "18.2.0", diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts index b749519e..844095aa 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Folders/Folders.ts @@ -88,7 +88,7 @@ export default class Folders extends BaseSuperAdmin { public async delete(uid: string): Promise { const url = new URL(this.baseURl.concat(`/${uid}`)); const targetedFolder = await this.getByUid(uid); - if (targetedFolder.office_folder_has_customers) return Promise.reject(`The folder ${uid} contains customers`); + if (targetedFolder.customers) return Promise.reject(`The folder ${uid} contains customers`); try { return await this.deleteRequest(url); } catch (err) { From ec60a5bfd9a6836b00474a34d29c21c83eeaef70 Mon Sep 17 00:00:00 2001 From: Vins Date: Mon, 10 Jul 2023 15:24:44 +0200 Subject: [PATCH 09/11] accessToken in header --- src/front/Api/BaseApiService.ts | 17 ++++++++++------- src/front/Components/Layouts/Login/index.tsx | 3 +-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/front/Api/BaseApiService.ts b/src/front/Api/BaseApiService.ts index 67bd7b60..003a902d 100644 --- a/src/front/Api/BaseApiService.ts +++ b/src/front/Api/BaseApiService.ts @@ -1,4 +1,5 @@ import { FrontendVariables } from "@Front/Config/VariablesFront"; +import CookieService from "@Front/Services/CookieService/CookieService"; export enum ContentType { JSON = "application/json", @@ -20,13 +21,15 @@ export default abstract class BaseApiService { return BaseApiService.baseUrl; } - protected buildHeaders(contentType: ContentType, token?: string) { + protected buildHeaders(contentType: ContentType) { + const token = CookieService.getInstance().getCookie("leCoffreAccessToken"); + const headers = new Headers(); if (contentType === ContentType.JSON) { headers.set("Content-Type", contentType); } - if (token) headers.set("Authorization", `Bearer ${token}`); + headers.set("Authorization", `Bearer ${token}`); return headers; } @@ -38,7 +41,7 @@ export default abstract class BaseApiService { const request = async () => await fetch(url, { method: "GET", - headers: this.buildHeaders(ContentType.JSON, token), + headers: this.buildHeaders(ContentType.JSON), }); return this.sendRequest(request); } @@ -48,7 +51,7 @@ export default abstract class BaseApiService { async () => await fetch(url, { method: "POST", - headers: this.buildHeaders(ContentType.JSON, token), + headers: this.buildHeaders(ContentType.JSON), body: this.buildBody(body), }), ); @@ -69,7 +72,7 @@ export default abstract class BaseApiService { const request = async () => await fetch(url, { method: "PUT", - headers: this.buildHeaders(ContentType.JSON, token), + headers: this.buildHeaders(ContentType.JSON), body: this.buildBody(body), }); @@ -91,7 +94,7 @@ export default abstract class BaseApiService { const request = async () => await fetch(url, { method: "DELETE", - headers: this.buildHeaders(ContentType.JSON, token), + headers: this.buildHeaders(ContentType.JSON), body: this.buildBody(body), }); @@ -102,7 +105,7 @@ export default abstract class BaseApiService { const request = async () => await fetch(url, { method: "PUT", - headers: this.buildHeaders(ContentType.FORM_DATA, token), + headers: this.buildHeaders(ContentType.FORM_DATA), body, }); diff --git a/src/front/Components/Layouts/Login/index.tsx b/src/front/Components/Layouts/Login/index.tsx index 216e3385..27a5b0a4 100644 --- a/src/front/Components/Layouts/Login/index.tsx +++ b/src/front/Components/Layouts/Login/index.tsx @@ -9,7 +9,6 @@ import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoub // import { FrontendVariables } from "@Front/Config/VariablesFront"; import idNoteLogo from "@Assets/Icons/id-note-logo.svg"; import UserStore from "@Front/Stores/UserStore"; -import JwtService from "@Front/Services/JwtService/JwtService"; export default class LoginClass extends BasePage { public override render(): JSX.Element { @@ -36,7 +35,7 @@ export default class LoginClass extends BasePage { // const variables = FrontendVariables.getInstance(); // const baseFronturl = variables.BACK_API_PROTOCOL + variables.FRONT_APP_HOST; - await UserStore.instance.connect("A1QAuhlImn"); + await UserStore.instance.connect("U5eUoGpRu4"); // await JwtService.getInstance().checkJwt(); // window.location.assign("http://localhost:3000" + "/folders"); From f57443a811035b03573932891578768c93e6b9e6 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Mon, 10 Jul 2023 15:58:23 +0200 Subject: [PATCH 10/11] :sparkles: Fixing build --- .../SuperAdmin/DeedTypes/DeedTypes.ts | 2 +- .../Api/LeCoffreApi/SuperAdmin/Deeds/Deeds.ts | 2 +- .../Api/LeCoffreApi/SuperAdmin/Users/Users.ts | 1 - .../DesignSystem/SearchBar/index.tsx | 6 +- .../DefaultNotaryDashboard/index.tsx | 2 +- .../Layouts/ClientDashboard/index.tsx | 3 +- .../Layouts/DesignSystem/classes.module.scss | 18 - .../Layouts/DesignSystem/dummyData.ts | 347 ------------------ .../Components/Layouts/DesignSystem/index.tsx | 319 ---------------- .../Folder/AddClientToFolder/index.tsx | 18 +- .../Layouts/Folder/AskDocuments/index.tsx | 18 +- .../Layouts/Folder/CreateFolder/index.tsx | 45 +-- .../FolderInformation/ClientSection/index.tsx | 14 +- .../Folder/FolderInformation/index.tsx | 4 +- .../UpdateFolderCollaborators/index.tsx | 40 +- .../FolderInformation/ClientSection/index.tsx | 14 +- .../FolderInformation/index.tsx | 2 +- src/pages/design-system.tsx | 5 - 18 files changed, 70 insertions(+), 790 deletions(-) delete mode 100644 src/front/Components/Layouts/DesignSystem/classes.module.scss delete mode 100644 src/front/Components/Layouts/DesignSystem/dummyData.ts delete mode 100644 src/front/Components/Layouts/DesignSystem/index.tsx delete mode 100644 src/pages/design-system.tsx diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/DeedTypes/DeedTypes.ts b/src/front/Api/LeCoffreApi/SuperAdmin/DeedTypes/DeedTypes.ts index 548a95ff..c9a05459 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/DeedTypes/DeedTypes.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/DeedTypes/DeedTypes.ts @@ -15,7 +15,7 @@ export type IPutDeedTypesParams = { deed?: DeedType["deed"]; office?: DeedType["office"]; archived_at?: DeedType["archived_at"]; - deed_type_has_document_types?: DeedType["deed_type_has_document_types"]; + document_types?: DeedType["document_types"]; }; export default class DeedTypes extends BaseSuperAdmin { diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Deeds/Deeds.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Deeds/Deeds.ts index 3953781f..a3360412 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/Deeds/Deeds.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Deeds/Deeds.ts @@ -15,7 +15,7 @@ export type IPutDeedsParams = { description?: OfficeFolder["description"]; archived_description?: OfficeFolder["archived_description"]; status?: OfficeFolder["status"]; - deed_has_document_types?: Deed["deed_has_document_types"]; + document_types?: Deed["document_types"]; }; export default class Deeds extends BaseSuperAdmin { diff --git a/src/front/Api/LeCoffreApi/SuperAdmin/Users/Users.ts b/src/front/Api/LeCoffreApi/SuperAdmin/Users/Users.ts index 17432643..319a01fd 100644 --- a/src/front/Api/LeCoffreApi/SuperAdmin/Users/Users.ts +++ b/src/front/Api/LeCoffreApi/SuperAdmin/Users/Users.ts @@ -15,7 +15,6 @@ export type IPutUsersParams = { idNot?: User["idNot"]; contact?: User["contact"]; office_membership?: User["office_membership"]; - office_folder_has_stakeholders?: User["office_folder_has_stakeholders"]; documents?: User["documents"]; }; diff --git a/src/front/Components/DesignSystem/SearchBar/index.tsx b/src/front/Components/DesignSystem/SearchBar/index.tsx index 3a680722..40590a95 100644 --- a/src/front/Components/DesignSystem/SearchBar/index.tsx +++ b/src/front/Components/DesignSystem/SearchBar/index.tsx @@ -59,10 +59,10 @@ export default class SearchBar extends React.Component { const number = folder.folder_number.toLowerCase(); const value = event.target.value.toLowerCase(); - if (folder.office_folder_has_customers) { - const customerNames = folder.office_folder_has_customers + if (folder.customers) { + const customerNames = folder.customers .map((customer) => { - return `${customer.customer.contact?.first_name.toLowerCase()} ${customer.customer.contact?.last_name.toLowerCase()}`; + return `${customer.contact?.first_name.toLowerCase()} ${customer.contact?.last_name.toLowerCase()}`; }) .join(", "); return name.includes(value) || number.includes(value) || customerNames.includes(value); diff --git a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx index bad6838a..00ec42dc 100644 --- a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx +++ b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx @@ -39,7 +39,7 @@ export type IDashBoardFolder = { description: OfficeFolder["description"]; deed?: OfficeFolder["deed"]; created_at: OfficeFolder["created_at"]; - office_folder_has_customers?: OfficeFolder["office_folder_has_customers"]; + customers?: OfficeFolder["customers"]; archived_description: OfficeFolder["archived_description"]; status: OfficeFolder["status"]; }; diff --git a/src/front/Components/Layouts/ClientDashboard/index.tsx b/src/front/Components/Layouts/ClientDashboard/index.tsx index dd25c1ec..0df97dce 100644 --- a/src/front/Components/Layouts/ClientDashboard/index.tsx +++ b/src/front/Components/Layouts/ClientDashboard/index.tsx @@ -10,7 +10,6 @@ import React from "react"; import classes from "./classes.module.scss"; import Customers from "@Front/Api/LeCoffreApi/SuperAdmin/Customers/Customers"; import Customer, { Document } from "le-coffre-resources/dist/Customer"; -import { document } from "./../../../Components/Layouts/DesignSystem/dummyData"; type IProps = { targetedCustormer: string; // MOCK @@ -69,7 +68,7 @@ export default class ClientDashboard extends Base { Glissez / Déposez votre document dans la zone prévue à cet effet ou cliquez sur la zone puis sélectionnez le document correspondant. - + {/* */} diff --git a/src/front/Components/Layouts/DesignSystem/classes.module.scss b/src/front/Components/Layouts/DesignSystem/classes.module.scss deleted file mode 100644 index 61db99b4..00000000 --- a/src/front/Components/Layouts/DesignSystem/classes.module.scss +++ /dev/null @@ -1,18 +0,0 @@ -.root { - margin-left: 35px; - margin-right: 35px; - .section { - margin-bottom: 32px; - } - .sub-section { - margin-bottom: 24px; - } - - .inline-flex { - display: inline-flex; - } - - .folder-conatainer { - width: 389px; - } -} diff --git a/src/front/Components/Layouts/DesignSystem/dummyData.ts b/src/front/Components/Layouts/DesignSystem/dummyData.ts deleted file mode 100644 index 85af3021..00000000 --- a/src/front/Components/Layouts/DesignSystem/dummyData.ts +++ /dev/null @@ -1,347 +0,0 @@ -import { ECustomerStatus } from "le-coffre-resources/dist/Customer/Customer"; -import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; -import EFolderStatus from "le-coffre-resources/dist/Customer/EFolderStatus"; -import { - Address, - Contact, - Customer, - Deed, - DeedType, - Document, - DocumentType, - File, - Office, - OfficeFolder, - OfficeFolderHasCustomer, -} from "le-coffre-resources/dist/Notary"; - -export const address: Address = { - uid: "a&2azedzaa3", - address: "123", - city: "France", - zip_code: 78140, - created_at: new Date(), - updated_at: new Date(), -}; - -export const office: Office = { - uid: "111zdazaefez213", - idNot: "12EE12", - name: "Office 1", - crpcen: "AZezdz", - address: address, - created_at: new Date(), - updated_at: new Date(), - office_status: "ACTIVATED", -}; -export const deedType: DeedType = { - uid: "123azefezgzeg312", - name: "Acte mariage", - description: "dzsdaf", - archived_at: new Date(), - office: office, - created_at: new Date(), - updated_at: new Date(), -}; - -export const deed: Deed = { - uid: "zegefzeferg", - deed_type: deedType, - created_at: new Date(), - updated_at: new Date(), -}; - -export const contact: Contact = { - uid: "contact_1_uid", - first_name: "John", - last_name: "Doe", - email: "johnDoe@gmail.com", - address: address, - created_at: new Date(), - updated_at: new Date(), - cell_phone_number: "0132249865", - phone_number: "0132249865", - civility: "MALE", -}; - -export const contact2: Contact = { - uid: "contact_2_uid", - first_name: "Customer2", - last_name: "Doe", - email: "johnDoe@gmail.com", - address: address, - created_at: new Date(), - updated_at: new Date(), - cell_phone_number: "0132249865", - phone_number: "0132249865", - civility: "MALE", -}; - -export const docType: DocumentType = { - name: "Votre document", - uid: "fezezfazegezrgrezg", - created_at: new Date(), - updated_at: new Date(), - public_description: "", - private_description: "", - archived_at: new Date(), - office: office, -}; - -export const identityDocType: DocumentType = { - name: "Carte d'identité", - uid: "fezezfazegezrgrezg", - created_at: new Date(), - updated_at: new Date(), - public_description: "Carte d'identité public description", - private_description: "Carte d'identité private description", - archived_at: new Date(), - office: office, -}; - -export const customer: Customer = { - uid: "erhtgerfzeare", - contact: contact, - created_at: new Date(), - updated_at: new Date(), - status: ECustomerStatus.VALIDATED, -}; - -export const customer2_mock: Customer = { - uid: "yregrgetergrt", - contact: contact2, - created_at: new Date(), - updated_at: new Date(), - status: ECustomerStatus.VALIDATED, -}; - -export const folder: OfficeFolder = { - uid: "mkovrijvrezviev", - folder_number: "12331", - name: "Mon dossier", - status: EFolderStatus.ARCHIVED, - deed: deed, - office: office, - created_at: new Date(), - updated_at: new Date(), - description: "Description", - archived_description: "Archived description", -}; - -export const document: Document = { - uid: "fzeafergreztyzgrf", - depositor: customer2_mock, - document_status: "ASKED", - folder: folder, - document_type: docType, - updated_at: new Date(), - created_at: new Date(), -}; - -export const fileMock: File = { - uid: "super_file_uid_1", - created_at: new Date(), - updated_at: new Date(), - document: document, - file_name: "file_1", - file_path: - "https://minteed-stg-euwest3-s3.s3.eu-west-3.amazonaws.com/Qmf_Yb_Eh_X9st_F_Srq_Ve_Bj_Yb_Aj56xv_AV_Nj6_Wjypo_B4r5ubce_U_ae3303e7ab.pdf", - archived_at: null, - mimetype: "image/png", - size: 0, -}; - -export const fileMock2: File = { - uid: "super_file_uid_2", - created_at: new Date(), - updated_at: new Date(), - document: document, - file_name: "file_2", - file_path: - "https://minteed-prod-euwest3-s3.s3.eu-west-3.amazonaws.com/Qm_Wq_En1_DCA_8yt_RX_Qx_QFA_9_Fm_ZKZH_Qqb_VH_1_Q_Mnv_G_Jtt1_FS_Xp_2a35a36e19", - archived_at: null, - mimetype: "image/png", - size: 0, -}; - -export const identityFile: File = { - uid: "identity_file_uid", - created_at: new Date(), - updated_at: new Date(), - document: document, - file_name: "file_3", - file_path: "https://minteed-stg-euwest3-s3.s3.eu-west-3.amazonaws.com/cni_fake_c7259d4923.png", - archived_at: null, - mimetype: "image/png", - size: 0, -}; - -export const documentIdentity: Document = { - uid: "ethrthbkjtrbporjbh", - depositor: customer2_mock, - document_status: EDocumentStatus.DEPOSITED, - folder: folder, - document_type: identityDocType, - updated_at: new Date(), - created_at: new Date(), - files: [identityFile], -}; - -export const documentPending: Document = { - uid: "fzefeazdagrtetrury", - depositor: customer2_mock, - document_status: EDocumentStatus.DEPOSITED, - folder: folder, - document_type: docType, - updated_at: new Date(), - created_at: new Date(), - files: [fileMock, fileMock2], -}; - -export const documentDeposited: Document = { - uid: "uè§u§htfgrthytrgr", - depositor: customer2_mock, - document_status: "VALIDATED", - folder: folder, - document_type: docType, - updated_at: new Date(), - created_at: new Date(), - files: [fileMock], -}; - -export const customer2: Customer = { - uid: "yregrgetergrt", - contact: contact2, - created_at: new Date(), - updated_at: new Date(), - status: ECustomerStatus.VALIDATED, - documents: [document, documentPending, documentDeposited, documentIdentity], -}; - -export const folderWithPendingDocument: OfficeFolder = { - uid: "ferzferzfezeefzdd", - folder_number: "00001", - name: "Mon dossier", - status: EFolderStatus.LIVE, - deed: deed, - office: office, - created_at: new Date(), - updated_at: new Date(), - description: "Description", - archived_description: "Archived description", - documents: [], -}; -export const folderWithPendingDocument1: OfficeFolder = { - uid: "gtrtyutyhretgytu", - folder_number: "00002", - name: "Mon dossier", - status: EFolderStatus.LIVE, - deed: deed, - office: office, - created_at: new Date(), - updated_at: new Date(), - description: "Description", - archived_description: "Archived description", - documents: [documentDeposited], -}; -export const folderWithPendingDocument2: OfficeFolder = { - uid: "adzefzefsfrefzrtgtr", - folder_number: "00003", - name: "Mon dossier", - status: EFolderStatus.LIVE, - deed: deed, - office: office, - created_at: new Date(), - updated_at: new Date(), - description: "Description", - archived_description: "Archived description", - documents: [document], -}; - -export const officeFolderHasCustomer1: OfficeFolderHasCustomer = { - uid: "ferzfergrzeyerezrz", - customer: customer, - office_folder: folderWithPendingDocument, - created_at: new Date(), - updated_at: new Date(), -}; - -export const officeFolderHasCustomer2: OfficeFolderHasCustomer = { - uid: "tezrfzdfgrggeerry", - customer: customer2, - office_folder: folderWithPendingDocument, - created_at: new Date(), - updated_at: new Date(), -}; - -export const folderWithPendingDocument3: OfficeFolder = { - uid: "mkovrijvrezviev", - folder_number: "00014", - name: "Mon dossier", - status: EFolderStatus.LIVE, - deed: deed, - office: office, - created_at: new Date(), - updated_at: new Date(), - description: "Description", - archived_description: "Archived description", - documents: [document, documentDeposited, documentPending, documentIdentity], - office_folder_has_customers: [officeFolderHasCustomer1, officeFolderHasCustomer2], -}; - -export const document8: Document = { - uid: "eztreggrgbyunjukhg", - depositor: customer, - document_status: "ASKED", - folder: folderWithPendingDocument, - document_type: docType, - updated_at: new Date(), - created_at: new Date(), -}; - -export const folderWithPendingDocumentArchived1: OfficeFolder = { - uid: "gtrtyutyhrdazafad&éfytu", - folder_number: "00007", - name: "Mon dossier", - status: EFolderStatus.ARCHIVED, - deed: deed, - office: office, - created_at: new Date(), - updated_at: new Date(), - description: "Description", - archived_description: "Archived description", - documents: [documentDeposited], - office_folder_has_customers: [officeFolderHasCustomer1, officeFolderHasCustomer2], -}; -export const folderWithPendingDocumentArchived2: OfficeFolder = { - uid: "adzefdazdaazzrtgtr", - folder_number: "00008", - name: "Mon dossier", - status: EFolderStatus.ARCHIVED, - deed: deed, - office: office, - created_at: new Date(), - updated_at: new Date(), - description: "Description", - archived_description: "Archived description", - documents: [document], -}; - -export const document2: Document = { - uid: "mejfihruehfoire", - depositor: customer, - document_status: "ASKED", - folder: folderWithPendingDocument3, - document_type: docType, - updated_at: new Date(), - created_at: new Date(), -}; - -export const folders: OfficeFolder[] = [ - folderWithPendingDocument, - folderWithPendingDocument1, - folderWithPendingDocument2, - folderWithPendingDocument3, -]; - -export const foldersArchived: OfficeFolder[] = [folderWithPendingDocumentArchived1, folderWithPendingDocumentArchived2]; diff --git a/src/front/Components/Layouts/DesignSystem/index.tsx b/src/front/Components/Layouts/DesignSystem/index.tsx deleted file mode 100644 index 20a6108e..00000000 --- a/src/front/Components/Layouts/DesignSystem/index.tsx +++ /dev/null @@ -1,319 +0,0 @@ -import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; -import CheckBox from "@Front/Components/DesignSystem/CheckBox"; -import DocumentNotary from "@Front/Components/DesignSystem/Document/DocumentNotary"; -import FilePreview from "@Front/Components/DesignSystem/FilePreview"; -import FolderContainer from "@Front/Components/DesignSystem/FolderContainer"; -import FolderList from "@Front/Components/DesignSystem/FolderListContainer"; -import HeaderLink from "@Front/Components/DesignSystem/Header/HeaderLink"; -import Confirm from "@Front/Components/DesignSystem/Modal/Confirm"; -import MultiSelect from "@Front/Components/DesignSystem/MultiSelect"; -import QuantityProgressBar from "@Front/Components/DesignSystem/QuantityProgressBar"; -import RadioBox from "@Front/Components/DesignSystem/RadioBox"; -import SearchBar from "@Front/Components/DesignSystem/SearchBar"; -import ToolTip from "@Front/Components/DesignSystem/ToolTip"; -import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography"; -import UserFolder from "@Front/Components/DesignSystem/UserFolder"; -import BasePage from "@Front/Components/Layouts/Base"; -import DefaultTemplate from "@Front/Components/LayoutTemplates/DefaultTemplate"; -import Toasts, { IToast } from "@Front/Stores/Toasts"; - -import classes from "./classes.module.scss"; -import { customer2, document, documentDeposited, documentPending, folder, folders, folderWithPendingDocument } from "./dummyData"; -import { IDashBoardFolder } from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; -import SelectField, { IOption } from "@Front/Components/DesignSystem/Form/SelectField"; -import TextField from "@Front/Components/DesignSystem/Form/TextField"; -import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField"; - -type IState = { - isModalDisplayed: boolean; - selectedOption?: IOption; -}; -type IProps = {}; - -export default class DesignSystem extends BasePage { - constructor(props: IProps) { - super(props); - this.state = { - isModalDisplayed: false, - }; - this.openModal = this.openModal.bind(this); - this.closeModal = this.closeModal.bind(this); - this.onSelectedOption = this.onSelectedOption.bind(this); - } - - public override render(): JSX.Element { - const selectOptions: IOption[] = [ - { value: "1", label: "Divorce" }, - { value: "2", label: "Succession" }, - { value: "3", label: "Vente immobilière" }, - ]; - return ( - -
-
-
- Website design System -
-
- - This page allows to gather all the design system of the site. A Design System is a library of components, - visuals and principles with reusable code. This evolving kit offers a UX and UI repository for designers and - developers of digital products and services. The construction of a design system offers many advantages. - This solution facilitates the work of the teams and reduces the "design debt" and the "technical debt". The - result is a coherent ecosystem and therefore a better experience for users and customers. - -
-
-
-
- Button components -
- - - -
- -
-
- Toaster component -
- -
-
-
- Modal components -
- - - - Lorem ipsum dolor sit amet consectetur. Aliquam nunc lobortis lacus vulputate sagittis sed tempor eget feugiat. - Elementum malesuada at sit elit. - -
- -
-
- HeaderLink components -
-
- - -
-
-
-
- CheckBox component -
- - -
-
-
- RadioBox component -
- - Radio Box 1 - - - Radio Box 2 - -
-
-
- Tool tip component -
- -
-
-
- Input component -
-
- -
-
- -
-
- -
-
- -
-
- Progress bar component -
-
- -
-
- -
-
- -
-
- -
-
- Folder container component -
-
- Folder with no document to validate -
- -
-
-
- Folder with document waiting for being validate -
- -
-
-
- -
-
- Select component -
-
-
- -
-
-
- -
-
- Notary Documents -
-
- Documents ASKED -
- -
-
-
- Documents Depoited -
- -
-
-
- Documents VALIDATED - -
- -
-
-
- -
-
- Notary Documents -
-
- { - return; - }} - /> -
-
- -
-
- MultiSelect -
-
- -
-
- -
-
- Document SearchBar -
-
- -
-
- -
-
- Folder List -
-
- -
-
- -
-
- Preview Image/Pdf -
-
-
- -
- -
-
-
-
- ); - } - private openModal() { - this.setState({ - isModalDisplayed: true, - }); - } - private closeModal() { - this.setState({ - isModalDisplayed: false, - }); - } - private spawnToast() { - const toast: IToast = { - title: "Un collaborateur veut rejoindre votre office", - text: "12:00 - 1 fev 2023", - }; - Toasts.getInstance().open(toast); - } - - private onSelectedOption(option: IOption) { - this.setState({ - selectedOption: option, - }); - } -} diff --git a/src/front/Components/Layouts/Folder/AddClientToFolder/index.tsx b/src/front/Components/Layouts/Folder/AddClientToFolder/index.tsx index 69e613cf..b9acad59 100644 --- a/src/front/Components/Layouts/Folder/AddClientToFolder/index.tsx +++ b/src/front/Components/Layouts/Folder/AddClientToFolder/index.tsx @@ -9,7 +9,7 @@ import BackArrow from "@Front/Components/Elements/BackArrow"; import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; import Module from "@Front/Config/Module"; import { ECivility } from "le-coffre-resources/dist/Customer/Contact"; -import { Customer, OfficeFolder, OfficeFolderHasCustomer } from "le-coffre-resources/dist/Notary"; +import { Customer, OfficeFolder } from "le-coffre-resources/dist/Notary"; import Link from "next/link"; import { NextRouter, useRouter } from "next/router"; @@ -164,10 +164,10 @@ class AddClientToFolderClass extends BasePage { let preExistingCustomers: IOption[] = []; try { const folder = await Folders.getInstance().getByUid(folderUid, query); - preExistingCustomers = folder.office_folder_has_customers!.map((folderHasCustomer) => { + preExistingCustomers = folder.customers!.map((customer) => { return { - label: folderHasCustomer.customer.contact?.first_name + " " + folderHasCustomer.customer.contact?.last_name, - value: folderHasCustomer.customer.uid, + label: customer.contact?.first_name + " " + customer.contact?.last_name, + value: customer.uid, }; }); } catch (error) { @@ -209,23 +209,23 @@ class AddClientToFolderClass extends BasePage { values["civility"] = ECivility.MALE; // TODO: should maybe be deleted later or added to the form const allCustomersToLink = this.state.selectedCustomers.concat(this.state.existingCustomers); - let customersToLink: Partial[] = allCustomersToLink.map((customer) => { + let customersToLink: Partial[] = allCustomersToLink.map((customer) => { return { customer: { uid: customer.value }, }; - }) as Partial[]; + }) as Partial[]; if (this.state.selectedOption === "new_customer") { const customer: Customer = await Customers.getInstance().post({ contact: values, }); if (!customer.uid) return; - customersToLink?.push({ customer: { uid: customer.uid } } as Partial); + customersToLink?.push({ customer: { uid: customer.uid } } as Partial); } if (customersToLink) { - const body = OfficeFolder.hydrate({ office_folder_has_customers: customersToLink.map((customer) => { - return OfficeFolderHasCustomer.hydrate(customer); + const body = OfficeFolder.hydrate({ customers: customersToLink.map((customer) => { + return Customer.hydrate(customer); }) }); await Folders.getInstance().put(this.props.selectedFolderUid, body); diff --git a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx index d360b6f5..eedec845 100644 --- a/src/front/Components/Layouts/Folder/AskDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/AskDocuments/index.tsx @@ -169,8 +169,8 @@ class AskDocumentsClass extends BasePage { .map((document) => { return document.document_type!.uid!; }); - const documentTypes = folder.deed!.deed_has_document_types!.filter((documentType) => { - if (userDocumentTypesUids.includes(documentType.document_type!.uid!)) return false; + const documentTypes = folder.deed!.document_types!.filter((documentType) => { + if (userDocumentTypesUids.includes(documentType!.uid!)) return false; return true; }); @@ -182,9 +182,9 @@ class AskDocumentsClass extends BasePage { }) .map((documentType) => { return { - label: documentType.document_type!.name!, - value: documentType.document_type!.uid!, - description: documentType.document_type!.private_description!, + label: documentType!.name!, + value: documentType!.uid!, + description: documentType!.private_description!, }; }); @@ -209,13 +209,11 @@ class AskDocumentsClass extends BasePage { public_description: this.state.visibleDescription, }); - const oldDocumentsType = this.state.folder?.deed?.deed_has_document_types!; + const oldDocumentsType = this.state.folder?.deed?.document_types!; await Deeds.getInstance().put(this.state.folder?.deed?.uid!, { - deed_has_document_types: [ + document_types: [ ...oldDocumentsType, - { - document_type: documentType, - }, + documentType, ], }); diff --git a/src/front/Components/Layouts/Folder/CreateFolder/index.tsx b/src/front/Components/Layouts/Folder/CreateFolder/index.tsx index bbae4b7b..5056836a 100644 --- a/src/front/Components/Layouts/Folder/CreateFolder/index.tsx +++ b/src/front/Components/Layouts/Folder/CreateFolder/index.tsx @@ -13,7 +13,7 @@ import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Ty import BackArrow from "@Front/Components/Elements/BackArrow"; import DefaultDoubleSidePage from "@Front/Components/LayoutTemplates/DefaultDoubleSidePage"; import { ValidationError } from "class-validator"; -import { Deed, DeedType, Office, OfficeFolder, OfficeFolderHasStakeholder } from "le-coffre-resources/dist/Notary"; +import { Deed, DeedType, Office, OfficeFolder } from "le-coffre-resources/dist/Notary"; import User from "le-coffre-resources/dist/Notary"; import { NextRouter, useRouter } from "next/router"; import React from "react"; @@ -243,13 +243,14 @@ class CreateFolderClass extends BasePage { const usersMock = await Users.getInstance().get({ include: { office_membership: true } }); const userMock = usersMock[0]; - let stakeholders = this.getStakeholders(); - let testUsers = stakeholders.map((stakeholder) => ({ - user_stakeholder: { - uid: stakeholder.user_stakeholder.uid, - }, - })); - + let stakeholders = this.state.collaborators; + if (this.state.folder_access === "select_collaborators") { + stakeholders = this.state.collaborators.filter((collaborator) => { + return this.state.formValues.collaborators?.some((selectedCollaborator) => { + return selectedCollaborator.value === collaborator.uid; + }); + }); + } const officeFolderForm = OfficeFolder.hydrate({ folder_number: values["folder_number"], name: values["name"], @@ -262,13 +263,8 @@ class CreateFolderClass extends BasePage { office: Office.hydrate({ uid: userMock?.office_membership?.uid, }), - office_folder_has_stakeholder: testUsers.map((user) => { - return OfficeFolderHasStakeholder.hydrate({ - user_stakeholder: User.hydrate({ - uid: user.user_stakeholder.uid, - }), - }); - }), + customers: [], + stakeholders }); try { @@ -313,25 +309,6 @@ class CreateFolderClass extends BasePage { folder_access: e.target.value, }); } - - private getStakeholders() { - let collaborators: User[] = this.state.collaborators; - - let office_folder_has_stakeholders = collaborators.map((collaborator) => { - return OfficeFolderHasStakeholder.hydrate({ - user_stakeholder: collaborator, - }); - }); - - if (this.state.folder_access === "select_collaborators") { - office_folder_has_stakeholders = office_folder_has_stakeholders.filter((collaborator) => { - return this.state.formValues.collaborators?.some((selectedCollaborator) => { - return selectedCollaborator.value === collaborator.user_stakeholder.uid; - }); - }); - } - return office_folder_has_stakeholders; - } } export default function CreateFolder(props: IProps): JSX.Element { diff --git a/src/front/Components/Layouts/Folder/FolderInformation/ClientSection/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/ClientSection/index.tsx index e95817f0..aa5f46b0 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/ClientSection/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/ClientSection/index.tsx @@ -60,14 +60,14 @@ export default class ClientSection extends React.Component { } private renderCustomerFolders() { - const output = this.props.folder.office_folder_has_customers?.map((folderHasCustomer) => { - if (!folderHasCustomer.customer) return null; + const output = this.props.folder.customers?.map((customer) => { + if (!customer) return null; return ( ); @@ -83,7 +83,7 @@ export default class ClientSection extends React.Component { } private doesFolderHaveCustomer(): boolean { - if (!this.props.folder?.office_folder_has_customers) return false; - return this.props.folder?.office_folder_has_customers!.length > 0; + if (!this.props.folder?.customers) return false; + return this.props.folder?.customers!.length > 0; } } diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index cd91f829..a0fafb0e 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -155,8 +155,8 @@ class FolderInformationClass extends BasePage { } private doesFolderHaveCustomer(): boolean { - if (!this.state.selectedFolder?.office_folder_has_customers) return false; - return this.state.selectedFolder?.office_folder_has_customers!.length > 0; + if (!this.state.selectedFolder?.customers) return false; + return this.state.selectedFolder?.customers!.length > 0; } private onSelectedFolder(folder: IDashBoardFolder): void { diff --git a/src/front/Components/Layouts/Folder/UpdateFolderCollaborators/index.tsx b/src/front/Components/Layouts/Folder/UpdateFolderCollaborators/index.tsx index 25ce20ba..8b99c85e 100644 --- a/src/front/Components/Layouts/Folder/UpdateFolderCollaborators/index.tsx +++ b/src/front/Components/Layouts/Folder/UpdateFolderCollaborators/index.tsx @@ -1,20 +1,20 @@ +import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; +import Users, { IGetUsersparams } from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import Form from "@Front/Components/DesignSystem/Form"; +import { IOption } from "@Front/Components/DesignSystem/Form/SelectField"; +import MultiSelect from "@Front/Components/DesignSystem/MultiSelect"; +import RadioBox from "@Front/Components/DesignSystem/RadioBox"; import Typography, { ITypo } from "@Front/Components/DesignSystem/Typography"; import BackArrow from "@Front/Components/Elements/BackArrow"; import DefaultNotaryDashboard, { IDashBoardFolder } from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; -import BasePage from "../../Base"; -import classes from "./classes.module.scss"; +import Module from "@Front/Config/Module"; +import User from "le-coffre-resources/dist/Notary"; import Link from "next/link"; import { NextRouter, useRouter } from "next/router"; -import RadioBox from "@Front/Components/DesignSystem/RadioBox"; -import MultiSelect from "@Front/Components/DesignSystem/MultiSelect"; -import Module from "@Front/Config/Module"; -import Users, { IGetUsersparams } from "@Front/Api/LeCoffreApi/SuperAdmin/Users/Users"; -import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; -import { OfficeFolderHasStakeholder } from "le-coffre-resources/dist/Customer"; -import { IOption } from "@Front/Components/DesignSystem/Form/SelectField"; -import User from "le-coffre-resources/dist/Notary"; + +import BasePage from "../../Base"; +import classes from "./classes.module.scss"; type IPropsClass = { selectedFolderUid: string; @@ -119,10 +119,10 @@ class UpdateFolderCollaboratorsClass extends BasePage { let folder = null; try { folder = await Folders.getInstance().getByUid(folderUid, query); - const preSelectedCollaborators: IOption[] = folder.office_folder_has_stakeholder!.map((collaborator) => { + const preSelectedCollaborators: IOption[] = folder.stakeholders!.map((collaborator) => { return { - label: collaborator.user_stakeholder.contact?.first_name + " " + collaborator.user_stakeholder.contact?.last_name, - value: collaborator.user_stakeholder.uid, + label: collaborator.contact?.first_name + " " + collaborator.contact?.last_name, + value: collaborator.uid, }; }); this.setState({ selectedCollaborators: preSelectedCollaborators }); @@ -173,17 +173,13 @@ class UpdateFolderCollaboratorsClass extends BasePage { private async onFormSubmit(e: React.FormEvent | null, values: { [key: string]: string }) { try { - let collaboratorsUid: OfficeFolderHasStakeholder[]; + let collaboratorsUid: User[] = this.state.availableCollaborators; if (this.state.selectedOption === ERadioBoxValue.SELECTION) { - collaboratorsUid = this.state.selectedCollaborators.map( - (collaborator) => ({ user_stakeholder: { uid: collaborator.value } } as OfficeFolderHasStakeholder), + collaboratorsUid = this.state.selectedCollaborators.map((collaborator) => + User.hydrate({ uid: collaborator.value as string }), ); - } else { - collaboratorsUid = this.state.availableCollaborators.map( - (collaborator) => ({ user_stakeholder: { uid: collaborator.uid } } as OfficeFolderHasStakeholder), - ); - } - await Folders.getInstance().put(this.props.selectedFolderUid, { office_folder_has_stakeholder: collaboratorsUid }); + } + await Folders.getInstance().put(this.props.selectedFolderUid, { stakeholders: collaboratorsUid }); this.props.router.push( Module.getInstance() .get() diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/ClientSection/index.tsx b/src/front/Components/Layouts/FolderArchived/FolderInformation/ClientSection/index.tsx index 84eafba9..33143af1 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/ClientSection/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/ClientSection/index.tsx @@ -40,14 +40,14 @@ export default class ClientSection extends React.Component { } private renderCustomerFolders() { - const output = this.props.folder.office_folder_has_customers?.map((folderHasCustomer) => { - if (!folderHasCustomer.customer) return null; + const output = this.props.folder.customers?.map((customer) => { + if (!customer) return null; return ( ); @@ -62,7 +62,7 @@ export default class ClientSection extends React.Component { } private doesFolderHaveCustomer(): boolean { - if (!this.props.folder?.office_folder_has_customers) return false; - return this.props.folder?.office_folder_has_customers!.length > 0; + if (!this.props.folder?.customers) return false; + return this.props.folder?.customers!.length > 0; } } diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx index 99609888..44fb416c 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx @@ -108,7 +108,7 @@ class FolderInformationClass extends BasePage { } private doesFolderHaveCustomer(): boolean { - return this.state.selectedFolder?.office_folder_has_customers !== undefined; + return this.state.selectedFolder?.customers !== undefined; } private onSelectedFolder(folder: IDashBoardFolder): void { diff --git a/src/pages/design-system.tsx b/src/pages/design-system.tsx deleted file mode 100644 index d3835570..00000000 --- a/src/pages/design-system.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import DesignSystem from "@Front/Components/Layouts/DesignSystem"; - -export default function Route() { - return ; -} From 324429c98896272766f575b53e541b255f590f6f Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Mon, 10 Jul 2023 16:12:07 +0200 Subject: [PATCH 11/11] :sparkles: Fixing getters --- .../DefaultNotaryDashboard/index.tsx | 20 ++++++--------- .../Folder/AddClientToFolder/index.tsx | 25 ++++++++----------- .../Folder/FolderInformation/index.tsx | 18 ++++++------- .../UpdateFolderCollaborators/index.tsx | 10 +++----- .../Folder/UpdateFolderMetadata/index.tsx | 2 +- .../FolderInformation/index.tsx | 2 +- 6 files changed, 29 insertions(+), 48 deletions(-) diff --git a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx index 00ec42dc..bacb0a23 100644 --- a/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx +++ b/src/front/Components/LayoutTemplates/DefaultNotaryDashboard/index.tsx @@ -1,4 +1,3 @@ - import ChevronIcon from "@Assets/Icons/chevron.svg"; import Folders, { IGetFoldersParams } from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; @@ -9,12 +8,11 @@ import BackArrow from "@Front/Components/Elements/BackArrow"; import WindowStore from "@Front/Stores/WindowStore"; import classNames from "classnames"; import { OfficeFolder } from "le-coffre-resources/dist/Customer"; +import EFolderStatus from "le-coffre-resources/dist/Customer/EFolderStatus"; import Image from "next/image"; import React, { ReactNode } from "react"; import classes from "./classes.module.scss"; -import EFolderStatus from "le-coffre-resources/dist/Customer/EFolderStatus"; - type IProps = { title: string; @@ -118,18 +116,14 @@ export default class DefaultNotaryDashboard extends React.Component { - +
@@ -150,13 +147,9 @@ class AddClientToFolderClass extends BasePage { private async getFolderPreSelectedCustomers(folderUid: string): Promise { const query = { q: { - office_folder_has_customers: { + customers: { include: { - customer: { - include: { - contact: true, - }, - }, + contact: true, }, }, }, @@ -224,9 +217,11 @@ class AddClientToFolderClass extends BasePage { } if (customersToLink) { - const body = OfficeFolder.hydrate({ customers: customersToLink.map((customer) => { - return Customer.hydrate(customer); - }) }); + const body = OfficeFolder.hydrate({ + customers: customersToLink.map((customer) => { + return Customer.hydrate(customer); + }), + }); await Folders.getInstance().put(this.props.selectedFolderUid, body); this.props.router.push(`/folders/${this.props.selectedFolderUid}`); diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index a0fafb0e..3e5e4c5a 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -2,6 +2,7 @@ import ChevronIcon from "@Assets/Icons/chevron.svg"; import Folders from "@Front/Api/LeCoffreApi/SuperAdmin/Folders/Folders"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import FolderBoxInformation, { EFolderBoxInformationType } from "@Front/Components/DesignSystem/FolderBoxInformation"; +import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField"; import Confirm from "@Front/Components/DesignSystem/Modal/Confirm"; import QuantityProgressBar from "@Front/Components/DesignSystem/QuantityProgressBar"; import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography"; @@ -16,7 +17,6 @@ import { ChangeEvent } from "react"; import BasePage from "../../Base"; import classes from "./classes.module.scss"; import ClientSection from "./ClientSection"; -import TextAreaField from "@Front/Components/DesignSystem/Form/TextareaField"; type IProps = {}; @@ -189,18 +189,14 @@ class FolderInformationClass extends BasePage { q: { deed: { include: { deed_type: true } }, office: true, - office_folder_has_customers: { + customer: { include: { - customer: { + contact: true, + documents: { include: { - contact: true, - documents: { - include: { - folder: true, - document_type: true, - files: true, - }, - }, + folder: true, + document_type: true, + files: true, }, }, }, diff --git a/src/front/Components/Layouts/Folder/UpdateFolderCollaborators/index.tsx b/src/front/Components/Layouts/Folder/UpdateFolderCollaborators/index.tsx index 8b99c85e..02f600ba 100644 --- a/src/front/Components/Layouts/Folder/UpdateFolderCollaborators/index.tsx +++ b/src/front/Components/Layouts/Folder/UpdateFolderCollaborators/index.tsx @@ -104,13 +104,9 @@ class UpdateFolderCollaboratorsClass extends BasePage { const query = { q: { office: true, - office_folder_has_stakeholder: { + stakeholders: { include: { - user_stakeholder: { - include: { - contact: true, - }, - }, + contact: true, }, }, }, @@ -178,7 +174,7 @@ class UpdateFolderCollaboratorsClass extends BasePage { collaboratorsUid = this.state.selectedCollaborators.map((collaborator) => User.hydrate({ uid: collaborator.value as string }), ); - } + } await Folders.getInstance().put(this.props.selectedFolderUid, { stakeholders: collaboratorsUid }); this.props.router.push( Module.getInstance() diff --git a/src/front/Components/Layouts/Folder/UpdateFolderMetadata/index.tsx b/src/front/Components/Layouts/Folder/UpdateFolderMetadata/index.tsx index 3f480fe7..30124d19 100644 --- a/src/front/Components/Layouts/Folder/UpdateFolderMetadata/index.tsx +++ b/src/front/Components/Layouts/Folder/UpdateFolderMetadata/index.tsx @@ -103,7 +103,7 @@ class UpdateFolderMetadataClass extends BasePage { q: { deed: { include: { deed_type: true } }, office: true, - office_folder_has_customers: { include: { customer: { include: { contact: true } } } }, + customers: { include: { contact: true } }, }, }; const folder = await Folders.getInstance().getByUid(this.props.folderUid, query); diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx index 44fb416c..127287cd 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx @@ -140,7 +140,7 @@ class FolderInformationClass extends BasePage { q: { deed: { include: { deed_type: "true" } }, office: "true", - office_folder_has_customers: { include: { customer: { include: { contact: true } } } }, + customer: { include: { contact: true } }, }, }; const folder = await Folders.getInstance().getByUid(this.props.selectedFolderUid, query);