diff --git a/package.json b/package.json index e06b8892..a0ec71c2 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "marked": "4.0.18", "mime-types": "*", "mkdirp": "*", - "mongoose": "6.5.0", + "mongoose": "6.5.1", "mongoose-aggregate-paginate-v2": "1.0.6", "mongoose-lean-getters": "0.3.5", "mongoose-lean-id": "0.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e3e3efe3..a6341897 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -92,7 +92,7 @@ specifiers: mime-types: '*' mkdirp: '*' mongodb-memory-server: 8.8.0 - mongoose: 6.5.0 + mongoose: 6.5.1 mongoose-aggregate-paginate-v2: 1.0.6 mongoose-lean-getters: 0.3.5 mongoose-lean-id: 0.3.0 @@ -125,7 +125,7 @@ specifiers: zx-cjs: 6.1.0 dependencies: - '@algolia/client-search': 4.13.1 + '@algolia/client-search': 4.14.2 '@babel/core': 7.18.10 '@babel/plugin-transform-modules-commonjs': 7.18.6_@babel+core@7.18.10 '@babel/plugin-transform-typescript': 7.18.12_@babel+core@7.18.10 @@ -145,8 +145,8 @@ dependencies: '@nestjs/websockets': 9.0.8_tfktegv5rc7kykrovtylwg5rzm '@socket.io/redis-adapter': 7.2.0 '@socket.io/redis-emitter': 4.1.1 - '@typegoose/auto-increment': 1.6.0_mongoose@6.5.0 - '@typegoose/typegoose': 9.11.0_mongoose@6.5.0 + '@typegoose/auto-increment': 1.6.0_mongoose@6.5.1 + '@typegoose/typegoose': 9.11.0_mongoose@6.5.1 '@types/jsonwebtoken': 8.5.8 algoliasearch: 4.14.2 axios: 0.27.2 @@ -176,11 +176,11 @@ dependencies: marked: 4.0.18 mime-types: 2.1.35 mkdirp: 1.0.4 - mongoose: 6.5.0 + mongoose: 6.5.1 mongoose-aggregate-paginate-v2: 1.0.6 - mongoose-lean-getters: 0.3.5_mongoose@6.5.0 - mongoose-lean-id: 0.3.0_mongoose@6.5.0 - mongoose-lean-virtuals: 0.9.1_mongoose@6.5.0 + mongoose-lean-getters: 0.3.5_mongoose@6.5.1 + mongoose-lean-id: 0.3.0_mongoose@6.5.1 + mongoose-lean-virtuals: 0.9.1_mongoose@6.5.1 mongoose-paginate-v2: 1.7.0 nanoid: 3.3.4 node-machine-id: 1.1.12 @@ -229,10 +229,10 @@ devDependencies: '@types/ua-parser-js': 0.7.36 '@types/validator': 13.7.5 '@vercel/ncc': 0.34.0 - cron: 2.0.0 + cron: 2.1.0 cross-env: 7.0.3 - eslint: 8.19.0 - eslint-plugin-unused-imports: 2.0.0_eslint@8.19.0 + eslint: 8.21.0 + eslint-plugin-unused-imports: 2.0.0_eslint@8.21.0 husky: 8.0.1 ioredis: 5.2.2 jest: 28.1.3_y6fn6jtbiyx6cy7zvn47g6jrgi @@ -254,10 +254,6 @@ packages: '@algolia/cache-common': 4.14.2 dev: false - /@algolia/cache-common/4.13.1: - resolution: {integrity: sha512-7Vaf6IM4L0Jkl3sYXbwK+2beQOgVJ0mKFbz/4qSxKd1iy2Sp77uTAazcX+Dlexekg1fqGUOSO7HS4Sx47ZJmjA==} - dev: false - /@algolia/cache-common/4.14.2: resolution: {integrity: sha512-SbvAlG9VqNanCErr44q6lEKD2qoK4XtFNx9Qn8FK26ePCI8I9yU7pYB+eM/cZdS9SzQCRJBbHUumVr4bsQ4uxg==} dev: false @@ -285,13 +281,6 @@ packages: '@algolia/transporter': 4.14.2 dev: false - /@algolia/client-common/4.13.1: - resolution: {integrity: sha512-LcDoUE0Zz3YwfXJL6lJ2OMY2soClbjrrAKB6auYVMNJcoKZZ2cbhQoFR24AYoxnGUYBER/8B+9sTBj5bj/Gqbg==} - dependencies: - '@algolia/requester-common': 4.13.1 - '@algolia/transporter': 4.13.1 - dev: false - /@algolia/client-common/4.14.2: resolution: {integrity: sha512-43o4fslNLcktgtDMVaT5XwlzsDPzlqvqesRi4MjQz2x4/Sxm7zYg5LRYFol1BIhG6EwxKvSUq8HcC/KxJu3J0Q==} dependencies: @@ -307,14 +296,6 @@ packages: '@algolia/transporter': 4.14.2 dev: false - /@algolia/client-search/4.13.1: - resolution: {integrity: sha512-YQKYA83MNRz3FgTNM+4eRYbSmHi0WWpo019s5SeYcL3HUan/i5R09VO9dk3evELDFJYciiydSjbsmhBzbpPP2A==} - dependencies: - '@algolia/client-common': 4.13.1 - '@algolia/requester-common': 4.13.1 - '@algolia/transporter': 4.13.1 - dev: false - /@algolia/client-search/4.14.2: resolution: {integrity: sha512-L5zScdOmcZ6NGiVbLKTvP02UbxZ0njd5Vq9nJAmPFtjffUSOGEp11BmD2oMJ5QvARgx2XbX4KzTTNS5ECYIMWw==} dependencies: @@ -323,10 +304,6 @@ packages: '@algolia/transporter': 4.14.2 dev: false - /@algolia/logger-common/4.13.1: - resolution: {integrity: sha512-L6slbL/OyZaAXNtS/1A8SAbOJeEXD5JcZeDCPYDqSTYScfHu+2ePRTDMgUTY4gQ7HsYZ39N1LujOd8WBTmM2Aw==} - dev: false - /@algolia/logger-common/4.14.2: resolution: {integrity: sha512-/JGlYvdV++IcMHBnVFsqEisTiOeEr6cUJtpjz8zc0A9c31JrtLm318Njc72p14Pnkw3A/5lHHh+QxpJ6WFTmsA==} dev: false @@ -343,10 +320,6 @@ packages: '@algolia/requester-common': 4.14.2 dev: false - /@algolia/requester-common/4.13.1: - resolution: {integrity: sha512-eGVf0ID84apfFEuXsaoSgIxbU3oFsIbz4XiotU3VS8qGCJAaLVUC5BUJEkiFENZIhon7hIB4d0RI13HY4RSA+w==} - dev: false - /@algolia/requester-common/4.14.2: resolution: {integrity: sha512-73YQsBOKa5fvVV3My7iZHu1sUqmjjfs9TteFWwPwDmnad7T0VTCopttcsM3OjLxZFtBnX61Xxl2T2gmG2O4ehg==} dev: false @@ -357,14 +330,6 @@ packages: '@algolia/requester-common': 4.14.2 dev: false - /@algolia/transporter/4.13.1: - resolution: {integrity: sha512-pICnNQN7TtrcYJqqPEXByV8rJ8ZRU2hCiIKLTLRyNpghtQG3VAFk6fVtdzlNfdUGZcehSKGarPIZEHlQXnKjgw==} - dependencies: - '@algolia/cache-common': 4.13.1 - '@algolia/logger-common': 4.13.1 - '@algolia/requester-common': 4.13.1 - dev: false - /@algolia/transporter/4.14.2: resolution: {integrity: sha512-t89dfQb2T9MFQHidjHcfhh6iGMNwvuKUvojAj+JsrHAGbuSy7yE4BylhLX6R0Q1xYRoC4Vvv+O5qIw/LdnQfsQ==} dependencies: @@ -373,10 +338,11 @@ packages: '@algolia/requester-common': 4.14.2 dev: false - /@ampproject/remapping/2.1.2: - resolution: {integrity: sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg==} + /@ampproject/remapping/2.2.0: + resolution: {integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==} engines: {node: '>=6.0.0'} dependencies: + '@jridgewell/gen-mapping': 0.1.1 '@jridgewell/trace-mapping': 0.3.14 /@angular-devkit/core/14.0.5: @@ -467,15 +433,15 @@ packages: resolution: {integrity: sha512-JQM6k6ENcBFKVtWvLavlvi/mPcpYZ3+R+2EySDEMSMbp7Mn4FexlbbJVrx2R7Ijhr01T8gyqrOaABWIOgxeUyw==} engines: {node: '>=6.9.0'} dependencies: - '@ampproject/remapping': 2.1.2 + '@ampproject/remapping': 2.2.0 '@babel/code-frame': 7.18.6 - '@babel/generator': 7.18.10 + '@babel/generator': 7.18.12 '@babel/helper-compilation-targets': 7.18.9_@babel+core@7.18.10 '@babel/helper-module-transforms': 7.18.9 '@babel/helpers': 7.18.9 - '@babel/parser': 7.18.10 + '@babel/parser': 7.18.11 '@babel/template': 7.18.10 - '@babel/traverse': 7.18.10 + '@babel/traverse': 7.18.11 '@babel/types': 7.18.10 convert-source-map: 1.8.0 debug: 4.3.4 @@ -485,8 +451,8 @@ packages: transitivePeerDependencies: - supports-color - /@babel/generator/7.18.10: - resolution: {integrity: sha512-0+sW7e3HjQbiHbj1NeU/vN8ornohYlacAfZIaXhdoGweQqgcNy69COVciYYqEXJ/v+9OBA7Frxm4CVAuNqKeNA==} + /@babel/generator/7.18.12: + resolution: {integrity: sha512-dfQ8ebCN98SvyL7IxNMCUtZQSq5R7kxgN+r8qYTGDmmSion1hX2C0zq2yo1bsCDhXixokv1SAWTZUMYbO/V5zg==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.18.10 @@ -509,7 +475,7 @@ packages: '@babel/compat-data': 7.18.8 '@babel/core': 7.18.10 '@babel/helper-validator-option': 7.18.6 - browserslist: 4.21.1 + browserslist: 4.21.3 semver: 7.3.7 /@babel/helper-create-class-features-plugin/7.18.9_@babel+core@7.18.10: @@ -591,7 +557,7 @@ packages: '@babel/helper-split-export-declaration': 7.18.6 '@babel/helper-validator-identifier': 7.18.6 '@babel/template': 7.18.10 - '@babel/traverse': 7.18.10 + '@babel/traverse': 7.18.11 '@babel/types': 7.18.10 transitivePeerDependencies: - supports-color @@ -619,7 +585,7 @@ packages: '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-member-expression-to-functions': 7.18.9 '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/traverse': 7.18.10 + '@babel/traverse': 7.18.11 '@babel/types': 7.18.10 transitivePeerDependencies: - supports-color @@ -654,7 +620,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.18.10 - '@babel/traverse': 7.18.10 + '@babel/traverse': 7.18.11 '@babel/types': 7.18.10 transitivePeerDependencies: - supports-color @@ -681,6 +647,14 @@ packages: hasBin: true dependencies: '@babel/types': 7.18.10 + dev: true + + /@babel/parser/7.18.11: + resolution: {integrity: sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.18.10 /@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.18.10: resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} @@ -841,7 +815,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/parser': 7.18.10 + '@babel/parser': 7.18.11 '@babel/types': 7.18.10 /@babel/traverse/7.18.10: @@ -849,12 +823,30 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/generator': 7.18.10 + '@babel/generator': 7.18.12 '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-function-name': 7.18.9 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.18.10 + '@babel/parser': 7.18.11 + '@babel/types': 7.18.10 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: false + + /@babel/traverse/7.18.11: + resolution: {integrity: sha512-TG9PiM2R/cWCAy6BPJKeHzNbu4lPzOSZpeMfeNErskGpTJx6trEvFaVCbDvpcxwy49BKWmEPwiW8mrysNiDvIQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.18.12 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.18.9 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/parser': 7.18.11 '@babel/types': 7.18.10 debug: 4.3.4 globals: 11.12.0 @@ -900,8 +892,8 @@ packages: dependencies: ajv: 6.12.6 debug: 4.3.4 - espree: 9.3.2 - globals: 13.16.0 + espree: 9.3.3 + globals: 13.17.0 ignore: 5.2.0 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -1001,8 +993,8 @@ packages: - supports-color dev: false - /@humanwhocodes/config-array/0.9.5: - resolution: {integrity: sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==} + /@humanwhocodes/config-array/0.10.4: + resolution: {integrity: sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==} engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 @@ -1012,6 +1004,10 @@ packages: - supports-color dev: true + /@humanwhocodes/gitignore-to-minimatch/1.0.2: + resolution: {integrity: sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==} + dev: true + /@humanwhocodes/object-schema/1.2.1: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true @@ -1022,9 +1018,9 @@ packages: prettier: 2.x dependencies: '@babel/core': 7.18.10 - '@babel/generator': 7.18.10 - '@babel/parser': 7.18.10 - '@babel/traverse': 7.18.10 + '@babel/generator': 7.18.12 + '@babel/parser': 7.18.11 + '@babel/traverse': 7.18.11 '@babel/types': 7.18.10 javascript-natural-sort: 0.7.1 lodash: 4.17.21 @@ -1051,12 +1047,12 @@ packages: /@innei/eslint-config-ts/0.9.4: resolution: {integrity: sha512-T52M6omBVNP6CbRN0sWNf8TjEEocuPTSN+FnVUY7c1P8JfgOTH9PFOG8fEt59UZLxZEIjy26pHGDqATv9inGVA==} dependencies: - '@typescript-eslint/eslint-plugin': 5.30.7_6zdoc3rn4mpiddqwhppni2mnnm - '@typescript-eslint/parser': 5.30.5_4x5o4skxv6sl53vpwefgt23khm - eslint: 8.19.0 - eslint-config-prettier: 8.5.0_eslint@8.19.0 - eslint-plugin-import: 2.26.0_iom7pm3yknyiblqpw2vvqvxs5i - eslint-plugin-unused-imports: 2.0.0_ckavnzrmfhceszgqfp6pq47qta + '@typescript-eslint/eslint-plugin': 5.30.7_iosr3hrei2tubxveewluhu5lhy + '@typescript-eslint/parser': 5.32.0_qugx7qdu5zevzvxaiqyxfiwquq + eslint: 8.21.0 + eslint-config-prettier: 8.5.0_eslint@8.21.0 + eslint-plugin-import: 2.26.0_wuikv5nqgdfyng42xxm7lklfmi + eslint-plugin-unused-imports: 2.0.0_xy7cbo5gk3k45sqbs2hkn32agq typescript: 4.7.4 transitivePeerDependencies: - eslint-import-resolver-typescript @@ -1307,6 +1303,13 @@ packages: chalk: 4.1.2 dev: true + /@jridgewell/gen-mapping/0.1.1: + resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.14 + /@jridgewell/gen-mapping/0.3.2: resolution: {integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==} engines: {node: '>=6.0.0'} @@ -1739,18 +1742,18 @@ packages: resolution: {integrity: sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==} dev: true - /@typegoose/auto-increment/1.6.0_mongoose@6.5.0: + /@typegoose/auto-increment/1.6.0_mongoose@6.5.1: resolution: {integrity: sha512-EDw+6N+ZS3V6I4IFj4mDxAkhZH0W6/3Zk3E7MPt3ybGcuJGAQEPBceOjMkoxVTaP8LxmYzrmeoKs8TIUCf+y/A==} engines: {node: '>=12.22.0'} peerDependencies: mongoose: ~6.5.0 dependencies: loglevel: 1.8.0 - mongoose: 6.5.0 + mongoose: 6.5.1 tslib: 2.4.0 dev: false - /@typegoose/typegoose/9.11.0_mongoose@6.5.0: + /@typegoose/typegoose/9.11.0_mongoose@6.5.1: resolution: {integrity: sha512-abAeJ3pxWVldG0WEV00vs7UyORSLUrFigRDCa71P1GTPRpAzfF28VwYdnDWq+L5b34GYAV7sQTU80ViAX2V18w==} engines: {node: '>=12.22.0'} peerDependencies: @@ -1758,7 +1761,7 @@ packages: dependencies: lodash: 4.17.21 loglevel: 1.8.0 - mongoose: 6.5.0 + mongoose: 6.5.1 reflect-metadata: 0.1.13 semver: 7.3.7 tslib: 2.4.0 @@ -1930,7 +1933,7 @@ packages: /@types/mongoose-aggregate-paginate-v2/1.0.5: resolution: {integrity: sha512-c3KXTwzW6+BZw2g2TgNgGUyMbotTcI2Ip+NSZWoJjG2UO+8BRjmy+kJUNu64rfdIqWJ1+8h5NLm9w+aVis93Hw==} dependencies: - mongoose: 6.5.0 + mongoose: 6.5.1 transitivePeerDependencies: - supports-color dev: true @@ -2012,7 +2015,7 @@ packages: dev: false optional: true - /@typescript-eslint/eslint-plugin/5.30.7_6zdoc3rn4mpiddqwhppni2mnnm: + /@typescript-eslint/eslint-plugin/5.30.7_iosr3hrei2tubxveewluhu5lhy: resolution: {integrity: sha512-l4L6Do+tfeM2OK0GJsU7TUcM/1oN/N25xHm3Jb4z3OiDU4Lj8dIuxX9LpVMS9riSXQs42D1ieX7b85/r16H9Fw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2023,12 +2026,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.30.5_4x5o4skxv6sl53vpwefgt23khm + '@typescript-eslint/parser': 5.32.0_qugx7qdu5zevzvxaiqyxfiwquq '@typescript-eslint/scope-manager': 5.30.7 - '@typescript-eslint/type-utils': 5.30.7_4x5o4skxv6sl53vpwefgt23khm - '@typescript-eslint/utils': 5.30.7_4x5o4skxv6sl53vpwefgt23khm + '@typescript-eslint/type-utils': 5.30.7_qugx7qdu5zevzvxaiqyxfiwquq + '@typescript-eslint/utils': 5.30.7_qugx7qdu5zevzvxaiqyxfiwquq debug: 4.3.4 - eslint: 8.19.0 + eslint: 8.21.0 functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 @@ -2039,8 +2042,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.30.5_4x5o4skxv6sl53vpwefgt23khm: - resolution: {integrity: sha512-zj251pcPXI8GO9NDKWWmygP6+UjwWmrdf9qMW/L/uQJBM/0XbU2inxe5io/234y/RCvwpKEYjZ6c1YrXERkK4Q==} + /@typescript-eslint/parser/5.32.0_qugx7qdu5zevzvxaiqyxfiwquq: + resolution: {integrity: sha512-IxRtsehdGV9GFQ35IGm5oKKR2OGcazUoiNBxhRV160iF9FoyuXxjY+rIqs1gfnd+4eL98OjeGnMpE7RF/NBb3A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -2049,24 +2052,16 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.30.5 - '@typescript-eslint/types': 5.30.5 - '@typescript-eslint/typescript-estree': 5.30.5_typescript@4.7.4 + '@typescript-eslint/scope-manager': 5.32.0 + '@typescript-eslint/types': 5.32.0 + '@typescript-eslint/typescript-estree': 5.32.0_typescript@4.7.4 debug: 4.3.4 - eslint: 8.19.0 + eslint: 8.21.0 typescript: 4.7.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager/5.30.5: - resolution: {integrity: sha512-NJ6F+YHHFT/30isRe2UTmIGGAiXKckCyMnIV58cE3JkHmaD6e5zyEYm5hBDv0Wbin+IC0T1FWJpD3YqHUG/Ydg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.30.5 - '@typescript-eslint/visitor-keys': 5.30.5 - dev: true - /@typescript-eslint/scope-manager/5.30.7: resolution: {integrity: sha512-7BM1bwvdF1UUvt+b9smhqdc/eniOnCKxQT/kj3oXtj3LqnTWCAM0qHRHfyzCzhEfWX0zrW7KqXXeE4DlchZBKw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2075,7 +2070,15 @@ packages: '@typescript-eslint/visitor-keys': 5.30.7 dev: true - /@typescript-eslint/type-utils/5.30.7_4x5o4skxv6sl53vpwefgt23khm: + /@typescript-eslint/scope-manager/5.32.0: + resolution: {integrity: sha512-KyAE+tUON0D7tNz92p1uetRqVJiiAkeluvwvZOqBmW9z2XApmk5WSMV9FrzOroAcVxJZB3GfUwVKr98Dr/OjOg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.32.0 + '@typescript-eslint/visitor-keys': 5.32.0 + dev: true + + /@typescript-eslint/type-utils/5.30.7_qugx7qdu5zevzvxaiqyxfiwquq: resolution: {integrity: sha512-nD5qAE2aJX/YLyKMvOU5jvJyku4QN5XBVsoTynFrjQZaDgDV6i7QHFiYCx10wvn7hFvfuqIRNBtsgaLe0DbWhw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2085,44 +2088,23 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 5.30.7_4x5o4skxv6sl53vpwefgt23khm + '@typescript-eslint/utils': 5.30.7_qugx7qdu5zevzvxaiqyxfiwquq debug: 4.3.4 - eslint: 8.19.0 + eslint: 8.21.0 tsutils: 3.21.0_typescript@4.7.4 typescript: 4.7.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types/5.30.5: - resolution: {integrity: sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - /@typescript-eslint/types/5.30.7: resolution: {integrity: sha512-ocVkETUs82+U+HowkovV6uxf1AnVRKCmDRNUBUUo46/5SQv1owC/EBFkiu4MOHeZqhKz2ktZ3kvJJ1uFqQ8QPg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.30.5_typescript@4.7.4: - resolution: {integrity: sha512-qGTc7QZC801kbYjAr4AgdOfnokpwStqyhSbiQvqGBLixniAKyH+ib2qXIVo4P9NgGzwyfD9I0nlJN7D91E1VpQ==} + /@typescript-eslint/types/5.32.0: + resolution: {integrity: sha512-EBUKs68DOcT/EjGfzywp+f8wG9Zw6gj6BjWu7KV/IYllqKJFPlZlLSYw/PTvVyiRw50t6wVbgv4p9uE2h6sZrQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 5.30.5 - '@typescript-eslint/visitor-keys': 5.30.5 - debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.3.7 - tsutils: 3.21.0_typescript@4.7.4 - typescript: 4.7.4 - transitivePeerDependencies: - - supports-color dev: true /@typescript-eslint/typescript-estree/5.30.7_typescript@4.7.4: @@ -2146,7 +2128,28 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.30.7_4x5o4skxv6sl53vpwefgt23khm: + /@typescript-eslint/typescript-estree/5.32.0_typescript@4.7.4: + resolution: {integrity: sha512-ZVAUkvPk3ITGtCLU5J4atCw9RTxK+SRc6hXqLtllC2sGSeMFWN+YwbiJR9CFrSFJ3w4SJfcWtDwNb/DmUIHdhg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.32.0 + '@typescript-eslint/visitor-keys': 5.32.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.3.7 + tsutils: 3.21.0_typescript@4.7.4 + typescript: 4.7.4 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/utils/5.30.7_qugx7qdu5zevzvxaiqyxfiwquq: resolution: {integrity: sha512-Z3pHdbFw+ftZiGUnm1GZhkJgVqsDL5CYW2yj+TB2mfXDFOMqtbzQi2dNJIyPqPbx9mv2kUxS1gU+r2gKlKi1rQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -2156,22 +2159,14 @@ packages: '@typescript-eslint/scope-manager': 5.30.7 '@typescript-eslint/types': 5.30.7 '@typescript-eslint/typescript-estree': 5.30.7_typescript@4.7.4 - eslint: 8.19.0 + eslint: 8.21.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint-utils: 3.0.0_eslint@8.21.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys/5.30.5: - resolution: {integrity: sha512-D+xtGo9HUMELzWIUqcQc0p2PO4NyvTrgIOK/VnSH083+8sq0tiLozNRKuLarwHYGRuA6TVBQSuuLwJUDWd3aaA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.30.5 - eslint-visitor-keys: 3.3.0 - dev: true - /@typescript-eslint/visitor-keys/5.30.7: resolution: {integrity: sha512-KrRXf8nnjvcpxDFOKej4xkD7657+PClJs5cJVSG7NNoCNnjEdc46juNAQt7AyuWctuCgs6mVRc1xGctEqrjxWw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2180,6 +2175,14 @@ packages: eslint-visitor-keys: 3.3.0 dev: true + /@typescript-eslint/visitor-keys/5.32.0: + resolution: {integrity: sha512-S54xOHZgfThiZ38/ZGTgB2rqx51CMJ5MCfVT2IplK4Q7hgzGfe0nLzLCcenDnc/cSjP568hdeKfeDcBgqNHD/g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.32.0 + eslint-visitor-keys: 3.3.0 + dev: true + /@vercel/ncc/0.34.0: resolution: {integrity: sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==} hasBin: true @@ -2329,12 +2332,12 @@ packages: acorn: 8.7.1 dev: true - /acorn-jsx/5.3.2_acorn@8.7.1: + /acorn-jsx/5.3.2_acorn@8.8.0: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.7.1 + acorn: 8.8.0 dev: true /acorn-walk/8.2.0: @@ -2346,6 +2349,12 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + /acorn/8.8.0: + resolution: {integrity: sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + /agent-base/6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -2778,6 +2787,17 @@ packages: electron-to-chromium: 1.4.185 node-releases: 2.0.6 update-browserslist-db: 1.0.4_browserslist@4.21.1 + dev: true + + /browserslist/4.21.3: + resolution: {integrity: sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + caniuse-lite: 1.0.30001374 + electron-to-chromium: 1.4.211 + node-releases: 2.0.6 + update-browserslist-db: 1.0.5_browserslist@4.21.3 /bs-logger/0.2.6: resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} @@ -2865,6 +2885,10 @@ packages: /caniuse-lite/1.0.30001363: resolution: {integrity: sha512-HpQhpzTGGPVMnCjIomjt+jvyUu8vNFo3TaDiZ/RcoTrlOq/5+tC8zHdsbgFB6MxmaY+jCpsH09aD80Bb4Ow3Sg==} + dev: true + + /caniuse-lite/1.0.30001374: + resolution: {integrity: sha512-mWvzatRx3w+j5wx/mpFN5v5twlPrabG8NqX2c6e45LCpymdoGqNvRkRutFUqpRTXKFQFNQJasvK0YT7suW6/Hw==} /caseless/0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} @@ -3153,6 +3177,10 @@ packages: resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} dev: false + /core-util-is/1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + dev: false + /cors/2.8.5: resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} engines: {node: '>= 0.10'} @@ -3189,6 +3217,13 @@ packages: resolution: {integrity: sha512-RPeRunBCFr/WEo7WLp8Jnm45F/ziGJiHVvVQEBSDTSGu6uHW49b2FOP2O14DcXlGJRLhwE7TIoDzHHK4KmlL6g==} dependencies: luxon: 1.28.0 + dev: false + + /cron/2.1.0: + resolution: {integrity: sha512-Hq7u3P8y7UWYvsZbSKHHJDVG0VO9O7tp2qljxzTScelcTODBfCme8AIhnZsFwmQ9NchZ3hr2uNr+s3DSms7q6w==} + dependencies: + luxon: 1.28.0 + dev: true /cross-env/7.0.3: resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} @@ -3355,6 +3390,10 @@ packages: resolution: {integrity: sha512-tfiWc6BQLXNLpNiR5iGd0Ocu3P3VpxfzFiqubLgMfhfOw9WyvgJBd46CClNn9k3qfbjvT//0cf7AlYRX/OslMQ==} engines: {node: '>=0.10'} + /denque/2.1.0: + resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==} + engines: {node: '>=0.10'} + /depd/2.0.0: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} @@ -3510,6 +3549,10 @@ packages: /electron-to-chromium/1.4.185: resolution: {integrity: sha512-9kV/isoOGpKkBt04yYNaSWIBn3187Q5VZRtoReq8oz5NY/A4XmU6cAoqgQlDp7kKJCZMRjWZ8nsQyxfpFHvfyw==} + dev: true + + /electron-to-chromium/1.4.211: + resolution: {integrity: sha512-BZSbMpyFQU0KBJ1JG26XGeFI3i4op+qOYGxftmZXFZoHkhLgsSv4DHDJfl8ogII3hIuzGt51PaZ195OVu0yJ9A==} /emittery/0.10.2: resolution: {integrity: sha512-aITqOwnLanpHLNXZJENbOgjUBeHocD+xsSJmNrjovKBW5HbSpW3d1pEls7GFQPUWXiwG9+0P4GtHfEqC/4M0Iw==} @@ -3660,13 +3703,13 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-prettier/8.5.0_eslint@8.19.0: + /eslint-config-prettier/8.5.0_eslint@8.21.0: resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.19.0 + eslint: 8.21.0 dev: true /eslint-import-resolver-node/0.3.6: @@ -3678,7 +3721,7 @@ packages: - supports-color dev: true - /eslint-module-utils/2.7.3_ea34krk32wbcqzxapvwr7rsjs4: + /eslint-module-utils/2.7.3_gjpiwexkhexdr4bbgrtzf23bg4: resolution: {integrity: sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==} engines: {node: '>=4'} peerDependencies: @@ -3696,7 +3739,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.30.5_4x5o4skxv6sl53vpwefgt23khm + '@typescript-eslint/parser': 5.32.0_qugx7qdu5zevzvxaiqyxfiwquq debug: 3.2.7 eslint-import-resolver-node: 0.3.6 find-up: 2.1.0 @@ -3704,7 +3747,7 @@ packages: - supports-color dev: true - /eslint-plugin-import/2.26.0_iom7pm3yknyiblqpw2vvqvxs5i: + /eslint-plugin-import/2.26.0_wuikv5nqgdfyng42xxm7lklfmi: resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} engines: {node: '>=4'} peerDependencies: @@ -3714,16 +3757,16 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.30.5_4x5o4skxv6sl53vpwefgt23khm + '@typescript-eslint/parser': 5.32.0_qugx7qdu5zevzvxaiqyxfiwquq array-includes: 3.1.5 array.prototype.flat: 1.3.0 debug: 2.6.9 doctrine: 2.1.0 - eslint: 8.19.0 + eslint: 8.21.0 eslint-import-resolver-node: 0.3.6 - eslint-module-utils: 2.7.3_ea34krk32wbcqzxapvwr7rsjs4 + eslint-module-utils: 2.7.3_gjpiwexkhexdr4bbgrtzf23bg4 has: 1.0.3 - is-core-module: 2.9.0 + is-core-module: 2.10.0 is-glob: 4.0.3 minimatch: 3.1.2 object.values: 1.1.5 @@ -3735,7 +3778,7 @@ packages: - supports-color dev: true - /eslint-plugin-unused-imports/2.0.0_ckavnzrmfhceszgqfp6pq47qta: + /eslint-plugin-unused-imports/2.0.0_eslint@8.21.0: resolution: {integrity: sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3745,12 +3788,11 @@ packages: '@typescript-eslint/eslint-plugin': optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.30.7_6zdoc3rn4mpiddqwhppni2mnnm - eslint: 8.19.0 + eslint: 8.21.0 eslint-rule-composer: 0.3.0 dev: true - /eslint-plugin-unused-imports/2.0.0_eslint@8.19.0: + /eslint-plugin-unused-imports/2.0.0_xy7cbo5gk3k45sqbs2hkn32agq: resolution: {integrity: sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3760,7 +3802,8 @@ packages: '@typescript-eslint/eslint-plugin': optional: true dependencies: - eslint: 8.19.0 + '@typescript-eslint/eslint-plugin': 5.30.7_iosr3hrei2tubxveewluhu5lhy + eslint: 8.21.0 eslint-rule-composer: 0.3.0 dev: true @@ -3785,13 +3828,13 @@ packages: estraverse: 5.3.0 dev: true - /eslint-utils/3.0.0_eslint@8.19.0: + /eslint-utils/3.0.0_eslint@8.21.0: resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '>=5' dependencies: - eslint: 8.19.0 + eslint: 8.21.0 eslint-visitor-keys: 2.1.0 dev: true @@ -3805,13 +3848,14 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint/8.19.0: - resolution: {integrity: sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw==} + /eslint/8.21.0: + resolution: {integrity: sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: '@eslint/eslintrc': 1.3.0 - '@humanwhocodes/config-array': 0.9.5 + '@humanwhocodes/config-array': 0.10.4 + '@humanwhocodes/gitignore-to-minimatch': 1.0.2 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 @@ -3819,16 +3863,19 @@ packages: doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.1.1 - eslint-utils: 3.0.0_eslint@8.19.0 + eslint-utils: 3.0.0_eslint@8.21.0 eslint-visitor-keys: 3.3.0 - espree: 9.3.2 + espree: 9.3.3 esquery: 1.4.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 file-entry-cache: 6.0.1 + find-up: 5.0.0 functional-red-black-tree: 1.0.1 glob-parent: 6.0.2 - globals: 13.16.0 + globals: 13.17.0 + globby: 11.1.0 + grapheme-splitter: 1.0.4 ignore: 5.2.0 import-fresh: 3.3.0 imurmurhash: 0.1.4 @@ -3849,12 +3896,12 @@ packages: - supports-color dev: true - /espree/9.3.2: - resolution: {integrity: sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==} + /espree/9.3.3: + resolution: {integrity: sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.7.1 - acorn-jsx: 5.3.2_acorn@8.7.1 + acorn: 8.8.0 + acorn-jsx: 5.3.2_acorn@8.8.0 eslint-visitor-keys: 3.3.0 dev: true @@ -3990,7 +4037,7 @@ packages: engines: {node: '>= 10.17.0'} hasBin: true dependencies: - debug: 4.3.4 + debug: 4.3.3 get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -4071,13 +4118,13 @@ packages: '@fastify/fast-json-stringify-compiler': 4.0.0 abstract-logging: 2.0.1 avvio: 8.2.0 - find-my-way: 7.0.0 + find-my-way: 7.0.1 light-my-request: 5.3.0 - pino: 8.1.0 + pino: 8.4.0 process-warning: 2.0.0 proxy-addr: 2.0.7 rfdc: 1.3.0 - secure-json-parse: 2.4.0 + secure-json-parse: 2.5.0 semver: 7.3.7 tiny-lru: 8.0.2 transitivePeerDependencies: @@ -4138,8 +4185,8 @@ packages: dev: false optional: true - /find-my-way/7.0.0: - resolution: {integrity: sha512-NHVohYPYRXgj6jxXVRwm4iMQjA2ggJpyewHz7Nq7hvBnHoYJJIyHuxNzs8QLPTLQfoqxZzls2g6Zm79XMbhXjA==} + /find-my-way/7.0.1: + resolution: {integrity: sha512-w05SaOPg54KqBof/RDA+75n1R48V7ZZNPL3nR17jJJs5dgZpR3ivfrMWOyx7BVFQgCLhYRG05hfgFCohYvSUXA==} engines: {node: '>=14'} dependencies: fast-deep-equal: 3.1.3 @@ -4172,6 +4219,14 @@ packages: locate-path: 5.0.0 path-exists: 4.0.0 + /find-up/5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true + /flat-cache/3.0.4: resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -4466,8 +4521,8 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} - /globals/13.16.0: - resolution: {integrity: sha512-A1lrQfpNF+McdPOnnFqY3kSN0AFTy485bTi1bkLk4mVPODIUEcSfhHgRqA+QdXPksrSTTztYXx37NFV+GpGk3Q==} + /globals/13.17.0: + resolution: {integrity: sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -4488,6 +4543,10 @@ packages: /graceful-fs/4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + /grapheme-splitter/1.0.4: + resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + dev: true + /har-schema/2.0.0: resolution: {integrity: sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==} engines: {node: '>=4'} @@ -4596,7 +4655,7 @@ packages: engines: {node: '>= 6'} dependencies: agent-base: 6.0.2 - debug: 4.3.4 + debug: 4.3.3 transitivePeerDependencies: - supports-color dev: false @@ -4769,6 +4828,11 @@ packages: /ip/1.1.8: resolution: {integrity: sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==} + dev: false + optional: true + + /ip/2.0.0: + resolution: {integrity: sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==} /ipaddr.js/1.9.1: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} @@ -4806,6 +4870,12 @@ packages: resolution: {integrity: sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==} engines: {node: '>= 0.4'} + /is-core-module/2.10.0: + resolution: {integrity: sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==} + dependencies: + has: 1.0.3 + dev: true + /is-core-module/2.9.0: resolution: {integrity: sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==} dependencies: @@ -4960,7 +5030,7 @@ packages: engines: {node: '>=8'} dependencies: '@babel/core': 7.18.10 - '@babel/parser': 7.18.10 + '@babel/parser': 7.18.11 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 semver: 7.3.7 @@ -5369,9 +5439,9 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} dependencies: '@babel/core': 7.18.10 - '@babel/generator': 7.18.10 + '@babel/generator': 7.18.12 '@babel/plugin-syntax-typescript': 7.18.6_@babel+core@7.18.10 - '@babel/traverse': 7.18.10 + '@babel/traverse': 7.18.11 '@babel/types': 7.18.10 '@jest/expect-utils': 28.1.3 '@jest/transform': 28.1.3 @@ -5635,7 +5705,7 @@ packages: dependencies: cookie: 0.5.0 process-warning: 2.0.0 - set-cookie-parser: 2.5.0 + set-cookie-parser: 2.5.1 dev: false /lilconfig/2.0.5: @@ -5726,6 +5796,13 @@ packages: dependencies: p-locate: 4.1.0 + /locate-path/6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + dependencies: + p-locate: 5.0.0 + dev: true + /lockfile/1.0.4: resolution: {integrity: sha512-cvbTwETRfsFh4nHsL1eGWapU1XFi5Ot9E85sWAwia7Y7EgB7vfqcZhTKZ+l7hCGxSPoushMv5GKhT5PdLv03WA==} dependencies: @@ -6032,6 +6109,14 @@ packages: dependencies: '@types/whatwg-url': 8.2.2 whatwg-url: 11.0.0 + dev: false + optional: true + + /mongodb-connection-string-url/2.5.3: + resolution: {integrity: sha512-f+/WsED+xF4B74l3k9V/XkTVj5/fxFH2o5ToKXd8Iyi5UhM+sO9u0Ape17Mvl/GkZaFtM0HQnzAG5OTmhKw+tQ==} + dependencies: + '@types/whatwg-url': 8.2.2 + whatwg-url: 11.0.0 /mongodb-memory-server-core/8.8.0: resolution: {integrity: sha512-pguLQes27cFhiqs/rRqINst1y2zCMGVNrVEREbvFtKaMTQUh40TU1XeOrVesqu1qYFGHYntYCOzlJueUtl62qQ==} @@ -6088,9 +6173,9 @@ packages: engines: {node: '>=12.9.0'} dependencies: bson: 4.6.5 - denque: 2.0.1 - mongodb-connection-string-url: 2.5.2 - socks: 2.6.2 + denque: 2.1.0 + mongodb-connection-string-url: 2.5.3 + socks: 2.7.0 optionalDependencies: saslprep: 1.0.3 @@ -6099,31 +6184,31 @@ packages: engines: {node: '>=4.0.0'} dev: false - /mongoose-lean-getters/0.3.5_mongoose@6.5.0: + /mongoose-lean-getters/0.3.5_mongoose@6.5.1: resolution: {integrity: sha512-gmQ+RFMVCOSyvBcdc0+0fZOsWFO/bUqfLPUcttkoN5Gvwh8fe3ZmPjPNHNhy34vEeR0aljAsmBQ/naKfNOqWsQ==} engines: {node: '>= 8'} peerDependencies: mongoose: '>= 5.11.0 || 6.x' dependencies: - mongoose: 6.5.0 + mongoose: 6.5.1 mpath: 0.8.4 dev: false - /mongoose-lean-id/0.3.0_mongoose@6.5.0: + /mongoose-lean-id/0.3.0_mongoose@6.5.1: resolution: {integrity: sha512-/eONPzg+tA7/VR4uv0uKxKwH4OCseZShqwbMW572QvlSU0g48zDFTiDuCjZmNykfZgK3ZOwjfLVbXBAAAbXI4Q==} peerDependencies: mongoose: 4.x || 5.x || 6.x dependencies: - mongoose: 6.5.0 + mongoose: 6.5.1 dev: false - /mongoose-lean-virtuals/0.9.1_mongoose@6.5.0: + /mongoose-lean-virtuals/0.9.1_mongoose@6.5.1: resolution: {integrity: sha512-jx4rhXuaQPam/lwef3z/FfYHlKdbFkDr9Qb7JEMeoa7y4pOuyJ83RkcNL25HRaoi4Bt71zKmV1cuJdv243t9aA==} peerDependencies: mongoose: '>=5.11.10' dependencies: array.prototype.flat: 1.2.3 - mongoose: 6.5.0 + mongoose: 6.5.1 mpath: 0.8.4 dev: false @@ -6132,8 +6217,8 @@ packages: engines: {node: '>=4.0.0'} dev: false - /mongoose/6.5.0: - resolution: {integrity: sha512-swOX8ZEbmCeJaEs29B1j67StBIhuOccNNkipbVhsnLYYCDpNE7heM9W54MFGwN5es9tGGoxINHSzOhJ9kTOZGg==} + /mongoose/6.5.1: + resolution: {integrity: sha512-8C0213y279nrSp6Au+WB+l/VczcotMU65jalTJJxU6KYf/Kd8gNW9+B3giWNJOVd8VvKvUQG0suWv/Vngp/83A==} engines: {node: '>=12.0.0'} dependencies: bson: 4.6.5 @@ -6491,6 +6576,13 @@ packages: dependencies: p-limit: 2.3.0 + /p-locate/5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + dependencies: + p-limit: 3.1.0 + dev: true + /p-map/4.0.0: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} engines: {node: '>=10'} @@ -6613,25 +6705,25 @@ packages: split2: 4.1.0 dev: false - /pino-std-serializers/5.6.0: - resolution: {integrity: sha512-VdUXCw8gO+xhir7sFuoYSjTnzB+TMDGxhAC/ph3YS3sdHnXNdsK0wMtADNUltfeGkn2KDxEM21fnjF3RwXyC8A==} + /pino-std-serializers/6.0.0: + resolution: {integrity: sha512-mMMOwSKrmyl+Y12Ri2xhH1lbzQxwwpuru9VjyJpgFIH4asSj88F2csdMwN6+M5g1Ll4rmsYghHLQJw81tgZ7LQ==} dev: false - /pino/8.1.0: - resolution: {integrity: sha512-53jlxs+02UNTtF1XwVWfa0dHipBiM5GK73XhkHn8M2hUl9y3L94dNwB8BwQhpd5WdHjBkyJiO7v0LRt4SGgsPg==} + /pino/8.4.0: + resolution: {integrity: sha512-R95U66WOb4Ggtb1RPGnC2uvtc8T0i1FSbrKHrAudRtiLDrlNxKjM1MyCJu+V4gL0qdE/7/LoXAmkEY/TlX6ELA==} hasBin: true dependencies: atomic-sleep: 1.0.0 fast-redact: 3.1.1 on-exit-leak-free: 2.1.0 pino-abstract-transport: 1.0.0 - pino-std-serializers: 5.6.0 + pino-std-serializers: 6.0.0 process-warning: 2.0.0 quick-format-unescaped: 4.0.4 - real-require: 0.1.0 + real-require: 0.2.0 safe-stable-stringify: 2.3.1 - sonic-boom: 3.0.0 - thread-stream: 1.0.1 + sonic-boom: 3.2.0 + thread-stream: 2.0.1 dev: false /pirates/4.0.5: @@ -6789,7 +6881,7 @@ packages: /readable-stream/2.3.7: resolution: {integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==} dependencies: - core-util-is: 1.0.2 + core-util-is: 1.0.3 inherits: 2.0.4 isarray: 1.0.0 process-nextick-args: 2.0.1 @@ -6820,8 +6912,8 @@ packages: picomatch: 2.3.1 dev: true - /real-require/0.1.0: - resolution: {integrity: sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==} + /real-require/0.2.0: + resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==} engines: {node: '>= 12.13.0'} dev: false @@ -7047,6 +7139,10 @@ packages: resolution: {integrity: sha512-Q5Z/97nbON5t/L/sH6mY2EacfjVGwrCcSi5D3btRO2GZ8pf1K1UN7Z9H5J57hjVU2Qzxr1xO+FmBhOvEkzCMmg==} dev: false + /secure-json-parse/2.5.0: + resolution: {integrity: sha512-ZQruFgZnIWH+WyO9t5rWt4ZEGqCKPwhiw+YbzTwpmT9elgLrLcfuyUiSnwwjUiVy9r4VM3urtbNF1xmEh9IL2w==} + dev: false + /semver/7.3.7: resolution: {integrity: sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==} engines: {node: '>=10'} @@ -7085,8 +7181,8 @@ packages: resolution: {integrity: sha1-BF+XgtARrppoA93TgrJDkrPYkPc=} dev: false - /set-cookie-parser/2.5.0: - resolution: {integrity: sha512-cHMAtSXilfyBePduZEBVPTCftTQWz6ehWJD5YNUg4mqvRosrrjKbo4WS8JkB0/RxonMoohHm7cOGH60mDkRQ9w==} + /set-cookie-parser/2.5.1: + resolution: {integrity: sha512-1jeBGaKNGdEq4FgIrORu/N570dwoPYio8lSoYLWmX7sQ//0JY08Xh9o5pBcgmHQ/MbsYp/aZnOe1s1lIsbLprQ==} dev: false /setimmediate/1.0.5: @@ -7224,9 +7320,18 @@ packages: dependencies: ip: 1.1.8 smart-buffer: 4.2.0 + dev: false + optional: true - /sonic-boom/3.0.0: - resolution: {integrity: sha512-p5DiZOZHbJ2ZO5MADczp5qrfOd3W5Vr2vHxfCpe7G4AzPwVOweIjbfgku8wSQUuk+Y5Yuo8W7JqRe6XKmKistg==} + /socks/2.7.0: + resolution: {integrity: sha512-scnOe9y4VuiNUULJN72GrM26BNOjVsfPXI+j+98PkyEfsIXroa5ofyjT+FzGvn/xHs73U2JtoBYAVx9Hl4quSA==} + engines: {node: '>= 10.13.0', npm: '>= 3.0.0'} + dependencies: + ip: 2.0.0 + smart-buffer: 4.2.0 + + /sonic-boom/3.2.0: + resolution: {integrity: sha512-SbbZ+Kqj/XIunvIAgUZRlqd6CGQYq71tRRbXR92Za8J/R3Yh4Av+TWENiSiEgnlwckYLyP0YZQWVfyNC0dzLaA==} dependencies: atomic-sleep: 1.0.0 dev: false @@ -7561,10 +7666,10 @@ packages: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true - /thread-stream/1.0.1: - resolution: {integrity: sha512-JuZyfzx81e5MBk8uIr8ZH76bXyjEQvbRDEkSdlV1JFBdq/rbby2RuvzBYlTBd/xCljxy6lPxrTLXzB9Jl1bNrw==} + /thread-stream/2.0.1: + resolution: {integrity: sha512-X7vWOdsHLkBq0si20ruEE2ttpS7WOVyD52xKu+TOjrRP9Qi9uB9ynHYpzZUbBptArBSuKYUn4mH+jEBnO2CRGg==} dependencies: - real-require: 0.1.0 + real-require: 0.2.0 dev: false /through/2.3.8: @@ -7837,6 +7942,17 @@ packages: browserslist: 4.21.1 escalade: 3.1.1 picocolors: 1.0.0 + dev: true + + /update-browserslist-db/1.0.5_browserslist@4.21.3: + resolution: {integrity: sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.21.3 + escalade: 3.1.1 + picocolors: 1.0.0 /uri-js/4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} diff --git a/src/common/exceptions/ban-in-demo.exception.ts b/src/common/exceptions/ban-in-demo.exception.ts index bc404275..aedeadcf 100644 --- a/src/common/exceptions/ban-in-demo.exception.ts +++ b/src/common/exceptions/ban-in-demo.exception.ts @@ -1,6 +1,6 @@ import { ErrorCodeEnum } from '~/constants/error-code.constant' -import { BusinessException } from './business.exception' +import { BusinessException } from './biz.exception' export class BanInDemoExcpetion extends BusinessException { constructor() { diff --git a/src/common/exceptions/business.exception.ts b/src/common/exceptions/biz.exception.ts similarity index 100% rename from src/common/exceptions/business.exception.ts rename to src/common/exceptions/biz.exception.ts diff --git a/src/common/exceptions/no-content-canbe-modified.exception.ts b/src/common/exceptions/no-content-canbe-modified.exception.ts new file mode 100644 index 00000000..9a0a0963 --- /dev/null +++ b/src/common/exceptions/no-content-canbe-modified.exception.ts @@ -0,0 +1,9 @@ +import { ErrorCodeEnum } from '~/constants/error-code.constant' + +import { BizException } from './biz.exception' + +export class NoContentCanBeModifiedException extends BizException { + constructor() { + super(ErrorCodeEnum.NoContentCanBeModified) + } +} diff --git a/src/common/filters/any-exception.filter.ts b/src/common/filters/any-exception.filter.ts index e551460e..9a6471a3 100644 --- a/src/common/filters/any-exception.filter.ts +++ b/src/common/filters/any-exception.filter.ts @@ -22,7 +22,7 @@ import { isDev } from '~/global/env.global' import { EventManagerService } from '~/processors/helper/helper.event.service' import { getIp } from '../../utils/ip.util' -import { BizException } from '../exceptions/business.exception' +import { BizException } from '../exceptions/biz.exception' import { LoggingInterceptor } from '../interceptors/logging.interceptor' type myError = { diff --git a/src/constants/error-code.constant.ts b/src/constants/error-code.constant.ts index b204372a..44ebfcf0 100644 --- a/src/constants/error-code.constant.ts +++ b/src/constants/error-code.constant.ts @@ -4,6 +4,7 @@ export enum ErrorCodeEnum { BanInDemo = 'ban_in_demo', MasterLost = 'master_lost', ServerlessError = 'function_error', + NoContentCanBeModified = 'no_content_can_be_modified', } export const ErrorCode = Object.freeze>( @@ -12,5 +13,9 @@ export const ErrorCode = Object.freeze>( [ErrorCodeEnum.BanInDemo]: ['Demo 模式下此操作不可用', 400], [ErrorCodeEnum.MasterLost]: ['站点主人信息已丢失', 500], [ErrorCodeEnum.ServerlessError]: ['Function 执行报错', 500], + [ErrorCodeEnum.NoContentCanBeModified]: [ + '内容不存在,没有内容可被修改', + 400, + ], }, ) diff --git a/src/modules/comment/comment.service.ts b/src/modules/comment/comment.service.ts index a754221c..a0f9c47f 100644 --- a/src/modules/comment/comment.service.ts +++ b/src/modules/comment/comment.service.ts @@ -10,7 +10,7 @@ import { import { DocumentType } from '@typegoose/typegoose' import { BeAnObject, ReturnModelType } from '@typegoose/typegoose/lib/types' -import { BusinessException } from '~/common/exceptions/business.exception' +import { BusinessException } from '~/common/exceptions/biz.exception' import { CannotFindException } from '~/common/exceptions/cant-find.exception' import { ErrorCodeEnum } from '~/constants/error-code.constant' import { DatabaseService } from '~/processors/database/database.service' @@ -23,9 +23,6 @@ import { InjectModel } from '~/transformers/model.transformer' import { hasChinese } from '~/utils' import { ConfigsService } from '../configs/configs.service' -import { NoteModel } from '../note/note.model' -import { PageModel } from '../page/page.model' -import { PostModel } from '../post/post.model' import { ToolService } from '../tool/tool.service' import { UserService } from '../user/user.service' import BlockedKeywords from './block-keywords.json' @@ -53,17 +50,14 @@ export class CommentService { private getModelByRefType( type: CommentRefTypes, - ): ReturnModelType< - typeof NoteModel | typeof PostModel | typeof PageModel, - BeAnObject - > { + ): ReturnModelType { switch (type) { case CommentRefTypes.Note: - return this.databaseService.getModelByRefType('Note') + return this.databaseService.getModelByRefType('Note') as any case CommentRefTypes.Page: - return this.databaseService.getModelByRefType('Page') + return this.databaseService.getModelByRefType('Page') as any case CommentRefTypes.Post: - return this.databaseService.getModelByRefType('Post') + return this.databaseService.getModelByRefType('Post') as any } } diff --git a/src/modules/note/note.service.ts b/src/modules/note/note.service.ts index 6add6245..9ffbba6c 100644 --- a/src/modules/note/note.service.ts +++ b/src/modules/note/note.service.ts @@ -5,6 +5,7 @@ import { Inject, Injectable, forwardRef } from '@nestjs/common' import { DocumentType } from '@typegoose/typegoose' import { CannotFindException } from '~/common/exceptions/cant-find.exception' +import { NoContentCanBeModifiedException } from '~/common/exceptions/no-content-canbe-modified.exception' import { BusinessEvents, EventScope } from '~/constants/business-event.constant' import { EventBusEvents } from '~/constants/event-bus.constant' import { EventManagerService } from '~/processors/helper/helper.event.service' @@ -103,7 +104,14 @@ export class NoteService { this.eventManager.emit(BusinessEvents.NOTE_CREATE, doc.toJSON(), { scope: EventScope.TO_SYSTEM, }), - this.imageService.recordImageDimensions(this.noteModel, doc._id), + this.imageService.saveImageDimensionsFromMarkdownText( + doc.text, + doc.images, + (images) => { + doc.images = images + return doc.save() + }, + ), doc.hide || doc.password ? null : this.eventManager.broadcast( @@ -131,19 +139,45 @@ export class NoteService { doc.modified = new Date() } - const updated = await this.noteModel.findOneAndUpdate( - { - _id: id, - }, - { ...doc }, - { new: true }, - ) + const updated = await this.noteModel + .findOneAndUpdate( + { + _id: id, + }, + { ...doc }, + { new: true }, + ) + .lean({ + getters: true, + }) + + if (!updated) { + throw new NoContentCanBeModifiedException() + } + process.nextTick(async () => { this.eventManager.emit(EventBusEvents.CleanAggregateCache, null, { scope: EventScope.TO_SYSTEM, }) await Promise.all([ - this.imageService.recordImageDimensions(this.noteModel, id), + this.imageService.saveImageDimensionsFromMarkdownText( + updated.text, + updated.images, + (images) => { + return this.model + .updateOne( + { + _id: id, + }, + { + $set: { + images, + }, + }, + ) + .exec() + }, + ), this.model .findById(id) .lean() diff --git a/src/modules/page/page.service.ts b/src/modules/page/page.service.ts index b128e1a2..2aa11fde 100644 --- a/src/modules/page/page.service.ts +++ b/src/modules/page/page.service.ts @@ -33,11 +33,16 @@ export class PageService { slug: slugify(doc.slug), created: new Date(), }) - process.nextTick(async () => { - await Promise.all([ - this.imageService.recordImageDimensions(this.pageModel, res._id), - ]) - }) + + this.imageService.saveImageDimensionsFromMarkdownText( + doc.text, + res.images, + (images) => { + res.images = images + return res.save() + }, + ) + return res } @@ -63,7 +68,15 @@ export class PageService { process.nextTick(async () => { await Promise.all([ - this.imageService.recordImageDimensions(this.pageModel, id), + this.imageService.saveImageDimensionsFromMarkdownText( + newDoc.text, + newDoc.images, + (images) => { + return this.model + .updateOne({ _id: id }, { $set: { images } }) + .exec() + }, + ), this.eventManager.broadcast(BusinessEvents.PAGE_UPDATED, newDoc, { scope: EventScope.TO_SYSTEM, }), diff --git a/src/modules/post/post.service.ts b/src/modules/post/post.service.ts index e2cc961a..752243df 100644 --- a/src/modules/post/post.service.ts +++ b/src/modules/post/post.service.ts @@ -10,7 +10,7 @@ import { forwardRef, } from '@nestjs/common' -import { BusinessException } from '~/common/exceptions/business.exception' +import { BusinessException } from '~/common/exceptions/biz.exception' import { BusinessEvents, EventScope } from '~/constants/business-event.constant' import { ErrorCodeEnum } from '~/constants/error-code.constant' import { EventBusEvents } from '~/constants/event-bus.constant' @@ -72,6 +72,16 @@ export class PostService { }) const doc = res.toJSON() + + this.imageService.saveImageDimensionsFromMarkdownText( + doc.text, + doc.images, + (images) => { + res.images = images + return res.save() + }, + ) + process.nextTick(async () => { await Promise.all([ this.eventManager.emit(EventBusEvents.CleanAggregateCache, null, { @@ -98,11 +108,6 @@ export class PostService { scope: EventScope.TO_VISITOR, }, ), - - this.imageService.recordImageDimensions( - this.postModel as MongooseModel, - res._id, - ), ]) }) @@ -154,9 +159,13 @@ export class PostService { scope: EventScope.TO_SYSTEM, }), data.text && - this.imageService.recordImageDimensions( - this.postModel as MongooseModel, - id, + this.imageService.saveImageDimensionsFromMarkdownText( + data.text, + doc?.images, + (images) => { + oldDocument.images = images + return oldDocument.save() + }, ), doc && this.eventManager.broadcast( diff --git a/src/modules/serverless/serverless.service.ts b/src/modules/serverless/serverless.service.ts index 6cbfd738..15f8f969 100644 --- a/src/modules/serverless/serverless.service.ts +++ b/src/modules/serverless/serverless.service.ts @@ -14,7 +14,7 @@ import { } from '@nestjs/common' import { Interval } from '@nestjs/schedule' -import { BizException } from '~/common/exceptions/business.exception' +import { BizException } from '~/common/exceptions/biz.exception' import { RedisKeys } from '~/constants/cache.constant' import { ErrorCodeEnum } from '~/constants/error-code.constant' import { DATA_DIR, NODE_REQUIRE_PATH } from '~/constants/path.constant' diff --git a/src/modules/user/user.service.ts b/src/modules/user/user.service.ts index d3d6b3d7..324244a9 100644 --- a/src/modules/user/user.service.ts +++ b/src/modules/user/user.service.ts @@ -10,9 +10,8 @@ import { } from '@nestjs/common' import { ReturnModelType } from '@typegoose/typegoose' -import { BusinessException } from '~/common/exceptions/business.exception' +import { BusinessException } from '~/common/exceptions/biz.exception' import { ErrorCodeEnum } from '~/constants/error-code.constant' -import { CacheService } from '~/processors/redis/cache.service' import { InjectModel } from '~/transformers/model.transformer' import { getAvatar, sleep } from '~/utils' @@ -26,7 +25,6 @@ export class UserService { @InjectModel(UserModel) private readonly userModel: ReturnModelType, private readonly authService: AuthService, - private readonly redis: CacheService, ) {} public get model() { return this.userModel diff --git a/src/processors/helper/helper.image.service.ts b/src/processors/helper/helper.image.service.ts index 1843dc7e..452b20bd 100644 --- a/src/processors/helper/helper.image.service.ts +++ b/src/processors/helper/helper.image.service.ts @@ -1,15 +1,9 @@ import imageSize from 'image-size' -import { - Injectable, - InternalServerErrorException, - Logger, -} from '@nestjs/common' -import { ReturnModelType } from '@typegoose/typegoose' +import { Injectable, Logger } from '@nestjs/common' import { ConfigsService } from '~/modules/configs/configs.service' -import { TextImageRecordType } from '~/shared/model/base.model' -import { WriteBaseModel } from '~/shared/model/write-base.model' +import { ImageModel } from '~/shared/model/image.model' import { getAverageRGB, pickImagesFromMarkdown } from '~/utils/pic.util' import { HttpService } from './helper.http.service' @@ -24,25 +18,19 @@ export class ImageService { this.logger = new Logger(ImageService.name) } - async recordImageDimensions( - _model: MongooseModel, - id: string, + async saveImageDimensionsFromMarkdownText( + text: string, + originImages: ImageModel[] | undefined, + updateFn: (images: ImageModel[]) => Promise, ) { - const model = _model as any as ReturnModelType - const document = await model.findById(id).lean() - if (!document) { - throw new InternalServerErrorException( - `document not found, can not record image dimensions`, - ) - } - const { text } = document const newImages = pickImagesFromMarkdown(text) - const result = [] as TextImageRecordType[] + const result = [] as ImageModel[] - const oldImages = document.images || [] - const oldImagesMap = new Map(oldImages.map((image) => [image.src, image])) - const task = [] as Promise[] + const oldImagesMap = new Map( + (originImages ?? []).map((image) => [image.src, image]), + ) + const task = [] as Promise[] for (const src of newImages) { const originImage = oldImagesMap.get(src) const keys = new Set(Object.keys(originImage || {})) @@ -58,7 +46,7 @@ export class ImageService { result.push(originImage) continue } - const promise = new Promise((resolve) => { + const promise = new Promise((resolve) => { this.logger.log(`Get --> ${src}`) this.getOnlineImageSizeAndMeta(src) .then(({ size, accent }) => { @@ -91,11 +79,7 @@ export class ImageService { const images = await Promise.all(task) result.push(...images) - await model.updateOne( - { _id: id }, - // 过滤多余的 - { images: result.filter(({ src }) => newImages.includes(src!)) }, - ) + await updateFn(result.filter(({ src }) => newImages.includes(src!))) } getOnlineImageSizeAndMeta = async (image: string) => { diff --git a/src/shared/model/base.model.ts b/src/shared/model/base.model.ts index 21493b6c..788a73cc 100644 --- a/src/shared/model/base.model.ts +++ b/src/shared/model/base.model.ts @@ -5,8 +5,6 @@ import Paginate from 'mongoose-paginate-v2' import { ApiHideProperty } from '@nestjs/swagger' import { index, modelOptions, plugin } from '@typegoose/typegoose' -import { ImageModel } from './image.model' - const mongooseLeanGetters = require('mongoose-lean-getters') @plugin(mongooseLeanVirtuals) @plugin(Paginate) @@ -36,5 +34,3 @@ export class BaseModel { return ['created', 'id', '_id'] } } - -export type { ImageModel as TextImageRecordType }