diff --git a/notifications.yml b/notifications.yml index 282c8952..ce08fc08 100644 --- a/notifications.yml +++ b/notifications.yml @@ -191,3 +191,32 @@ recipients: - rule: type: USER_SELF_MANAGEMENT resource_id: + aspect_created: + - name: admin + rules: + - rule: + type: HUB_ADMIN + resource_id: + - rule: + type: CHALLENGE_ADMIN + resource_id: + - rule: + type: OPPORTUNITY_ADMIN + resource_id: + - name: user + rules: + - rule: + type: HUB_MEMBER + resource_id: + - rule: + type: CHALLENGE_MEMBER + resource_id: + - rule: + type: OPPORTUNITY_MEMBER + resource_id: + aspect_comment_created: + - name: owner + rules: + - rule: + type: USER_SELF_MANAGEMENT + resource_id: diff --git a/package-lock.json b/package-lock.json index 706e2f16..fd879d75 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.5.5", "license": "EUPL-1.2", "dependencies": { - "@alkemio/client-lib": "^0.13.2", + "@alkemio/client-lib": "^0.14.4", "@nestjs/axios": "^0.0.1", "@nestjs/common": "^8.0.5", "@nestjs/config": "^1.0.1", @@ -74,9 +74,9 @@ } }, "node_modules/@alkemio/client-lib": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@alkemio/client-lib/-/client-lib-0.13.2.tgz", - "integrity": "sha512-NHhY/hdM9Gn5AfvDIDesDTYRIyNmGsyvVHNTF6Tn97H/cWf1m/+5A7qGtJH9uZBuhQSSBrUsS7zzXvlkVzdn2w==", + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/@alkemio/client-lib/-/client-lib-0.14.4.tgz", + "integrity": "sha512-HuyIwfOAzOZqxdVhB7tPVpV/u0VP22kMYAa9eEifitukC+FhBBCzxWjAcFeqzEETNBFXHxOJmZK3PGzyV+uD7A==", "dependencies": { "axios": "^0.21.1", "dotenv": "^8.2.0", @@ -89,8 +89,8 @@ "winston": "^3.6.0" }, "engines": { - "node": ">=14.17.3", - "npm": ">=7" + "node": ">=16.15.0", + "npm": ">=8.5.5" } }, "node_modules/@alkemio/client-lib/node_modules/dotenv": { @@ -102,9 +102,9 @@ } }, "node_modules/@alkemio/client-lib/node_modules/winston": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.6.0.tgz", - "integrity": "sha512-9j8T75p+bcN6D00sF/zjFVmPp+t8KMPB1MzbbzYjeN9VWxdsYnTB40TkbNUEXAmILEfChMvAMgidlX64OG3p6w==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.7.2.tgz", + "integrity": "sha512-QziIqtojHBoyzUOdQvQiar1DH0Xp9nF1A1y7NVy2DGEsz82SBDtOalS0ulTRGVT14xPX3WRWkCsdcJKqNflKng==", "dependencies": { "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", @@ -122,9 +122,9 @@ } }, "node_modules/@angular-devkit/core": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-13.3.0.tgz", - "integrity": "sha512-8YrreVbWlJVZnk5zs4vfkRItrPEtWhUcxWOBfYT/Kwu4FwJVAnNuhJAxxXOAQ2Ckd7cv30Idh/RFVLbTZ5Gs9w==", + "version": "13.3.5", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-13.3.5.tgz", + "integrity": "sha512-w7vzK4VoYP9rLgxJ2SwEfrkpKybdD+QgQZlsDBzT0C6Ebp7b4gkNcNVFo8EiZvfDl6Yplw2IAP7g7fs3STn0hQ==", "dev": true, "dependencies": { "ajv": "8.9.0", @@ -189,12 +189,12 @@ "dev": true }, "node_modules/@angular-devkit/schematics": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-13.3.0.tgz", - "integrity": "sha512-hq7tqnB3uVT/iDgqWWZ4kvnijeAcgd4cfLzZiCPaYn1nuhZf0tWsho6exhJ/odMZHvVp7w8OibqWiUKxNY9zHA==", + "version": "13.3.5", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-13.3.5.tgz", + "integrity": "sha512-0N/kL/Vfx0yVAEwa3HYxNx9wYb+G9r1JrLjJQQzDp+z9LtcojNf7j3oey6NXrDUs1WjVZOa/AIdRl3/DuaoG5w==", "dev": true, "dependencies": { - "@angular-devkit/core": "13.3.0", + "@angular-devkit/core": "13.3.5", "jsonc-parser": "3.0.0", "magic-string": "0.25.7", "ora": "5.4.1", @@ -207,16 +207,16 @@ } }, "node_modules/@angular-devkit/schematics-cli": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@angular-devkit/schematics-cli/-/schematics-cli-13.3.0.tgz", - "integrity": "sha512-DXT+k4228Ke1zCoU9QxPhXm1xzeYBs5aqgMWhyjXdkfDokJcjQM79CSVLHdKX/OLgR51qhnQ5qVFEHHhVV40EQ==", + "version": "13.3.5", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics-cli/-/schematics-cli-13.3.5.tgz", + "integrity": "sha512-ARX20ebtfwzef8GdXIcB6uv0sjTsaEniZyXBFchEKD6kR5EYZVaBL+ZVUbmsU1d0XY///WzW7pqwCyu5H1u+vw==", "dev": true, "dependencies": { - "@angular-devkit/core": "13.3.0", - "@angular-devkit/schematics": "13.3.0", + "@angular-devkit/core": "13.3.5", + "@angular-devkit/schematics": "13.3.5", "ansi-colors": "4.1.1", "inquirer": "8.2.0", - "minimist": "1.2.5", + "minimist": "1.2.6", "symbol-observable": "4.0.0" }, "bin": { @@ -2194,20 +2194,20 @@ } }, "node_modules/@nestjs/cli": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/@nestjs/cli/-/cli-8.2.4.tgz", - "integrity": "sha512-9zNV9oMtaz1vwLO3WXviD0wzRpyiaLWJZ7KCIZLk62U22RDNRsbtLLDS52Wkig5L8UU7Z1xRfrEv+s3f9keysQ==", + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/@nestjs/cli/-/cli-8.2.6.tgz", + "integrity": "sha512-uvwKbUZJmgdJu1D24e+uUqHnwoB/0R9hLfUJjr5pTvLlP/RJugHAdJr7m1dQe92Xzdyi36kBN4Id3RXHgfz1UA==", "dev": true, "dependencies": { - "@angular-devkit/core": "13.3.0", - "@angular-devkit/schematics": "13.3.0", - "@angular-devkit/schematics-cli": "13.3.0", + "@angular-devkit/core": "13.3.5", + "@angular-devkit/schematics": "13.3.5", + "@angular-devkit/schematics-cli": "13.3.5", "@nestjs/schematics": "^8.0.3", "chalk": "3.0.0", "chokidar": "3.5.3", - "cli-table3": "0.6.1", + "cli-table3": "0.6.2", "commander": "4.1.1", - "fork-ts-checker-webpack-plugin": "7.2.1", + "fork-ts-checker-webpack-plugin": "7.2.11", "inquirer": "7.3.3", "node-emoji": "1.11.0", "ora": "5.4.1", @@ -2216,10 +2216,10 @@ "shelljs": "0.8.5", "source-map-support": "0.5.21", "tree-kill": "1.2.2", - "tsconfig-paths": "3.14.0", + "tsconfig-paths": "3.14.1", "tsconfig-paths-webpack-plugin": "3.5.2", - "typescript": "4.6.2", - "webpack": "5.70.0", + "typescript": "4.6.4", + "webpack": "5.72.1", "webpack-node-externals": "3.0.0" }, "bin": { @@ -2849,9 +2849,9 @@ "dev": true }, "node_modules/@types/eslint": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz", - "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==", + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.2.tgz", + "integrity": "sha512-Z1nseZON+GEnFjJc04sv4NSALGjhFwy6K0HXt7qsn5ArfAKtb63dXNJHf+1YW6IpOIYRBGUbu3GwJdj8DGnCjA==", "dev": true, "dependencies": { "@types/estree": "*", @@ -4717,7 +4717,7 @@ "node_modules/cheerio": { "version": "0.22.0", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", - "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", + "integrity": "sha512-8/MzidM6G/TgRelkzDG13y3Y9LxBjCb+8yOEZ9+wwq5gVF2w2pV0wmHvjfT0RvuxGyR7UEuK36r+yYMbT4uKgA==", "optional": true, "dependencies": { "css-select": "~1.2.0", @@ -4861,9 +4861,9 @@ } }, "node_modules/cli-table3": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.1.tgz", - "integrity": "sha512-w0q/enDHhPLq44ovMGdQeeDLvwxwavsJX7oQGYt/LrBlYsyaxyDnp6z3QzFut/6kLLKnlcUVJLrpB7KBfgG/RA==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.2.tgz", + "integrity": "sha512-QyavHCaIC80cMivimWu4aWHilIpiDpfm3hGmqAmXVL1UsnbLuBSMd21hTX6VY4ZSDSM73ESLeF8TOYId3rBTbw==", "dev": true, "dependencies": { "string-width": "^4.2.0" @@ -4872,7 +4872,7 @@ "node": "10.* || >= 12.*" }, "optionalDependencies": { - "colors": "1.4.0" + "@colors/colors": "1.5.0" } }, "node_modules/cli-truncate": { @@ -4997,16 +4997,6 @@ "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", "dev": true }, - "node_modules/colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/colorspace": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.2.tgz", @@ -6126,9 +6116,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.9.2", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.9.2.tgz", - "integrity": "sha512-GIm3fQfwLJ8YZx2smuHpBKkXC1yOk+OBEmKckVyL0i/ea8mqDEykK3ld5dgH1QYPNyT/lIllxV2LULnxCHaHkA==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.9.3.tgz", + "integrity": "sha512-Bq9VSor+kjvW3f9/MiiR4eE3XYgOl7/rS8lnSxbRbF3kS0B2r+Y9w5krBWxZgDxASVZbdYrn5wT4j/Wb0J9qow==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -7447,9 +7437,9 @@ } }, "node_modules/fork-ts-checker-webpack-plugin": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-7.2.1.tgz", - "integrity": "sha512-uOfQdg/iQ8iokQ64qcbu8iZb114rOmaKLQFu7hU14/eJaKgsP91cQ7ts7v2iiDld6TzDe84Meksha8/MkWiCyw==", + "version": "7.2.11", + "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-7.2.11.tgz", + "integrity": "sha512-2e5+NyTUTE1Xq4fWo7KFEQblCaIvvINQwUX3jRmEGlgCTc1Ecqw/975EfQrQ0GEraxJTnp8KB9d/c8hlCHUMJA==", "dev": true, "dependencies": { "@babel/code-frame": "^7.16.7", @@ -7460,7 +7450,7 @@ "fs-extra": "^10.0.0", "memfs": "^3.4.1", "minimatch": "^3.0.4", - "schema-utils": "4.0.0", + "schema-utils": "^3.1.1", "semver": "^7.3.5", "tapable": "^2.2.1" }, @@ -7821,16 +7811,16 @@ } }, "node_modules/graphql-request": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-3.6.1.tgz", - "integrity": "sha512-Nm1EasrAQVZllyNTlHDLnLZjlhC6eRWnWP6KH//ytnAL08pjlLkdI2K+s6OV92p45hn5b/kUlLbDwACmRoLwrQ==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-3.7.0.tgz", + "integrity": "sha512-dw5PxHCgBneN2DDNqpWu8QkbbJ07oOziy8z+bK/TAXufsOLaETuVO4GkXrbs0WjhdKhBMN3BkpN/RIvUHkmNUQ==", "dependencies": { "cross-fetch": "^3.0.6", "extract-files": "^9.0.0", "form-data": "^3.0.0" }, "peerDependencies": { - "graphql": "14.x || 15.x" + "graphql": "14 - 16" } }, "node_modules/graphql-tag": { @@ -11490,9 +11480,9 @@ } }, "node_modules/loader-runner": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", - "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", "dev": true, "engines": { "node": ">=6.11.5" @@ -11927,9 +11917,9 @@ } }, "node_modules/memfs": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.1.tgz", - "integrity": "sha512-1c9VPVvW5P7I85c35zAdEr1TD5+F11IToIHIlrVIcflfnzPkJa0ZoYEoEdYDP8KgPFoSZ/opDrUsAoZWym3mtw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.3.tgz", + "integrity": "sha512-eivjfi7Ahr6eQTn44nvTnR60e4a1Fs1Via2kCR5lHo/kyNoiMWaXCNJ/GpSd0ilXas2JSOl9B5FTIhflXu0hlg==", "dev": true, "dependencies": { "fs-monkey": "1.0.3" @@ -12087,9 +12077,9 @@ } }, "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "node_modules/mkdirp": { "version": "0.5.5", @@ -12520,7 +12510,7 @@ "node_modules/notification-catcher/node_modules/accepts": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz", - "integrity": "sha1-5fHzkoxtlf2WVYw27D2dDeSm7Oo=", + "integrity": "sha512-R190A3EzrS4huFOVZajhXCYZt5p5yrkaQOB4nsWzfth0cYaDcSN5J86l58FJ1dt7igp37fB/QhnuFkGAJmr+eg==", "dev": true, "dependencies": { "mime-types": "~2.1.6", @@ -12533,7 +12523,7 @@ "node_modules/notification-catcher/node_modules/async": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/async/-/async-1.5.1.tgz", - "integrity": "sha1-sFcU9LEbNXv3mtr/3QbaQtB2bBA=", + "integrity": "sha512-xpP8QJKDlqOhumIYy3wTwSAT6Pyw6+dK3KEG5JYq6dCY6HXP+Ykh3gnj+JI11HxnAjFQlG7ovtHmiukkTYHIkg==", "dev": true }, "node_modules/notification-catcher/node_modules/commander": { @@ -14305,58 +14295,23 @@ } }, "node_modules/schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" }, "engines": { - "node": ">= 12.13.0" + "node": ">= 10.13.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" } }, - "node_modules/schema-utils/node_modules/ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/schema-utils/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/schema-utils/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, "node_modules/secure-json-parse": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.4.0.tgz", @@ -15407,14 +15362,14 @@ } }, "node_modules/terser": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz", - "integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==", + "version": "5.13.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.13.1.tgz", + "integrity": "sha512-hn4WKOfwnwbYfe48NgrQjqNOH9jzLqRcIfbYytOXCOv46LBfWr9bDS17MQqOi+BWGD0sJK3Sj5NC/gJjiojaoA==", "dev": true, "dependencies": { "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", + "source-map": "~0.8.0-beta.0", "source-map-support": "~0.5.20" }, "bin": { @@ -15458,24 +15413,6 @@ } } }, - "node_modules/terser-webpack-plugin/node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, "node_modules/terser-webpack-plugin/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -15486,9 +15423,9 @@ } }, "node_modules/terser/node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -15503,6 +15440,44 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "node_modules/terser/node_modules/source-map": { + "version": "0.8.0-beta.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", + "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", + "dev": true, + "dependencies": { + "whatwg-url": "^7.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/terser/node_modules/tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/terser/node_modules/webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "node_modules/terser/node_modules/whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -15804,14 +15779,14 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.0.tgz", - "integrity": "sha512-cg/1jAZoL57R39+wiw4u/SCC6Ic9Q5NqjBOb+9xISedOYurfog9ZNmKJSxAnb2m/5Bq4lE9lhUcau33Ml8DM0g==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", "dev": true, "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.1", - "minimist": "^1.2.0", + "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, @@ -15965,9 +15940,9 @@ } }, "node_modules/typescript": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz", - "integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==", + "version": "4.6.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz", + "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -16527,9 +16502,9 @@ } }, "node_modules/webpack": { - "version": "5.70.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.70.0.tgz", - "integrity": "sha512-ZMWWy8CeuTTjCxbeaQI21xSswseF2oNOwc70QSKNePvmxE7XW36i7vpBMYZFAUHPwQiEbNGCEYIOOlyRbdGmxw==", + "version": "5.72.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.72.1.tgz", + "integrity": "sha512-dXG5zXCLspQR4krZVR6QgajnZOjW2K/djHvdcRaDQvsjV9z9vaW6+ja5dZOYbqBBjF6kGXka/2ZyxNdc+8Jung==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", @@ -16541,13 +16516,13 @@ "acorn-import-assertions": "^1.7.6", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.9.2", + "enhanced-resolve": "^5.9.3", "es-module-lexer": "^0.9.0", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.2.9", - "json-parse-better-errors": "^1.0.2", + "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", @@ -16592,9 +16567,9 @@ } }, "node_modules/webpack/node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -16612,24 +16587,6 @@ "acorn": "^8" } }, - "node_modules/webpack/node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, "node_modules/whatwg-encoding": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", @@ -16983,9 +16940,9 @@ }, "dependencies": { "@alkemio/client-lib": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@alkemio/client-lib/-/client-lib-0.13.2.tgz", - "integrity": "sha512-NHhY/hdM9Gn5AfvDIDesDTYRIyNmGsyvVHNTF6Tn97H/cWf1m/+5A7qGtJH9uZBuhQSSBrUsS7zzXvlkVzdn2w==", + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/@alkemio/client-lib/-/client-lib-0.14.4.tgz", + "integrity": "sha512-HuyIwfOAzOZqxdVhB7tPVpV/u0VP22kMYAa9eEifitukC+FhBBCzxWjAcFeqzEETNBFXHxOJmZK3PGzyV+uD7A==", "requires": { "axios": "^0.21.1", "dotenv": "^8.2.0", @@ -17004,9 +16961,9 @@ "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==" }, "winston": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.6.0.tgz", - "integrity": "sha512-9j8T75p+bcN6D00sF/zjFVmPp+t8KMPB1MzbbzYjeN9VWxdsYnTB40TkbNUEXAmILEfChMvAMgidlX64OG3p6w==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.7.2.tgz", + "integrity": "sha512-QziIqtojHBoyzUOdQvQiar1DH0Xp9nF1A1y7NVy2DGEsz82SBDtOalS0ulTRGVT14xPX3WRWkCsdcJKqNflKng==", "requires": { "@dabh/diagnostics": "^2.0.2", "async": "^3.2.3", @@ -17023,9 +16980,9 @@ } }, "@angular-devkit/core": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-13.3.0.tgz", - "integrity": "sha512-8YrreVbWlJVZnk5zs4vfkRItrPEtWhUcxWOBfYT/Kwu4FwJVAnNuhJAxxXOAQ2Ckd7cv30Idh/RFVLbTZ5Gs9w==", + "version": "13.3.5", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-13.3.5.tgz", + "integrity": "sha512-w7vzK4VoYP9rLgxJ2SwEfrkpKybdD+QgQZlsDBzT0C6Ebp7b4gkNcNVFo8EiZvfDl6Yplw2IAP7g7fs3STn0hQ==", "dev": true, "requires": { "ajv": "8.9.0", @@ -17072,12 +17029,12 @@ } }, "@angular-devkit/schematics": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-13.3.0.tgz", - "integrity": "sha512-hq7tqnB3uVT/iDgqWWZ4kvnijeAcgd4cfLzZiCPaYn1nuhZf0tWsho6exhJ/odMZHvVp7w8OibqWiUKxNY9zHA==", + "version": "13.3.5", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-13.3.5.tgz", + "integrity": "sha512-0N/kL/Vfx0yVAEwa3HYxNx9wYb+G9r1JrLjJQQzDp+z9LtcojNf7j3oey6NXrDUs1WjVZOa/AIdRl3/DuaoG5w==", "dev": true, "requires": { - "@angular-devkit/core": "13.3.0", + "@angular-devkit/core": "13.3.5", "jsonc-parser": "3.0.0", "magic-string": "0.25.7", "ora": "5.4.1", @@ -17102,16 +17059,16 @@ } }, "@angular-devkit/schematics-cli": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/@angular-devkit/schematics-cli/-/schematics-cli-13.3.0.tgz", - "integrity": "sha512-DXT+k4228Ke1zCoU9QxPhXm1xzeYBs5aqgMWhyjXdkfDokJcjQM79CSVLHdKX/OLgR51qhnQ5qVFEHHhVV40EQ==", + "version": "13.3.5", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics-cli/-/schematics-cli-13.3.5.tgz", + "integrity": "sha512-ARX20ebtfwzef8GdXIcB6uv0sjTsaEniZyXBFchEKD6kR5EYZVaBL+ZVUbmsU1d0XY///WzW7pqwCyu5H1u+vw==", "dev": true, "requires": { - "@angular-devkit/core": "13.3.0", - "@angular-devkit/schematics": "13.3.0", + "@angular-devkit/core": "13.3.5", + "@angular-devkit/schematics": "13.3.5", "ansi-colors": "4.1.1", "inquirer": "8.2.0", - "minimist": "1.2.5", + "minimist": "1.2.6", "symbol-observable": "4.0.0" }, "dependencies": { @@ -18667,20 +18624,20 @@ } }, "@nestjs/cli": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/@nestjs/cli/-/cli-8.2.4.tgz", - "integrity": "sha512-9zNV9oMtaz1vwLO3WXviD0wzRpyiaLWJZ7KCIZLk62U22RDNRsbtLLDS52Wkig5L8UU7Z1xRfrEv+s3f9keysQ==", + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/@nestjs/cli/-/cli-8.2.6.tgz", + "integrity": "sha512-uvwKbUZJmgdJu1D24e+uUqHnwoB/0R9hLfUJjr5pTvLlP/RJugHAdJr7m1dQe92Xzdyi36kBN4Id3RXHgfz1UA==", "dev": true, "requires": { - "@angular-devkit/core": "13.3.0", - "@angular-devkit/schematics": "13.3.0", - "@angular-devkit/schematics-cli": "13.3.0", + "@angular-devkit/core": "13.3.5", + "@angular-devkit/schematics": "13.3.5", + "@angular-devkit/schematics-cli": "13.3.5", "@nestjs/schematics": "^8.0.3", "chalk": "3.0.0", "chokidar": "3.5.3", - "cli-table3": "0.6.1", + "cli-table3": "0.6.2", "commander": "4.1.1", - "fork-ts-checker-webpack-plugin": "7.2.1", + "fork-ts-checker-webpack-plugin": "7.2.11", "inquirer": "7.3.3", "node-emoji": "1.11.0", "ora": "5.4.1", @@ -18689,10 +18646,10 @@ "shelljs": "0.8.5", "source-map-support": "0.5.21", "tree-kill": "1.2.2", - "tsconfig-paths": "3.14.0", + "tsconfig-paths": "3.14.1", "tsconfig-paths-webpack-plugin": "3.5.2", - "typescript": "4.6.2", - "webpack": "5.70.0", + "typescript": "4.6.4", + "webpack": "5.72.1", "webpack-node-externals": "3.0.0" } }, @@ -19136,9 +19093,9 @@ "dev": true }, "@types/eslint": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz", - "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==", + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.2.tgz", + "integrity": "sha512-Z1nseZON+GEnFjJc04sv4NSALGjhFwy6K0HXt7qsn5ArfAKtb63dXNJHf+1YW6IpOIYRBGUbu3GwJdj8DGnCjA==", "dev": true, "requires": { "@types/estree": "*", @@ -20629,7 +20586,7 @@ "cheerio": { "version": "0.22.0", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", - "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", + "integrity": "sha512-8/MzidM6G/TgRelkzDG13y3Y9LxBjCb+8yOEZ9+wwq5gVF2w2pV0wmHvjfT0RvuxGyR7UEuK36r+yYMbT4uKgA==", "optional": true, "requires": { "css-select": "~1.2.0", @@ -20735,12 +20692,12 @@ "dev": true }, "cli-table3": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.1.tgz", - "integrity": "sha512-w0q/enDHhPLq44ovMGdQeeDLvwxwavsJX7oQGYt/LrBlYsyaxyDnp6z3QzFut/6kLLKnlcUVJLrpB7KBfgG/RA==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.2.tgz", + "integrity": "sha512-QyavHCaIC80cMivimWu4aWHilIpiDpfm3hGmqAmXVL1UsnbLuBSMd21hTX6VY4ZSDSM73ESLeF8TOYId3rBTbw==", "dev": true, "requires": { - "colors": "1.4.0", + "@colors/colors": "1.5.0", "string-width": "^4.2.0" } }, @@ -20849,13 +20806,6 @@ "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", "dev": true }, - "colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "dev": true, - "optional": true - }, "colorspace": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.2.tgz", @@ -21793,9 +21743,9 @@ } }, "enhanced-resolve": { - "version": "5.9.2", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.9.2.tgz", - "integrity": "sha512-GIm3fQfwLJ8YZx2smuHpBKkXC1yOk+OBEmKckVyL0i/ea8mqDEykK3ld5dgH1QYPNyT/lIllxV2LULnxCHaHkA==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.9.3.tgz", + "integrity": "sha512-Bq9VSor+kjvW3f9/MiiR4eE3XYgOl7/rS8lnSxbRbF3kS0B2r+Y9w5krBWxZgDxASVZbdYrn5wT4j/Wb0J9qow==", "dev": true, "requires": { "graceful-fs": "^4.2.4", @@ -22829,9 +22779,9 @@ "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, "fork-ts-checker-webpack-plugin": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-7.2.1.tgz", - "integrity": "sha512-uOfQdg/iQ8iokQ64qcbu8iZb114rOmaKLQFu7hU14/eJaKgsP91cQ7ts7v2iiDld6TzDe84Meksha8/MkWiCyw==", + "version": "7.2.11", + "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-7.2.11.tgz", + "integrity": "sha512-2e5+NyTUTE1Xq4fWo7KFEQblCaIvvINQwUX3jRmEGlgCTc1Ecqw/975EfQrQ0GEraxJTnp8KB9d/c8hlCHUMJA==", "dev": true, "requires": { "@babel/code-frame": "^7.16.7", @@ -22842,7 +22792,7 @@ "fs-extra": "^10.0.0", "memfs": "^3.4.1", "minimatch": "^3.0.4", - "schema-utils": "4.0.0", + "schema-utils": "^3.1.1", "semver": "^7.3.5", "tapable": "^2.2.1" }, @@ -23108,9 +23058,9 @@ "integrity": "sha512-WJR872Zlc9hckiEPhXgyUftXH48jp2EjO5tgBBOyNMRJZ9fviL2mJBD6CAysk6N5S0r9BTs09Qk39nnJBkvOXQ==" }, "graphql-request": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-3.6.1.tgz", - "integrity": "sha512-Nm1EasrAQVZllyNTlHDLnLZjlhC6eRWnWP6KH//ytnAL08pjlLkdI2K+s6OV92p45hn5b/kUlLbDwACmRoLwrQ==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/graphql-request/-/graphql-request-3.7.0.tgz", + "integrity": "sha512-dw5PxHCgBneN2DDNqpWu8QkbbJ07oOziy8z+bK/TAXufsOLaETuVO4GkXrbs0WjhdKhBMN3BkpN/RIvUHkmNUQ==", "requires": { "cross-fetch": "^3.0.6", "extract-files": "^9.0.0", @@ -25957,9 +25907,9 @@ } }, "loader-runner": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", - "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", "dev": true }, "locate-path": { @@ -26323,9 +26273,9 @@ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, "memfs": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.1.tgz", - "integrity": "sha512-1c9VPVvW5P7I85c35zAdEr1TD5+F11IToIHIlrVIcflfnzPkJa0ZoYEoEdYDP8KgPFoSZ/opDrUsAoZWym3mtw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.3.tgz", + "integrity": "sha512-eivjfi7Ahr6eQTn44nvTnR60e4a1Fs1Via2kCR5lHo/kyNoiMWaXCNJ/GpSd0ilXas2JSOl9B5FTIhflXu0hlg==", "dev": true, "requires": { "fs-monkey": "1.0.3" @@ -26443,9 +26393,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "mkdirp": { "version": "0.5.5", @@ -26807,7 +26757,7 @@ "accepts": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz", - "integrity": "sha1-5fHzkoxtlf2WVYw27D2dDeSm7Oo=", + "integrity": "sha512-R190A3EzrS4huFOVZajhXCYZt5p5yrkaQOB4nsWzfth0cYaDcSN5J86l58FJ1dt7igp37fB/QhnuFkGAJmr+eg==", "dev": true, "requires": { "mime-types": "~2.1.6", @@ -26817,7 +26767,7 @@ "async": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/async/-/async-1.5.1.tgz", - "integrity": "sha1-sFcU9LEbNXv3mtr/3QbaQtB2bBA=", + "integrity": "sha512-xpP8QJKDlqOhumIYy3wTwSAT6Pyw6+dK3KEG5JYq6dCY6HXP+Ykh3gnj+JI11HxnAjFQlG7ovtHmiukkTYHIkg==", "dev": true }, "commander": { @@ -28182,44 +28132,14 @@ } }, "schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "requires": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" - }, - "dependencies": { - "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.3" - } - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - } + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" } }, "secure-json-parse": { @@ -29087,21 +29007,21 @@ } }, "terser": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz", - "integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==", + "version": "5.13.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.13.1.tgz", + "integrity": "sha512-hn4WKOfwnwbYfe48NgrQjqNOH9jzLqRcIfbYytOXCOv46LBfWr9bDS17MQqOi+BWGD0sJK3Sj5NC/gJjiojaoA==", "dev": true, "requires": { "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", + "source-map": "~0.8.0-beta.0", "source-map-support": "~0.5.20" }, "dependencies": { "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true }, "commander": { @@ -29109,6 +29029,41 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true + }, + "source-map": { + "version": "0.8.0-beta.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", + "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", + "dev": true, + "requires": { + "whatwg-url": "^7.0.0" + } + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } } } }, @@ -29125,17 +29080,6 @@ "terser": "^5.7.2" }, "dependencies": { - "schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -29358,14 +29302,14 @@ } }, "tsconfig-paths": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.0.tgz", - "integrity": "sha512-cg/1jAZoL57R39+wiw4u/SCC6Ic9Q5NqjBOb+9xISedOYurfog9ZNmKJSxAnb2m/5Bq4lE9lhUcau33Ml8DM0g==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", "dev": true, "requires": { "@types/json5": "^0.0.29", "json5": "^1.0.1", - "minimist": "^1.2.0", + "minimist": "^1.2.6", "strip-bom": "^3.0.0" }, "dependencies": { @@ -29492,9 +29436,9 @@ } }, "typescript": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz", - "integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==", + "version": "4.6.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz", + "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==", "dev": true }, "ultron": { @@ -29949,9 +29893,9 @@ "dev": true }, "webpack": { - "version": "5.70.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.70.0.tgz", - "integrity": "sha512-ZMWWy8CeuTTjCxbeaQI21xSswseF2oNOwc70QSKNePvmxE7XW36i7vpBMYZFAUHPwQiEbNGCEYIOOlyRbdGmxw==", + "version": "5.72.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.72.1.tgz", + "integrity": "sha512-dXG5zXCLspQR4krZVR6QgajnZOjW2K/djHvdcRaDQvsjV9z9vaW6+ja5dZOYbqBBjF6kGXka/2ZyxNdc+8Jung==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.3", @@ -29963,13 +29907,13 @@ "acorn-import-assertions": "^1.7.6", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.9.2", + "enhanced-resolve": "^5.9.3", "es-module-lexer": "^0.9.0", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.2.9", - "json-parse-better-errors": "^1.0.2", + "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", @@ -29981,9 +29925,9 @@ }, "dependencies": { "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true }, "acorn-import-assertions": { @@ -29992,17 +29936,6 @@ "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", "dev": true, "requires": {} - }, - "schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } } } }, diff --git a/package.json b/package.json index cd0c2ae7..91587186 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "validate-connection": "ts-node src/utils/validate-connection.ts" }, "dependencies": { - "@alkemio/client-lib": "^0.13.2", + "@alkemio/client-lib": "^0.14.4", "@nestjs/axios": "^0.0.1", "@nestjs/common": "^8.0.5", "@nestjs/config": "^1.0.1", diff --git a/src/app.controller.ts b/src/app.controller.ts index f8fc776a..19a902f4 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -1,10 +1,18 @@ import { Controller, Inject, LoggerService } from '@nestjs/common'; -import { Ctx, EventPattern, Payload, RmqContext } from '@nestjs/microservices'; +import { + Ctx, + EventPattern, + Payload, + RmqContext, + Transport, +} from '@nestjs/microservices'; import { WINSTON_MODULE_NEST_PROVIDER } from 'nest-winston'; import { Channel, Message } from 'amqplib'; import { NotificationStatus } from 'notifme-sdk'; import { ALKEMIO_CLIENT_ADAPTER, + ASPECT_CREATED, + COMMENT_CREATED_ON_ASPECT, COMMUNICATION_DISCUSSION_CREATED, COMMUNICATION_UPDATE_SENT, COMMUNITY_APPLICATION_CREATED, @@ -16,11 +24,13 @@ import { import { IFeatureFlagProvider } from '@core/contracts'; import { ApplicationCreatedEventPayload, - CommunicationUpdateEventPayload, + AspectCommentCreatedEventPayload, + AspectCreatedEventPayload, CommunicationDiscussionCreatedEventPayload, + CommunicationUpdateEventPayload, CommunityContextReviewSubmittedPayload, - UserRegistrationEventPayload, CommunityNewMemberPayload, + UserRegistrationEventPayload, } from '@common/dto'; import { NotificationService } from './services/domain/notification/notification.service'; @@ -127,6 +137,34 @@ export class AppController { ); } + @EventPattern(ASPECT_CREATED, Transport.RMQ) + async sendAspectCreatedNotifications( + @Payload() eventPayload: AspectCreatedEventPayload, + @Ctx() context: RmqContext + ) { + this.sendNotifications( + eventPayload, + context, + this.notificationService.sendAspectCreatedNotification(eventPayload), + ASPECT_CREATED + ); + } + + @EventPattern(COMMENT_CREATED_ON_ASPECT, Transport.RMQ) + async sendAspectCommentCreatedNotifications( + @Payload() eventPayload: AspectCommentCreatedEventPayload, + @Ctx() context: RmqContext + ) { + this.sendNotifications( + eventPayload, + context, + this.notificationService.sendAspectCommentCreatedNotification( + eventPayload + ), + ASPECT_CREATED + ); + } + private async sendNotifications( @Payload() eventPayload: Record, @Ctx() context: RmqContext, diff --git a/src/app.module.ts b/src/app.module.ts index 5a3a2ebb..a07b504f 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -18,6 +18,8 @@ import { CommunityContextReviewSubmittedNotificationBuilder, UserRegisteredNotificationBuilder, CommunityNewMemberNotificationBuilder, + AspectCreatedNotificationBuilder, + AspectCommentCreatedNotificationBuilder, } from './services/domain/builders'; import { NotificationService } from './services/domain/notification/notification.service'; import { @@ -53,6 +55,8 @@ import { CommunicationDiscussionCreatedNotificationBuilder, CommunityContextReviewSubmittedNotificationBuilder, CommunityNewMemberNotificationBuilder, + AspectCreatedNotificationBuilder, + AspectCommentCreatedNotificationBuilder, NotificationService, ], controllers: [AppController], diff --git a/src/common/constants/events.ts b/src/common/constants/events.ts index 1911ad3b..f63ce8e3 100644 --- a/src/common/constants/events.ts +++ b/src/common/constants/events.ts @@ -6,3 +6,5 @@ export const COMMUNICATION_DISCUSSION_CREATED = 'communicationDiscussionCreated'; export const COMMUNITY_CONTEXT_REVIEW_SUBMITTED = 'communityContextReviewSubmitted'; +export const ASPECT_CREATED = 'aspectCreated'; +export const COMMENT_CREATED_ON_ASPECT = 'commentCreatedOnAspect'; diff --git a/src/common/dto/aspect.comment.created.event.payload.ts b/src/common/dto/aspect.comment.created.event.payload.ts new file mode 100644 index 00000000..f7f0356b --- /dev/null +++ b/src/common/dto/aspect.comment.created.event.payload.ts @@ -0,0 +1,26 @@ +export type AspectCommentCreatedEventPayload = { + aspect: { + displayName: string; + createdBy: string; + }; + comment: { + message: string; + createdBy: string; + }; + community: { + name: string; + type: string; + }; + hub: { + nameID: string; + id: string; + challenge?: { + nameID: string; + id: string; + opportunity?: { + nameID: string; + id: string; + }; + }; + }; +}; diff --git a/src/common/dto/aspect.created.event.payload.ts b/src/common/dto/aspect.created.event.payload.ts new file mode 100644 index 00000000..c16180b7 --- /dev/null +++ b/src/common/dto/aspect.created.event.payload.ts @@ -0,0 +1,24 @@ +export type AspectCreatedEventPayload = { + aspect: { + id: string; + createdBy: string; + displayName: string; + type: string; + }; + community: { + name: string; + type: string; + }; + hub: { + nameID: string; + id: string; + challenge?: { + nameID: string; + id: string; + opportunity?: { + nameID: string; + id: string; + }; + }; + }; +}; diff --git a/src/common/dto/index.ts b/src/common/dto/index.ts index f728eb05..f24d74b1 100644 --- a/src/common/dto/index.ts +++ b/src/common/dto/index.ts @@ -5,3 +5,5 @@ export * from './community.context.review.submitted.payload'; export * from './community.new.member.payload'; export * from './user.registration.event.payload'; export * from './hub.payload'; +export * from './aspect.created.event.payload'; +export * from './aspect.comment.created.event.payload'; diff --git a/src/common/enums/email.template.ts b/src/common/enums/email.template.ts index 9e5dc7b8..d1a0e125 100644 --- a/src/common/enums/email.template.ts +++ b/src/common/enums/email.template.ts @@ -11,4 +11,7 @@ export enum EmailTemplate { COMMUNITY_REVIEW_SUBMITTED_REVIEWER = 'community.review.submitted.reviewer', COMMUNITY_NEW_MEMBER_ADMIN = 'community.new.member.admin', COMMUNITY_NEW_MEMBER_MEMBER = 'community.new.member.member', + ASPECT_CREATED_ADMIN = 'aspect.created.admin', + ASPECT_CREATED_MEMBER = 'aspect.created.member', + ASPECT_COMMENT_CREATED_MEMBER = 'aspect.comment.created.member', } diff --git a/src/core/contracts/notification.recipient.template.provider.interface.ts b/src/core/contracts/notification.recipient.template.provider.interface.ts index 82a4ecf3..8d471103 100644 --- a/src/core/contracts/notification.recipient.template.provider.interface.ts +++ b/src/core/contracts/notification.recipient.template.provider.interface.ts @@ -15,6 +15,8 @@ export type TemplateRuleSet = { export type TemplateConfig = { application_created?: TemplateRuleSet[]; + aspect_created?: TemplateRuleSet[]; + aspect_comment_created?: TemplateRuleSet[]; user_registered?: TemplateRuleSet[]; communication_update_sent?: TemplateRuleSet[]; communication_discussion_created?: TemplateRuleSet[]; diff --git a/src/services/application/notification-builder/notification.builder.ts b/src/services/application/notification-builder/notification.builder.ts index 178e3c81..b51fb63e 100644 --- a/src/services/application/notification-builder/notification.builder.ts +++ b/src/services/application/notification-builder/notification.builder.ts @@ -164,21 +164,29 @@ export class NotificationBuilder> { filteredRecipients.push(...recipients); } else { for (const recipient of recipients) { - if ( + const targetedUserPreference = recipient.preferences && recipient.preferences.find( preference => - preference.definition.type === extra?.rolePreferenceType && - preference.value === 'true' - ) - ) { - filteredRecipients.push(recipient); - } else { + preference.definition.type === extra.rolePreferenceType + ); + + if (!targetedUserPreference) { + this.logger.verbose?.( + `Skipping recipient ${recipient.nameID} - ${extra.rolePreferenceType} preference not found` + ); + continue; + } + + if (targetedUserPreference.value !== 'true') { this.logger.verbose?.( `User ${recipient.displayName} filtered out because of ${extra?.rolePreferenceType}`, LogContext.NOTIFICATIONS ); + continue; } + + filteredRecipients.push(recipient); } } diff --git a/src/services/domain/builders/aspect-comment-created/aspect.comment.created.notification.builder.ts b/src/services/domain/builders/aspect-comment-created/aspect.comment.created.notification.builder.ts new file mode 100644 index 00000000..abd401e8 --- /dev/null +++ b/src/services/domain/builders/aspect-comment-created/aspect.comment.created.notification.builder.ts @@ -0,0 +1,91 @@ +import { Inject, Injectable } from '@nestjs/common'; +import { INotificationBuilder } from '@core/contracts'; +import { AspectCommentCreatedEventPayload } from '@common/dto'; +import { + AlkemioUrlGenerator, + NotificationBuilder, + RoleConfig, +} from '@src/services/application'; +import { NotificationTemplateType } from '@src/types'; +import { EmailTemplate } from '@common/enums/email.template'; +import { User } from '@core/models'; +import { ALKEMIO_URL_GENERATOR, COMMENT_CREATED_ON_ASPECT } from '@src/common'; + +@Injectable() +export class AspectCommentCreatedNotificationBuilder + implements INotificationBuilder +{ + constructor( + private readonly notificationBuilder: NotificationBuilder, + @Inject(ALKEMIO_URL_GENERATOR) + private readonly alkemioUrlGenerator: AlkemioUrlGenerator + ) {} + build( + payload: AspectCommentCreatedEventPayload + ): Promise { + const roleConfig: RoleConfig[] = [ + { + role: 'owner', + preferenceType: 'NOTIFICATION_ASPECT_COMMENT_CREATED' as any, // UserPreferenceType.NotificationAspectCommentCreated, // todo not the correct one + emailTemplate: EmailTemplate.ASPECT_COMMENT_CREATED_MEMBER, + }, + ]; + + const templateVariables = { + ownerID: payload.aspect.createdBy, + }; + + return this.notificationBuilder.build({ + payload, + eventUserId: payload.comment.createdBy, + roleConfig, + templateType: 'aspect_comment_created', + templateVariables, + templatePayloadBuilderFn: this.createTemplatePayload.bind(this), + }); + } + + createTemplatePayload( + eventPayload: AspectCommentCreatedEventPayload, + recipient: User, + commentAuthor?: User + ): Record { + if (!commentAuthor) { + throw Error( + `Comment author not provided for '${COMMENT_CREATED_ON_ASPECT} event'` + ); + } + const notificationPreferenceURL = + this.alkemioUrlGenerator.createUserNotificationPreferencesURL( + recipient.nameID + ); + + const communityURL = this.alkemioUrlGenerator.createCommunityURL( + eventPayload.hub.nameID, + eventPayload.hub.challenge?.nameID, + eventPayload.hub.challenge?.opportunity?.nameID + ); + + return { + emailFrom: 'info@alkem.io', + aspect: { + displayName: eventPayload.aspect.displayName, + }, + recipient: { + name: recipient.displayName, + firstname: recipient.firstName, + email: recipient.email, + notificationPreferences: notificationPreferenceURL, + }, + createdBy: { + name: commentAuthor.displayName, + firstname: commentAuthor.firstName, + email: commentAuthor.email, + }, + community: { + name: eventPayload.community.name, + url: communityURL, + }, + }; + } +} diff --git a/src/services/domain/builders/aspect-created/aspect.created.notification.builder.ts b/src/services/domain/builders/aspect-created/aspect.created.notification.builder.ts new file mode 100644 index 00000000..97ef6023 --- /dev/null +++ b/src/services/domain/builders/aspect-created/aspect.created.notification.builder.ts @@ -0,0 +1,96 @@ +import { Inject, Injectable } from '@nestjs/common'; +import { INotificationBuilder } from '@core/contracts'; +import { AspectCreatedEventPayload } from '@common/dto'; +import { + AlkemioUrlGenerator, + NotificationBuilder, + RoleConfig, +} from '@src/services/application'; +import { NotificationTemplateType } from '@src/types'; +import { UserPreferenceType } from '@alkemio/client-lib'; +import { User } from '@core/models'; +import { ALKEMIO_URL_GENERATOR, ASPECT_CREATED } from '@src/common'; +import { EmailTemplate } from '@common/enums/email.template'; + +@Injectable() +export class AspectCreatedNotificationBuilder implements INotificationBuilder { + constructor( + private readonly notificationBuilder: NotificationBuilder, + @Inject(ALKEMIO_URL_GENERATOR) + private readonly alkemioUrlGenerator: AlkemioUrlGenerator + ) {} + build( + payload: AspectCreatedEventPayload + ): Promise { + const roleConfig: RoleConfig[] = [ + { + role: 'admin', + preferenceType: UserPreferenceType.NotificationAspectCreatedAdmin, + emailTemplate: EmailTemplate.ASPECT_CREATED_ADMIN, + }, + { + role: 'user', + preferenceType: UserPreferenceType.NotificationAspectCreated, + emailTemplate: EmailTemplate.ASPECT_CREATED_MEMBER, + }, + ]; + + const templateVariables = { + hubID: payload.hub.id, + challengeID: payload.hub?.challenge?.id ?? '', + opportunityID: payload.hub?.challenge?.opportunity?.id ?? '', + }; + + return this.notificationBuilder.build({ + payload, + eventUserId: payload.aspect.createdBy, + roleConfig, + templateType: 'aspect_created', + templateVariables, + templatePayloadBuilderFn: this.createTemplatePayload.bind(this), + }); + } + + createTemplatePayload( + eventPayload: AspectCreatedEventPayload, + recipient: User, + creator?: User + ): Record { + if (!creator) { + throw Error(`Creator not provided for '${ASPECT_CREATED} event'`); + } + + const notificationPreferenceURL = + this.alkemioUrlGenerator.createUserNotificationPreferencesURL( + recipient.nameID + ); + + const communityURL = this.alkemioUrlGenerator.createCommunityURL( + eventPayload.hub.nameID, + eventPayload.hub.challenge?.nameID, + eventPayload.hub.challenge?.opportunity?.nameID + ); + + return { + emailFrom: 'info@alkem.io', + createdBy: { + name: creator.displayName, + firstname: creator.firstName, + email: creator.email, + }, + aspect: { + displayName: eventPayload.aspect.displayName, + }, + recipient: { + name: recipient.displayName, + firstname: recipient.firstName, + email: recipient.email, + notificationPreferences: notificationPreferenceURL, + }, + community: { + name: eventPayload.community.name, + url: communityURL, + }, + }; + } +} diff --git a/src/services/domain/builders/index.ts b/src/services/domain/builders/index.ts index 8c233eb6..36df412a 100644 --- a/src/services/domain/builders/index.ts +++ b/src/services/domain/builders/index.ts @@ -4,3 +4,5 @@ export * from './communication-update-created/communication.update.created.notif export * from './community-context-feedback/community.context.review.submitted.notification.builder'; export * from './community-new-member/community.new.member.notification.builder'; export * from './user-registered/user.registered.notification.builder'; +export * from './aspect-created/aspect.created.notification.builder'; +export * from './aspect-comment-created/aspect.comment.created.notification.builder'; diff --git a/src/services/domain/notification/notification.service.spec.ts b/src/services/domain/notification/notification.service.spec.ts index f62fe2fc..7195c0f4 100644 --- a/src/services/domain/notification/notification.service.spec.ts +++ b/src/services/domain/notification/notification.service.spec.ts @@ -21,6 +21,8 @@ import { CommunicationDiscussionCreatedNotificationBuilder, CommunityContextReviewSubmittedNotificationBuilder, CommunityNewMemberNotificationBuilder, + AspectCreatedNotificationBuilder, + AspectCommentCreatedNotificationBuilder, } from '../builders'; import { AlkemioUrlGenerator } from '@src/services/application/alkemio-url-generator'; import { @@ -63,6 +65,8 @@ describe('NotificationService', () => { CommunicationDiscussionCreatedNotificationBuilder, CommunityContextReviewSubmittedNotificationBuilder, CommunityNewMemberNotificationBuilder, + AspectCreatedNotificationBuilder, + AspectCommentCreatedNotificationBuilder, MockNotificationBuilderProvider, MockConfigServiceProvider, MockAlkemioClientAdapterProvider, diff --git a/src/services/domain/notification/notification.service.ts b/src/services/domain/notification/notification.service.ts index d27f6ec4..e83ee3b6 100644 --- a/src/services/domain/notification/notification.service.ts +++ b/src/services/domain/notification/notification.service.ts @@ -14,16 +14,22 @@ import { CommunityContextReviewSubmittedPayload, UserRegistrationEventPayload, CommunityNewMemberPayload, + AspectCreatedEventPayload, + AspectCommentCreatedEventPayload, } from '@common/dto'; -import { ApplicationCreatedNotificationBuilder } from '@src/services'; -import { CommunicationDiscussionCreatedNotificationBuilder } from '../builders/communication-discussion-created/communication.discussion.created.notification.builder'; -import { CommunicationUpdateCreatedNotificationBuilder } from '../builders/communication-update-created/communication.update.created.notification.builder'; -import { UserRegisteredNotificationBuilder } from '../builders/user-registered/user.registered.notification.builder'; -import { CommunityContextReviewSubmittedNotificationBuilder } from '../builders/community-context-feedback/community.context.review.submitted.notification.builder'; import { AlkemioClientAdapter } from '@src/services/application/alkemio-client-adapter'; import { NotificationTemplateType } from '@src/types/notification.template.type'; import { INotificationBuilder } from '@core/contracts'; import { CommunityNewMemberNotificationBuilder } from '@src/services/domain/builders'; +import { + ApplicationCreatedNotificationBuilder, + CommunicationDiscussionCreatedNotificationBuilder, + CommunicationUpdateCreatedNotificationBuilder, + UserRegisteredNotificationBuilder, + CommunityContextReviewSubmittedNotificationBuilder, + AspectCreatedNotificationBuilder, + AspectCommentCreatedNotificationBuilder, +} from '../builders'; @Injectable() export class NotificationService { @@ -39,7 +45,9 @@ export class NotificationService { private communicationUpdatedNotificationBuilder: CommunicationUpdateCreatedNotificationBuilder, private communicationDiscussionCreatedNotificationBuilder: CommunicationDiscussionCreatedNotificationBuilder, private communityContextReviewSubmittedNotificationBuilder: CommunityContextReviewSubmittedNotificationBuilder, - private communityNewMemberNotificationBuilder: CommunityNewMemberNotificationBuilder + private communityNewMemberNotificationBuilder: CommunityNewMemberNotificationBuilder, + private aspectCreatedNotificationBuilder: AspectCreatedNotificationBuilder, + private aspectCommentCreatedNotificationBuilder: AspectCommentCreatedNotificationBuilder ) {} async sendNotifications( @@ -118,6 +126,24 @@ export class NotificationService { ); } + async sendAspectCreatedNotification( + payload: AspectCreatedEventPayload + ): Promise[]> { + return this.sendNotifications( + payload, + this.aspectCreatedNotificationBuilder + ); + } + + async sendAspectCommentCreatedNotification( + payload: AspectCommentCreatedEventPayload + ): Promise[]> { + return this.sendNotifications( + payload, + this.aspectCommentCreatedNotificationBuilder + ); + } + private async sendNotification( notification: NotificationTemplateType ): Promise { diff --git a/src/templates/aspect.comment.created.member.js b/src/templates/aspect.comment.created.member.js new file mode 100644 index 00000000..1c596f30 --- /dev/null +++ b/src/templates/aspect.comment.created.member.js @@ -0,0 +1,24 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires +var templates = require('./alkemio.template.blocks'); +/* eslint-disable quotes */ +module.exports = () => ({ + name: 'aspect-created-member', + title: 'New comment received on your aspect {{aspect.displayName}}', + version: 1, + channels: { + email: { + from: '{{emailFrom}}', + to: '{{recipient.email}}', + subject: 'New comment received on your aspect {{aspect.displayName}}', + html: `{% extends "src/templates/_layouts/email-transactional.html" %} + {% block content %} + Hi {{recipient.firstname}},

+ + A new comment was created by {{createdBy.firstname}} on your community {{community.name}}: {{aspect.displayName}}

+ + Sincerely yours, + {% endblock %} + ${templates.footerBlock}`, + }, + }, +}); diff --git a/src/templates/aspect.created.admin.js b/src/templates/aspect.created.admin.js new file mode 100644 index 00000000..274a2e10 --- /dev/null +++ b/src/templates/aspect.created.admin.js @@ -0,0 +1,24 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires +var templates = require('./alkemio.template.blocks'); +/* eslint-disable quotes */ +module.exports = () => ({ + name: 'aspect-created-admin', + title: 'New aspect created on {{community.name}}: {{aspect.displayName}}', + version: 1, + channels: { + email: { + from: '{{emailFrom}}', + to: '{{recipient.email}}', + subject: 'New aspect created on {{community.name}}: {{aspect.displayName}}', + html: `{% extends "src/templates/_layouts/email-transactional.html" %} + {% block content %} + Hi {{recipient.firstname}},

+ + A new aspect was created by {{createdBy.firstname}} on {{community.name}}: {{aspect.displayName}}

+ + Sincerely yours, + {% endblock %} + ${templates.footerBlock}`, + }, + }, +}); diff --git a/src/templates/aspect.created.member.js b/src/templates/aspect.created.member.js new file mode 100644 index 00000000..637f6206 --- /dev/null +++ b/src/templates/aspect.created.member.js @@ -0,0 +1,24 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires +var templates = require('./alkemio.template.blocks'); +/* eslint-disable quotes */ +module.exports = () => ({ + name: 'aspect-created-member', + title: 'New aspect created on {{community.name}}: {{aspect.displayName}}', + version: 1, + channels: { + email: { + from: '{{emailFrom}}', + to: '{{recipient.email}}', + subject: 'New aspect created on {{community.name}}: {{aspect.displayName}}', + html: `{% extends "src/templates/_layouts/email-transactional.html" %} + {% block content %} + Hi {{recipient.firstname}},

+ + A new aspect was created by {{createdBy.firstname}} on your community {{community.name}}: {{aspect.displayName}}

+ + Sincerely yours, + {% endblock %} + ${templates.footerBlock}`, + }, + }, +});