diff --git a/.kodiak.toml b/.kodiak.toml new file mode 100644 index 000000000000..bbbfca713a5e --- /dev/null +++ b/.kodiak.toml @@ -0,0 +1,16 @@ +# .kodiak.toml +version = 1 + + +[merge] +method = "squash" +automerge_label = ["stat: ready to merge", "QA tested", "automerge"] + +[merge.message] +title = "pull_request_title" # default: "github_default" +body = "pull_request_body" # default: "github_default" +include_coauthors=true +[merge.automerge_dependencies] +versions = ["minor", "patch"] +usernames = ["dependabot"] + diff --git a/.yarnrc.yml b/.yarnrc.yml index 404765a22773..1d00b70c6e57 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -11,3 +11,4 @@ plugins: spec: '@yarnpkg/plugin-typescript' yarnPath: .yarn/releases/yarn-3.2.0.cjs +checksumBehavior: 'ignore' diff --git a/apps/meteor/.snapcraft/launchpadkey.enc b/apps/meteor/.snapcraft/launchpadkey.enc deleted file mode 100644 index af91e0e62be9..000000000000 Binary files a/apps/meteor/.snapcraft/launchpadkey.enc and /dev/null differ diff --git a/apps/meteor/.snapcraft/resources/Caddyfile b/apps/meteor/.snapcraft/resources/Caddyfile deleted file mode 100644 index 23299c1d2b7e..000000000000 --- a/apps/meteor/.snapcraft/resources/Caddyfile +++ /dev/null @@ -1,5 +0,0 @@ -_caddy-url_ -proxy / localhost:_port_ { - websocket - transparent -} diff --git a/apps/meteor/.snapcraft/resources/backupdb b/apps/meteor/.snapcraft/resources/backupdb deleted file mode 100755 index b457d325e543..000000000000 --- a/apps/meteor/.snapcraft/resources/backupdb +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -if [[ ${EUID} != 0 ]]; then - echo "[-] This task must be run with 'sudo'." - exit 1 -fi - -if $(ps x | grep "node ${SNAP}/main.js" | grep -qv "grep"); then - echo "[-] Please shutdown Rocket.Chat first to get a clean backup" - echo "[-] Use 'sudo systemctl stop snap.rocketchat-server.rocketchat-server'" -fi - -TIMESTAMP=$(date +"%Y%m%d.%H%M") -BACKUP_DIR="${SNAP_COMMON}/backup" - -if [[ ! -d ${BACKUP_DIR} ]]; then - mkdir ${BACKUP_DIR} -fi - -if [[ -d ${BACKUP_DIR}/dump ]]; then - rm -rf ${BACKUP_DIR}/dump -fi - -if [[ -f ${BACKUP_DIR}/rocketchat_backup_${TIMESTAMP}.tar.gz ]]; then - rm -f ${BACKUP_DIR}/rocketchat_backup_${TIMESTAMP}.tar.gz -fi - -if [[ -f ${BACKUP_DIR}/backup_${TIMESTAMP}.log ]]; then - rm -f ${BACKUP_DIR}/backup_${TIMESTAMP}.log -fi - -echo "[*] Creating backup file..." -mkdir ${BACKUP_DIR}/dump -echo "[*] Dumping database with \"mongodump -d parties -o ${BACKUP_DIR}/dump\"" > "${BACKUP_DIR}/backup_${TIMESTAMP}.log" -mongodump -d parties -o ${BACKUP_DIR}/dump &>> "${BACKUP_DIR}/backup_${TIMESTAMP}.log" -echo "[*] Packing archive with \"tar czvf ${BACKUP_DIR}/rocketchat_backup_${TIMESTAMP}.tar.gz ${BACKUP_DIR}/dump\"" >> "${BACKUP_DIR}/backup_${TIMESTAMP}.log" -tar czvf ${BACKUP_DIR}/rocketchat_backup_${TIMESTAMP}.tar.gz -C ${BACKUP_DIR} dump &>> "${BACKUP_DIR}/backup_${TIMESTAMP}.log" -rm -rf ${BACKUP_DIR}/dump - -echo "[+] A backup of your data can be found at ${BACKUP_DIR}/rocketchat_backup_${TIMESTAMP}.tar.gz" diff --git a/apps/meteor/.snapcraft/resources/initcaddy b/apps/meteor/.snapcraft/resources/initcaddy deleted file mode 100755 index b55d20de02b3..000000000000 --- a/apps/meteor/.snapcraft/resources/initcaddy +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -# Config options for Caddyfile -#options="site path port" -options="caddy-url port" - -refresh_opt_in_config() { -# replace an option inside the config file. - opt=$1 - value="$2" - if $(grep -q "_${opt}_" $Caddyfile); then - sed "s,_${opt}_,$value," $Caddyfile 2>/dev/null > ${Caddyfile}.new - mv -f ${Caddyfile}.new $Caddyfile 2>/dev/null - else - echo "Fail to update $opt in Caddyfile" - fi -} - -create_caddyfile(){ -# Copy template to config Caddyfile -cp $SNAP/bin/Caddyfile $SNAP_DATA/Caddyfile -} - -update_caddyfile(){ -# Config file path for Caddyfile -Caddyfile=$SNAP_DATA/Caddyfile - -# Iterate through the config options array -for opt in $options - do - # Use snapctl to get the value registered by the snap set command - refresh_opt_in_config $opt $(snapctl get $opt) -done -} - -caddy="$(snapctl get caddy)" -if [[ $caddy == "disable" ]]; then - echo "Caddy is not enabled, please set caddy-url= and caddy=enable" - exit 1 -fi - -create_caddyfile -update_caddyfile - -echo "Your URL was successfully configured - Please restart rocketchat and caddy services to apply configuration changes" - diff --git a/apps/meteor/.snapcraft/resources/initreplset.js b/apps/meteor/.snapcraft/resources/initreplset.js deleted file mode 100644 index 6883e248ebd6..000000000000 --- a/apps/meteor/.snapcraft/resources/initreplset.js +++ /dev/null @@ -1,13 +0,0 @@ -var ism = db.isMaster(); -if (!ism.ismaster) { - rs.initiate( - { - _id: 'rs0', - members: [ - { - _id: 0, - host: 'localhost:27017' - } - ] - }); -} diff --git a/apps/meteor/.snapcraft/resources/prepareRocketChat b/apps/meteor/.snapcraft/resources/prepareRocketChat deleted file mode 100755 index 1e89be5ce3f3..000000000000 --- a/apps/meteor/.snapcraft/resources/prepareRocketChat +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -curl -SLf "https://releases.rocket.chat/5.0.0/download/" -o rocket.chat.tgz - -tar xf rocket.chat.tgz --strip 1 - -cd programs/server -rm -rf npm/node_modules/meteor/emojione_emojione/node_modules/grunt-contrib-qunit - -if [[ $(uname -m) == *armv6l* ]] || [[ $(uname -m) == *armv7l* ]] -then - rm -rf npm/node_modules/sharp/vendor -fi - -export NODE_ENV=production -npm i - -# Ideally this will go away. For some reason on install its installing node-v57-linux-x64-glibc but when actually running it is looking for node-v57-linux-x64-unknown -if [[ $(uname -m) == "x86_64" ]] -then - cp -r npm/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc npm/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-unknown - rm npm/node_modules/grpc/node_modules/tar/lib/.unpack.js.swp -fi - -# sharp needs execution stack removed - https://forum.snapcraft.io/t/snap-and-executable-stacks/1812 -ls -l npm/node_modules/sharp/vendor -execstack --clear-execstack npm/node_modules/sharp/vendor/lib/librsvg-2.so* - -# Having to manually remove because of latest warning -rm -rf npm/node_modules/meteor/konecty_user-presence/node_modules/colors/lib/.colors.js.swp -rm -rf node_modules/node-pre-gyp/node_modules/tar/lib/.mkdir.js.swp -rm -rf npm/node_modules/sharp/node_modules/semver/bin/.semver.js.swp -rm -rf npm/node_modules/tar/lib/.mkdir.js.swp - diff --git a/apps/meteor/.snapcraft/resources/preparecaddy b/apps/meteor/.snapcraft/resources/preparecaddy deleted file mode 100755 index 303020c803e1..000000000000 --- a/apps/meteor/.snapcraft/resources/preparecaddy +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/bash - -caddy_version="v1.0.4" - -caddy_bin="caddy" -caddy_dl_ext=".tar.gz" - -# NOTE: `uname -m` is more accurate and universal than `arch` -# See https://en.wikipedia.org/wiki/Uname -unamem="$(uname -m)" -if [[ $unamem == *aarch64* ]]; then - caddy_arch="arm64" -elif [[ $unamem == *64* ]]; then - caddy_arch="amd64" -elif [[ $unamem == *86* ]]; then - caddy_arch="386" -elif [[ $unamem == *armv5* ]]; then - caddy_arch="arm" - caddy_arm="5" -elif [[ $unamem == *armv6l* ]]; then - caddy_arch="arm" - caddy_arm="6" -elif [[ $unamem == *armv7l* ]]; then - caddy_arch="arm" - caddy_arm="7" -else - echo "Aborted, unsupported or unknown architecture: $unamem" - return 2 -fi - -caddy_arch=_linux_$caddy_arch - -echo "Downloading Caddy for $caddy_os/$caddy_arch$caddy_arm..." -caddy_file="caddy_linux_$caddy_arch${caddy_arm}_custom$caddy_dl_ext" -caddy_url="https://github.com/caddyserver/caddy/releases/download/$caddy_version/caddy_$caddy_version$caddy_arch$caddy_arm.tar.gz" -echo "$caddy_url" - -curl -L "$caddy_url" -o "$caddy_file" -tar -xzf $caddy_file -C . "$caddy_bin" -chmod +x $caddy_bin diff --git a/apps/meteor/.snapcraft/resources/preparemongo b/apps/meteor/.snapcraft/resources/preparemongo deleted file mode 100755 index 3ccfd8b35195..000000000000 --- a/apps/meteor/.snapcraft/resources/preparemongo +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/bash - -if [[ $(uname -m) == "x86_64" ]] -then - wget --backups=0 "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.14.tgz" - tar -zxf ./mongodb-linux-x86_64-3.6.14.tgz --strip-components=1 -else - IFS=" " read -a links <<< $(apt-get -y --print-uris install mongodb | egrep -o "https?://[^']+") - for link in ${links[@]} - do - wget --backups=0 ${link} - done - - IFS=" " read -a deb_pkgs <<< $(ls ./ | egrep "\.deb") - for pkg in ${deb_pkgs[@]} - do - echo "Extracting ${pkg}..." - dpkg-deb -R ${pkg} ./ - done - - mv usr/bin bin -fi diff --git a/apps/meteor/.snapcraft/resources/preparenode b/apps/meteor/.snapcraft/resources/preparenode deleted file mode 100755 index d6619dd9bf4d..000000000000 --- a/apps/meteor/.snapcraft/resources/preparenode +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -node_version="v14.18.3" - -unamem="$(uname -m)" -if [[ $unamem == *aarch64* ]]; then - node_arch="arm64" -elif [[ $unamem == *64* ]]; then - node_arch="x64" -elif [[ $unamem == *86* ]]; then - node_arch="x86" -elif [[ $unamem == *armv6l* ]]; then - node_arch="armv6l" -elif [[ $unamem == *armv7l* ]]; then - node_arch="armv7l" -else - echo "Aborted, unsupported or unknown architecture: $unamem" - return 2 -fi - - -wget https://nodejs.org/dist/$node_version/node-$node_version-linux-$node_arch.tar.xz -tar xf node-$node_version-linux-$node_arch.tar.xz --strip 1 diff --git a/apps/meteor/.snapcraft/resources/restoredb b/apps/meteor/.snapcraft/resources/restoredb deleted file mode 100755 index 731cc8bbfcb0..000000000000 --- a/apps/meteor/.snapcraft/resources/restoredb +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash - -function warn { - echo "[!] ${1}" - echo "[*] Check ${RESTORE_DIR}/${LOG_NAME} for details." -} - -function abort { - echo "[!] ${1}" - echo "[*] Check ${RESTORE_DIR}/${LOG_NAME} for details." - echo "[-] Restore aborted!" - exit 1 -} - -if [[ ${EUID} != 0 ]]; then - echo "[-] This task must be run with 'sudo'." - exit 1 -fi - -echo "*** ATTENTION ***" -echo "* Your current database WILL BE DROPPED prior to the restore!" -echo "* Do you want to continue?" - -select yn in "Yes" "No"; do - case $yn in - Yes ) break;; - No ) exit 1;; - esac -done - -if $(ps x | grep "node ${SNAP}/main.js" | grep -qv "grep"); then - echo "[-] Please shutdown Rocket.Chat first to restore a clean backup" - echo "[-] Use 'sudo systemctl stop snap.rocketchat-server.rocketchat-server'" - echo "[-] Backup aborted!" - exit 1 -fi - -TIMESTAMP=$(date +"%Y%m%d.%H%M") -RESTORE_DIR="${SNAP_COMMON}/restore" -DATA_DIR="${RESTORE_DIR}/dump/parties" -LOG_NAME="restore_${TIMESTAMP}.log" - -if [[ ! -d ${RESTORE_DIR} ]]; then - mkdir ${RESTORE_DIR} -fi - -if [[ -d ${RESTORE_DIR}/dump ]]; then - rm -rf ${RESTORE_DIR}/dump -fi - -if [[ -f ${RESTORE_DIR}/${LOG_NAME} ]]; then - rm -f ${RESTORE_DIR}/${LOG_NAME} -fi - -BACKUP_FILE=${1} -if [[ ! -f ${BACKUP_FILE} ]]; then - echo "[-] Usage: sudo snap run rocketchat-server.restoredb ${SNAP_COMMON}/rocketchat_backup_{TIMESTAMP}.tar.gz" - exit 1 -fi - -if ! $(echo "${BACKUP_FILE}" | grep -q "${SNAP_COMMON}"); then - echo "[-] Backup file must be within ${SNAP_COMMON}." - exit 1 -fi - -echo "[*] Extracting backup file..." -echo "[*] Extracting backup file with \"tar --no-same-owner --overwrite -xzvf ${BACKUP_FILE}\"" &> "${RESTORE_DIR}/${LOG_NAME}" -cd ${RESTORE_DIR} -tar --no-same-owner --overwrite -xzvf ${BACKUP_FILE} &>> "${RESTORE_DIR}/${LOG_NAME}" \ - || abort "Failed to extract backup files to ${RESTORE_DIR}!" - -if [ $(ls -l ${DATA_DIR} | wc -l) -le 1 ]; then - abort "No restore data found within ${DATA_DIR}!" -fi -echo "[*] Restoring data..." -echo "[*] Restoring data with \"mongorestore --db parties --noIndexRestore --drop ${DATA_DIR}\"" &>> "${RESTORE_DIR}/${LOG_NAME}" -mongorestore --db parties --noIndexRestore --drop ${DATA_DIR} &>> "${RESTORE_DIR}/${LOG_NAME}" \ - || abort "Failed to execute mongorestore from ${DATA_DIR}!" -if [ $(cat ${RESTORE_DIR}/${LOG_NAME} | grep $(date +%Y) | wc -l) -lt 24 ]; then - warn "Little or no data could be restored from the backup!" -fi - -echo "[*] Preparing database..." -echo "[*] Preparing database with \"mongo parties --eval 'db.repairDatabase()' --verbose\"" &>> "${RESTORE_DIR}/${LOG_NAME}" -mongo parties --eval "db.repairDatabase()" --verbose &>> "${RESTORE_DIR}/${LOG_NAME}" \ - || abort "Failed to prepare database for usage!" - -echo "[+] Restore completed! Please with 'sudo systemctl restart snap.rocketchat-server.rocketchat-server' to verify." diff --git a/apps/meteor/.snapcraft/resources/startRocketChat b/apps/meteor/.snapcraft/resources/startRocketChat deleted file mode 100755 index 7e1cca2f0787..000000000000 --- a/apps/meteor/.snapcraft/resources/startRocketChat +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash - -function start_rocketchat { - echo "Checking if oplog has been enabled, and enabling if not" - LC_ALL=C mongo $SNAP/bin/initreplset.js - - echo "Checking if mongo featureCompatibilityVersion is correct, changing if not" - db_version=$(mongo --eval "printjson(db.version())" |tail -1 |tr -d '"' |cut -d. -f1,2) - db_comp_version=$(mongo --eval "printjson(db.adminCommand ({getParameter: 1, featureCompatibilityVersion: 1}))"|grep '"version" :' |cut -d: -f3 |cut -d} -f1|tr -d '[:space:]'|tr -d '"') - db_featureCompatibilityVersion="$(snapctl get db-feature-compatibility-version)" - if [[ $db_version == "3.6" ]] && [[ $db_comp_version == "3.4" ]] && [[ $db_featureCompatibilityVersion == "3.6" ]]; then - LC_ALL=C mongo --eval "printjson(db.adminCommand ({ setFeatureCompatibilityVersion: \"3.6\" }))" - fi - - ## For making fonts work for sharp - export XDG_DATA_HOME=$SNAP/usr/share - - # Font Config - export FONTCONFIG_PATH=$SNAP/etc/fonts/config.d - export FONTCONFIG_FILE=$SNAP/etc/fonts/fonts.conf - - - export DEPLOY_METHOD=snap - export NODE_ENV=production - export BABEL_CACHE_DIR=/tmp - export ROOT_URL=http://localhost - export PORT="$(snapctl get port)" - export MONGO_URL="$(snapctl get mongo-url)" - export MONGO_OPLOG_URL="$(snapctl get mongo-oplog-url)" - export Accounts_AvatarStorePath=$SNAP_COMMON/uploads - siteurl="$(snapctl get siteurl)" - if [ -n "$siteurl" ]; then - export OVERWRITE_SETTING_Site_Url=$siteurl - fi - - if ls $SNAP_COMMON/*.env >/dev/null 2>&1; then - for filename in $SNAP_COMMON/*.env; do - while read env_var; do - export "$env_var" - done < $filename - done - fi - - node $SNAP/main.js -} - -sleep_time=5 -try_times=0 - -function try_start { - - refreshing="$(snapctl get snap-refreshing)" - if [ $refreshing == "true" ]; then - exit 0 - fi - - search=$(ps --pid $(cat $SNAP_COMMON/mongod.pid) -o comm=) - - if [ $search ] - then - start_rocketchat - else - if [[ "$try_times" == 5 || "$try_times" > 5 ]]; then - echo "Was unable to connect to Mongo. Please make sure Mongo has started successfully: sudo systemctl status snap.rocketchat-server.rocketchat-mongo to view logs: sudo journalctl -u snap.rocketchat-server.rocketchat-mongo" - exit 1; - fi - - ((try_times += 1)) - ((sleep_time += 5)) - echo "Mongo is not available, can't start. Waiting ${sleep_time} seconds and trying again" - sleep $sleep_time - try_start - fi -} - -try_start diff --git a/apps/meteor/.snapcraft/resources/startmongo b/apps/meteor/.snapcraft/resources/startmongo deleted file mode 100755 index 5697c6df6dba..000000000000 --- a/apps/meteor/.snapcraft/resources/startmongo +++ /dev/null @@ -1 +0,0 @@ -env LC_ALL=C mongod --bind_ip 127.0.0.1 --pidfilepath $SNAP_COMMON/mongod.pid --smallfiles --journal --dbpath=$SNAP_COMMON --replSet rs0 diff --git a/apps/meteor/.snapcraft/snap/hooks/configure b/apps/meteor/.snapcraft/snap/hooks/configure deleted file mode 100755 index 3a2863d7de16..000000000000 --- a/apps/meteor/.snapcraft/snap/hooks/configure +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash - -export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH" -export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/x86_64-linux-gnu:$SNAP/usr/lib/x86_64-linux-gnu" -export LD_LIBRARY_PATH=$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH - -# Obtain caddyurl value -caddyurl="$(snapctl get caddy-url)" -# Validate it -#caddyurl_regex='^https?:\/\/([0-9A-Za-z\.-]+){1,}(\.[a-z\.]{2,6})?([\/\da-z\.-]+)?$' #(supporting path) -caddyurl_regex='^https?:\/\/([0-9A-Za-z\.-]+){1,}(\.[a-z\.]{2,6})?$' -if [ -n "$caddyurl" ]; then - if ! [[ $caddyurl =~ $caddyurl_regex ]]; then - echo "\"$caddyurl\" is not a valid url" >&2 - exit 1 - fi -#else -# if [[ $siteurl =~ ^http: ]] && [[ $siteurl =~ ^http:\/\/([0-9A-Za-z\.-]+){1,}?(\.[a-z\.]{2,6})?\/([\/\da-z\.-]+){1,}$ ]]; then -# path=${siteurl#http://*/} -# site=${siteurl#"http://"} -# site=${site%%/*} -# site=http://$site -# elif [[ $siteurl =~ ^https: ]] && [[ $siteurl =~ ^https:\/\/([0-9A-Za-z\.-]+){1,}?(\.[a-z\.]{2,6})?\/([\/\da-z\.-]+){1,}$ ]]; then -# path=${siteurl#https://*/} -# site=${siteurl#"https://"} -# site=${site%%/*} -# site=https://$site -# else -# path="" -# site=$siteurl -# fi -# snapctl set path=$path -# snapctl set site=$site -fi - -# Obtain caddy value -caddy="$(snapctl get caddy)" -# Validate it -caddy_regex='((enable)|(disable))' -if ! [[ $caddy =~ $caddy_regex ]]; then - echo "\"$caddy_regex\" is not a valid, set to enable or disable" >&2 - exit 1 -else - if [[ $caddy == enable ]]; then - caddyurl="$(snapctl get caddy-url)" - if [ -z "$caddyurl" ]; then - echo "You tried to enable caddy but caddy-url is not set yet, please set up caddy-url first and then enable caddy again" >&2 - snapctl set caddy=disable - exit 1 - else - snapctl set siteurl=$caddyurl - fi - else - siteurl="$(snapctl get siteurl)" - if [ -n "$siteurl" ]; then - snapctl set siteurl= - fi - fi -fi - -# Obtain port value -port="$(snapctl get port)" -# Validate it -port_regex='^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$' -if ! [[ $port =~ $port_regex ]]; then - echo "\"$port\" is not a valid port" >&2 - exit 1 -fi - -# Obtain mongourl value -mongourl="$(snapctl get mongo-url)" -# Validate it -mongourl_regex='^mongodb:\/\/([0-9A-Za-z\.\-\_]+){1,}(([a-z\.\-\_]+){2,6})?(:[0-9]{2,5})?\/([0-9A-Za-z\_\-]+)$' -if ! [[ $mongourl =~ $mongourl_regex ]] ; then - echo "\"$mongourl\" is not a valid url" >&2 - exit 1 -fi - -# Obtain mongooplogurl value -mongooplogurl="$(snapctl get mongo-oplog-url)" -# Validate it -mongooplogurl_regex='^mongodb:\/\/([0-9A-Za-z\.\-\_]+){1,}(([a-z\.\-\_]+){2,6})?(:[0-9]{2,5})?\/local$' -if ! [[ $mongooplogurl =~ $mongooplogurl_regex ]] ; then - echo "\"$mongooplogurl\" is not a valid url" >&2 - exit 1 -fi - -# Obtain site protocol -https="$(snapctl get https)" -# Validate it -https_regex='((enable)|(disable))' -if ! [[ $https =~ $https_regex ]]; then - echo "\"$https\" should be enable or disable" >&2 - exit 1 -else - if [[ $https == enable ]] && [[ $caddyurl =~ ^http: ]]; then - echo "Error: You enabled https but your site URL starts with http, disabling https ..." - snapctl set https=disable - exit 1 - elif [[ $https == enable ]] && [[ $caddyurl =~ ^https: ]]; then - domain=${caddyurl#"https://"} - domain=${domain%%/*} - pubip=$(dig $domain |grep -A1 ";; ANSWER SECTION:" |tail -1 | awk '{print $5}') - if [ -z "$pubip" ]; then - echo "Error: Can't resove DNS query for $domain, check your DNS configuration, disabling https ..." - snapctl set https=disable - exit 1 - else - ip=$(curl ipinfo.io/ip 2>/dev/null) - if [[ $ip != $pubip ]]; then - echo "Error: Your public IP doesn't match the one resolved for caddy-url, disabling https ..." - snapctl set https=disable - exit 1 - fi - fi - elif [[ $https == enable ]] && [ -z "$caddyurl" ]; then - echo "Error: You enabled https but your site URL is empty, please set caddy-url=, disabling https ..." - snapctl set https=disable - exit 1 - fi -fi - -# Obtain backup value -backup="$(snapctl get backup-on-refresh)" -# Validate it -backup_regex='((enable)|(disable))' -if ! [[ $backup =~ $backup_regex ]] ; then - echo "\"$backup\" should be enable or disable" >&2 - exit 1 -fi - -# Obtain db featureCompatibilityVersion -db_featureCompatibilityVersion="$(snapctl get db-feature-compatibility-version)" -db_featureCompatibilityVersion_regex='^3\.[4,6]$' -if ! [[ $db_featureCompatibilityVersion =~ $db_featureCompatibilityVersion_regex ]] ; then - echo "\"$db_featureCompatibilityVersion\" should be 3.4 or 3.6" >&2 - exit 1 -else - db_version=$(mongo --eval "printjson(db.version())" |tail -1 |tr -d '"' |cut -d. -f1,2) - if [[ $db_version == "3.6" ]] && [[ $db_featureCompatibilityVersion == "3.4" ]]; then - mongo --eval "printjson(db.adminCommand ({ setFeatureCompatibilityVersion: \"3.4\" }))" - elif [[ $db_version == "3.6" ]] && [[ $db_featureCompatibilityVersion == "3.6" ]]; then - mongo --eval "printjson(db.adminCommand ({ setFeatureCompatibilityVersion: \"3.6\" }))" - fi -fi diff --git a/apps/meteor/.snapcraft/snap/hooks/install b/apps/meteor/.snapcraft/snap/hooks/install deleted file mode 100755 index c7ed881d4b82..000000000000 --- a/apps/meteor/.snapcraft/snap/hooks/install +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Initialize the CADDY_URL to a default -snapctl set caddy=disable - -# Initialize the PORT to a default -snapctl set port=3000 - -# Initialize the MONGO_URL to a default -snapctl set mongo-url=mongodb://localhost:27017/parties - -# Initialize the MONGO_OPLOG_URL to a default -snapctl set mongo-oplog-url=mongodb://localhost:27017/local - -# Initialize the protocol to a default -snapctl set https=disable - -# Initialize backup to a default -snapctl set backup-on-refresh=disable - -# Initialize snap-refreshing to false -snapctl set snap-refreshing=false - -# Initialize db-feature-compatibility-version to 3.6 -snapctl set db-feature-compatibility-version=3.6 - diff --git a/apps/meteor/.snapcraft/snap/hooks/post-refresh b/apps/meteor/.snapcraft/snap/hooks/post-refresh deleted file mode 100755 index ec0a988afd4c..000000000000 --- a/apps/meteor/.snapcraft/snap/hooks/post-refresh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -# Initialize the CADDY_URL to a default -caddy="$(snapctl get caddy)" -if [ -z "$caddy" ]; then - snapctl set caddy=disable -fi - -# Initialize the PORT to a default -port="$(snapctl get port)" -if [ -z "$port" ]; then - snapctl set port=3000 -fi - -# Initialize the MONGO_URL to a default -mongourl="$(snapctl get mongo-url)" -if [ -z "$mongourl" ]; then - snapctl set mongo-url=mongodb://localhost:27017/parties -fi - -# Initialize the MONGO_OPLOG_URL to a default -mongooplogurl="$(snapctl get mongo-oplog-url)" -if [ -z "$mongooplogurl" ]; then - snapctl set mongo-oplog-url=mongodb://localhost:27017/local -fi - -# Initialize the protocol to a default -https="$(snapctl get https)" -if [ -z "$https" ]; then - snapctl set https=disable -fi - -# Initialize backup to a default -backup="$(snapctl get backup-on-refresh)" -if [ -z "$backup" ]; then - snapctl set backup-on-refresh=disable -fi - -# Set back snap-refreshing to false -snapctl set snap-refreshing=false - -# Initialize db-feature-compatibility-version to a default -db_featureCompatibilityVersion="$(snapctl get db-feature-compatibility-version)" -if [ -z "$db_featureCompatibilityVersion" ]; then - snapctl set db-feature-compatibility-version=3.6 -fi - diff --git a/apps/meteor/.snapcraft/snap/hooks/pre-refresh b/apps/meteor/.snapcraft/snap/hooks/pre-refresh deleted file mode 100755 index 41d8df57a1e8..000000000000 --- a/apps/meteor/.snapcraft/snap/hooks/pre-refresh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH" -export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/x86_64-linux-gnu:$SNAP/usr/lib/x86_64-linux-gnu" -export LD_LIBRARY_PATH=$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH - -TIMESTAMP=$(date +"%Y%m%d.%H%M") - -# stop rocketchat -snapctl set snap-refreshing=true - -rocketchatpid=$(pgrep -f "node $SNAP/main.js") -kill -9 $rocketchatpid -if ! [ $? == 0 ]; then - echo "Failed to stop rocketchat service" > $SNAP_COMMON/refresh_${TIMESTAMP}.log -fi - -backup="$(snapctl get backup-on-refresh)" -if [ $backup == "enable" ]; then - backupdb - if ! [ $? == 0 ]; then - echo "Failed rocketchat database backup before refresh" >> $SNAP_COMMON/refresh_${TIMESTAMP}.log - fi -fi - diff --git a/apps/meteor/.snapcraft/snap/snapcraft.yaml b/apps/meteor/.snapcraft/snap/snapcraft.yaml deleted file mode 100644 index 024184829e7b..000000000000 --- a/apps/meteor/.snapcraft/snap/snapcraft.yaml +++ /dev/null @@ -1,112 +0,0 @@ -# -# Easiest way to work with this file, from an updated Ubuntu 16.04 LTS image -# 1. create a non-root user with sudo priv and perform following steps as non-root -# 2. `sudo apt-get update` -# 3. `sudo apt-get install snapcraft python build-essential` -# 4. `snapcraft stage` -# 5. `snapcraft snap` - -name: rocketchat-server -version: 5.0.0 -summary: Rocket.Chat server -description: Have your own Slack like online chat, built with Meteor. https://rocket.chat/ -confinement: strict -assumes: [snapd2.21] -apps: - rocketchat-server: - command: startRocketChat - daemon: simple - plugs: [network, network-bind, removable-media] - rocketchat-mongo: - command: startmongo - daemon: simple - plugs: [network, network-bind, network-observe] - rocketchat-caddy: - command: env LC_ALL=C caddy -conf=$SNAP_DATA/Caddyfile - daemon: simple - plugs: [network, network-bind] - mongo: - command: env LC_ALL=C mongo - plugs: [network] - restoredb: - command: env LC_ALL=C restoredb - plugs: [network] - backupdb: - command: env LC_ALL=C backupdb - plugs: [network] - initcaddy: - command: env LC_ALL=C initcaddy -hooks: - configure: - plugs: [network] - pre-refresh: - plugs: [network] -parts: - node: - plugin: dump - prepare: ./resources/preparenode - build-packages: - # For fibers - - python - - build-essential - - nodejs - rocketchat-server: - build-packages: - - curl - plugin: dump - prepare: ./resources/prepareRocketChat - after: [node] - source: . - stage-packages: - - execstack - - fontconfig-config - stage: - - programs - - main.js - - .node_version.txt - - etc - - usr - - star.json - mongodb: - build-packages: - - wget - source: ./ - prepare: ./resources/preparemongo - plugin: dump - stage-packages: - - libssl1.0.0 - prime: - - usr - - bin - - lib - scripts: - plugin: dump - source: resources/ - organize: - backupdb: bin/backupdb - restoredb: bin/restoredb - startmongo: bin/startmongo - startRocketChat: bin/startRocketChat - initreplset.js: bin/initreplset.js - Caddyfile: bin/Caddyfile - initcaddy: bin/initcaddy - prime: - - bin - caddy: - prepare: ./resources/preparecaddy - plugin: dump - source: ./ - prime: - - bin - organize: - caddy: bin/caddy - after: [mongodb] - hooks: - plugin: nil - stage-packages: - - dnsutils - - curl - prime: - - usr - - lib - diff --git a/apps/meteor/app/api/server/api.d.ts b/apps/meteor/app/api/server/api.d.ts index 98fcefe501e1..e8a8634e0615 100644 --- a/apps/meteor/app/api/server/api.d.ts +++ b/apps/meteor/app/api/server/api.d.ts @@ -82,6 +82,7 @@ type PartialThis = { }; type ActionThis = { + readonly requestIp: string; urlParams: UrlParams; // TODO make it unsafe readonly queryParams: TMethod extends 'GET' @@ -110,16 +111,29 @@ type ActionThis({ object, userId }: { object: { [key: string]: unknown }; userId: string }): { [key: string]: unknown } & T; composeRoomWithLastMessage(room: IRoom, userId: string): IRoom; } & (TOptions extends { authRequired: true } ? { readonly user: IUser; readonly userId: string; + readonly token: string; } : { readonly user: null; - readonly userId: null; + readonly userId: undefined; + readonly token?: string; }); export type ResultFor = diff --git a/apps/meteor/app/api/server/v1/invites.js b/apps/meteor/app/api/server/v1/invites.ts similarity index 50% rename from apps/meteor/app/api/server/v1/invites.js rename to apps/meteor/app/api/server/v1/invites.ts index 907585a818bc..8ac3a2b8eddb 100644 --- a/apps/meteor/app/api/server/v1/invites.js +++ b/apps/meteor/app/api/server/v1/invites.ts @@ -1,3 +1,7 @@ +/* eslint-disable react-hooks/rules-of-hooks */ +import { IInvite } from '@rocket.chat/core-typings'; +import { isFindOrCreateInviteParams, isUseInviteTokenProps, isValidateInviteTokenProps } from '@rocket.chat/rest-typings'; + import { API } from '../api'; import { findOrCreateInvite } from '../../../invites/server/functions/findOrCreateInvite'; import { removeInvite } from '../../../invites/server/functions/removeInvite'; @@ -7,10 +11,12 @@ import { validateInviteToken } from '../../../invites/server/functions/validateI API.v1.addRoute( 'listInvites', - { authRequired: true }, { - get() { - const result = Promise.await(listInvites(this.userId)); + authRequired: true, + }, + { + async get() { + const result = await listInvites(this.userId); return API.v1.success(result); }, }, @@ -18,13 +24,15 @@ API.v1.addRoute( API.v1.addRoute( 'findOrCreateInvite', - { authRequired: true }, { - post() { + authRequired: true, + validateParams: isFindOrCreateInviteParams, + }, + { + async post() { const { rid, days, maxUses } = this.bodyParams; - const result = Promise.await(findOrCreateInvite(this.userId, { rid, days, maxUses })); - return API.v1.success(result); + return API.v1.success((await findOrCreateInvite(this.userId, { rid, days, maxUses })) as IInvite); }, }, ); @@ -33,44 +41,44 @@ API.v1.addRoute( 'removeInvite/:_id', { authRequired: true }, { - delete() { + async delete() { const { _id } = this.urlParams; - const result = Promise.await(removeInvite(this.userId, { _id })); - return API.v1.success(result); + return API.v1.success(await removeInvite(this.userId, { _id })); }, }, ); API.v1.addRoute( 'useInviteToken', - { authRequired: true }, { - post() { + authRequired: true, + validateParams: isUseInviteTokenProps, + }, + { + async post() { const { token } = this.bodyParams; // eslint-disable-next-line react-hooks/rules-of-hooks - const result = Promise.await(useInviteToken(this.userId, token)); - return API.v1.success(result); + return API.v1.success(await useInviteToken(this.userId, token)); }, }, ); API.v1.addRoute( 'validateInviteToken', - { authRequired: false }, { - post() { + authRequired: false, + validateParams: isValidateInviteTokenProps, + }, + { + async post() { const { token } = this.bodyParams; - - let valid = true; try { - Promise.await(validateInviteToken(token)); - } catch (e) { - valid = false; + return API.v1.success({ valid: Boolean(await validateInviteToken(token)) }); + } catch (_) { + return API.v1.success({ valid: false }); } - - return API.v1.success({ valid }); }, }, ); diff --git a/apps/meteor/app/api/server/v1/misc.js b/apps/meteor/app/api/server/v1/misc.ts similarity index 74% rename from apps/meteor/app/api/server/v1/misc.js rename to apps/meteor/app/api/server/v1/misc.ts index 77b8519c3818..9a7b7135a56a 100644 --- a/apps/meteor/app/api/server/v1/misc.js +++ b/apps/meteor/app/api/server/v1/misc.ts @@ -6,6 +6,14 @@ import { TAPi18n } from 'meteor/rocketchat:tap-i18n'; import { EJSON } from 'meteor/ejson'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { escapeHTML } from '@rocket.chat/string-helpers'; +import { + isShieldSvgProps, + isSpotlightProps, + isDirectoryProps, + isMethodCallProps, + isMethodCallAnonProps, + isMeteorCall, +} from '@rocket.chat/rest-typings'; import { hasPermission } from '../../../authorization/server'; import { Users } from '../../../models/server'; @@ -97,8 +105,6 @@ import { SystemLogger } from '../../../../server/lib/logger/system'; * type: object * tokenpass: * type: object - * blockstack: - * type: object * password: * type: object * properties: @@ -178,9 +184,17 @@ API.v1.addRoute( let onlineCache = 0; let onlineCacheDate = 0; const cacheInvalid = 60000; // 1 minute + API.v1.addRoute( 'shield.svg', - { authRequired: false, rateLimiterOptions: { numRequestsAllowed: 60, intervalTimeInMS: 60000 } }, + { + authRequired: false, + rateLimiterOptions: { + numRequestsAllowed: 60, + intervalTimeInMS: 60000, + }, + validateParams: isShieldSvgProps, + }, { get() { const { type, icon } = this.queryParams; @@ -191,13 +205,13 @@ API.v1.addRoute( }); } - const types = settings.get('API_Shield_Types'); + const types = settings.get('API_Shield_Types'); if ( type && types !== '*' && !types .split(',') - .map((t) => t.trim()) + .map((t: string) => t.trim()) .includes(type) ) { throw new Meteor.Error('error-shield-disabled', 'This shield type is disabled', { @@ -299,23 +313,22 @@ API.v1.addRoute( ` .trim() .replace(/\>[\s]+\<'), - }; + } as any; }, }, ); API.v1.addRoute( 'spotlight', - { authRequired: true }, + { + authRequired: true, + validateParams: isSpotlightProps, + }, { get() { - check(this.queryParams, { - query: String, - }); - const { query } = this.queryParams; - const result = Meteor.runAsUser(this.userId, () => Meteor.call('spotlight', query)); + const result = Meteor.call('spotlight', query); return API.v1.success(result); }, @@ -324,7 +337,10 @@ API.v1.addRoute( API.v1.addRoute( 'directory', - { authRequired: true }, + { + authRequired: true, + validateParams: isDirectoryProps, + }, { get() { const { offset, count } = this.getPaginationItems(); @@ -338,17 +354,15 @@ API.v1.addRoute( const sortBy = sort ? Object.keys(sort)[0] : undefined; const sortDirection = sort && Object.values(sort)[0] === 1 ? 'asc' : 'desc'; - const result = Meteor.runAsUser(this.userId, () => - Meteor.call('browseChannels', { - text, - type, - workspace, - sortBy, - sortDirection, - offset: Math.max(0, offset), - limit: Math.max(0, count), - }), - ); + const result = Meteor.call('browseChannels', { + text, + type, + workspace, + sortBy, + sortDirection, + offset: Math.max(0, offset), + limit: Math.max(0, count), + }); if (!result) { return API.v1.failure('Please verify the parameters'); @@ -412,60 +426,154 @@ API.v1.addRoute( }, ); -const mountResult = ({ id, error, result }) => ({ +declare module '@rocket.chat/rest-typings' { + // eslint-disable-next-line @typescript-eslint/interface-name-prefix + interface Endpoints { + 'method.call/:method': { + POST: (params: { method: string; args: any[] }) => any; + }; + 'method.callAnon/:method': { + POST: (params: { method: string; args: any[] }) => any; + }; + } +} + +const mountResult = ({ + id, + error, + result, +}: { + id: string; + error?: unknown; + result?: unknown; +}): { + message: string; +} => ({ message: EJSON.stringify({ msg: 'result', id, - error, - result, + error: error as any, + result: result as any, }), }); -const methodCall = () => ({ - post() { - check(this.bodyParams, { - message: String, - }); - - const { method, params, id } = EJSON.parse(this.bodyParams.message); - - const connectionId = - this.token || - crypto - .createHash('md5') - .update(this.requestIp + this.request.headers['user-agent']) - .digest('hex'); - - const rateLimiterInput = { - userId: this.userId, - clientAddress: this.requestIp, - type: 'method', - name: method, - connectionId, - }; +// had to create two different endpoints for authenticated and non-authenticated calls +// because restivus does not provide 'this.userId' if 'authRequired: false' +API.v1.addRoute( + 'method.call/:method', + { + authRequired: true, + rateLimiterOptions: false, + validateParams: isMeteorCall, + }, + { + post() { + check(this.bodyParams, { + message: String, + }); - try { - DDPRateLimiter._increment(rateLimiterInput); - const rateLimitResult = DDPRateLimiter._check(rateLimiterInput); - if (!rateLimitResult.allowed) { - throw new Meteor.Error('too-many-requests', DDPRateLimiter.getErrorMessage(rateLimitResult), { - timeToReset: rateLimitResult.timeToReset, - }); + const data = EJSON.parse(this.bodyParams.message); + + if (!isMethodCallProps(data)) { + return API.v1.failure('Invalid method call'); } - const result = Meteor.call(method, ...params); - return API.v1.success(mountResult({ id, result })); - } catch (error) { - SystemLogger.error(`Exception while invoking method ${method}`, error.message); - if (settings.get('Log_Level') === '2') { - Meteor._debug(`Exception while invoking method ${method}`, error); + const { method, params, id } = data; + + const connectionId = + this.token || + crypto + .createHash('md5') + .update(this.requestIp + this.request.headers['user-agent']) + .digest('hex'); + + const rateLimiterInput = { + userId: this.userId, + clientAddress: this.requestIp, + type: 'method', + name: method, + connectionId, + }; + + try { + DDPRateLimiter._increment(rateLimiterInput); + const rateLimitResult = DDPRateLimiter._check(rateLimiterInput); + if (!rateLimitResult.allowed) { + throw new Meteor.Error('too-many-requests', DDPRateLimiter.getErrorMessage(rateLimitResult), { + timeToReset: rateLimitResult.timeToReset, + }); + } + + const result = Meteor.call(method, ...params); + return API.v1.success(mountResult({ id, result })); + } catch (error) { + if (error instanceof Error) SystemLogger.error(`Exception while invoking method ${method}`, error.message); + else SystemLogger.error(`Exception while invoking method ${method}`, error); + + if (settings.get('Log_Level') === '2') { + Meteor._debug(`Exception while invoking method ${method}`, error); + } + return API.v1.success(mountResult({ id, error })); } - return API.v1.success(mountResult({ id, error })); - } + }, }, -}); +); +API.v1.addRoute( + 'method.callAnon/:method', + { + authRequired: false, + rateLimiterOptions: false, + validateParams: isMeteorCall, + }, + { + post() { + check(this.bodyParams, { + message: String, + }); -// had to create two different endpoints for authenticated and non-authenticated calls -// because restivus does not provide 'this.userId' if 'authRequired: false' -API.v1.addRoute('method.call/:method', { authRequired: true, rateLimiterOptions: false }, methodCall()); -API.v1.addRoute('method.callAnon/:method', { authRequired: false, rateLimiterOptions: false }, methodCall()); + const data = EJSON.parse(this.bodyParams.message); + + if (!isMethodCallAnonProps(data)) { + return API.v1.failure('Invalid method call'); + } + + const { method, params, id } = data; + + const connectionId = + this.token || + crypto + .createHash('md5') + .update(this.requestIp + this.request.headers['user-agent']) + .digest('hex'); + + const rateLimiterInput = { + userId: this.userId || undefined, + clientAddress: this.requestIp, + type: 'method', + name: method, + connectionId, + }; + + try { + DDPRateLimiter._increment(rateLimiterInput); + const rateLimitResult = DDPRateLimiter._check(rateLimiterInput); + if (!rateLimitResult.allowed) { + throw new Meteor.Error('too-many-requests', DDPRateLimiter.getErrorMessage(rateLimitResult), { + timeToReset: rateLimitResult.timeToReset, + }); + } + + const result = Meteor.call(method, ...params); + return API.v1.success(mountResult({ id, result })); + } catch (error) { + if (error instanceof Error) SystemLogger.error(`Exception while invoking method ${method}`, error.message); + else SystemLogger.error(`Exception while invoking method ${method}`, error); + + if (settings.get('Log_Level') === '2') { + Meteor._debug(`Exception while invoking method ${method}`, error); + } + return API.v1.success(mountResult({ id, error })); + } + }, + }, +); diff --git a/apps/meteor/app/api/server/v1/subscriptions.js b/apps/meteor/app/api/server/v1/subscriptions.js deleted file mode 100644 index 6624ede0e6c4..000000000000 --- a/apps/meteor/app/api/server/v1/subscriptions.js +++ /dev/null @@ -1,99 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { check } from 'meteor/check'; - -import { Subscriptions } from '../../../models'; -import { API } from '../api'; - -API.v1.addRoute( - 'subscriptions.get', - { authRequired: true }, - { - get() { - const { updatedSince } = this.queryParams; - - let updatedSinceDate; - if (updatedSince) { - if (isNaN(Date.parse(updatedSince))) { - throw new Meteor.Error('error-roomId-param-invalid', 'The "lastUpdate" query parameter must be a valid date.'); - } else { - updatedSinceDate = new Date(updatedSince); - } - } - - let result; - Meteor.runAsUser(this.userId, () => { - result = Meteor.call('subscriptions/get', updatedSinceDate); - }); - - if (Array.isArray(result)) { - result = { - update: result, - remove: [], - }; - } - - return API.v1.success(result); - }, - }, -); - -API.v1.addRoute( - 'subscriptions.getOne', - { authRequired: true }, - { - get() { - const { roomId } = this.requestParams(); - - if (!roomId) { - return API.v1.failure("The 'roomId' param is required"); - } - - const subscription = Subscriptions.findOneByRoomIdAndUserId(roomId, this.userId); - - return API.v1.success({ - subscription, - }); - }, - }, -); - -/** - This API is suppose to mark any room as read. - - Method: POST - Route: api/v1/subscriptions.read - Params: - - rid: The rid of the room to be marked as read. - */ -API.v1.addRoute( - 'subscriptions.read', - { authRequired: true }, - { - post() { - check(this.bodyParams, { - rid: String, - }); - - Meteor.runAsUser(this.userId, () => Meteor.call('readMessages', this.bodyParams.rid)); - - return API.v1.success(); - }, - }, -); - -API.v1.addRoute( - 'subscriptions.unread', - { authRequired: true }, - { - post() { - const { roomId, firstUnreadMessage } = this.bodyParams; - if (!roomId && firstUnreadMessage && !firstUnreadMessage._id) { - return API.v1.failure('At least one of "roomId" or "firstUnreadMessage._id" params is required'); - } - - Meteor.runAsUser(this.userId, () => Meteor.call('unreadMessages', firstUnreadMessage, roomId)); - - return API.v1.success(); - }, - }, -); diff --git a/apps/meteor/app/api/server/v1/subscriptions.ts b/apps/meteor/app/api/server/v1/subscriptions.ts new file mode 100644 index 000000000000..c042863eb1ec --- /dev/null +++ b/apps/meteor/app/api/server/v1/subscriptions.ts @@ -0,0 +1,101 @@ +import { Meteor } from 'meteor/meteor'; +import { + isSubscriptionsGetProps, + isSubscriptionsGetOneProps, + isSubscriptionsReadProps, + isSubscriptionsUnreadProps, +} from '@rocket.chat/rest-typings'; + +import { Subscriptions } from '../../../models/server/raw'; +import { API } from '../api'; + +API.v1.addRoute( + 'subscriptions.get', + { + authRequired: true, + validateParams: isSubscriptionsGetProps, + }, + { + async get() { + const { updatedSince } = this.queryParams; + + let updatedSinceDate: Date | undefined; + if (updatedSince) { + if (isNaN(Date.parse(updatedSince as string))) { + throw new Meteor.Error('error-roomId-param-invalid', 'The "lastUpdate" query parameter must be a valid date.'); + } + updatedSinceDate = new Date(updatedSince as string); + } + + const result = await Meteor.call('subscriptions/get', updatedSinceDate); + + return API.v1.success( + Array.isArray(result) + ? { + update: result, + remove: [], + } + : result, + ); + }, + }, +); + +API.v1.addRoute( + 'subscriptions.getOne', + { + authRequired: true, + validateParams: isSubscriptionsGetOneProps, + }, + { + async get() { + const { roomId }: { [roomId: string]: {} } | Record = this.queryParams; + + if (!roomId) { + return API.v1.failure("The 'roomId' param is required"); + } + + return API.v1.success({ + subscription: await Subscriptions.findOneByRoomIdAndUserId(roomId as string, this.userId), + }); + }, + }, +); + +/** + This API is suppose to mark any room as read. + + Method: POST + Route: api/v1/subscriptions.read + Params: + - rid: The rid of the room to be marked as read. + */ +API.v1.addRoute( + 'subscriptions.read', + { + authRequired: true, + validateParams: isSubscriptionsReadProps, + }, + { + post() { + Meteor.call('readMessages', this.bodyParams.rid); + + return API.v1.success(); + }, + }, +); + +API.v1.addRoute( + 'subscriptions.unread', + { + authRequired: true, + validateParams: isSubscriptionsUnreadProps, + }, + { + post() { + Meteor.call('unreadMessages', (this.bodyParams as any).firstUnreadMessage, (this.bodyParams as any).roomId); + + return API.v1.success(); + }, + }, +); diff --git a/apps/meteor/app/blockstack/client/index.js b/apps/meteor/app/blockstack/client/index.js deleted file mode 100644 index 23420dbe4d70..000000000000 --- a/apps/meteor/app/blockstack/client/index.js +++ /dev/null @@ -1,53 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { ServiceConfiguration } from 'meteor/service-configuration'; -import { check, Match } from 'meteor/check'; -import { Session } from 'meteor/session'; -import './routes'; - -const handleError = (error) => error && Session.set('errorMessage', error.reason || 'Unknown error'); - -// TODO: allow serviceConfig.loginStyle == popup -Meteor.loginWithBlockstack = (options, callback = handleError) => { - if (!options || !options.redirectURI) { - options = ServiceConfiguration.configurations.findOne({ - service: 'blockstack', - }); - - options.blockstackIDHost = Meteor.Device.isDesktop() ? 'http://localhost:8888/auth' : 'https://blockstack.org/auth'; - - options.scopes = ['store_write']; - } - - try { - check( - options, - Match.ObjectIncluding({ - blockstackIDHost: String, - redirectURI: String, - manifestURI: String, - }), - ); - - import('blockstack/dist/blockstack').then(({ redirectToSignIn }) => - redirectToSignIn(options.redirectURI, options.manifestURI, options.scopes), - ); - } catch (err) { - callback.call(Meteor, err); - } -}; - -const meteorLogout = Meteor.logout; -Meteor.logout = (...args) => { - const serviceConfig = ServiceConfiguration.configurations.findOne({ - service: 'blockstack', - }); - - const blockstackAuth = Session.get('blockstack_auth'); - - if (serviceConfig && blockstackAuth) { - Session.delete('blockstack_auth'); - import('blockstack/dist/blockstack').then(({ signUserOut }) => signUserOut(window.location.href)); - } - - return meteorLogout(...args); -}; diff --git a/apps/meteor/app/blockstack/client/routes.js b/apps/meteor/app/blockstack/client/routes.js deleted file mode 100644 index 1f0e340c5eda..000000000000 --- a/apps/meteor/app/blockstack/client/routes.js +++ /dev/null @@ -1,46 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { Accounts } from 'meteor/accounts-base'; -import { FlowRouter } from 'meteor/kadira:flow-router'; - -const blockstackLogin = (authResponse, userData = {}) => { - Accounts.callLoginMethod({ - methodArguments: [ - { - blockstack: true, - authResponse, - userData, - }, - ], - userCallback() { - FlowRouter.go('home'); - }, - }); -}; - -FlowRouter.route('/_blockstack/validate', { - name: 'blockstackValidate', - async action(params, queryParams) { - const blockstack = await import('blockstack/dist/blockstack'); - - if (Meteor.userId()) { - console.log('Blockstack Auth requested when already logged in. Reloading.'); - return FlowRouter.go('home'); - } - - if (queryParams.authResponse == null) { - throw new Meteor.Error('Blockstack: Auth request without response param.'); - } - - let userData; - - if (blockstack.isUserSignedIn()) { - userData = blockstack.loadUserData(); - } - - if (blockstack.isSignInPending()) { - userData = await blockstack.handlePendingSignIn(); - } - - blockstackLogin(queryParams.authResponse, userData); - }, -}); diff --git a/apps/meteor/app/blockstack/server/index.js b/apps/meteor/app/blockstack/server/index.js deleted file mode 100644 index f0cf809aaf0e..000000000000 --- a/apps/meteor/app/blockstack/server/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import './routes.js'; -import './settings.js'; -import './loginHandler.js'; diff --git a/apps/meteor/app/blockstack/server/logger.js b/apps/meteor/app/blockstack/server/logger.js deleted file mode 100644 index e88f4df9bf1c..000000000000 --- a/apps/meteor/app/blockstack/server/logger.js +++ /dev/null @@ -1,3 +0,0 @@ -import { Logger } from '../../logger'; - -export const logger = new Logger('Blockstack'); diff --git a/apps/meteor/app/blockstack/server/loginHandler.js b/apps/meteor/app/blockstack/server/loginHandler.js deleted file mode 100644 index c1f50416d5c8..000000000000 --- a/apps/meteor/app/blockstack/server/loginHandler.js +++ /dev/null @@ -1,56 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { Accounts } from 'meteor/accounts-base'; - -import { updateOrCreateUser } from './userHandler'; -import { handleAccessToken } from './tokenHandler'; -import { logger } from './logger'; -import { settings } from '../../settings/server'; -import { Users } from '../../models'; -import { setUserAvatar } from '../../lib'; - -// Blockstack login handler, triggered by a blockstack authResponse in route -Accounts.registerLoginHandler('blockstack', (loginRequest) => { - if (!loginRequest.blockstack || !loginRequest.authResponse) { - return; - } - - if (!settings.get('Blockstack_Enable')) { - return; - } - - logger.debug('Processing login request', loginRequest); - - const auth = handleAccessToken(loginRequest); - - // TODO: Fix #9484 and re-instate usage of accounts helper - // const result = Accounts.updateOrCreateUserFromExternalService('blockstack', auth.serviceData, auth.options) - const result = updateOrCreateUser(auth.serviceData, auth.options); - logger.debug('User create/update result', result); - - // Ensure processing succeeded - if (result === undefined || result.userId === undefined) { - return { - type: 'blockstack', - error: new Meteor.Error(Accounts.LoginCancelledError.numericError, 'User creation failed from Blockstack response token'), - }; - } - - if (result.isNew) { - try { - const user = Users.findOneById(result.userId, { - fields: { 'services.blockstack.image': 1, 'username': 1 }, - }); - if (user && user.services && user.services.blockstack && user.services.blockstack.image) { - Meteor.runAsUser(user._id, () => { - setUserAvatar(user, user.services.blockstack.image, undefined, 'url'); - }); - } - } catch (e) { - logger.error(e); - } - } - - delete result.isNew; - - return result; -}); diff --git a/apps/meteor/app/blockstack/server/routes.js b/apps/meteor/app/blockstack/server/routes.js deleted file mode 100644 index 9f6bc061f787..000000000000 --- a/apps/meteor/app/blockstack/server/routes.js +++ /dev/null @@ -1,31 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { WebApp } from 'meteor/webapp'; - -import { settings } from '../../settings/server'; -import { RocketChatAssets } from '../../assets/server'; - -WebApp.connectHandlers.use( - '/_blockstack/manifest', - Meteor.bindEnvironment(function (req, res) { - const name = settings.get('Site_Name'); - const startUrl = Meteor.absoluteUrl(); - const description = settings.get('Blockstack_Auth_Description'); - const iconUrl = RocketChatAssets.getURL('Assets_favicon_192'); - - res.writeHead(200, { - 'Content-Type': 'application/json', - 'Access-Control-Allow-Origin': '*', - }); - - res.end(`{ - "name": "${name}", - "start_url": "${startUrl}", - "description": "${description}", - "icons": [{ - "src": "${iconUrl}", - "sizes": "192x192", - "type": "image/png" - }] - }`); - }), -); diff --git a/apps/meteor/app/blockstack/server/settings.js b/apps/meteor/app/blockstack/server/settings.js deleted file mode 100644 index 640e35187a6b..000000000000 --- a/apps/meteor/app/blockstack/server/settings.js +++ /dev/null @@ -1,70 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { ServiceConfiguration } from 'meteor/service-configuration'; - -import { logger } from './logger'; -import { settings, settingsRegistry } from '../../settings/server'; - -const defaults = { - enable: false, - loginStyle: 'redirect', - generateUsername: false, - manifestURI: Meteor.absoluteUrl('_blockstack/manifest'), - redirectURI: Meteor.absoluteUrl('_blockstack/validate'), - authDescription: 'Rocket.Chat login', - buttonLabelText: 'Blockstack', - buttonColor: '#271132', - buttonLabelColor: '#ffffff', -}; - -Meteor.startup(() => { - settingsRegistry.addGroup('Blockstack', function () { - this.add('Blockstack_Enable', defaults.enable, { - type: 'boolean', - i18nLabel: 'Enable', - }); - this.add('Blockstack_Auth_Description', defaults.authDescription, { - type: 'string', - }); - this.add('Blockstack_ButtonLabelText', defaults.buttonLabelText, { - type: 'string', - }); - this.add('Blockstack_Generate_Username', defaults.generateUsername, { - type: 'boolean', - }); - }); -}); - -// Helper to return all Blockstack settings -const getSettings = () => - Object.assign({}, defaults, { - enable: settings.get('Blockstack_Enable'), - authDescription: settings.get('Blockstack_Auth_Description'), - buttonLabelText: settings.get('Blockstack_ButtonLabelText'), - generateUsername: settings.get('Blockstack_Generate_Username'), - }); - -// Add settings to auth provider configs on startup -settings.watchMultiple( - ['Blockstack_Enable', 'Blockstack_Auth_Description', 'Blockstack_ButtonLabelText', 'Blockstack_Generate_Username'], - () => { - const serviceConfig = getSettings(); - - if (!serviceConfig.enable) { - logger.debug('Blockstack not enabled', serviceConfig); - return ServiceConfiguration.configurations.remove({ - service: 'blockstack', - }); - } - - ServiceConfiguration.configurations.upsert( - { - service: 'blockstack', - }, - { - $set: serviceConfig, - }, - ); - - logger.debug('Init Blockstack auth', serviceConfig); - }, -); diff --git a/apps/meteor/app/blockstack/server/tokenHandler.js b/apps/meteor/app/blockstack/server/tokenHandler.js deleted file mode 100644 index 29079e3eb0a3..000000000000 --- a/apps/meteor/app/blockstack/server/tokenHandler.js +++ /dev/null @@ -1,63 +0,0 @@ -import { decodeToken } from 'blockstack'; -import { Meteor } from 'meteor/meteor'; -import { Accounts } from 'meteor/accounts-base'; -import { Match, check } from 'meteor/check'; - -import { logger } from './logger'; - -// Handler extracts data from JSON and tokenised reponse. -// Reflects OAuth token service, with some slight modifications for Blockstack. -// -// Uses 'iss' (issuer) as unique key (decentralised ID) for user. -// The 'did' final portion of the blockstack decentralised ID, is displayed as -// your profile ID in the service. This isn't used yet, but could be useful -// to link accounts if identity providers other than btc address are added. -export const handleAccessToken = (loginRequest) => { - logger.debug('Login request received', loginRequest); - - check( - loginRequest, - Match.ObjectIncluding({ - authResponse: String, - userData: Object, - }), - ); - - // Decode auth response for user attributes - const { username, profile } = loginRequest.userData; - const decodedToken = decodeToken(loginRequest.authResponse).payload; - - profile.username = username; - - logger.debug('User data', loginRequest.userData); - logger.debug('Login decoded', decodedToken); - - const { iss, iat, exp } = decodedToken; - - if (!iss) { - return { - type: 'blockstack', - error: new Meteor.Error(Accounts.LoginCancelledError.numericError, 'Insufficient data in auth response token'), - }; - } - - // Collect basic auth provider details - const serviceData = { - id: iss, - did: iss.split(':').pop(), - issuedAt: new Date(iat * 1000), - expiresAt: new Date(exp * 1000), - }; - - // Add Avatar image source to use for auth service suggestions - if (Array.isArray(profile.image) && profile.image.length) { - serviceData.image = profile.image[0].contentUrl; - } - - logger.debug('Login data', serviceData, profile); - - return { - serviceData, - options: { profile }, - }; -}; diff --git a/apps/meteor/app/blockstack/server/userHandler.js b/apps/meteor/app/blockstack/server/userHandler.js deleted file mode 100644 index 393129f74a99..000000000000 --- a/apps/meteor/app/blockstack/server/userHandler.js +++ /dev/null @@ -1,81 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { Accounts } from 'meteor/accounts-base'; -import { ServiceConfiguration } from 'meteor/service-configuration'; - -import { logger } from './logger'; -import { settings } from '../../settings/server'; -import { generateUsernameSuggestion } from '../../lib'; - -// Updates or creates a user after we authenticate with Blockstack -// Clones Accounts.updateOrCreateUserFromExternalService with some modifications -export const updateOrCreateUser = (serviceData, options) => { - const serviceConfig = ServiceConfiguration.configurations.findOne({ service: 'blockstack' }); - logger.debug('Auth config', serviceConfig); - - // Extract user data from service / token - const { id, did } = serviceData; - const { profile } = options; - - // Look for existing Blockstack user - const user = Meteor.users.findOne({ 'services.blockstack.id': id }); - let userId; - let isNew = false; - - // Use found or create a user - if (user) { - logger.info(`User login with Blockstack ID ${id}`); - userId = user._id; - } else { - isNew = true; - let emails = []; - if (!Array.isArray(profile.emails)) { - // Fix absense of emails by adding placeholder address using decentralised - // ID at blockstack.email - a holding domain only, no MX record, does not - // process email, may be used in future to provide decentralised email via - // gaia, encrypting mail for DID user only. @TODO: document this approach. - emails.push({ address: `${did}@blockstack.email`, verified: false }); - } else { - const verified = settings.get('Accounts_Verify_Email_For_External_Accounts'); - // Reformat array of emails into expected format if they exist - emails = profile.emails.map((address) => ({ address, verified })); - } - - const newUser = { - name: profile.name, - active: true, - emails, - services: { blockstack: serviceData }, - }; - - // Set username same as in blockstack, or suggest if none - if (profile.name) { - newUser.name = profile.name; - } - - // Take profile username if exists, or generate one if enabled - if (profile.username && profile.username !== '') { - newUser.username = profile.username; - } else if (serviceConfig.generateUsername === true) { - newUser.username = generateUsernameSuggestion(newUser); - } - // If no username at this point it will suggest one from the name - - // Create and get created user to make a couple more mods before returning - logger.info(`Creating user for Blockstack ID ${id}`); - userId = Accounts.insertUserDoc({}, newUser); - logger.debug('New user ${ userId }', newUser); - } - - // Add login token for blockstack auth session (take expiration from response) - // TODO: Regquired method result format ignores `.when` - const { token } = Accounts._generateStampedLoginToken(); - const tokenExpires = serviceData.expiresAt; - - return { - type: 'blockstack', - userId, - token, - tokenExpires, - isNew, - }; -}; diff --git a/apps/meteor/app/invites/server/functions/validateInviteToken.js b/apps/meteor/app/invites/server/functions/validateInviteToken.js index 385d55ca0ee1..99603999f5ae 100644 --- a/apps/meteor/app/invites/server/functions/validateInviteToken.js +++ b/apps/meteor/app/invites/server/functions/validateInviteToken.js @@ -1,7 +1,6 @@ import { Meteor } from 'meteor/meteor'; -import { Rooms } from '../../../models'; -import { Invites } from '../../../models/server/raw'; +import { Rooms, Invites } from '../../../models/server/raw'; export const validateInviteToken = async (token) => { if (!token || typeof token !== 'string') { @@ -19,7 +18,7 @@ export const validateInviteToken = async (token) => { }); } - const room = Rooms.findOneById(inviteData.rid); + const room = await Rooms.findOneById(inviteData.rid); if (!room) { throw new Meteor.Error('error-invalid-room', 'The invite token is invalid.', { method: 'validateInviteToken', diff --git a/apps/meteor/app/lib/server/functions/getAvatarSuggestionForUser.js b/apps/meteor/app/lib/server/functions/getAvatarSuggestionForUser.js index 57d788d70649..e7bf5755f362 100644 --- a/apps/meteor/app/lib/server/functions/getAvatarSuggestionForUser.js +++ b/apps/meteor/app/lib/server/functions/getAvatarSuggestionForUser.js @@ -74,15 +74,6 @@ const avatarProviders = { } }, - blockstack(user) { - if (user.services && user.services.blockstack && user.services.blockstack.image && settings.get('Blockstack_Enable')) { - return { - service: 'blockstack', - url: user.services.blockstack.image, - }; - } - }, - customOAuth(user) { const avatars = []; for (const service in user.services) { diff --git a/apps/meteor/app/lib/server/methods/refreshOAuthService.ts b/apps/meteor/app/lib/server/methods/refreshOAuthService.ts index 1373cd10d436..466316f4ba76 100644 --- a/apps/meteor/app/lib/server/methods/refreshOAuthService.ts +++ b/apps/meteor/app/lib/server/methods/refreshOAuthService.ts @@ -23,6 +23,6 @@ Meteor.methods({ ServiceConfiguration.configurations.remove({}); - await Settings.update({ _id: /^(Accounts_OAuth_|SAML_|CAS_|Blockstack_).+/ }, { $set: { _updatedAt: new Date() } }, { multi: true }); + await Settings.update({ _id: /^(Accounts_OAuth_|SAML_|CAS_).+/ }, { $set: { _updatedAt: new Date() } }, { multi: true }); }, }); diff --git a/apps/meteor/app/markdown/lib/parser/marked/marked.js b/apps/meteor/app/markdown/lib/parser/marked/marked.js index 7739fe77b7da..22f7974fcace 100644 --- a/apps/meteor/app/markdown/lib/parser/marked/marked.js +++ b/apps/meteor/app/markdown/lib/parser/marked/marked.js @@ -100,7 +100,7 @@ export const marked = (message, { marked: { gfm, tables, breaks, pedantic, smart const window = getGlobalWindow(); const DomPurify = createDOMPurify(window); - message.html = DomPurify.sanitize(message.html, { ADD_ATTR: ['target'] }); + message.html = DomPurify.sanitize(message.html, { ADD_ATTR: ['target'], FORBID_ATTR: ['style'], FORBID_TAGS: ['style'] }); return message; }; diff --git a/apps/meteor/app/mentions/server/methods/getUserMentionsByChannel.js b/apps/meteor/app/mentions/server/methods/getUserMentionsByChannel.js index d554fe1b32a6..9c622e3d6581 100644 --- a/apps/meteor/app/mentions/server/methods/getUserMentionsByChannel.js +++ b/apps/meteor/app/mentions/server/methods/getUserMentionsByChannel.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; import { Rooms, Users, Messages } from '../../../models'; +import { canAccessRoom } from '../../../authorization/server'; Meteor.methods({ getUserMentionsByChannel({ roomId, options }) { @@ -13,16 +14,16 @@ Meteor.methods({ }); } + const user = Users.findOneById(Meteor.userId()); + const room = Rooms.findOneById(roomId); - if (!room) { + if (!room || !canAccessRoom(room, user)) { throw new Meteor.Error('error-invalid-room', 'Invalid room', { method: 'getUserMentionsByChannel', }); } - const user = Users.findOneById(Meteor.userId()); - return Messages.findVisibleByMentionAndRoomId(user.username, roomId, options).fetch(); }, }); diff --git a/apps/meteor/app/metrics/server/lib/collectMetrics.js b/apps/meteor/app/metrics/server/lib/collectMetrics.ts similarity index 77% rename from apps/meteor/app/metrics/server/lib/collectMetrics.js rename to apps/meteor/app/metrics/server/lib/collectMetrics.ts index 46e32dd1d1d8..61eacebba057 100644 --- a/apps/meteor/app/metrics/server/lib/collectMetrics.js +++ b/apps/meteor/app/metrics/server/lib/collectMetrics.ts @@ -15,21 +15,23 @@ import { SystemLogger } from '../../../../server/lib/logger/system'; import { metrics } from './metrics'; import { getAppsStatistics } from '../../../statistics/server/lib/getAppsStatistics'; -Facts.incrementServerFact = function (pkg, fact, increment) { +Facts.incrementServerFact = function (pkg: 'pkg' | 'fact', fact: string | number, increment: number): void { metrics.meteorFacts.inc({ pkg, fact }, increment); }; -const setPrometheusData = async () => { +const setPrometheusData = async (): Promise => { metrics.info.set( { version: Info.version, - unique_id: settings.get('uniqueID'), - site_url: settings.get('Site_Url'), + // eslint-disable-next-line @typescript-eslint/camelcase + unique_id: settings.get('uniqueID'), + // eslint-disable-next-line @typescript-eslint/camelcase + site_url: settings.get('Site_Url'), }, 1, ); - const sessions = Array.from(Meteor.server.sessions.values()); + const sessions = Array.from<{ userId: string }>(Meteor.server.sessions.values()); const authenticatedSessions = sessions.filter((s) => s.userId); metrics.ddpSessions.set(Meteor.server.sessions.size); metrics.ddpAuthenticatedSessions.set(authenticatedSessions.length); @@ -53,7 +55,7 @@ const setPrometheusData = async () => { metrics.version.set({ version: statistics.version }, 1); metrics.migration.set(getControl().version); metrics.instanceCount.set(statistics.instanceCount); - metrics.oplogEnabled.set({ enabled: statistics.oplogEnabled }, 1); + metrics.oplogEnabled.set({ enabled: `${statistics.oplogEnabled}` }, 1); // User statistics metrics.totalUsers.set(statistics.totalUsers); @@ -85,17 +87,17 @@ const app = connect(); // const compression = require('compression'); // app.use(compression()); -app.use('/metrics', (req, res) => { +app.use('/metrics', (_req, res) => { res.setHeader('Content-Type', 'text/plain'); - const data = client.register.metrics(); + client.register.metrics().then((data) => { + metrics.metricsRequests.inc(); + metrics.metricsSize.set(data.length); - metrics.metricsRequests.inc(); - metrics.metricsSize.set(data.length); - - res.end(data); + res.end(data); + }); }); -app.use('/', (req, res) => { +app.use('/', (_req, res) => { const html = ` Rocket.Chat Prometheus Exporter @@ -112,8 +114,8 @@ app.use('/', (req, res) => { const server = http.createServer(app); -let timer; -let resetTimer; +let timer: number; +let resetTimer: number; let defaultMetricsInitiated = false; let gcStatsInitiated = false; const was = { @@ -122,19 +124,19 @@ const was = { resetInterval: 0, collectGC: false, }; -const updatePrometheusConfig = async () => { +const updatePrometheusConfig = async (): Promise => { const is = { port: process.env.PROMETHEUS_PORT || settings.get('Prometheus_Port'), - enabled: settings.get('Prometheus_Enabled'), - resetInterval: settings.get('Prometheus_Reset_Interval'), - collectGC: settings.get('Prometheus_Garbage_Collector'), + enabled: settings.get('Prometheus_Enabled'), + resetInterval: settings.get('Prometheus_Reset_Interval'), + collectGC: settings.get('Prometheus_Garbage_Collector'), }; if (Object.values(is).some((s) => s == null)) { return; } - if (Object.entries(is).every(([k, v]) => v === was[k])) { + if (Object.entries(is).every(([k, v]) => v === was[k as keyof typeof was])) { return; } @@ -162,8 +164,11 @@ const updatePrometheusConfig = async () => { Meteor.clearInterval(resetTimer); if (is.resetInterval) { resetTimer = Meteor.setInterval(() => { - client.register.getMetricsAsArray().forEach((metric) => { - metric.hashMap = {}; + client.register.getMetricsAsArray().then((metrics) => { + metrics.forEach((metric) => { + // @ts-expect-error + metric.hashMap = {}; + }); }); }, is.resetInterval); } @@ -177,7 +182,7 @@ const updatePrometheusConfig = async () => { } if (is.collectGC && gcStatsInitiated === false) { gcStatsInitiated = true; - gcStats()(); + gcStats(client.register)(); } } catch (error) { SystemLogger.error(error); diff --git a/apps/meteor/app/slashcommands-join/client/client.ts b/apps/meteor/app/slashcommands-join/client/client.ts index 3fb1ac1c949d..fcf56d6e55a6 100644 --- a/apps/meteor/app/slashcommands-join/client/client.ts +++ b/apps/meteor/app/slashcommands-join/client/client.ts @@ -10,8 +10,8 @@ slashCommands.add( params: '#channel', permission: 'view-c-room', }, - function (err: Meteor.Error, _result: unknown, params: Record) { - if (err.error === 'error-user-already-in-room') { + function (err, _result: unknown, params: Record) { + if ((err as Meteor.Error).error === 'error-user-already-in-room') { params.cmd = 'open'; params.msg.msg = params.msg.msg.replace('join', 'open'); return slashCommands.run('open', params.params, params.msg, ''); diff --git a/apps/meteor/app/theme/client/imports/general/rtl.css b/apps/meteor/app/theme/client/imports/general/rtl.css index e4a16e61846f..3e260ee22e56 100644 --- a/apps/meteor/app/theme/client/imports/general/rtl.css +++ b/apps/meteor/app/theme/client/imports/general/rtl.css @@ -411,12 +411,6 @@ } } - /* Override toastr messages to show on the left side */ - & .toast-top-right { - right: auto; - left: 12px; - } - @media (width <= 1100px) { & #rocket-chat .flex-opened { left: 0; diff --git a/apps/meteor/app/theme/client/index.js b/apps/meteor/app/theme/client/index.js index 304c6de1954f..2dc7ee1fe082 100644 --- a/apps/meteor/app/theme/client/index.js +++ b/apps/meteor/app/theme/client/index.js @@ -1,4 +1,3 @@ -import 'toastr/build/toastr.min.css'; import './main.css'; import './vendor/photoswipe.css'; import './vendor/fontello/css/fontello.css'; diff --git a/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.js b/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.js index e0d9de196656..3da924f71675 100644 --- a/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.js +++ b/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.js @@ -129,7 +129,7 @@ export class CachedCollection extends Emitter { userRelated = true, listenChangesForLoggedUsersOnly = false, useSync = true, - version = 16, + version = 17, maxCacheTime = 60 * 60 * 24 * 30, onSyncData = (/* action, record */) => {}, }) { diff --git a/apps/meteor/app/ui-sidenav/client/roomList.js b/apps/meteor/app/ui-sidenav/client/roomList.js index 3dfdf1189230..23bb768cf3e8 100644 --- a/apps/meteor/app/ui-sidenav/client/roomList.js +++ b/apps/meteor/app/ui-sidenav/client/roomList.js @@ -129,7 +129,7 @@ const getLowerCaseNames = (room, nameDefault = '', fnameDefault = '') => { const name = room.name || nameDefault; const fname = room.fname || fnameDefault || name; return { - lowerCaseName: String(name).toLowerCase(), + lowerCaseName: String(!room.prid ? name : fname).toLowerCase(), lowerCaseFName: String(fname).toLowerCase(), }; }; diff --git a/apps/meteor/app/utils/server/functions/getDefaultUserFields.ts b/apps/meteor/app/utils/server/functions/getDefaultUserFields.ts index 574d118198b4..2f0dce22cd89 100644 --- a/apps/meteor/app/utils/server/functions/getDefaultUserFields.ts +++ b/apps/meteor/app/utils/server/functions/getDefaultUserFields.ts @@ -27,7 +27,6 @@ export const getDefaultUserFields = (): DefaultUserFields => ({ 'services.github': 1, 'services.gitlab': 1, 'services.tokenpass': 1, - 'services.blockstack': 1, 'services.password.bcrypt': 1, 'services.totp.enabled': 1, 'services.email2fa.enabled': 1, diff --git a/apps/meteor/app/webrtc/client/actionLink.tsx b/apps/meteor/app/webrtc/client/actionLink.tsx index 71b3121226c3..1265d52b14b5 100644 --- a/apps/meteor/app/webrtc/client/actionLink.tsx +++ b/apps/meteor/app/webrtc/client/actionLink.tsx @@ -1,16 +1,16 @@ import { TAPi18n } from 'meteor/rocketchat:tap-i18n'; -import toastr from 'toastr'; import type { IMessage } from '@rocket.chat/core-typings'; import { actionLinks } from '../../action-links/client'; import { APIClient } from '../../utils/client'; import { Rooms } from '../../models/client'; import { Notifications } from '../../notifications/client'; +import { dispatchToastMessage } from '../../../client/lib/toast'; actionLinks.register('joinLivechatWebRTCCall', (message: IMessage) => { const { callStatus, _id } = Rooms.findOne({ _id: message.rid }); if (callStatus === 'declined' || callStatus === 'ended') { - toastr.info(TAPi18n.__('Call_Already_Ended')); + dispatchToastMessage({ type: 'info', message: TAPi18n.__('Call_Already_Ended') }); return; } window.open(`/meet/${_id}`, _id); @@ -19,7 +19,7 @@ actionLinks.register('joinLivechatWebRTCCall', (message: IMessage) => { actionLinks.register('endLivechatWebRTCCall', async (message: IMessage) => { const { callStatus, _id } = Rooms.findOne({ _id: message.rid }); if (callStatus === 'declined' || callStatus === 'ended') { - toastr.info(TAPi18n.__('Call_Already_Ended')); + dispatchToastMessage({ type: 'info', message: TAPi18n.__('Call_Already_Ended') }); return; } await APIClient.v1.put(`livechat/webrtc.call/${message._id}`, {}, { rid: _id, status: 'ended' }); diff --git a/apps/meteor/client/components/RoomAutoComplete/Avatar.tsx b/apps/meteor/client/components/RoomAutoComplete/Avatar.tsx index d90fa71772b4..49041e23d821 100644 --- a/apps/meteor/client/components/RoomAutoComplete/Avatar.tsx +++ b/apps/meteor/client/components/RoomAutoComplete/Avatar.tsx @@ -1,16 +1,16 @@ import { Options } from '@rocket.chat/fuselage'; -import React, { ReactElement } from 'react'; +import React, { FC } from 'react'; import RoomAvatar from '../avatar/RoomAvatar'; type AvatarProps = { value: string; type: string; - avatarETag?: string | undefined; + avatarETag?: string; }; -const Avatar = ({ value, type, avatarETag, ...props }: AvatarProps): ReactElement => ( - +const Avatar: FC = ({ value, type, avatarETag, ...props }) => ( + ); export default Avatar; diff --git a/apps/meteor/client/components/RoomAutoComplete/RoomAutoComplete.tsx b/apps/meteor/client/components/RoomAutoComplete/RoomAutoComplete.tsx index 731d3a724cb5..4cf8077e9853 100644 --- a/apps/meteor/client/components/RoomAutoComplete/RoomAutoComplete.tsx +++ b/apps/meteor/client/components/RoomAutoComplete/RoomAutoComplete.tsx @@ -1,5 +1,5 @@ import { AutoComplete, Option, Box } from '@rocket.chat/fuselage'; -import React, { ComponentProps, memo, ReactElement, useMemo, useState } from 'react'; +import React, { memo, useMemo, useState, ReactElement, ComponentProps } from 'react'; import { useEndpointData } from '../../hooks/useEndpointData'; import RoomAvatar from '../avatar/RoomAvatar'; diff --git a/apps/meteor/client/components/avatar/RoomAvatar.tsx b/apps/meteor/client/components/avatar/RoomAvatar.tsx index 0c4a1105a721..750776a00b5a 100644 --- a/apps/meteor/client/components/avatar/RoomAvatar.tsx +++ b/apps/meteor/client/components/avatar/RoomAvatar.tsx @@ -14,7 +14,7 @@ type RoomAvatarProps = { room: { _id: string; type?: string; - t: string; + t?: string; avatarETag?: string; }; }; diff --git a/apps/meteor/client/importPackages.ts b/apps/meteor/client/importPackages.ts index 4ee4fc8b4688..554c3e280396 100644 --- a/apps/meteor/client/importPackages.ts +++ b/apps/meteor/client/importPackages.ts @@ -69,7 +69,6 @@ import '../app/wordpress/client'; import '../app/nrr/client'; import '../app/meteor-accounts-saml/client'; import '../app/e2e/client'; -import '../app/blockstack/client'; import '../app/version-check/client'; import '../app/search/client'; import '../app/chatpal-search/client'; diff --git a/apps/meteor/client/lib/utils/handleError.ts b/apps/meteor/client/lib/utils/handleError.ts index 87f4bd5cdcd2..1e1370c03dee 100644 --- a/apps/meteor/client/lib/utils/handleError.ts +++ b/apps/meteor/client/lib/utils/handleError.ts @@ -1,6 +1,7 @@ import { escapeHTML } from '@rocket.chat/string-helpers'; import { TAPi18n } from 'meteor/rocketchat:tap-i18n'; -import toastr from 'toastr'; + +import { dispatchToastMessage } from '../toast'; const hasXHR = (error: {}): error is { xhr: JQuery.jqXHR } => 'xhr' in error; @@ -31,10 +32,14 @@ export const handleError = (error: {}, useToastr = true): JQuery | return; } - return toastr.error( - TAPi18n.__(message, Object.fromEntries(Object.entries(details).map(([key, value]) => [key, escapeHTML(TAPi18n.__(value))]))), - hasErrorTitle(details) ? TAPi18n.__(details.errorTitle) : undefined, - ); + const i18message = + (hasErrorTitle(details) ? TAPi18n.__(details.errorTitle) : '') + + TAPi18n.__(message, Object.fromEntries(Object.entries(details).map(([key, value]) => [key, escapeHTML(TAPi18n.__(value))]))); + + dispatchToastMessage({ + type: 'error', + message: i18message, + }); } return escapeHTML(TAPi18n.__(message, Object.fromEntries(Object.entries(details).map(([key, value]) => [key, TAPi18n.__(value)])))); diff --git a/apps/meteor/client/providers/ToastMessagesProvider.tsx b/apps/meteor/client/providers/ToastMessagesProvider.tsx index 509dabece81e..151919273be9 100644 --- a/apps/meteor/client/providers/ToastMessagesProvider.tsx +++ b/apps/meteor/client/providers/ToastMessagesProvider.tsx @@ -1,6 +1,6 @@ +import { ToastBarProvider, useToastBarDispatch } from '@rocket.chat/fuselage-toastbar'; import { ToastMessagesContext } from '@rocket.chat/ui-contexts'; import React, { FC, useEffect } from 'react'; -import toastr from 'toastr'; import { dispatchToastMessage, subscribeToToastMessages } from '../lib/toast'; import { handleError } from '../lib/utils/handleError'; @@ -9,10 +9,12 @@ const contextValue = { dispatch: dispatchToastMessage, }; -const ToastMessagesProvider: FC = ({ children }) => { +const ToastMessageInnerProvider: FC = ({ children }) => { + const dispatchToastBar = useToastBarDispatch(); + useEffect( () => - subscribeToToastMessages(({ type, message, title, options }) => { + subscribeToToastMessages(({ type, message, title = '' }) => { if (type === 'error' && typeof message === 'object') { handleError(message); return; @@ -22,12 +24,23 @@ const ToastMessagesProvider: FC = ({ children }) => { message = `[${message.name}] ${message.message}`; } - toastr[type](message, title, options); + if (type === 'warning') { + return; + } + + dispatchToastBar({ type, message: title + message }); }), - [], + [dispatchToastBar], ); return ; }; +// eslint-disable-next-line react/no-multi-comp +const ToastMessagesProvider: FC = ({ children }) => ( + + + +); + export default ToastMessagesProvider; diff --git a/apps/meteor/client/sidebar/hooks/useQueryOptions.js b/apps/meteor/client/sidebar/hooks/useQueryOptions.js index 6bd31aad23f2..812ef6936832 100644 --- a/apps/meteor/client/sidebar/hooks/useQueryOptions.js +++ b/apps/meteor/client/sidebar/hooks/useQueryOptions.js @@ -10,8 +10,7 @@ export const useQueryOptions = () => { sort: { ...(sortBy === 'activity' && { lm: -1 }), ...(sortBy !== 'activity' && { - ...(showRealName && { lowerCaseFName: /descending/.test(sortBy) ? -1 : 1 }), - ...(!showRealName && { lowerCaseName: /descending/.test(sortBy) ? -1 : 1 }), + ...(showRealName ? { lowerCaseFName: 1 } : { lowerCaseName: 1 }), }), }, }), diff --git a/apps/meteor/client/startup/routes.tsx b/apps/meteor/client/startup/routes.tsx index 4af555824ca3..5d60f65b2cf4 100644 --- a/apps/meteor/client/startup/routes.tsx +++ b/apps/meteor/client/startup/routes.tsx @@ -6,7 +6,6 @@ import { TAPi18n } from 'meteor/rocketchat:tap-i18n'; import { Session } from 'meteor/session'; import { Tracker } from 'meteor/tracker'; import React, { lazy } from 'react'; -import toastr from 'toastr'; import { KonchatNotification } from '../../app/ui/client'; import { APIClient } from '../../app/utils/client'; @@ -82,7 +81,7 @@ FlowRouter.route('/meet/:rid', { return; } - toastr.error(TAPi18n.__('Visitor_does_not_exist')); + dispatchToastMessage({ type: 'error', message: TAPi18n.__('Visitor_does_not_exist') }); return; } diff --git a/apps/meteor/client/startup/startup.ts b/apps/meteor/client/startup/startup.ts index 7d719d600a4e..ac1d44ede102 100644 --- a/apps/meteor/client/startup/startup.ts +++ b/apps/meteor/client/startup/startup.ts @@ -5,7 +5,6 @@ import { Meteor } from 'meteor/meteor'; import { TimeSync } from 'meteor/mizzao:timesync'; import { Session } from 'meteor/session'; import { Tracker } from 'meteor/tracker'; -import toastr from 'toastr'; import { hasPermission } from '../../app/authorization/client'; import { register } from '../../app/markdown/lib/hljs'; @@ -16,13 +15,6 @@ import * as banners from '../lib/banners'; import { synchronizeUserData, removeLocalUserData } from '../lib/userData'; import { fireGlobalEvent } from '../lib/utils/fireGlobalEvent'; -if (window.DISABLE_ANIMATION) { - toastr.options.timeOut = 1; - toastr.options.showDuration = 0; - toastr.options.hideDuration = 0; - toastr.options.extendedTimeOut = 0; -} - Meteor.startup(() => { fireGlobalEvent('startup', true); diff --git a/apps/meteor/client/views/invite/InvitePage.tsx b/apps/meteor/client/views/invite/InvitePage.tsx index 98e3448dbe82..319f997ba089 100644 --- a/apps/meteor/client/views/invite/InvitePage.tsx +++ b/apps/meteor/client/views/invite/InvitePage.tsx @@ -36,9 +36,9 @@ const InvitePage = (): ReactElement => { try { const { valid } = await APIClient.v1.post< - OperationParams<'POST', '/v1/validateInviteToken'>, + OperationParams<'POST', 'validateInviteToken'>, never, - OperationResult<'POST', '/v1/validateInviteToken'> + OperationResult<'POST', 'validateInviteToken'> >('validateInviteToken', { token }); return valid; @@ -65,9 +65,9 @@ const InvitePage = (): ReactElement => { try { const result = await APIClient.v1.post< - OperationParams<'POST', '/v1/useInviteToken'>, + OperationParams<'POST', 'useInviteToken'>, never, - OperationResult<'POST', '/v1/useInviteToken'> + OperationResult<'POST', 'useInviteToken'> >('useInviteToken', { token }); if (!result?.room.name) { dispatchToastMessage({ type: 'error', message: t('Failed_to_activate_invite_token') }); diff --git a/apps/meteor/client/views/omnichannel/agents/AddAgent.tsx b/apps/meteor/client/views/omnichannel/agents/AddAgent.tsx index e0bbee433a4e..dc1e7a9166d9 100644 --- a/apps/meteor/client/views/omnichannel/agents/AddAgent.tsx +++ b/apps/meteor/client/views/omnichannel/agents/AddAgent.tsx @@ -1,17 +1,16 @@ import { Button, Box, Field } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import React, { useState, FC } from 'react'; +import React, { useState, ReactElement } from 'react'; import UserAutoComplete from '../../../components/UserAutoComplete'; import { useEndpointAction } from '../../../hooks/useEndpointAction'; type AddAgentProps = { reload: () => void; - pi?: 'x24'; }; -const AddAgent: FC = ({ reload, ...props }) => { +const AddAgent = ({ reload }: AddAgentProps): ReactElement => { const t = useTranslation(); const [username, setUsername] = useState(''); @@ -29,7 +28,7 @@ const AddAgent: FC = ({ reload, ...props }) => { setUsername(username); }); return ( - + {t('Username')} diff --git a/apps/meteor/client/views/omnichannel/agents/AgentEditWithData.tsx b/apps/meteor/client/views/omnichannel/agents/AgentEditWithData.tsx index 04357e546900..3ff846618622 100644 --- a/apps/meteor/client/views/omnichannel/agents/AgentEditWithData.tsx +++ b/apps/meteor/client/views/omnichannel/agents/AgentEditWithData.tsx @@ -1,6 +1,6 @@ import { Box } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import React, { FC } from 'react'; +import React, { ReactElement } from 'react'; import { FormSkeleton } from '../../../components/Skeleton'; import { AsyncStatePhase } from '../../../hooks/useAsyncState'; @@ -12,7 +12,7 @@ type AgentEditWithDataProps = { reload: () => void; }; -const AgentEditWithData: FC = ({ uid, reload }) => { +const AgentEditWithData = ({ uid, reload }: AgentEditWithDataProps): ReactElement => { const t = useTranslation(); const { value: data, phase: state, error } = useEndpointData(`livechat/users/agent/${uid}`); const { @@ -35,7 +35,7 @@ const AgentEditWithData: FC = ({ uid, reload }) => { } if (error || userDepartmentsError || availableDepartmentsError || !data || !data.user) { - return {t('User_not_found')}; + return {t('User_not_found')}; } return ; diff --git a/apps/meteor/client/views/omnichannel/agents/AgentInfoActions.tsx b/apps/meteor/client/views/omnichannel/agents/AgentInfoActions.tsx index ddd50628da4d..089bb43078ff 100644 --- a/apps/meteor/client/views/omnichannel/agents/AgentInfoActions.tsx +++ b/apps/meteor/client/views/omnichannel/agents/AgentInfoActions.tsx @@ -1,14 +1,12 @@ import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useSetModal, useToastMessageDispatch, useRouteParameter, useRoute, useTranslation } from '@rocket.chat/ui-contexts'; -import React, { VFC } from 'react'; +import React, { ReactElement } from 'react'; import GenericModal from '../../../components/GenericModal'; import { useEndpointAction } from '../../../hooks/useEndpointAction'; import AgentInfo from './AgentInfo'; -const AgentInfoActions: VFC<{ - reload: () => void; -}> = ({ reload }) => { +const AgentInfoActions = ({ reload }: { reload: () => void }): ReactElement => { const t = useTranslation(); const _id = useRouteParameter('id'); const agentsRoute = useRoute('omnichannel-agents'); @@ -48,8 +46,8 @@ const AgentInfoActions: VFC<{ return ( <> - , - , + + ); }; diff --git a/apps/meteor/client/views/omnichannel/agents/AgentsPage.tsx b/apps/meteor/client/views/omnichannel/agents/AgentsPage.tsx index 84293e15582f..94045e8e982f 100644 --- a/apps/meteor/client/views/omnichannel/agents/AgentsPage.tsx +++ b/apps/meteor/client/views/omnichannel/agents/AgentsPage.tsx @@ -1,39 +1,113 @@ -import React, { FC, Key, ReactNode, ReactElement } from 'react'; +import { Box, Pagination } from '@rocket.chat/fuselage'; +import { useDebouncedValue, useMediaQuery, useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { usePermission, useRouteParameter, useTranslation } from '@rocket.chat/ui-contexts'; +import React, { ReactElement, useMemo, useState } from 'react'; import FilterByText from '../../../components/FilterByText'; -import GenericTable from '../../../components/GenericTable'; +import { GenericTableBody, GenericTableHeader, GenericTableHeaderCell, GenericTableLoadingTable } from '../../../components/GenericTable'; +import { GenericTable } from '../../../components/GenericTable/V2/GenericTable'; +import { usePagination } from '../../../components/GenericTable/hooks/usePagination'; +import { useSort } from '../../../components/GenericTable/hooks/useSort'; import Page from '../../../components/Page'; +import { useEndpointData } from '../../../hooks/useEndpointData'; +import { AsyncStatePhase } from '../../../lib/asyncState'; +import NotAuthorizedPage from '../../notAuthorized/NotAuthorizedPage'; import AddAgent from './AddAgent'; +import AgentsPageRow from './AgentsPageRow'; +import AgentsTab from './AgentsTab'; +import { useQuery } from './hooks/useQuery'; -type AgentPageProps = { - reload: () => void; - data: any; - header: ReactNode; - setParams: (params: any) => void; - params: any; - title: string; - renderRow: (props: { _id?: Key }) => ReactElement; -}; +const AgentsPage = (): ReactElement => { + const t = useTranslation(); + const canViewAgents = usePermission('manage-livechat-agents'); + const mediaQuery = useMediaQuery('(min-width: 1024px)'); + + const context = useRouteParameter('context'); + const id = useRouteParameter('id'); + + const { sortBy, sortDirection, setSort } = useSort<'name' | 'username' | 'emails.address' | 'statusLivechat'>('name'); + const [filter, setFilter] = useState(''); + const debouncedFilter = useDebouncedValue(filter, 500); + const debouncedSort = useDebouncedValue( + useMemo(() => [sortBy, sortDirection], [sortBy, sortDirection]), + 500, + ) as ['name' | 'username' | 'emails.address' | 'statusLivechat', 'asc' | 'desc']; + + const { current, itemsPerPage, setItemsPerPage, setCurrent, ...paginationProps } = usePagination(); -const AgentsPage: FC = ({ data, reload, header, setParams, params, title, renderRow, children }) => ( - - - - - - } - /> - + const query = useQuery({ text: debouncedFilter, current, itemsPerPage }, debouncedSort); + const { reload, ...result } = useEndpointData('livechat/users/agent', query); + + const onHeaderClick = useMutableCallback((id) => { + if (sortBy === id) { + setSort(id, sortDirection === 'asc' ? 'desc' : 'asc'); + return; + } + setSort(id, 'asc'); + }); + + if (!canViewAgents) { + return ; + } + + return ( + + + + + + setFilter(text)} /> + + + + + + {t('Name')} + + {mediaQuery && ( + + {t('Username')} + + )} + + {t('Email')} + + + {t('Livechat_status')} + + {t('Remove')} + + + {result.phase === AsyncStatePhase.LOADING && } + {result.phase === AsyncStatePhase.RESOLVED && + result.value.users.map((user) => )} + + + {result.phase === AsyncStatePhase.RESOLVED && ( + + )} + + + {context && id && } - {children} - -); + ); +}; export default AgentsPage; diff --git a/apps/meteor/client/views/omnichannel/agents/AgentsPageRow.tsx b/apps/meteor/client/views/omnichannel/agents/AgentsPageRow.tsx new file mode 100644 index 000000000000..b67fa10033c6 --- /dev/null +++ b/apps/meteor/client/views/omnichannel/agents/AgentsPageRow.tsx @@ -0,0 +1,62 @@ +import { Box } from '@rocket.chat/fuselage'; +import { useRoute, useTranslation } from '@rocket.chat/ui-contexts'; +import React, { ReactElement, useCallback } from 'react'; + +import { GenericTableRow, GenericTableCell } from '../../../components/GenericTable'; +import UserAvatar from '../../../components/avatar/UserAvatar'; +import RemoveAgentButton from './RemoveAgentButton'; + +const AgentsPageRow = ({ + user: { _id, name, username, avatarETag, emails, statusLivechat }, + mediaQuery, + reload, +}: { + user: { _id: string; name?: string; username?: string; avatarETag?: string; emails?: { address: string }[]; statusLivechat: string }; + mediaQuery: boolean; + reload: () => void; +}): ReactElement => { + const t = useTranslation(); + const agentsRoute = useRoute('omnichannel-agents'); + + const onRowClick = useCallback(() => { + agentsRoute.push({ + context: 'info', + id: _id, + }); + }, [_id, agentsRoute]); + + return ( + + + + {username && } + + + + {name || username} + + {!mediaQuery && name && ( + + {`@${username}`} + + )} + + + + + {mediaQuery && ( + + + {username} + + + + )} + {emails?.length && emails[0].address} + {statusLivechat === 'available' ? t('Available') : t('Not_Available')} + + + ); +}; + +export default AgentsPageRow; diff --git a/apps/meteor/client/views/omnichannel/agents/AgentsRoute.tsx b/apps/meteor/client/views/omnichannel/agents/AgentsRoute.tsx deleted file mode 100644 index c47c96f596a5..000000000000 --- a/apps/meteor/client/views/omnichannel/agents/AgentsRoute.tsx +++ /dev/null @@ -1,204 +0,0 @@ -import { Box, Table } from '@rocket.chat/fuselage'; -import { useDebouncedValue, useMediaQuery, useMutableCallback } from '@rocket.chat/fuselage-hooks'; -import { PaginatedRequest } from '@rocket.chat/rest-typings'; -import { useRouteParameter, useRoute, usePermission, useTranslation } from '@rocket.chat/ui-contexts'; -import React, { useMemo, useCallback, useState, FC, ReactElement } from 'react'; - -import GenericTable from '../../../components/GenericTable'; -import { useSort } from '../../../components/GenericTable/hooks/useSort'; -import VerticalBar from '../../../components/VerticalBar'; -import UserAvatar from '../../../components/avatar/UserAvatar'; -import { useEndpointData } from '../../../hooks/useEndpointData'; -import NotAuthorizedPage from '../../notAuthorized/NotAuthorizedPage'; -import AgentEditWithData from './AgentEditWithData'; -import AgentInfo from './AgentInfo'; -import AgentInfoActions from './AgentInfoActions'; -import AgentsPage from './AgentsPage'; -import RemoveAgentButton from './RemoveAgentButton'; - -const sortDir = (sortDir: 'asc' | 'desc'): 1 | -1 => (sortDir === 'asc' ? 1 : -1); - -const useQuery = ( - { - text, - itemsPerPage, - current, - }: { - text: string; - itemsPerPage: number; - current: number; - }, - [column, direction]: [string, 'asc' | 'desc'], -): PaginatedRequest<{ text: string }> => - useMemo( - () => ({ - fields: JSON.stringify({ name: 1, username: 1, emails: 1, avatarETag: 1 }), - text, - sort: JSON.stringify({ - [column]: sortDir(direction), - usernames: column === 'name' ? sortDir(direction) : undefined, - }), - ...(itemsPerPage && { count: itemsPerPage }), - ...(current && { offset: current }), - }), - [text, itemsPerPage, current, column, direction], - ); - -const AgentsRoute: FC = () => { - const t = useTranslation(); - const canViewAgents = usePermission('manage-livechat-agents'); - - const [params, setParams] = useState({ text: '', current: 0, itemsPerPage: 25 }); - const { sortBy, sortDirection, setSort } = useSort<'name' | 'username' | 'emails.address' | 'statusLivechat'>('name'); - - const mediaQuery = useMediaQuery('(min-width: 1024px)'); - - const debouncedParams = useDebouncedValue(params, 500); - const debouncedSort = useDebouncedValue([sortBy, sortDirection], 500) as [ - 'name' | 'username' | 'emails.address' | 'statusLivechat', - 'asc' | 'desc', - ]; - const query = useQuery(debouncedParams, debouncedSort); - const agentsRoute = useRoute('omnichannel-agents'); - const context = useRouteParameter('context'); - const id = useRouteParameter('id'); - - if (!id) { - throw new Error('Agent id is required'); - } - - const onHeaderClick = useMutableCallback((id) => { - if (sortBy === id) { - setSort(id, sortDirection === 'asc' ? 'desc' : 'asc'); - return; - } - setSort(id, 'asc'); - }); - - const onRowClick = useMutableCallback( - (id) => (): void => - agentsRoute.push({ - context: 'info', - id, - }), - ); - - const { value: data, reload } = useEndpointData('livechat/users/agent', query); - - const header = useMemo( - () => - [ - - {t('Name')} - , - mediaQuery && ( - - {t('Username')} - - ), - - {t('Email')} - , - - {t('Livechat_status')} - , - - {t('Remove')} - , - ].filter(Boolean), - [sortDirection, sortBy, onHeaderClick, t, mediaQuery], - ) as ReactElement[]; - - const renderRow = useCallback( - ({ emails, _id, username, name, avatarETag, statusLivechat }) => ( - - - - - - - - {name || username} - - {!mediaQuery && name && ( - - {' '} - {`@${username}`}{' '} - - )} - - - - - {mediaQuery && ( - - - {username} - {' '} - - - )} - {emails?.length && emails[0].address} - {statusLivechat === 'available' ? t('Available') : t('Not_Available')} - - - ), - [mediaQuery, reload, onRowClick, t], - ); - - const EditAgentsTab = useCallback((): ReactElement => { - if (!context) { - return <>; - } - const handleVerticalBarCloseButtonClick = (): void => { - agentsRoute.push({}); - }; - - return ( - - - {context === 'edit' && t('Edit_User')} - {context === 'info' && t('User_Info')} - - - - {context === 'edit' && } - {context === 'info' && ( - - - - )} - - ); - }, [t, context, id, agentsRoute, reload]); - - if (!canViewAgents) { - return ; - } - - return ( - - - - ); -}; - -export default AgentsRoute; diff --git a/apps/meteor/client/views/omnichannel/agents/AgentsTab.tsx b/apps/meteor/client/views/omnichannel/agents/AgentsTab.tsx new file mode 100644 index 000000000000..7662c1f6840c --- /dev/null +++ b/apps/meteor/client/views/omnichannel/agents/AgentsTab.tsx @@ -0,0 +1,35 @@ +import { useRoute, useTranslation } from '@rocket.chat/ui-contexts'; +import React, { ReactElement, useCallback } from 'react'; + +import VerticalBar from '../../../components/VerticalBar'; +import AgentEditWithData from './AgentEditWithData'; +import AgentInfo from './AgentInfo'; +import AgentInfoActions from './AgentInfoActions'; + +const AgentsTab = ({ reload, context, id }: { reload: () => void; context: string; id: string }): ReactElement => { + const t = useTranslation(); + const agentsRoute = useRoute('omnichannel-agents'); + + const handleVerticalBarCloseButtonClick = useCallback((): void => { + agentsRoute.push({}); + }, [agentsRoute]); + + return ( + + + {context === 'edit' && t('Edit_User')} + {context === 'info' && t('User_Info')} + + + + {context === 'edit' && } + {context === 'info' && ( + + + + )} + + ); +}; + +export default AgentsTab; diff --git a/apps/meteor/client/views/omnichannel/agents/RemoveAgentButton.tsx b/apps/meteor/client/views/omnichannel/agents/RemoveAgentButton.tsx index b37303a3ca59..a5f48da05a38 100644 --- a/apps/meteor/client/views/omnichannel/agents/RemoveAgentButton.tsx +++ b/apps/meteor/client/views/omnichannel/agents/RemoveAgentButton.tsx @@ -1,9 +1,10 @@ -import { Table, Icon, Button } from '@rocket.chat/fuselage'; +import { Icon, Button } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useSetModal, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; -import React, { FC } from 'react'; +import React, { ReactElement } from 'react'; import GenericModal from '../../../components/GenericModal'; +import { GenericTableCell } from '../../../components/GenericTable'; import { useEndpointAction } from '../../../hooks/useEndpointAction'; type RemoveAgentButtonProps = { @@ -11,7 +12,7 @@ type RemoveAgentButtonProps = { reload: () => void; }; -const RemoveAgentButton: FC = ({ _id, reload }) => { +const RemoveAgentButton = ({ _id, reload }: RemoveAgentButtonProps): ReactElement => { const deleteAction = useEndpointAction('DELETE', `livechat/users/agent/${_id}`); const setModal = useSetModal(); const dispatchToastMessage = useToastMessageDispatch(); @@ -40,11 +41,11 @@ const RemoveAgentButton: FC = ({ _id, reload }) => { }); return ( - + - + ); }; diff --git a/apps/meteor/client/views/omnichannel/agents/hooks/useQuery.ts b/apps/meteor/client/views/omnichannel/agents/hooks/useQuery.ts new file mode 100644 index 000000000000..fa98e888ca86 --- /dev/null +++ b/apps/meteor/client/views/omnichannel/agents/hooks/useQuery.ts @@ -0,0 +1,30 @@ +import { PaginatedRequest } from '@rocket.chat/rest-typings'; +import { useMemo } from 'react'; + +const sortDir = (sortDir: 'asc' | 'desc'): 1 | -1 => (sortDir === 'asc' ? 1 : -1); + +export const useQuery = ( + { + text, + itemsPerPage, + current, + }: { + text: string; + itemsPerPage: number; + current: number; + }, + [column, direction]: [string, 'asc' | 'desc'], +): PaginatedRequest<{ text: string }> => + useMemo( + () => ({ + fields: JSON.stringify({ name: 1, username: 1, emails: 1, avatarETag: 1 }), + text, + sort: JSON.stringify({ + [column]: sortDir(direction), + usernames: column === 'name' ? sortDir(direction) : undefined, + }), + ...(itemsPerPage && { count: itemsPerPage }), + ...(current && { offset: current }), + }), + [text, itemsPerPage, current, column, direction], + ); diff --git a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.tsx b/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.tsx index b5a20852c467..c970bb2a4f15 100644 --- a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.tsx +++ b/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.tsx @@ -1,6 +1,6 @@ import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; import { Serialized } from '@rocket.chat/core-typings'; -import React, { Dispatch, FC, Key, memo, ReactElement, ReactNode, SetStateAction } from 'react'; +import React, { Key, memo, ReactElement, ReactNode } from 'react'; import GenericTable from '../../../components/GenericTable'; import Page from '../../../components/Page'; @@ -23,19 +23,25 @@ type CurrentChatsPageDataParams = { to: string; customFields: any; current: number; - itemsPerPage: number; + itemsPerPage: 25 | 50 | 100; tags: string[]; }; -const CurrentChatsPage: FC<{ +const CurrentChatsPage = ({ + data, + header, + setParams, + params, + title, + renderRow, +}: { data?: CurrentChatsPageData; header: ReactNode; - setParams: Dispatch>; + setParams: (params: any) => void; // TODO: Change to GenericTable V2 params: CurrentChatsPageDataParams; title: string; renderRow: (props: { _id?: Key }) => ReactElement; - reload: () => void; -}> = ({ data, header, setParams, params, title, renderRow, reload }) => ( +}): ReactElement => ( @@ -46,8 +52,7 @@ const CurrentChatsPage: FC<{ total={data?.total} params={params} setParams={setParams} - reload={reload} - renderFilter={({ onChange, ...props }: any): any => } + renderFilter={({ onChange, ...props }: any): ReactElement => } /> diff --git a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsRoute.tsx b/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsRoute.tsx index fc69981b09a9..f2e7ad337ec7 100644 --- a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsRoute.tsx +++ b/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsRoute.tsx @@ -2,7 +2,7 @@ import { Table } from '@rocket.chat/fuselage'; import { useDebouncedValue, useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useRoute, useRouteParameter, usePermission, useTranslation } from '@rocket.chat/ui-contexts'; import moment from 'moment'; -import React, { useMemo, useCallback, useState, FC } from 'react'; +import React, { useMemo, useCallback, useState, ReactElement } from 'react'; import GenericTable from '../../../components/GenericTable'; import { useEndpointData } from '../../../hooks/useEndpointData'; @@ -22,7 +22,7 @@ type useQueryType = ( to: string; tags: any[]; customFields: any; - itemsPerPage: number; + itemsPerPage: 25 | 50 | 100; current: number; }, debouncedSort: any[], @@ -90,7 +90,7 @@ const useQuery: useQueryType = ( return query; }, [guest, column, direction, itemsPerPage, current, from, to, status, servedBy, department, tags, customFields]); -const CurrentChatsRoute: FC = () => { +const CurrentChatsRoute = (): ReactElement => { const t = useTranslation(); const canViewCurrentChats = usePermission('view-livechat-current-chats'); const canRemoveClosedChats = usePermission('remove-closed-livechat-room'); @@ -107,7 +107,7 @@ const CurrentChatsRoute: FC = () => { to: '', customFields: {}, current: 0, - itemsPerPage: 25, + itemsPerPage: 25 as 25 | 50 | 100, tags: [] as string[], }); const [sort, setSort] = useState<[string, 'asc' | 'desc' | undefined]>(['ts', 'desc']); @@ -207,7 +207,6 @@ const CurrentChatsRoute: FC = () => { setParams={setParams} params={params} data={data} - reload={reload} header={header} renderRow={renderRow} title={t('Current_Chats')} diff --git a/apps/meteor/client/views/omnichannel/routes.ts b/apps/meteor/client/views/omnichannel/routes.ts index d7ab9012aca7..0ff9756b311d 100644 --- a/apps/meteor/client/views/omnichannel/routes.ts +++ b/apps/meteor/client/views/omnichannel/routes.ts @@ -20,7 +20,7 @@ registerOmnichannelRoute('/managers', { registerOmnichannelRoute('/agents/:context?/:id?', { name: 'omnichannel-agents', - component: lazy(() => import('./agents/AgentsRoute')), + component: lazy(() => import('./agents/AgentsPage')), }); registerOmnichannelRoute('/webhooks', { diff --git a/apps/meteor/definition/externals/meteor/ddp-rate-limiter.d.ts b/apps/meteor/definition/externals/meteor/ddp-rate-limiter.d.ts new file mode 100644 index 000000000000..784abd6def11 --- /dev/null +++ b/apps/meteor/definition/externals/meteor/ddp-rate-limiter.d.ts @@ -0,0 +1,10 @@ +declare module 'meteor/ddp-rate-limiter' { + namespace DDPRateLimiter { + function _increment(number: DDPRateLimiter.Matcher): void; + function _check(number: DDPRateLimiter.Matcher): { + allowed: boolean; + timeToReset: number; + }; + function getErrorMessage(result: { allowed: boolean }): string; + } +} diff --git a/apps/meteor/definition/externals/meteor/facts-base.d.ts b/apps/meteor/definition/externals/meteor/facts-base.d.ts new file mode 100644 index 000000000000..9b56d44d5ce2 --- /dev/null +++ b/apps/meteor/definition/externals/meteor/facts-base.d.ts @@ -0,0 +1,5 @@ +declare module 'meteor/facts-base' { + namespace Facts { + function incrementServerFact(pkg: 'pkg' | 'fact', fact: string | number, increment: number): void; + } +} diff --git a/apps/meteor/definition/externals/meteor/mongo.d.ts b/apps/meteor/definition/externals/meteor/mongo.d.ts index 7efb5b5b0860..7c973f888777 100644 --- a/apps/meteor/definition/externals/meteor/mongo.d.ts +++ b/apps/meteor/definition/externals/meteor/mongo.d.ts @@ -12,6 +12,7 @@ declare module 'meteor/mongo' { onSkippedEntries(callback: Function): void; waitUntilCaughtUp(): void; _defineTooFarBehind(value: number): void; + _entryQueue?: unknown[]; } interface MongoConnection { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index aabd707580e3..993111666eba 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -115,6 +115,7 @@ "@types/nodemailer": "^6.4.4", "@types/parseurl": "^1.3.1", "@types/photoswipe": "^4.1.2", + "@types/prometheus-gc-stats": "^0.6.2", "@types/psl": "^1.1.0", "@types/react": "~17.0.42", "@types/react-dom": "~17.0.14", @@ -124,7 +125,6 @@ "@types/sinon": "^10.0.11", "@types/string-strip-html": "^5.0.0", "@types/supertest": "^2.0.11", - "@types/toastr": "^2.1.39", "@types/ua-parser-js": "^0.7.36", "@types/underscore.string": "0.0.38", "@types/use-subscription": "^1.0.0", @@ -194,8 +194,9 @@ "@rocket.chat/fuselage": "0.31.13", "@rocket.chat/fuselage-hooks": "~0.31.12", "@rocket.chat/fuselage-polyfills": "~0.31.12", + "@rocket.chat/fuselage-toastbar": "^0.32.0-dev.22", "@rocket.chat/fuselage-tokens": "~0.31.12", - "@rocket.chat/fuselage-ui-kit": "~0.31.12", + "@rocket.chat/fuselage-ui-kit": "~0.31.14-dev.1", "@rocket.chat/icons": "~0.31.12", "@rocket.chat/logo": "~0.31.12", "@rocket.chat/memo": "~0.31.12", @@ -226,7 +227,6 @@ "aws-sdk": "^2.1121.0", "bad-words": "^3.0.4", "bcrypt": "^5.0.1", - "blockstack": "19.3.0", "body-parser": "1.20.0", "bson": "^4.6.3", "busboy": "^1.6.0", @@ -336,7 +336,6 @@ "string-strip-html": "^7.0.3", "tar-stream": "^1.6.2", "tinykeys": "^1.4.0", - "toastr": "^2.1.4", "turndown": "^7.1.1", "twilio": "^3.76.1", "twit": "^2.2.11", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 3b2158bfdbdb..3a8be97ee912 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -683,11 +683,6 @@ "Block_Multiple_Failed_Logins_Notify_Failed_Channel_Desc": "This is where notifications will be received. Make sure the channel exists. The channel name should not include # symbol", "Block_User": "Block User", "Blockchain": "Blockchain", - "Blockstack": "Blockstack", - "Blockstack_Description": "Give workspace members the ability to sign in without relying on any third parties or remote servers.", - "Blockstack_Auth_Description": "Auth description", - "Blockstack_ButtonLabelText": "Button label text", - "Blockstack_Generate_Username": "Generate username", "Body": "Body", "bold": "bold", "bot_request": "Bot request", diff --git a/apps/meteor/server/importPackages.ts b/apps/meteor/server/importPackages.ts index ab98b032ac0b..1cfec8eabf13 100644 --- a/apps/meteor/server/importPackages.ts +++ b/apps/meteor/server/importPackages.ts @@ -92,7 +92,6 @@ import '../app/webrtc/server'; import '../app/wordpress/server'; import '../app/meteor-accounts-saml/server'; import '../app/e2e/server'; -import '../app/blockstack/server'; import '../app/version-check/server'; import '../app/search/server'; import '../app/chatpal-search/server'; diff --git a/apps/meteor/server/startup/migrations/index.ts b/apps/meteor/server/startup/migrations/index.ts index f293f36a4640..440d32220fdf 100644 --- a/apps/meteor/server/startup/migrations/index.ts +++ b/apps/meteor/server/startup/migrations/index.ts @@ -90,4 +90,5 @@ import './v263'; import './v264'; import './v265'; import './v266'; +import './v267'; import './xrun'; diff --git a/apps/meteor/server/startup/migrations/v267.ts b/apps/meteor/server/startup/migrations/v267.ts new file mode 100644 index 000000000000..65f07177df4b --- /dev/null +++ b/apps/meteor/server/startup/migrations/v267.ts @@ -0,0 +1,27 @@ +import { MongoInternals } from 'meteor/mongo'; +import { ServiceConfiguration } from 'meteor/service-configuration'; + +import { addMigration } from '../../lib/migrations'; + +addMigration({ + version: 267, + async up() { + ServiceConfiguration.configurations.remove({ + service: 'blockstack', + }); + + const { mongo } = MongoInternals.defaultRemoteCollectionDriver(); + const settings = mongo.db.collection('rocketchat_settings'); + await settings.deleteMany({ + _id: { + $in: [ + 'Blockstack', + 'Blockstack_Enable', + 'Blockstack_Auth_Description', + 'Blockstack_ButtonLabelText', + 'Blockstack_Generate_Username', + ], + }, + }); + }, +}); diff --git a/apps/meteor/tests/e2e/01-forgot-password.spec.ts b/apps/meteor/tests/e2e/01-forgot-password.spec.ts index 952cf32e627c..7f087fff746c 100644 --- a/apps/meteor/tests/e2e/01-forgot-password.spec.ts +++ b/apps/meteor/tests/e2e/01-forgot-password.spec.ts @@ -1,13 +1,16 @@ import { test, expect } from '@playwright/test'; import LoginPage from './utils/pageobjects/LoginPage'; +import Global from './utils/pageobjects/Global'; import { VALID_EMAIL, INVALID_EMAIL, INVALID_EMAIL_WITHOUT_MAIL_PROVIDER } from './utils/mocks/userAndPasswordMock'; test.describe('[Forgot Password]', () => { let loginPage: LoginPage; + let global: Global; test.beforeEach(async ({ page, baseURL }) => { loginPage = new LoginPage(page); + global = new Global(page); const baseUrl = baseURL as string; await loginPage.goto(baseUrl); await loginPage.gotToForgotPassword(); @@ -34,6 +37,6 @@ test.describe('[Forgot Password]', () => { test('expect user type a valid email', async () => { await loginPage.emailField().type(VALID_EMAIL); await loginPage.submit(); - await expect(loginPage.getToastMessageSuccess()).toBeVisible(); + await expect(global.getToastBarSuccess()).toBeVisible(); }); }); diff --git a/apps/meteor/tests/e2e/03-login.spec.ts b/apps/meteor/tests/e2e/03-login.spec.ts index 6137e2bed323..223262a0afb8 100644 --- a/apps/meteor/tests/e2e/03-login.spec.ts +++ b/apps/meteor/tests/e2e/03-login.spec.ts @@ -2,14 +2,17 @@ import { test, expect } from '@playwright/test'; import { validUser } from './utils/mocks/userAndPasswordMock'; import LoginPage from './utils/pageobjects/LoginPage'; +import Global from './utils/pageobjects/Global'; import { HOME_SELECTOR } from './utils/mocks/waitSelectorsMock'; test.describe('[Login]', () => { let loginPage: LoginPage; + let global: Global; test.beforeEach(async ({ page, baseURL }) => { const baseUrl = baseURL; loginPage = new LoginPage(page); + global = new Global(page); await loginPage.goto(baseUrl as string); }); @@ -19,7 +22,7 @@ test.describe('[Login]', () => { password: 'any_password1', }; await loginPage.login(invalidUserPassword); - await expect(loginPage.getToastError()).toBeVisible(); + await expect(global.getToastBarError()).toBeVisible(); }); test('expect user make login', async () => { diff --git a/apps/meteor/tests/e2e/09-channel.spec.ts b/apps/meteor/tests/e2e/09-channel.spec.ts index 0ce1aec44c43..555d6e3ce464 100644 --- a/apps/meteor/tests/e2e/09-channel.spec.ts +++ b/apps/meteor/tests/e2e/09-channel.spec.ts @@ -102,15 +102,15 @@ test.describe('[Channel]', () => { test.describe('Adding a user to the room:', async () => { test.beforeAll(async () => { - if (await global.toastAlert().isVisible()) { - await global.dismissToast(); + if (await global.getToastBar().isVisible()) { + await global.dismissToastBar(); } await flexTab.operateFlexTab('members', true); }); test.afterAll(async () => { - if (await global.toastAlert().isVisible()) { - await global.dismissToast(); + if (await global.getToastBar().isVisible()) { + await global.dismissToastBar(); } await flexTab.operateFlexTab('members', false); }); @@ -118,7 +118,7 @@ test.describe('[Channel]', () => { test('expect add people to the room', async () => { await flexTab.addPeopleToChannel(targetUser); hasUserAddedInChannel = true; - await expect(global.toastAlert()).toBeVisible(); + await expect(global.getToastBarSuccess()).toBeVisible(); }); }); @@ -130,8 +130,8 @@ test.describe('[Channel]', () => { }); test.afterAll(async () => { - if (await global.toastAlert().isVisible()) { - await global.dismissToast(); + if (await global.getToastBar().isVisible()) { + await global.dismissToastBar(); } if (await flexTab.mainSideBar().isVisible()) { await flexTab.mainSideBarClose().click(); @@ -158,8 +158,8 @@ test.describe('[Channel]', () => { }); test.afterAll(async () => { - if (await global.toastAlert().isVisible()) { - await global.dismissToast(); + if (await global.getToastBar().isVisible()) { + await global.dismissToastBar(); } if (await flexTab.mainSideBar().isVisible()) { await flexTab.mainSideBarClose().click(); @@ -186,8 +186,8 @@ test.describe('[Channel]', () => { }); test.afterAll(async () => { - if (await global.toastAlert().isVisible()) { - await global.dismissToast(); + if (await global.getToastBar().isVisible()) { + await global.dismissToastBar(); } if (await flexTab.mainSideBar().isVisible()) { await flexTab.mainSideBarClose().click(); @@ -221,8 +221,8 @@ test.describe('[Channel]', () => { }); test.afterAll(async () => { - if (await global.toastAlert().isVisible()) { - await global.dismissToast(); + if (await global.getToastBar().isVisible()) { + await global.dismissToastBar(); } await flexTab.operateFlexTab('members', false); }); @@ -243,8 +243,8 @@ test.describe('[Channel]', () => { }); test.afterAll(async () => { - if (await global.toastAlert().isVisible()) { - await global.dismissToast(); + if (await global.getToastBar().isVisible()) { + await global.dismissToastBar(); } await flexTab.operateFlexTab('members', false); }); @@ -254,8 +254,8 @@ test.describe('[Channel]', () => { }); test('expect dismiss the toast', async () => { - if (await global.toastAlert().isVisible()) { - await global.dismissToast(); + if (await global.getToastBar().isVisible()) { + await global.dismissToastBar(); } }); @@ -279,8 +279,8 @@ test.describe('[Channel]', () => { }); test.afterAll(async () => { - if (await global.toastAlert().isVisible()) { - await global.dismissToast(); + if (await global.getToastBar().isVisible()) { + await global.dismissToastBar(); } await flexTab.operateFlexTab('members', false); }); @@ -296,15 +296,15 @@ test.describe('[Channel]', () => { test.describe('Channel name edit', async () => { test.beforeAll(async () => { - if (await global.toastAlert().isVisible()) { - await global.dismissToast(); + if (await global.getToastBar().isVisible()) { + await global.dismissToastBar(); } await flexTab.operateFlexTab('info', true); }); test.afterAll(async () => { - if (await global.toastAlert().isVisible()) { - await global.dismissToast(); + if (await global.getToastBar().isVisible()) { + await global.dismissToastBar(); } if (await flexTab.mainSideBar().isVisible()) { diff --git a/apps/meteor/tests/e2e/omnichannel-departaments.spec.ts b/apps/meteor/tests/e2e/omnichannel-departaments.spec.ts index 697a06ee9bd1..1237156c2efd 100644 --- a/apps/meteor/tests/e2e/omnichannel-departaments.spec.ts +++ b/apps/meteor/tests/e2e/omnichannel-departaments.spec.ts @@ -1,6 +1,7 @@ import { test, Page, expect } from '@playwright/test'; import LoginPage from './utils/pageobjects/LoginPage'; +import Global from './utils/pageobjects/Global'; import SideNav from './utils/pageobjects/SideNav'; import Departments from './utils/pageobjects/Departments'; import { adminLogin } from './utils/mocks/userAndPasswordMock'; @@ -10,6 +11,8 @@ test.describe('[Department]', () => { let sideNav: SideNav; let departments: Departments; let page: Page; + let global: Global; + test.beforeAll(async ({ browser }) => { page = await browser.newPage(); const basePath = '/'; @@ -18,6 +21,7 @@ test.describe('[Department]', () => { loginPage = new LoginPage(page); sideNav = new SideNav(page); departments = new Departments(page); + global = new Global(page); await loginPage.login(adminLogin); await sideNav.sidebarUserMenu().click(); @@ -39,7 +43,7 @@ test.describe('[Department]', () => { }); test.describe('[Create and Edit]', async () => { test.afterEach(async () => { - await departments.toastSuccess.click(); + await global.dismissToastBar(); }); test('expect new department is created', async () => { diff --git a/apps/meteor/tests/e2e/utils/pageobjects/BasePage.ts b/apps/meteor/tests/e2e/utils/pageobjects/BasePage.ts index d920c3fcc5cd..6b2f85211cf1 100644 --- a/apps/meteor/tests/e2e/utils/pageobjects/BasePage.ts +++ b/apps/meteor/tests/e2e/utils/pageobjects/BasePage.ts @@ -1,4 +1,4 @@ -import { Page, Locator } from '@playwright/test'; +import { Page } from '@playwright/test'; class BasePage { private page: Page; @@ -22,9 +22,5 @@ class BasePage { public async keyboardPress(key: string): Promise { await this.getPage().keyboard.press(key); } - - get toastSuccess(): Locator { - return this.getPage().locator('#toast-container'); - } } export default BasePage; diff --git a/apps/meteor/tests/e2e/utils/pageobjects/Global.ts b/apps/meteor/tests/e2e/utils/pageobjects/Global.ts index f6750773844c..7877c9d5815f 100644 --- a/apps/meteor/tests/e2e/utils/pageobjects/Global.ts +++ b/apps/meteor/tests/e2e/utils/pageobjects/Global.ts @@ -40,8 +40,16 @@ class Global extends BasePage { return this.getPage().locator('.rc-modal .upload-preview-title'); } - public toastAlert(): Locator { - return this.getPage().locator('.toast-message'); + public getToastBar(): Locator { + return this.getPage().locator('.rcx-toastbar'); + } + + public getToastBarError(): Locator { + return this.getPage().locator('.rcx-toastbar.rcx-toastbar--error'); + } + + public getToastBarSuccess(): Locator { + return this.getPage().locator('.rcx-toastbar.rcx-toastbar--success'); } public async confirmPopup(): Promise { @@ -50,8 +58,8 @@ class Global extends BasePage { await this.modalConfirm().click(); } - public async dismissToast(): Promise { - await this.toastAlert().click(); + public async dismissToastBar(): Promise { + await this.getToastBar().locator('button').click(); } } diff --git a/apps/meteor/tests/e2e/utils/pageobjects/LoginPage.ts b/apps/meteor/tests/e2e/utils/pageobjects/LoginPage.ts index c5472de404a7..d13f1c03546a 100644 --- a/apps/meteor/tests/e2e/utils/pageobjects/LoginPage.ts +++ b/apps/meteor/tests/e2e/utils/pageobjects/LoginPage.ts @@ -49,14 +49,6 @@ class LoginPage extends BasePage { return this.getPage().locator('[name=confirm-pass]'); } - public getToastError(): Locator { - return this.getPage().locator('.toast'); - } - - public getToastMessageSuccess(): Locator { - return this.getPage().locator('.toast-message'); - } - public emailOrUsernameInvalidText(): Locator { return this.getPage().locator('[name=emailOrUsername]~.input-error'); } diff --git a/apps/meteor/tests/e2e/utils/pageobjects/MainContent.ts b/apps/meteor/tests/e2e/utils/pageobjects/MainContent.ts index be835d133c45..38ce5a9f29e0 100644 --- a/apps/meteor/tests/e2e/utils/pageobjects/MainContent.ts +++ b/apps/meteor/tests/e2e/utils/pageobjects/MainContent.ts @@ -384,7 +384,7 @@ export default class MainContent extends BasePage { break; case 'star': await this.messageStar().click(); - await expect(this.getPage().locator('div.toast-message:has-text("Message has been starred")')).toBeVisible(); + await expect(this.getPage().locator('div.rcx-toastbar:has-text("Message has been starred")')).toBeVisible(); break; case 'unread': await this.messageUnread().click(); diff --git a/apps/meteor/tests/end-to-end/api/00-miscellaneous.js b/apps/meteor/tests/end-to-end/api/00-miscellaneous.js index 674ddccdf96a..35057ab54b3a 100644 --- a/apps/meteor/tests/end-to-end/api/00-miscellaneous.js +++ b/apps/meteor/tests/end-to-end/api/00-miscellaneous.js @@ -564,6 +564,12 @@ describe('miscellaneous', function () { updateSetting('API_Enable_Shields', false).then(() => { request .get(api('shield.svg')) + .query({ + type: 'online', + icon: true, + channel: 'general', + name: 'Rocket.Chat', + }) .expect('Content-Type', 'application/json') .expect(400) .expect((res) => { diff --git a/apps/meteor/tests/end-to-end/api/02-channels.js b/apps/meteor/tests/end-to-end/api/02-channels.js index c049602aad99..80e7435c8e8f 100644 --- a/apps/meteor/tests/end-to-end/api/02-channels.js +++ b/apps/meteor/tests/end-to-end/api/02-channels.js @@ -184,6 +184,27 @@ describe('[Channels]', function () { }) .end(done); }); + it('should return all channels messages where the last message of array should have the "star" array with USERS star ONLY even requested with count and offset params', (done) => { + request + .get(api('channels.messages')) + .set(credentials) + .query({ + roomId: testChannel._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages').and.to.be.an('array'); + const { messages } = res.body; + const lastMessage = messages.filter((message) => message._id === channelMessage._id)[0]; + expect(lastMessage).to.have.property('starred').and.to.be.an('array'); + expect(lastMessage.starred[0]._id).to.be.equal(adminUsername); + }) + .end(done); + }); }); describe('[/channels.online]', () => { @@ -340,6 +361,24 @@ describe('[Channels]', function () { .end(done); }); + it('should succeed when searching by roomId even requested with count and offset params', (done) => { + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomId: 'GENERAL', + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('files').and.to.be.an('array'); + }) + .end(done); + }); + it('should succeed when searching by roomName', (done) => { request .get(api('channels.files')) @@ -355,6 +394,24 @@ describe('[Channels]', function () { }) .end(done); }); + + it('should succeed when searching by roomName even requested with count and offset params', (done) => { + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomName: 'general', + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('files').and.to.be.an('array'); + }) + .end(done); + }); }); describe('[/channels.join]', () => { @@ -818,20 +875,40 @@ describe('[Channels]', function () { }); }); - it('/channels.history', (done) => { - request - .get(api('channels.history')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('messages'); - }) - .end(done); + describe('/channels.history', () => { + it('should return an array of members by channel', (done) => { + request + .get(api('channels.history')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages'); + }) + .end(done); + }); + + it('should return an array of members by channel even requested with count and offset params', (done) => { + request + .get(api('channels.history')) + .set(credentials) + .query({ + roomId: channel._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages'); + }) + .end(done); + }); }); it('/channels.archive', (done) => { @@ -964,23 +1041,45 @@ describe('[Channels]', function () { }) .end(done); }); - it('/channels.members', (done) => { - request - .get(api('channels.members')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('members').and.to.be.an('array'); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - expect(res.body).to.have.property('offset'); - }) - .end(done); + describe('/channels.members', () => { + it('should return an array of members by channel', (done) => { + request + .get(api('channels.members')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('members').and.to.be.an('array'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + }) + .end(done); + }); + it('should return an array of members by channel even requested with count and offset params', (done) => { + request + .get(api('channels.members')) + .set(credentials) + .query({ + roomId: channel._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('members').and.to.be.an('array'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + }) + .end(done); + }); }); it('/channels.rename', async () => { @@ -1531,7 +1630,7 @@ describe('[Channels]', function () { }); describe('/channels.getAllUserMentionsByChannel', () => { - it('should return and array of mentions by channel', (done) => { + it('should return an array of mentions by channel', (done) => { request .get(api('channels.getAllUserMentionsByChannel')) .set(credentials) @@ -1549,6 +1648,26 @@ describe('[Channels]', function () { }) .end(done); }); + it('should return an array of mentions by channel even requested with count and offset params', (done) => { + request + .get(api('channels.getAllUserMentionsByChannel')) + .set(credentials) + .query({ + roomId: channel._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('mentions').and.to.be.an('array'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); }); describe('/channels.roles', () => { @@ -1714,6 +1833,24 @@ describe('[Channels]', function () { .end(done); }); }); + it('should return the messages list when the setting "Accounts_AllowAnonymousRead" is enabled even requested with count and offset params', (done) => { + updateSetting('Accounts_AllowAnonymousRead', true).then(() => { + request + .get(api('channels.anonymousread')) + .query({ + roomId: 'GENERAL', + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + expect(res.body).to.have.a.property('messages').that.is.an('array'); + }) + .end(done); + }); + }); }); describe('/channels.convertToTeam', () => { diff --git a/apps/meteor/tests/end-to-end/api/03-groups.js b/apps/meteor/tests/end-to-end/api/03-groups.js index 9a7ffc64c3ad..3e5bd508dacb 100644 --- a/apps/meteor/tests/end-to-end/api/03-groups.js +++ b/apps/meteor/tests/end-to-end/api/03-groups.js @@ -227,6 +227,27 @@ describe('[Groups]', function () { }) .end(done); }); + it('should return all groups messages where the last message of array should have the "star" array with USERS star ONLY even requested with count and offset params', (done) => { + request + .get(api('groups.messages')) + .set(credentials) + .query({ + roomId: testGroup._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages').and.to.be.an('array'); + const { messages } = res.body; + const lastMessage = messages.filter((message) => message._id === groupMessage._id)[0]; + expect(lastMessage).to.have.property('starred').and.to.be.an('array'); + expect(lastMessage.starred[0]._id).to.be.equal(adminUsername); + }) + .end(done); + }); }); it('/groups.invite', async () => { @@ -503,20 +524,39 @@ describe('[Groups]', function () { }); }); - it('/groups.history', (done) => { - request - .get(api('groups.history')) - .set(credentials) - .query({ - roomId: group._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('messages'); - }) - .end(done); + describe('/groups.history', () => { + it('should return groups history when searching by roomId', (done) => { + request + .get(api('groups.history')) + .set(credentials) + .query({ + roomId: group._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages'); + }) + .end(done); + }); + it('should return groups history when searching by roomId even requested with count and offset params', (done) => { + request + .get(api('groups.history')) + .set(credentials) + .query({ + roomId: group._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages'); + }) + .end(done); + }); }); it('/groups.archive', (done) => { @@ -705,43 +745,86 @@ describe('[Groups]', function () { }); }); }); - - it('/groups.members', (done) => { - request - .get(api('groups.members')) - .set(credentials) - .query({ - roomId: group._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - expect(res.body).to.have.property('offset'); - expect(res.body).to.have.property('members').and.to.be.an('array'); - }) - .end(done); + describe('/groups.files', () => { + it('should return group members when searching by roomId', (done) => { + request + .get(api('groups.members')) + .set(credentials) + .query({ + roomId: group._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('members').and.to.be.an('array'); + }) + .end(done); + }); + it('should return group members when searching by roomId even requested with count and offset params', (done) => { + request + .get(api('groups.members')) + .set(credentials) + .query({ + roomId: group._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('members').and.to.be.an('array'); + }) + .end(done); + }); }); - it('/groups.files', (done) => { - request - .get(api('groups.files')) - .set(credentials) - .query({ - roomId: group._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - expect(res.body).to.have.property('offset'); - expect(res.body).to.have.property('files').and.to.be.an('array'); - }) - .end(done); + describe('/groups.files', () => { + it('should return group files when searching by roomId', (done) => { + request + .get(api('groups.files')) + .set(credentials) + .query({ + roomId: group._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('files').and.to.be.an('array'); + }) + .end(done); + }); + it('should return group files when searching by roomId even requested with count and offset params', (done) => { + request + .get(api('groups.files')) + .set(credentials) + .query({ + roomId: group._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('files').and.to.be.an('array'); + }) + .end(done); + }); }); describe('/groups.listAll', () => { diff --git a/apps/meteor/tests/end-to-end/api/04-direct-message.js b/apps/meteor/tests/end-to-end/api/04-direct-message.js index 9eb450539ab9..3610b073c34b 100644 --- a/apps/meteor/tests/end-to-end/api/04-direct-message.js +++ b/apps/meteor/tests/end-to-end/api/04-direct-message.js @@ -617,6 +617,8 @@ describe('[Direct Messages]', function () { .set(userCredentials) .send({ message: JSON.stringify({ + id: 'id', + msg: 'method', method: 'saveUserPreferences', params: [{ emailNotificationMode: 'nothing' }], }), diff --git a/apps/meteor/tests/end-to-end/api/05-chat.js b/apps/meteor/tests/end-to-end/api/05-chat.js index de689e8bfef6..4b7720913ad1 100644 --- a/apps/meteor/tests/end-to-end/api/05-chat.js +++ b/apps/meteor/tests/end-to-end/api/05-chat.js @@ -2153,6 +2153,26 @@ describe('[Chat]', function () { }) .end(done); }); + it('should return the discussions of a room even requested with count and offset params', (done) => { + request + .get(api('chat.getDiscussions')) + .set(credentials) + .query({ + roomId: 'GENERAL', + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body.messages).to.be.an('array'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('count'); + }) + .end(done); + }); function filterDiscussionsByText(text) { it(`should return the room's discussion list filtered by the text '${text}'`, (done) => { @@ -2176,6 +2196,30 @@ describe('[Chat]', function () { }) .end(done); }); + + it(`should return the room's discussion list filtered by the text '${text}' even requested with count and offset params`, (done) => { + request + .get(api('chat.getDiscussions')) + .set(credentials) + .query({ + roomId: testChannel._id, + text, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages').and.to.be.an('array'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('count'); + expect(res.body.messages).to.have.lengthOf(1); + expect(res.body.messages[0].drid).to.be.equal(discussionRoom.rid); + }) + .end(done); + }); } messageWords.forEach((text) => { @@ -2318,6 +2362,31 @@ describe('Threads', () => { }); }); + it("should return the room's thread list even requested with count and offset params", (done) => { + updatePermission('view-c-room', ['admin', 'user']).then(() => { + request + .get(api('chat.getThreadsList')) + .set(credentials) + .query({ + rid: testChannel._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('threads').and.to.be.an('array'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('count'); + expect(res.body.threads).to.have.lengthOf(1); + expect(res.body.threads[0]._id).to.be.equal(threadMessage.tmid); + }) + .end(done); + }); + }); + function filterThreadsByText(text) { it(`should return the room's thread list filtered by the text '${text}'`, (done) => { request @@ -2340,6 +2409,29 @@ describe('Threads', () => { }) .end(done); }); + it(`should return the room's thread list filtered by the text '${text}' even requested with count and offset params`, (done) => { + request + .get(api('chat.getThreadsList')) + .set(credentials) + .query({ + rid: testChannel._id, + text, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('threads').and.to.be.an('array'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('count'); + expect(res.body.threads).to.have.lengthOf(1); + expect(res.body.threads[0]._id).to.be.equal(threadMessage.tmid); + }) + .end(done); + }); } messageWords.forEach((text) => { diff --git a/apps/meteor/tests/end-to-end/api/08-settings.js b/apps/meteor/tests/end-to-end/api/08-settings.js index 61e48cd8e456..3753e9e4394e 100644 --- a/apps/meteor/tests/end-to-end/api/08-settings.js +++ b/apps/meteor/tests/end-to-end/api/08-settings.js @@ -20,6 +20,22 @@ describe('[Settings]', function () { }) .end(done); }); + it('should return public settings even requested with count and offset params', (done) => { + request + .get(api('settings.public')) + .query({ + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('settings'); + expect(res.body).to.have.property('count'); + }) + .end(done); + }); }); describe('[/settings]', () => { diff --git a/apps/meteor/tests/end-to-end/api/09-rooms.js b/apps/meteor/tests/end-to-end/api/09-rooms.js index 0bc97d9bbf65..ec168a7104ce 100644 --- a/apps/meteor/tests/end-to-end/api/09-rooms.js +++ b/apps/meteor/tests/end-to-end/api/09-rooms.js @@ -954,6 +954,52 @@ describe('[Rooms]', function () { .end(done); }); }); + describe('[/rooms.autocomplete.channelAndPrivate.withPagination]', () => { + it('should return an error when the required parameter "selector" is not provided', (done) => { + request + .get(api('rooms.autocomplete.channelAndPrivate.withPagination')) + .set(credentials) + .query({}) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body.error).to.be.equal("The 'selector' param is required"); + }) + .end(done); + }); + it('should return the rooms to fill auto complete', (done) => { + request + .get(api('rooms.autocomplete.channelAndPrivate.withPagination?selector={}')) + .set(credentials) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('items').and.to.be.an('array'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + it('should return the rooms to fill auto complete even requested with count and offset params', (done) => { + request + .get(api('rooms.autocomplete.channelAndPrivate.withPagination?selector={}')) + .set(credentials) + .query({ + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('items').and.to.be.an('array'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + }); + describe('[/rooms.autocomplete.availableForTeams]', () => { it('should return the rooms to fill auto complete', (done) => { request @@ -1071,6 +1117,24 @@ describe('[Rooms]', function () { }) .end(done); }); + it('should return a list of admin rooms even requested with count and offset params', (done) => { + request + .get(api('rooms.adminRooms')) + .set(credentials) + .query({ + count: 5, + offset: 0, + }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('rooms').and.to.be.an('array'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('count'); + }) + .end(done); + }); }); describe('update group dms name', () => { diff --git a/apps/meteor/tests/end-to-end/api/12-emoji-custom.js b/apps/meteor/tests/end-to-end/api/12-emoji-custom.js index f4fc4df56470..a9a088985ae7 100644 --- a/apps/meteor/tests/end-to-end/api/12-emoji-custom.js +++ b/apps/meteor/tests/end-to-end/api/12-emoji-custom.js @@ -263,6 +263,23 @@ describe('[EmojiCustom]', function () { }) .end(done); }); + it('should return emojis even requested with count and offset params', (done) => { + request + .get(api('emoji-custom.all')) + .set(credentials) + .query({ + count: 5, + offset: 0, + }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('emojis').and.to.be.an('array'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('count'); + }) + .end(done); + }); }); describe('[/emoji-custom.delete]', () => { diff --git a/apps/meteor/tests/end-to-end/api/16-commands.js b/apps/meteor/tests/end-to-end/api/16-commands.js index 1671abda739f..70c0e90f0dae 100644 --- a/apps/meteor/tests/end-to-end/api/16-commands.js +++ b/apps/meteor/tests/end-to-end/api/16-commands.js @@ -70,6 +70,24 @@ describe('[Commands]', function () { }) .end(done); }); + it('should return a list of commands even requested with count and offset params', (done) => { + request + .get(api('commands.list')) + .set(credentials) + .query({ + count: 5, + offset: 0, + }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('commands').and.to.be.an('array'); + }) + .end(done); + }); }); describe('[/commands.run]', () => { diff --git a/apps/meteor/tests/end-to-end/api/17-custom-sounds.js b/apps/meteor/tests/end-to-end/api/17-custom-sounds.js index 34eca545f3f8..b0b2ba7e1029 100644 --- a/apps/meteor/tests/end-to-end/api/17-custom-sounds.js +++ b/apps/meteor/tests/end-to-end/api/17-custom-sounds.js @@ -21,5 +21,22 @@ describe('[CustomSounds]', function () { }) .end(done); }); + it('should return custom sounds even requested with count and offset params', (done) => { + request + .get(api('custom-sounds.list')) + .set(credentials) + .expect(200) + .query({ + count: 5, + offset: 0, + }) + .expect((res) => { + expect(res.body).to.have.property('sounds').and.to.be.an('array'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('count'); + }) + .end(done); + }); }); }); diff --git a/apps/meteor/tests/end-to-end/api/17-custom-user-status.js b/apps/meteor/tests/end-to-end/api/17-custom-user-status.js index 30734c90a526..d5d8951f2050 100644 --- a/apps/meteor/tests/end-to-end/api/17-custom-user-status.js +++ b/apps/meteor/tests/end-to-end/api/17-custom-user-status.js @@ -21,5 +21,22 @@ describe('[CustomUserStatus]', function () { }) .end(done); }); + it('should return custom user status even requested with count and offset params', (done) => { + request + .get(api('custom-user-status.list')) + .set(credentials) + .expect(200) + .query({ + count: 5, + offset: 0, + }) + .expect((res) => { + expect(res.body).to.have.property('statuses').and.to.be.an('array'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('count'); + }) + .end(done); + }); }); }); diff --git a/apps/meteor/tests/end-to-end/api/19-statistics.js b/apps/meteor/tests/end-to-end/api/19-statistics.js index 82ba16dc44a6..9f59936c807a 100644 --- a/apps/meteor/tests/end-to-end/api/19-statistics.js +++ b/apps/meteor/tests/end-to-end/api/19-statistics.js @@ -83,5 +83,25 @@ describe('[Statistics]', function () { .end(done); }); }); + it('should return an array with the statistics even requested with count and offset params', (done) => { + updatePermission('view-statistics', ['admin']).then(() => { + request + .get(api('statistics.list')) + .set(credentials) + .query({ + count: 5, + offset: 0, + }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('statistics').and.to.be.an('array'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('count'); + }) + .end(done); + }); + }); }); }); diff --git a/apps/meteor/tests/end-to-end/api/23-invites.js b/apps/meteor/tests/end-to-end/api/23-invites.js index 0b2cbc7e6c15..1adcfc5d99e9 100644 --- a/apps/meteor/tests/end-to-end/api/23-invites.js +++ b/apps/meteor/tests/end-to-end/api/23-invites.js @@ -142,7 +142,7 @@ describe('Invites', function () { .expect(400) .expect((res) => { expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('errorType', 'error-invalid-token'); + expect(res.body).to.have.property('errorType', 'invalid-params'); }) .end(done); }); diff --git a/apps/meteor/tests/end-to-end/api/24-methods.js b/apps/meteor/tests/end-to-end/api/24-methods.js index 65c74c18f17e..67d8f8253c87 100644 --- a/apps/meteor/tests/end-to-end/api/24-methods.js +++ b/apps/meteor/tests/end-to-end/api/24-methods.js @@ -80,6 +80,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getThreadMessages', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -99,6 +101,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getThreadMessages', params: [{ tmid: firstMessage._id }], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -188,6 +192,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getMessages', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -207,6 +213,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getMessages', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -231,6 +239,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getMessages', params: [[firstMessage._id]], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -254,6 +264,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getMessages', params: [[firstMessage._id, lastMessage._id]], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -343,6 +355,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadHistory', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -362,6 +376,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadHistory', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -384,6 +400,8 @@ describe('Meteor.methods', function () { .set(credentials) .send({ message: JSON.stringify({ + id: 'id', + msg: 'method', method: 'loadHistory', params: [rid], }), @@ -410,6 +428,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadHistory', params: [rid, postMessageDate], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -434,6 +454,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadHistory', params: [rid, { $date: new Date().getTime() }, 1], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -458,6 +480,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadHistory', params: [rid, null, 20, lastMessage], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -547,6 +571,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadNextMessages', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -566,6 +592,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadNextMessages', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -590,6 +618,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadNextMessages', params: [rid], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -614,6 +644,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadNextMessages', params: [rid, postMessageDate], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -638,6 +670,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadNextMessages', params: [rid, startDate, 1], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -715,6 +749,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getUsersOfRoom', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -734,6 +770,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getUsersOfRoom', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -757,6 +795,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getUsersOfRoom', params: [rid], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -781,6 +821,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getUserRoles', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -800,6 +842,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getUserRoles', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -823,6 +867,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'listCustomUserStatus', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -842,6 +888,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'listCustomUserStatus', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -869,6 +917,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'permissions/get', params: [date], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -888,6 +938,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'permissions/get', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -911,6 +963,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'permissions/get', params: [date], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1000,6 +1054,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadMissedMessages', params: [rid, date], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1019,6 +1075,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadMissedMessages', params: ['', date], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1038,6 +1096,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadMissedMessages', params: [rid], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1057,6 +1117,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadMissedMessages', params: [rid, { $date: new Date().getTime() }], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1080,6 +1142,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadMissedMessages', params: [rid, date], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1103,6 +1167,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'loadMissedMessages', params: [rid, postMessageDate], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1131,6 +1197,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'public-settings/get', params: [date], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1150,6 +1218,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'public-settings/get', params: [date], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1177,6 +1247,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'private-settings/get', params: [date], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1200,6 +1272,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'private-settings/get', params: [date], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1225,6 +1299,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'private-settings/get', params: [date], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1254,6 +1330,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'private-settings/get', params: [date], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1284,6 +1362,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'subscriptions/get', params: [date], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1303,6 +1383,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'subscriptions/get', params: [], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1326,6 +1408,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'subscriptions/get', params: [date], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1376,6 +1460,7 @@ describe('Meteor.methods', function () { method: 'sendMessage', params: [{ _id: `${Date.now() + Math.random()}`, rid, msg: 'test message' }], id: 1000, + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1405,6 +1490,8 @@ describe('Meteor.methods', function () { msg: 'test message with https://github.com', }, ], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1463,6 +1550,8 @@ describe('Meteor.methods', function () { msg: 'test message with https://github.com', }, ], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1494,6 +1583,8 @@ describe('Meteor.methods', function () { msg: 'test message with ```https://github.com```', }, ], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1517,6 +1608,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'updateMessage', params: [{ _id: messageId, rid, msg: 'https://github.com updated' }], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1544,6 +1637,8 @@ describe('Meteor.methods', function () { msg: 'test message with ```https://github.com``` updated', }, ], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1629,6 +1724,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'createDirectMessage', params: [testUser.username], + id: 'id', + msg: 'method', }), }) .end((err, res) => { @@ -1649,6 +1746,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'createDirectMessage', params: [testUser2.username], + id: 'id', + msg: 'method', }), }) .end((err, res) => { @@ -1669,6 +1768,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'setUserActiveStatus', params: [testUser._id, false, false], + id: 'id', + msg: 'method', }), }) .end((err, res) => { @@ -1687,6 +1788,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'setUserActiveStatus', params: [testUser2._id, false, false], + id: 'id', + msg: 'method', }), }) .end((err, res) => { @@ -1705,6 +1808,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getRoomByTypeAndName', params: ['d', dmId], + id: 'id', + msg: 'method', }), }) .end((err, res) => { @@ -1723,6 +1828,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'setUserActiveStatus', params: [testUser._id, true, false], + id: 'id', + msg: 'method', }), }) .end((err, res) => { @@ -1741,6 +1848,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getRoomByTypeAndName', params: ['d', dmId], + id: 'id', + msg: 'method', }), }) .end((err, res) => { @@ -1772,6 +1881,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getRoomByTypeAndName', params: ['d', dmTestId], + id: 'id', + msg: 'method', }), }) .end((err, res) => { @@ -1792,6 +1903,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'setUserActiveStatus', params: [testUser2._id, true, false], + id: 'id', + msg: 'method', }), }) .end((err, res) => { @@ -1810,6 +1923,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getRoomByTypeAndName', params: ['d', dmTestId], + id: 'id', + msg: 'method', }), }) .end((err, res) => { @@ -1828,6 +1943,8 @@ describe('Meteor.methods', function () { message: JSON.stringify({ method: 'getRoomByTypeAndName', params: ['d', dmTestId], + id: 'id', + msg: 'method', }), }) .end((err, res) => { diff --git a/apps/meteor/tests/end-to-end/api/25-teams.js b/apps/meteor/tests/end-to-end/api/25-teams.js index e549e761c6c8..41722083e608 100644 --- a/apps/meteor/tests/end-to-end/api/25-teams.js +++ b/apps/meteor/tests/end-to-end/api/25-teams.js @@ -1230,6 +1230,8 @@ describe('[Teams]', () => { message: JSON.stringify({ method: 'addUsersToRoom', params: [{ rid: privateRoom3._id, users: [testUser.username] }], + id: 'id', + msg: 'method', }), }) .expect('Content-Type', 'application/json') @@ -1348,6 +1350,27 @@ describe('[Teams]', () => { .end(done); }); }); + it('should return all rooms for public team even requested with count and offset params', (done) => { + updatePermission('view-all-team-channels', ['user']).then(() => { + request + .get(api('teams.listRooms')) + .set(testUserCredentials) + .query({ + teamId: publicTeam._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('rooms'); + expect(res.body.rooms).to.be.an('array'); + expect(res.body.rooms.length).to.equal(2); + }) + .end(done); + }); + }); it('should return public rooms for private team', (done) => { updatePermission('view-all-team-channels', []).then(() => { @@ -1370,6 +1393,29 @@ describe('[Teams]', () => { }); }); }); + it('should return public rooms for private team even requested with count and offset params', (done) => { + updatePermission('view-all-team-channels', []).then(() => { + updatePermission('view-all-teams', ['admin']).then(() => { + request + .get(api('teams.listRooms')) + .set(credentials) + .query({ + teamId: privateTeam._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('rooms'); + expect(res.body.rooms).to.be.an('array'); + expect(res.body.rooms.length).to.equal(2); + }) + .end(done); + }); + }); + }); }); describe('/teams.updateRoom', () => { @@ -1584,6 +1630,8 @@ describe('[Teams]', () => { message: JSON.stringify({ method: 'saveUserPreferences', params: [{ emailNotificationMode: 'nothing' }], + id: 'id', + msg: 'method', }), }) .expect(200); diff --git a/apps/meteor/tests/end-to-end/api/livechat/01-department.js b/apps/meteor/tests/end-to-end/api/livechat/01-department.js index a38baa5c716f..84822885ec63 100644 --- a/apps/meteor/tests/end-to-end/api/livechat/01-department.js +++ b/apps/meteor/tests/end-to-end/api/livechat/01-department.js @@ -56,6 +56,29 @@ describe('LIVECHAT - departments', function () { .end(done); }); }); + it('should return an array of departments even requested with count and offset params', (done) => { + updatePermission('view-l-room', ['admin']) + .then(() => updatePermission('view-livechat-departments', ['admin'])) + .then(() => { + request + .get(api('livechat/department')) + .set(credentials) + .query({ + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body.departments).to.be.an('array'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('count'); + }) + .end(done); + }); + }); }); describe('livechat/department/id', () => { diff --git a/apps/meteor/tests/end-to-end/api/livechat/custom-fields.js b/apps/meteor/tests/end-to-end/api/livechat/custom-fields.js index 50adcff68712..a9ef318921d2 100644 --- a/apps/meteor/tests/end-to-end/api/livechat/custom-fields.js +++ b/apps/meteor/tests/end-to-end/api/livechat/custom-fields.js @@ -44,6 +44,27 @@ describe('LIVECHAT - custom fields', function () { .end(done); }); }); + it('should return an array of custom fields even requested with count and offset params', (done) => { + updatePermission('view-l-room', ['admin']).then(() => { + request + .get(api('livechat/custom-fields')) + .set(credentials) + .query({ + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body.customFields).to.be.an('array'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('count'); + }) + .end(done); + }); + }); }); describe('livechat/custom-fields/id', () => { diff --git a/apps/meteor/tests/end-to-end/api/livechat/queue.js b/apps/meteor/tests/end-to-end/api/livechat/queue.js index c373af585c8a..1340517a0db7 100644 --- a/apps/meteor/tests/end-to-end/api/livechat/queue.js +++ b/apps/meteor/tests/end-to-end/api/livechat/queue.js @@ -44,5 +44,26 @@ describe('LIVECHAT - Queue', function () { .end(done); }); }); + it('should return an array of queued metrics even requested with count and offset params', (done) => { + updatePermission('view-l-room', ['admin']).then(() => { + request + .get(api('livechat/queue')) + .set(credentials) + .query({ + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body.queue).to.be.an('array'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('count'); + }) + .end(done); + }); + }); }); }); diff --git a/packages/core-typings/src/SlashCommands/index.ts b/packages/core-typings/src/SlashCommands/index.ts index b8e0d5d9a7f9..928d34008c5e 100644 --- a/packages/core-typings/src/SlashCommands/index.ts +++ b/packages/core-typings/src/SlashCommands/index.ts @@ -43,7 +43,7 @@ export type SlashCommand = { description: SlashCommandOptions['description']; permission: SlashCommandOptions['permission']; clientOnly?: SlashCommandOptions['clientOnly']; - result?: (err: Meteor.Error, result: never, data: { cmd: string; params: string; msg: IMessage }) => void; + result?: (err: unknown, result: never, data: { cmd: string; params: string; msg: IMessage }) => void; providesPreview: boolean; previewer?: SlashCommandPreviewer; previewCallback?: SlashCommandPreviewCallback; diff --git a/packages/rest-typings/src/index.ts b/packages/rest-typings/src/index.ts index 0a9dbb202fe3..5c2b9fa56e4d 100644 --- a/packages/rest-typings/src/index.ts +++ b/packages/rest-typings/src/index.ts @@ -35,6 +35,7 @@ import type { VoipEndpoints } from './v1/voip'; import type { EmailInboxEndpoints } from './v1/email-inbox'; import type { WebdavEndpoints } from './v1/webdav'; import type { OAuthAppsEndpoint } from './v1/oauthapps'; +import type { SubscriptionsEndpoints } from './v1/subscriptionsEndpoints'; import type { CommandsEndpoints } from './v1/commands'; // eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/interface-name-prefix @@ -73,6 +74,7 @@ export interface Endpoints EmailInboxEndpoints, WebdavEndpoints, OAuthAppsEndpoint, + SubscriptionsEndpoints, AutoTranslateEndpoints {} type OperationsByPathPattern = TPathPattern extends any @@ -157,6 +159,11 @@ export * from './v1/channels/ChannelsModeratorsProps'; export * from './v1/channels/ChannelsConvertToTeamProps'; export * from './v1/channels/ChannelsSetReadOnlyProps'; export * from './v1/channels/ChannelsDeleteProps'; + +export * from './v1/subscriptionsEndpoints'; +export * from './v1/misc'; +export * from './v1/invites'; + export * from './v1/dm'; export * from './v1/dm/DmHistoryProps'; export * from './v1/integrations'; diff --git a/packages/rest-typings/src/v1/commands.ts b/packages/rest-typings/src/v1/commands.ts index 32e14b1c0393..aec14e57c669 100644 --- a/packages/rest-typings/src/v1/commands.ts +++ b/packages/rest-typings/src/v1/commands.ts @@ -5,7 +5,7 @@ import type { PaginatedResult } from '../helpers/PaginatedResult'; export type CommandsEndpoints = { 'commands.get': { GET: (params: { command: string }) => { - command: SlashCommand; + command: Pick; }; }; 'commands.list': { @@ -14,7 +14,7 @@ export type CommandsEndpoints = { fields?: string; }>, ) => PaginatedResult<{ - commands: SlashCommand[]; + commands: Pick[]; }>; }; 'commands.run': { diff --git a/packages/rest-typings/src/v1/invites.ts b/packages/rest-typings/src/v1/invites.ts index fda658af2267..d123c3d18df7 100644 --- a/packages/rest-typings/src/v1/invites.ts +++ b/packages/rest-typings/src/v1/invites.ts @@ -5,11 +5,11 @@ const ajv = new Ajv({ coerceTypes: true, }); -type v1UseInviteTokenProps = { +type UseInviteTokenProps = { token: string; }; -const v1UseInviteTokenPropsSchema = { +const UseInviteTokenPropsSchema = { type: 'object', properties: { token: { @@ -20,13 +20,13 @@ const v1UseInviteTokenPropsSchema = { additionalProperties: false, }; -export const isV1UseInviteTokenProps = ajv.compile(v1UseInviteTokenPropsSchema); +export const isUseInviteTokenProps = ajv.compile(UseInviteTokenPropsSchema); -type v1ValidateInviteTokenProps = { +type ValidateInviteTokenProps = { token: string; }; -const v1ValidateInviteTokenPropsSchema = { +const ValidateInviteTokenPropsSchema = { type: 'object', properties: { token: { @@ -37,17 +37,38 @@ const v1ValidateInviteTokenPropsSchema = { additionalProperties: false, }; -export const isV1ValidateInviteTokenProps = ajv.compile(v1ValidateInviteTokenPropsSchema); +export const isValidateInviteTokenProps = ajv.compile(ValidateInviteTokenPropsSchema); + +type FindOrCreateInviteParams = { rid: IRoom['_id']; days: number; maxUses: number }; + +const FindOrCreateInviteParamsSchema = { + type: 'object', + properties: { + rid: { + type: 'string', + }, + days: { + type: 'integer', + }, + maxUses: { + type: 'integer', + }, + }, + required: ['rid', 'days', 'maxUses'], + additionalProperties: false, +}; + +export const isFindOrCreateInviteParams = ajv.compile(FindOrCreateInviteParamsSchema); export type InvitesEndpoints = { 'listInvites': { GET: () => Array; }; 'removeInvite/:_id': { - DELETE: () => void; + DELETE: () => boolean; }; - '/v1/useInviteToken': { - POST: (params: v1UseInviteTokenProps) => { + 'useInviteToken': { + POST: (params: UseInviteTokenProps) => { room: { rid: IRoom['_id']; prid: IRoom['prid']; @@ -57,7 +78,10 @@ export type InvitesEndpoints = { }; }; }; - '/v1/validateInviteToken': { - POST: (params: v1ValidateInviteTokenProps) => { valid: boolean }; + 'validateInviteToken': { + POST: (params: ValidateInviteTokenProps) => { valid: boolean }; + }; + 'findOrCreateInvite': { + POST: (params: FindOrCreateInviteParams) => IInvite; }; }; diff --git a/packages/rest-typings/src/v1/misc.ts b/packages/rest-typings/src/v1/misc.ts index 06d59cd754b6..f41ffe905860 100644 --- a/packages/rest-typings/src/v1/misc.ts +++ b/packages/rest-typings/src/v1/misc.ts @@ -1,3 +1,175 @@ +import type { IRoom, ITeam, IUser } from '@rocket.chat/core-typings'; +import Ajv from 'ajv'; + +import type { PaginatedRequest } from '../helpers/PaginatedRequest'; +import type { PaginatedResult } from '../helpers/PaginatedResult'; + +const ajv = new Ajv({ + coerceTypes: true, +}); + +type ShieldSvg = { + type?: string; + icon?: 'true' | 'false'; + channel: string; + name: string; +}; + +const ShieldSvgSchema = { + type: 'object', + properties: { + type: { + type: 'string', + nullable: true, + }, + icon: { + type: 'string', + enum: ['true', 'false'], + nullable: true, + }, + channel: { + type: 'string', + }, + name: { + type: 'string', + }, + }, + required: ['name', 'channel'], + additionalProperties: false, +}; + +export const isShieldSvgProps = ajv.compile(ShieldSvgSchema); + +type Spotlight = { query: string; limit: number; offset: number }; + +const SpotlightSchema = { + type: 'object', + properties: { + query: { + type: 'string', + }, + limit: { + type: 'number', + nullable: true, + }, + offset: { + type: 'number', + nullable: true, + }, + }, + required: ['query'], + additionalProperties: false, +}; + +export const isSpotlightProps = ajv.compile(SpotlightSchema); + +type Directory = PaginatedRequest<{ + text: string; + type: string; + workspace: string; +}>; + +const DirectorySchema = { + type: 'object', + properties: { + text: { + type: 'string', + nullable: true, + }, + type: { + type: 'string', + nullable: true, + }, + workspace: { + type: 'string', + nullable: true, + }, + count: { + type: 'number', + nullable: true, + }, + offset: { + type: 'number', + nullable: true, + }, + sort: { + type: 'string', + nullable: true, + }, + query: { + type: 'string', + nullable: true, + }, + }, + required: [], + additionalProperties: false, +}; + +export const isDirectoryProps = ajv.compile(DirectorySchema); + +type MethodCall = { method: string; params: unknown[]; id: string; msg: 'string' }; + +const MethodCallSchema = { + type: 'object', + properties: { + method: { + type: 'string', + }, + params: { + type: 'array', + }, + id: { + type: 'string', + }, + msg: { + type: 'string', + enum: ['method'], + }, + }, + required: ['method', 'params', 'id', 'msg'], + additionalProperties: false, +}; + +export const isMethodCallProps = ajv.compile(MethodCallSchema); + +export const isMeteorCall = ajv.compile<{ + message: string; +}>({ + type: 'object', + properties: { + message: { + type: 'string', + }, + }, + required: ['message'], + additionalProperties: false, +}); + +type MethodCallAnon = { method: string; params: unknown[]; id: string; msg: 'method' }; + +const MethodCallAnonSchema = { + type: 'object', + properties: { + method: { + type: 'string', + }, + params: { + type: 'array', + }, + id: { + type: 'string', + }, + msg: { + type: 'string', + enum: ['method'], + }, + }, + required: ['method', 'params', 'id', 'msg'], + additionalProperties: false, +}; + +export const isMethodCallAnonProps = ajv.compile(MethodCallAnonSchema); + export type MiscEndpoints = { 'stdout.queue': { GET: () => { @@ -8,4 +180,45 @@ export type MiscEndpoints = { }[]; }; }; + 'me': { + GET: (params: { fields: { [k: string]: number }; user: IUser }) => IUser & { + email?: string; + settings: { + profile: {}; + preferences: unknown; + }; + avatarUrl: string; + }; + }; + + 'shield.svg': { + GET: (params: ShieldSvg) => { + svg: string; + }; + }; + + 'spotlight': { + GET: (params: Spotlight) => { + users: Pick[]; + rooms: IRoom[]; + }; + }; + + 'directory': { + GET: (params: Directory) => PaginatedResult<{ + result: (IUser | IRoom | ITeam)[]; + }>; + }; + + 'method.call': { + POST: (params: MethodCall) => { + result: unknown; + }; + }; + + 'method.callAnon': { + POST: (params: MethodCallAnon) => { + result: unknown; + }; + }; }; diff --git a/packages/rest-typings/src/v1/subscriptionsEndpoints.ts b/packages/rest-typings/src/v1/subscriptionsEndpoints.ts new file mode 100644 index 000000000000..d913fb8ebc1d --- /dev/null +++ b/packages/rest-typings/src/v1/subscriptionsEndpoints.ts @@ -0,0 +1,111 @@ +import type { ISubscription, IMessage, IRoom } from '@rocket.chat/core-typings'; +import Ajv from 'ajv'; + +type SubscriptionsGet = { updatedSince?: string }; + +type SubscriptionsGetOne = { roomId: IRoom['_id'] }; + +type SubscriptionsRead = { rid: IRoom['_id'] }; + +type SubscriptionsUnread = { roomId: IRoom['_id'] } | { firstUnreadMessage: Pick }; + +const ajv = new Ajv({ + coerceTypes: true, +}); + +const SubscriptionsGetSchema = { + type: 'object', + properties: { + updatedSince: { + type: 'string', + nullable: true, + }, + }, + required: [], + additionalProperties: false, +}; + +export const isSubscriptionsGetProps = ajv.compile(SubscriptionsGetSchema); + +const SubscriptionsGetOneSchema = { + type: 'object', + properties: { + roomId: { + type: 'string', + }, + }, + required: ['roomId'], + additionalProperties: false, +}; + +export const isSubscriptionsGetOneProps = ajv.compile(SubscriptionsGetOneSchema); + +const SubscriptionsReadSchema = { + type: 'object', + properties: { + rid: { + type: 'string', + }, + }, + required: ['rid'], + additionalProperties: false, +}; + +export const isSubscriptionsReadProps = ajv.compile(SubscriptionsReadSchema); + +const SubscriptionsUnreadSchema = { + anyOf: [ + { + type: 'object', + properties: { + roomId: { + type: 'string', + }, + }, + required: ['roomId'], + additionalProperties: false, + }, + { + type: 'object', + properties: { + firstUnreadMessage: { + type: 'object', + properties: { + _id: { + type: 'string', + }, + }, + required: ['_id'], + additionalProperties: false, + }, + }, + required: ['firstUnreadMessage'], + additionalProperties: false, + }, + ], +}; + +export const isSubscriptionsUnreadProps = ajv.compile(SubscriptionsUnreadSchema); + +export type SubscriptionsEndpoints = { + 'subscriptions.get': { + GET: (params: SubscriptionsGet) => { + update: ISubscription[]; + remove: (Pick & { _deletedAt: Date })[]; + }; + }; + + 'subscriptions.getOne': { + GET: (params: SubscriptionsGetOne) => { + subscription: ISubscription | null; + }; + }; + + 'subscriptions.read': { + POST: (params: SubscriptionsRead) => void; + }; + + 'subscriptions.unread': { + POST: (params: SubscriptionsUnread) => void; + }; +}; diff --git a/yarn.lock b/yarn.lock index bd6380a7cf07..79f53cff45e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -101,25 +101,25 @@ __metadata: linkType: hard "@babel/core@npm:^7.17.9": - version: 7.18.0 - resolution: "@babel/core@npm:7.18.0" + version: 7.18.2 + resolution: "@babel/core@npm:7.18.2" dependencies: "@ampproject/remapping": ^2.1.0 "@babel/code-frame": ^7.16.7 - "@babel/generator": ^7.18.0 - "@babel/helper-compilation-targets": ^7.17.10 + "@babel/generator": ^7.18.2 + "@babel/helper-compilation-targets": ^7.18.2 "@babel/helper-module-transforms": ^7.18.0 - "@babel/helpers": ^7.18.0 + "@babel/helpers": ^7.18.2 "@babel/parser": ^7.18.0 "@babel/template": ^7.16.7 - "@babel/traverse": ^7.18.0 - "@babel/types": ^7.18.0 + "@babel/traverse": ^7.18.2 + "@babel/types": ^7.18.2 convert-source-map: ^1.7.0 debug: ^4.1.0 gensync: ^1.0.0-beta.2 json5: ^2.2.1 semver: ^6.3.0 - checksum: 350b7724a48c80b76f8af11e3cac1ad8ec9021325389f5ae20c713b10d4359c5e60aa7e71a309a3e1893826c46e72eef5df4978eb63eaabc403e8cc4ce5e94fc + checksum: 14a4142c12e004cd2477b7610408d5788ee5dd821ee9e4de204cbb72d9c399d858d9deabc3d49914d5d7c2927548160c19bdc7524b1a9f6acc1ec96a8d9848dd languageName: node linkType: hard @@ -134,14 +134,14 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.18.0": - version: 7.18.0 - resolution: "@babel/generator@npm:7.18.0" +"@babel/generator@npm:^7.18.2": + version: 7.18.2 + resolution: "@babel/generator@npm:7.18.2" dependencies: - "@babel/types": ^7.18.0 + "@babel/types": ^7.18.2 "@jridgewell/gen-mapping": ^0.3.0 jsesc: ^2.5.1 - checksum: 0854b21d94f99e3ac68249a9bbaa0c3a914a600c69c12fffa4a01377d89282174a67e619654e401be4c791414a1d5e825671f089f1c2407694a494dcfab8b06c + checksum: d0661e95532ddd97566d41fec26355a7b28d1cbc4df95fe80cc084c413342935911b48db20910708db39714844ddd614f61c2ec4cca3fb10181418bdcaa2e7a3 languageName: node linkType: hard @@ -178,9 +178,9 @@ __metadata: languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.17.10": - version: 7.17.10 - resolution: "@babel/helper-compilation-targets@npm:7.17.10" +"@babel/helper-compilation-targets@npm:^7.17.10, @babel/helper-compilation-targets@npm:^7.18.2": + version: 7.18.2 + resolution: "@babel/helper-compilation-targets@npm:7.18.2" dependencies: "@babel/compat-data": ^7.17.10 "@babel/helper-validator-option": ^7.16.7 @@ -188,7 +188,7 @@ __metadata: semver: ^6.3.0 peerDependencies: "@babel/core": ^7.0.0 - checksum: 5f547c7ebd372e90fa72c2aaea867e7193166e9f469dec5acde4f0e18a78b80bdca8e02a0f641f3e998be984fb5b802c729a9034faaee8b1a9ef6670cb76f120 + checksum: 4f02e79f20c0b3f8db5049ba8c35027c41ccb3fc7884835d04e49886538e0f55702959db1bb75213c94a5708fec2dc81a443047559a4f184abb884c72c0059b4 languageName: node linkType: hard @@ -295,6 +295,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-environment-visitor@npm:^7.18.2": + version: 7.18.2 + resolution: "@babel/helper-environment-visitor@npm:7.18.2" + checksum: 1a9c8726fad454a082d077952a90f17188e92eabb3de236cb4782c49b39e3f69c327e272b965e9a20ff8abf37d30d03ffa6fd7974625a6c23946f70f7527f5e9 + languageName: node + linkType: hard + "@babel/helper-explode-assignable-expression@npm:^7.16.7": version: 7.16.7 resolution: "@babel/helper-explode-assignable-expression@npm:7.16.7" @@ -427,6 +434,19 @@ __metadata: languageName: node linkType: hard +"@babel/helper-replace-supers@npm:^7.18.2": + version: 7.18.2 + resolution: "@babel/helper-replace-supers@npm:7.18.2" + dependencies: + "@babel/helper-environment-visitor": ^7.18.2 + "@babel/helper-member-expression-to-functions": ^7.17.7 + "@babel/helper-optimise-call-expression": ^7.16.7 + "@babel/traverse": ^7.18.2 + "@babel/types": ^7.18.2 + checksum: c0083b7933672dd2aed50b79021c46401c83f41bc2132def19c5414cf8f944251f6d91dd959b2bedada9a7436a80fab629adb486e008566290c82293e89fec05 + languageName: node + linkType: hard + "@babel/helper-simple-access@npm:^7.17.7": version: 7.17.7 resolution: "@babel/helper-simple-access@npm:7.17.7" @@ -436,6 +456,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-simple-access@npm:^7.18.2": + version: 7.18.2 + resolution: "@babel/helper-simple-access@npm:7.18.2" + dependencies: + "@babel/types": ^7.18.2 + checksum: c0862b56db7e120754d89273a039b128c27517389f6a4425ff24e49779791e8fe10061579171fb986be81fa076778acb847c709f6f5e396278d9c5e01360c375 + languageName: node + linkType: hard + "@babel/helper-skip-transparent-expression-wrappers@npm:^7.16.0": version: 7.16.0 resolution: "@babel/helper-skip-transparent-expression-wrappers@npm:7.16.0" @@ -491,14 +520,14 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.18.0": - version: 7.18.0 - resolution: "@babel/helpers@npm:7.18.0" +"@babel/helpers@npm:^7.18.2": + version: 7.18.2 + resolution: "@babel/helpers@npm:7.18.2" dependencies: "@babel/template": ^7.16.7 - "@babel/traverse": ^7.18.0 - "@babel/types": ^7.18.0 - checksum: 3f41631c0797b052cc22337ee56290700fe7db7bc06b847fcdf2c0043cddc35861855a1acc4c948397838675d2dc694f4fb1b102d1c7eb484ea01e9029916b55 + "@babel/traverse": ^7.18.2 + "@babel/types": ^7.18.2 + checksum: 94620242f23f6d5f9b83a02b1aa1632ffb05b0815e1bb53d3b46d64aa8e771066bba1db8bd267d9091fb00134cfaeda6a8d69d1d4cc2c89658631adfa077ae70 languageName: node linkType: hard @@ -523,11 +552,11 @@ __metadata: linkType: hard "@babel/parser@npm:^7.18.0": - version: 7.18.0 - resolution: "@babel/parser@npm:7.18.0" + version: 7.18.4 + resolution: "@babel/parser@npm:7.18.4" bin: parser: ./bin/babel-parser.js - checksum: 253b5828bf4a0b443301baedc5993d6f7f35aa0d81cf8f2f2f53940904b7067eab7bd2380aee4b3be1d8efd5ae1008eb0fad19bde28f5fbc213c0fdf9a414466 + checksum: e05b2dc720c4b200e088258f3c2a2de5041c140444edc38181d1217b10074e881a7133162c5b62356061f26279f08df5a06ec14c5842996ee8601ad03c57a44f languageName: node linkType: hard @@ -1294,13 +1323,13 @@ __metadata: linkType: hard "@babel/plugin-transform-block-scoping@npm:^7.17.12": - version: 7.17.12 - resolution: "@babel/plugin-transform-block-scoping@npm:7.17.12" + version: 7.18.4 + resolution: "@babel/plugin-transform-block-scoping@npm:7.18.4" dependencies: "@babel/helper-plugin-utils": ^7.17.12 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: ea3d4d88e38367d62a1029d204c5cc0ac410b00779179c8507448001c64784bf8e34c6fa57f23d8b95a835541a2fc67d1076650b1efc99c78f699de354472e49 + checksum: 5fdc8fd2f56f43e275353123fa1cda3df475daf1e9d92c03d5aa1ae50d3a0ccabf80c6168356947d8eb8e6e29098c875bc27fda8c7d4fbca6ffc6eec5d5faa8d languageName: node linkType: hard @@ -1323,20 +1352,20 @@ __metadata: linkType: hard "@babel/plugin-transform-classes@npm:^7.17.12": - version: 7.17.12 - resolution: "@babel/plugin-transform-classes@npm:7.17.12" + version: 7.18.4 + resolution: "@babel/plugin-transform-classes@npm:7.18.4" dependencies: "@babel/helper-annotate-as-pure": ^7.16.7 - "@babel/helper-environment-visitor": ^7.16.7 + "@babel/helper-environment-visitor": ^7.18.2 "@babel/helper-function-name": ^7.17.9 "@babel/helper-optimise-call-expression": ^7.16.7 "@babel/helper-plugin-utils": ^7.17.12 - "@babel/helper-replace-supers": ^7.16.7 + "@babel/helper-replace-supers": ^7.18.2 "@babel/helper-split-export-declaration": ^7.16.7 globals: ^11.1.0 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 0127b1cc432373965edf28cbfd9e85df5bc77e974ceb80ba32691e050e8fb6792f207d1941529c81d1b9e7a6e82da26ecc445f6f547f0ad5076cd2b27adc18ac + checksum: 968711024c2ed1c08ced754243edde3a663ab40c414ca6fcad1a75f27789f3f52cc78fbafe21c6337c4c6a0dfbeddd1527caff1558ed477790b600a1e6f99cda languageName: node linkType: hard @@ -1453,7 +1482,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-for-of@npm:^7.17.12": +"@babel/plugin-transform-for-of@npm:^7.18.1": version: 7.18.1 resolution: "@babel/plugin-transform-for-of@npm:7.18.1" dependencies: @@ -1550,17 +1579,17 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-modules-commonjs@npm:^7.18.0": - version: 7.18.0 - resolution: "@babel/plugin-transform-modules-commonjs@npm:7.18.0" +"@babel/plugin-transform-modules-commonjs@npm:^7.18.2": + version: 7.18.2 + resolution: "@babel/plugin-transform-modules-commonjs@npm:7.18.2" dependencies: "@babel/helper-module-transforms": ^7.18.0 "@babel/helper-plugin-utils": ^7.17.12 - "@babel/helper-simple-access": ^7.17.7 + "@babel/helper-simple-access": ^7.18.2 babel-plugin-dynamic-import-node: ^2.3.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: debb8c952b689def0d3f02d2944b8d031650adcad042277f91c4d137d96c4de1796576d2791fc55217c19004947a37f031c9870d830861075d33d279fe02dda8 + checksum: 99c1c5ce9c353e29eb680ebb5bdf27c076c6403e133a066999298de642423cc7f38cfbac02372d33ed73278da13be23c4be7d60169c3e27bd900a373e61a599a languageName: node linkType: hard @@ -1580,8 +1609,8 @@ __metadata: linkType: hard "@babel/plugin-transform-modules-systemjs@npm:^7.18.0": - version: 7.18.0 - resolution: "@babel/plugin-transform-modules-systemjs@npm:7.18.0" + version: 7.18.4 + resolution: "@babel/plugin-transform-modules-systemjs@npm:7.18.4" dependencies: "@babel/helper-hoist-variables": ^7.16.7 "@babel/helper-module-transforms": ^7.18.0 @@ -1590,7 +1619,7 @@ __metadata: babel-plugin-dynamic-import-node: ^2.3.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 80fccfc546aab76238d3f4aeb454f61ed885670578f1ab6dc063bba5b5d4cbdf821439ac6ca8bc24449eed752359600b47be717196103d2eabba06de1bf3f732 + checksum: abe6948a1548b20055bf1c56ceab5b17dc283e7cdbcc0525b297b726f0785f1169333b5e685add81337fc749588adb8d96ccba9269565031db006a710e7eaf02 languageName: node linkType: hard @@ -1874,14 +1903,14 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-template-literals@npm:^7.17.12": - version: 7.17.12 - resolution: "@babel/plugin-transform-template-literals@npm:7.17.12" +"@babel/plugin-transform-template-literals@npm:^7.18.2": + version: 7.18.2 + resolution: "@babel/plugin-transform-template-literals@npm:7.18.2" dependencies: "@babel/helper-plugin-utils": ^7.17.12 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: fec220cea6e7bcd7720c65245e628cdf8e8276379e8ee041e49217b5ebb426911cb738d5b66afa5b1c7d17fc8dbe76d8041dbbce442925d83f08fb510f90507e + checksum: bc0102ed8c789e5bc01053088e2de85b82cebcd4d57af9fdc32ca62f559d3dd19c33e9d26caa71c5fd8e94152e5ce4fc4da19badc2d537620e6dea83bce7eb05 languageName: node linkType: hard @@ -2028,11 +2057,11 @@ __metadata: linkType: hard "@babel/preset-env@npm:^7.16.11": - version: 7.18.0 - resolution: "@babel/preset-env@npm:7.18.0" + version: 7.18.2 + resolution: "@babel/preset-env@npm:7.18.2" dependencies: "@babel/compat-data": ^7.17.10 - "@babel/helper-compilation-targets": ^7.17.10 + "@babel/helper-compilation-targets": ^7.18.2 "@babel/helper-plugin-utils": ^7.17.12 "@babel/helper-validator-option": ^7.16.7 "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ^7.17.12 @@ -2077,12 +2106,12 @@ __metadata: "@babel/plugin-transform-dotall-regex": ^7.16.7 "@babel/plugin-transform-duplicate-keys": ^7.17.12 "@babel/plugin-transform-exponentiation-operator": ^7.16.7 - "@babel/plugin-transform-for-of": ^7.17.12 + "@babel/plugin-transform-for-of": ^7.18.1 "@babel/plugin-transform-function-name": ^7.16.7 "@babel/plugin-transform-literals": ^7.17.12 "@babel/plugin-transform-member-expression-literals": ^7.16.7 "@babel/plugin-transform-modules-amd": ^7.18.0 - "@babel/plugin-transform-modules-commonjs": ^7.18.0 + "@babel/plugin-transform-modules-commonjs": ^7.18.2 "@babel/plugin-transform-modules-systemjs": ^7.18.0 "@babel/plugin-transform-modules-umd": ^7.18.0 "@babel/plugin-transform-named-capturing-groups-regex": ^7.17.12 @@ -2095,12 +2124,12 @@ __metadata: "@babel/plugin-transform-shorthand-properties": ^7.16.7 "@babel/plugin-transform-spread": ^7.17.12 "@babel/plugin-transform-sticky-regex": ^7.16.7 - "@babel/plugin-transform-template-literals": ^7.17.12 + "@babel/plugin-transform-template-literals": ^7.18.2 "@babel/plugin-transform-typeof-symbol": ^7.17.12 "@babel/plugin-transform-unicode-escapes": ^7.16.7 "@babel/plugin-transform-unicode-regex": ^7.16.7 "@babel/preset-modules": ^0.1.5 - "@babel/types": ^7.18.0 + "@babel/types": ^7.18.2 babel-plugin-polyfill-corejs2: ^0.3.0 babel-plugin-polyfill-corejs3: ^0.5.0 babel-plugin-polyfill-regenerator: ^0.3.0 @@ -2108,7 +2137,7 @@ __metadata: semver: ^6.3.0 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: f2d4f6305c0e1a4f49d89c076f67f93e20d9fce73cde1c74447c2c3cc519b3568a2359815221eb386cac0050fdaf8a032f4f85746aa4c1f4d0b7808dcebf2966 + checksum: f81892a7970cb34643b93917cbbc9b581d5066d892639867521f4a85ec258e69362a37bbb7b899b351e71d26095a97cd2d6e35e5f9ee110715146e0ccc19e700 languageName: node linkType: hard @@ -2210,11 +2239,11 @@ __metadata: linkType: hard "@babel/runtime@npm:^7.17.9": - version: 7.18.0 - resolution: "@babel/runtime@npm:7.18.0" + version: 7.18.3 + resolution: "@babel/runtime@npm:7.18.3" dependencies: regenerator-runtime: ^0.13.4 - checksum: 9d0caa5fe690623fb6c5df6fb3b3581d227b55ef9f7c35eba0da83d10aa756669a81fe521ac4dbc007e5790716bac40ebe71ff098e2d1a9599dd696a282a3e95 + checksum: db8526226aa02cfa35a5a7ac1a34b5f303c62a1f000c7db48cb06c6290e616483e5036ab3c4e7a84d0f3be6d4e2148d5fe5cec9564bf955f505c3e764b83d7f1 languageName: node linkType: hard @@ -2247,21 +2276,21 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.18.0": - version: 7.18.0 - resolution: "@babel/traverse@npm:7.18.0" +"@babel/traverse@npm:^7.18.0, @babel/traverse@npm:^7.18.2": + version: 7.18.2 + resolution: "@babel/traverse@npm:7.18.2" dependencies: "@babel/code-frame": ^7.16.7 - "@babel/generator": ^7.18.0 - "@babel/helper-environment-visitor": ^7.16.7 + "@babel/generator": ^7.18.2 + "@babel/helper-environment-visitor": ^7.18.2 "@babel/helper-function-name": ^7.17.9 "@babel/helper-hoist-variables": ^7.16.7 "@babel/helper-split-export-declaration": ^7.16.7 "@babel/parser": ^7.18.0 - "@babel/types": ^7.18.0 + "@babel/types": ^7.18.2 debug: ^4.1.0 globals: ^11.1.0 - checksum: b80b49ba5cead42c4b09bdfbe926d94179f884d35319a0a3ab5a798c85f16102a7342799fac928b3041337ea2c3f5194f17c4a08f611a474de6eea719b640dd4 + checksum: e21c2d550bf610406cf21ef6fbec525cb1d80b9d6d71af67552478a24ee371203cb4025b23b110ae7288a62a874ad5898daad19ad23daa95dfc8ab47a47a092f languageName: node linkType: hard @@ -2275,13 +2304,13 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.17.12, @babel/types@npm:^7.18.0": - version: 7.18.0 - resolution: "@babel/types@npm:7.18.0" +"@babel/types@npm:^7.17.12, @babel/types@npm:^7.18.0, @babel/types@npm:^7.18.2": + version: 7.18.4 + resolution: "@babel/types@npm:7.18.4" dependencies: "@babel/helper-validator-identifier": ^7.16.7 to-fast-properties: ^2.0.0 - checksum: 151485f94c929171fd6539430c0ae519e8bb67fbc0d856b285328f5e6ecbaf4237b52d7a581b413f5e7b6268d31a4db6ca9bc01372b284b2966aa473fc902f27 + checksum: 85df59beb99c1b95e9e41590442f2ffa1e5b1b558d025489db40c9f7c906bd03a17da26c3ec486e5800e80af27c42ca7eee9506d9212ab17766d2d68d30fbf52 languageName: node linkType: hard @@ -2316,25 +2345,25 @@ __metadata: languageName: node linkType: hard -"@bugsnag/browser@npm:^7.16.5": - version: 7.16.5 - resolution: "@bugsnag/browser@npm:7.16.5" +"@bugsnag/browser@npm:^7.16.7": + version: 7.16.7 + resolution: "@bugsnag/browser@npm:7.16.7" dependencies: - "@bugsnag/core": ^7.16.1 - checksum: 4434c857376a45b92b549a79be97d3a2c8144c4220d0ee6b5866393ecb03d2bc6509ce44df7b53ebfe7397273a41abc6e5d03d96cd18527cface88f11b180dfe + "@bugsnag/core": ^7.16.7 + checksum: c83a8d0184fdc33473043994a41c0e832152cf84a32bcc97663ebc8da17bfde84fd8c971e40ba0c03fd178f4615c6834764af2119c29f44a48d2c68819bbf675 languageName: node linkType: hard -"@bugsnag/core@npm:^7.16.1": - version: 7.16.1 - resolution: "@bugsnag/core@npm:7.16.1" +"@bugsnag/core@npm:^7.16.7": + version: 7.16.7 + resolution: "@bugsnag/core@npm:7.16.7" dependencies: "@bugsnag/cuid": ^3.0.0 "@bugsnag/safe-json-stringify": ^6.0.0 error-stack-parser: ^2.0.3 iserror: 0.0.2 stack-generator: ^2.0.3 - checksum: 53c7803a0457fad905aa712105e819ac89162e09bff0b7b78a2b94d236634b6de5771b5c9761e123b9dbcfbb170890f2f20598993f2748733476884e6f18447c + checksum: 2212ceb090ef9d53d048fc4b03f8f9dd22573838374f4aca7075f8431bf46fad9d07018804e12cc6508925207aee198b1330b1c42e3c71ec7ab112a74cd0534a languageName: node linkType: hard @@ -2346,26 +2375,26 @@ __metadata: linkType: hard "@bugsnag/js@npm:^7.16.2": - version: 7.16.5 - resolution: "@bugsnag/js@npm:7.16.5" + version: 7.16.7 + resolution: "@bugsnag/js@npm:7.16.7" dependencies: - "@bugsnag/browser": ^7.16.5 - "@bugsnag/node": ^7.16.2 - checksum: 2d8cc5b2e757ada851b2139a3087500b386305d9c3dbdb02d3165b73ce7fe4e8208b471c1a31086441dce28a007169eeb699ccb38e9817a0fbbe32430415640f + "@bugsnag/browser": ^7.16.7 + "@bugsnag/node": ^7.16.7 + checksum: ba49fe64646738db130d56f58bd4f206d1e905c441e517b9a82ed823482cb9a6d51cc51cdcb7539baff41c6f2eca69b36bf48004163cdc6bed3f0c5e6450f944 languageName: node linkType: hard -"@bugsnag/node@npm:^7.16.2": - version: 7.16.2 - resolution: "@bugsnag/node@npm:7.16.2" +"@bugsnag/node@npm:^7.16.7": + version: 7.16.7 + resolution: "@bugsnag/node@npm:7.16.7" dependencies: - "@bugsnag/core": ^7.16.1 + "@bugsnag/core": ^7.16.7 byline: ^5.0.0 error-stack-parser: ^2.0.2 iserror: ^0.0.2 pump: ^3.0.0 stack-generator: ^2.0.3 - checksum: 484254472d07aa899ee072741c0516d4cb1c347bf4a78cc5163dd3311add0dad37fb27f12e9a24f959f17814cef52a4b72b1a07c7293b13aa01c75356b9e3297 + checksum: ec03529627319adebaab410615f73728ffc1244372ca4343abc4e5be2c59734e1e4170c6ac7d844004fe34b14679a3e70e50a215b4f364c93e7669991c2e2fea languageName: node linkType: hard @@ -4250,20 +4279,7 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/css-in-js@npm:^0.31.12, @rocket.chat/css-in-js@npm:~0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/css-in-js@npm:0.31.12" - dependencies: - "@emotion/hash": ^0.8.0 - "@rocket.chat/css-supports": ^0.31.12 - "@rocket.chat/memo": ^0.31.12 - "@rocket.chat/stylis-logical-props-middleware": ^0.31.12 - stylis: ~4.0.13 - checksum: 42c22c976e8fdabf50d45c39fba357d25cd7b21ed5f3b16b1c75efe70f09ac658b5e47124a862445e21266dab38352d88902e739bdc9f866c3a43fcd498765c7 - languageName: node - linkType: hard - -"@rocket.chat/css-in-js@npm:^0.31.13": +"@rocket.chat/css-in-js@npm:^0.31.13, @rocket.chat/css-in-js@npm:~0.31.12": version: 0.31.13 resolution: "@rocket.chat/css-in-js@npm:0.31.13" dependencies: @@ -4276,6 +4292,19 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/css-in-js@npm:~0.31.14-dev.1": + version: 0.31.14-dev.1 + resolution: "@rocket.chat/css-in-js@npm:0.31.14-dev.1" + dependencies: + "@emotion/hash": ^0.8.0 + "@rocket.chat/css-supports": ~0.31.14-dev.1 + "@rocket.chat/memo": ~0.31.14-dev.1 + "@rocket.chat/stylis-logical-props-middleware": ~0.31.14-dev.1 + stylis: ~4.0.13 + checksum: 536ef1a0a462ac00810a05231dffdc78c0d3dbc951e3b4fffdcfe1a5c02b1209fefb542a24f172b7dc52b716a975aede5fd634dbdd86fcd9c3bd82288bcdda0c + languageName: node + linkType: hard + "@rocket.chat/css-supports@npm:^0.31.11": version: 0.31.11 resolution: "@rocket.chat/css-supports@npm:0.31.11" @@ -4285,15 +4314,6 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/css-supports@npm:^0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/css-supports@npm:0.31.12" - dependencies: - "@rocket.chat/memo": ^0.31.12 - checksum: 0f6716b707e6b861589b51e8fdac48fd3fa2512e83e213bbb09379cb93d30f8712cc2e517ba0acf593ec835c2fd57eb54d060030221bb6146fada5b41c228314 - languageName: node - linkType: hard - "@rocket.chat/css-supports@npm:^0.31.13": version: 0.31.13 resolution: "@rocket.chat/css-supports@npm:0.31.13" @@ -4303,6 +4323,15 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/css-supports@npm:~0.31.14-dev.1": + version: 0.31.14-dev.1 + resolution: "@rocket.chat/css-supports@npm:0.31.14-dev.1" + dependencies: + "@rocket.chat/memo": ~0.31.14-dev.1 + checksum: 90dc00bf41dd2bb95e7674591f64f58b8a4b02229d792492628e41220ee7fb85d8c4e7ad96f9a61c65a5cb810d30dadb1ef6a0bd8c9091e0d294e03ff47bd0c0 + languageName: node + linkType: hard + "@rocket.chat/ddp-streamer@workspace:ee/apps/ddp-streamer": version: 0.0.0-use.local resolution: "@rocket.chat/ddp-streamer@workspace:ee/apps/ddp-streamer" @@ -4346,9 +4375,9 @@ __metadata: linkType: hard "@rocket.chat/emitter@npm:~0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/emitter@npm:0.31.12" - checksum: d66636ebc05f60526b18056c211793176702e915788254b603bb45ea209f740b5247a2c95f27ccb66963866001bf5dcb4e9b46c2ded450749ca5381c6439833b + version: 0.31.13 + resolution: "@rocket.chat/emitter@npm:0.31.13" + checksum: a6b00781b68eb4b584b184e67ad129a3599bb190f153f17d91547d1dacbe83d142c2e202ffbee664459cb9888497d4084d37a83cbd1d2f257c571967c0ee6afb languageName: node linkType: hard @@ -4455,22 +4484,35 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/fuselage-hooks@npm:^0.31.12, @rocket.chat/fuselage-hooks@npm:~0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/fuselage-hooks@npm:0.31.12" +"@rocket.chat/fuselage-hooks@npm:^0.31.13, @rocket.chat/fuselage-hooks@npm:~0.31.12": + version: 0.31.13 + resolution: "@rocket.chat/fuselage-hooks@npm:0.31.13" dependencies: "@testing-library/user-event": ^13.5.0 peerDependencies: "@rocket.chat/fuselage-tokens": "*" react: ^17.0.2 use-subscription: ^1.5.1 - checksum: 4ebb49de7ee49e8f9a76f5b98ad0e11010090f889f965b826207e231502e00e265d8bf15c5c3af193724ce976bd43a9f5a63015a3741cd692c6ed2171db3c491 + checksum: 4b1f63536bafd31cc18d2c6479a253c7b41226c43dddc60adc55681ba971f542452f4db62b845b5b47c0b37f5fb822c7ae9612a3c8d4cc1a026fee9170aceac1 + languageName: node + linkType: hard + +"@rocket.chat/fuselage-hooks@npm:~0.31.14-dev.1": + version: 0.31.14-dev.1 + resolution: "@rocket.chat/fuselage-hooks@npm:0.31.14-dev.1" + dependencies: + "@testing-library/user-event": ^13.5.0 + peerDependencies: + "@rocket.chat/fuselage-tokens": "*" + react: ^17.0.2 + use-subscription: ^1.5.1 + checksum: 2c4fb22824400e3742a3c2fc0e2152db55d7125bb8653f6f467d6314217a83e58ed9cf3b59613348552fbe50de38a77169b7b8f4343b5903a935b8f090cd9521 languageName: node linkType: hard "@rocket.chat/fuselage-polyfills@npm:~0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/fuselage-polyfills@npm:0.31.12" + version: 0.31.13 + resolution: "@rocket.chat/fuselage-polyfills@npm:0.31.13" dependencies: "@juggle/resize-observer": ^3.3.1 clipboard-polyfill: ^3.0.3 @@ -4478,18 +4520,26 @@ __metadata: focus-visible: ^5.2.0 focus-within-polyfill: ^5.2.1 new-event-polyfill: ^1.0.1 - checksum: 997db51a38a5b65aecc7d59959e4155697e15ac0992b22934b1cb932b6f8a9c1d65770dfd9f01c079c5c87818f51cc37ceaf22dd16b7d37a0b9278ce4daa9aef + checksum: 650ac1b31a8d6ef3f7cf69706a738a4223295ffb7b7f336d3dead57ed0f1fb3709d5cfd714407e480a5521b6269a03780c0cd0b2181dd58b9ddea9d2538222fd languageName: node linkType: hard -"@rocket.chat/fuselage-tokens@npm:^0.31.12, @rocket.chat/fuselage-tokens@npm:~0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/fuselage-tokens@npm:0.31.12" - checksum: ba2ccb37311ff192290f7a8e49d370aff62b6a8cb8ac2ff425860f9721a1bfe724778468e22364154df2b9c3effaea09e4de8bcd520d28952faf3646fd81cc4a +"@rocket.chat/fuselage-toastbar@npm:^0.32.0-dev.22": + version: 0.32.0-dev.22 + resolution: "@rocket.chat/fuselage-toastbar@npm:0.32.0-dev.22" + dependencies: + "@rocket.chat/fuselage-hooks": ~0.31.14-dev.1 + "@rocket.chat/styled": ~0.31.14-dev.1 + peerDependencies: + "@rocket.chat/fuselage": "*" + "@rocket.chat/fuselage-polyfills": "*" + react: ^17.0.2 + react-dom: ^17.0.2 + checksum: 50ef252f689f63ffb02e1f6ffd4580e8aaf253b765e607c77f52d783b5fc7695361965d906ec3aa18547283b140033c596d6f169bbfbb5d884a7b35cdb8270aa languageName: node linkType: hard -"@rocket.chat/fuselage-tokens@npm:^0.31.13": +"@rocket.chat/fuselage-tokens@npm:^0.31.13, @rocket.chat/fuselage-tokens@npm:~0.31.12": version: 0.31.13 resolution: "@rocket.chat/fuselage-tokens@npm:0.31.13" checksum: 848a800e6bd8c8fc46d473f18152168515e54ecf5b5a51ec4920d5478a28797e9d5bad652708b988305484cf646b3a167d0bff4bf0689bfbc7999f50f4bbf3ef @@ -4503,25 +4553,25 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/fuselage-ui-kit@npm:~0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/fuselage-ui-kit@npm:0.31.12" +"@rocket.chat/fuselage-ui-kit@npm:~0.31.14-dev.1": + version: 0.31.14-dev.1 + resolution: "@rocket.chat/fuselage-ui-kit@npm:0.31.14-dev.1" dependencies: - "@rocket.chat/fuselage": ^0.31.12 - "@rocket.chat/fuselage-hooks": ^0.31.12 - "@rocket.chat/styled": ^0.31.12 - "@rocket.chat/ui-kit": ^0.31.12 + "@rocket.chat/ui-kit": ~0.31.14-dev.1 tslib: ^2.3.1 peerDependencies: + "@rocket.chat/fuselage": ~0.32.0-dev.48 + "@rocket.chat/fuselage-hooks": ~0.31.14-dev.1 "@rocket.chat/fuselage-polyfills": "*" "@rocket.chat/icons": "*" + "@rocket.chat/styled": ~0.31.14-dev.1 react: ^17.0.2 react-dom: ^17.0.2 - checksum: ae14aca1c93cf6aad70c9455ae72db6980b2157f89678ea8412cea953a437e0138f3a086b86812863b77757af4bc4f844e6ab64ff7eab520b33802011cff3863 + checksum: 3be924851a2ebe90a5ff61349fc9c02ebcb98035a9a33f42f6f16be282b1687a847845e59523789153ae5476f9b0640885c21827018c5e1d722460e81e15b058 languageName: node linkType: hard -"@rocket.chat/fuselage@npm:0.31.13": +"@rocket.chat/fuselage@npm:0.31.13, @rocket.chat/fuselage@npm:^0.31.13": version: 0.31.13 resolution: "@rocket.chat/fuselage@npm:0.31.13" dependencies: @@ -4543,28 +4593,6 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/fuselage@npm:^0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/fuselage@npm:0.31.12" - dependencies: - "@rocket.chat/css-in-js": ^0.31.12 - "@rocket.chat/css-supports": ^0.31.12 - "@rocket.chat/fuselage-tokens": ^0.31.12 - "@rocket.chat/memo": ^0.31.12 - "@rocket.chat/styled": ^0.31.12 - invariant: ^2.2.4 - react-keyed-flatten-children: ^1.3.0 - peerDependencies: - "@rocket.chat/fuselage-hooks": "*" - "@rocket.chat/fuselage-polyfills": "*" - "@rocket.chat/icons": "*" - react: ^17.0.2 - react-dom: ^17.0.2 - react-virtuoso: 1.2.4 - checksum: 451dadcf2584e9eb1765b2fbbfa825d518a60cde6f185596ede138096c31a40e33b3e1b14ef84f5aaee1f271789eda01c18c9782e74c7d2998114c61e7bf0aac - languageName: node - linkType: hard - "@rocket.chat/icons@npm:^0.31.0, @rocket.chat/icons@npm:^0.31.9": version: 0.31.9 resolution: "@rocket.chat/icons@npm:0.31.9" @@ -4572,10 +4600,10 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/icons@npm:^0.31.12, @rocket.chat/icons@npm:~0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/icons@npm:0.31.12" - checksum: 101f9147f8eca1e83469c9c76ad9665682382507fe52af4bbebf08715e1f4968dcadabfc5e2d715bfdef4b2c38b3562d8495ab49dd38b9c204bee7fec0caf9ca +"@rocket.chat/icons@npm:^0.31.13, @rocket.chat/icons@npm:~0.31.12": + version: 0.31.13 + resolution: "@rocket.chat/icons@npm:0.31.13" + checksum: 17b9a6555a2bdfefdcbaabdbfcad766eb24f66ee5e02ac1e11b75918d8bf4256fdf42a082b1b56f4d748eb6171a7d54ff544e740e9e00702c79822710f9dc51f languageName: node linkType: hard @@ -4675,17 +4703,17 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/logo@npm:^0.31.12, @rocket.chat/logo@npm:~0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/logo@npm:0.31.12" +"@rocket.chat/logo@npm:^0.31.13, @rocket.chat/logo@npm:~0.31.12": + version: 0.31.13 + resolution: "@rocket.chat/logo@npm:0.31.13" dependencies: - "@rocket.chat/fuselage-hooks": ^0.31.12 - "@rocket.chat/styled": ^0.31.12 + "@rocket.chat/fuselage-hooks": ^0.31.13 + "@rocket.chat/styled": ^0.31.13 tslib: ^2.3.1 peerDependencies: react: 17.0.2 react-dom: 17.0.2 - checksum: d69e82f403606471a64a31825f5ab46f73a09c35121b2f9fc6db47c918dc9959eef8784e7197beca583ef6b56de26f85839e5630488ec22ed1ab91f00bf1a671 + checksum: 15e93ab6c5de9320fa2833dbe7d71b7247d084de8c006a6f22fe784046e7a3360b0911acfc9b5cebdac434e8a121fbb354f5000467b3392cbacf14f361636003 languageName: node linkType: hard @@ -4696,31 +4724,31 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/memo@npm:^0.31.12, @rocket.chat/memo@npm:~0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/memo@npm:0.31.12" - checksum: ad500775c6ab7a77e147a20a5ee478c42403286a2229d04a787341020d37ae0fefec62ae8f027b7f2113b123e7ea743380e30b715de5459f4a67c45983440da5 - languageName: node - linkType: hard - -"@rocket.chat/memo@npm:^0.31.13": +"@rocket.chat/memo@npm:^0.31.13, @rocket.chat/memo@npm:~0.31.12": version: 0.31.13 resolution: "@rocket.chat/memo@npm:0.31.13" checksum: ade0d9b637c3a31bdc7c02a3bbb7fc873e34ed165f43c3189eeed643c97cb5c3734a6696d68271910834b7203a96cc984c209ed90c2a9e8b71cac16c1dad6cc4 languageName: node linkType: hard +"@rocket.chat/memo@npm:~0.31.14-dev.1": + version: 0.31.14-dev.1 + resolution: "@rocket.chat/memo@npm:0.31.14-dev.1" + checksum: f4d83b6e08b5dda2c86b676576679d837435a5a7c366962ee2c3499ddb2484123bbb4c5209701c8ac940445dc62557de7e90cfb981f93bb4c0bfa52ce4478d7c + languageName: node + linkType: hard + "@rocket.chat/message-parser@npm:next": - version: 0.31.12-dev.10 - resolution: "@rocket.chat/message-parser@npm:0.31.12-dev.10" - checksum: 5d302792ab2988750b3b4c7ce4cf0aa42ec18bded9eb1179ec3ab8d9aa26d0ed0a1817cf2d60990dc61941b0ba39ba53396daa1fc36b1323e43110910ca40a62 + version: 0.31.14-dev.1 + resolution: "@rocket.chat/message-parser@npm:0.31.14-dev.1" + checksum: c3b7e7da0881e39d980725a3b64f0ab16c01a522d2be82688abc8bf7011900b4dc01e778e0ead4beb5b84abe4e08acf073c97fab5d57cfe6b4eed38cfbf99b01 languageName: node linkType: hard "@rocket.chat/message-parser@npm:~0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/message-parser@npm:0.31.12" - checksum: cd7ba4aca924ea291135d087207212431160ae6a8d265b4551c0295ed0e922930b7623ae027b80bf760982057f521aaf9dee1bd42f37c7ac3141f69c66ad344c + version: 0.31.13 + resolution: "@rocket.chat/message-parser@npm:0.31.13" + checksum: f670170464c148eaff2218749b76423c17ffe02d325ca99fab39abe8dae5edb7ba1f36871b4a045e589d2af5fc607681bf45d4a544cb958136c13e83f18dc193 languageName: node linkType: hard @@ -4754,8 +4782,9 @@ __metadata: "@rocket.chat/fuselage": 0.31.13 "@rocket.chat/fuselage-hooks": ~0.31.12 "@rocket.chat/fuselage-polyfills": ~0.31.12 + "@rocket.chat/fuselage-toastbar": ^0.32.0-dev.22 "@rocket.chat/fuselage-tokens": ~0.31.12 - "@rocket.chat/fuselage-ui-kit": ~0.31.12 + "@rocket.chat/fuselage-ui-kit": ~0.31.14-dev.1 "@rocket.chat/icons": ~0.31.12 "@rocket.chat/livechat": "workspace:^" "@rocket.chat/logo": ~0.31.12 @@ -4819,6 +4848,7 @@ __metadata: "@types/object-path": ^0.11.1 "@types/parseurl": ^1.3.1 "@types/photoswipe": ^4.1.2 + "@types/prometheus-gc-stats": ^0.6.2 "@types/proxy-from-env": ^1.0.1 "@types/psl": ^1.1.0 "@types/react": ~17.0.42 @@ -4830,7 +4860,6 @@ __metadata: "@types/speakeasy": ^2.0.7 "@types/string-strip-html": ^5.0.0 "@types/supertest": ^2.0.11 - "@types/toastr": ^2.1.39 "@types/ua-parser-js": ^0.7.36 "@types/underscore.string": 0.0.38 "@types/use-subscription": ^1.0.0 @@ -4854,7 +4883,6 @@ __metadata: babel-plugin-array-includes: ^2.0.3 bad-words: ^3.0.4 bcrypt: ^5.0.1 - blockstack: 19.3.0 body-parser: 1.20.0 bson: ^4.6.3 busboy: ^1.6.0 @@ -4999,7 +5027,6 @@ __metadata: tar-stream: ^1.6.2 template-file: ^6.0.1 tinykeys: ^1.4.0 - toastr: ^2.1.4 ts-node: ^10.7.0 turndown: ^7.1.1 twilio: ^3.76.1 @@ -5033,14 +5060,14 @@ __metadata: linkType: hard "@rocket.chat/onboarding-ui@npm:~0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/onboarding-ui@npm:0.31.12" - dependencies: - "@rocket.chat/fuselage": ^0.31.12 - "@rocket.chat/fuselage-hooks": ^0.31.12 - "@rocket.chat/icons": ^0.31.12 - "@rocket.chat/logo": ^0.31.12 - "@rocket.chat/styled": ^0.31.12 + version: 0.31.13 + resolution: "@rocket.chat/onboarding-ui@npm:0.31.13" + dependencies: + "@rocket.chat/fuselage": ^0.31.13 + "@rocket.chat/fuselage-hooks": ^0.31.13 + "@rocket.chat/icons": ^0.31.13 + "@rocket.chat/logo": ^0.31.13 + "@rocket.chat/styled": ^0.31.13 i18next: ~21.6.11 react-hook-form: ~7.27.0 tslib: ~2.3.1 @@ -5049,7 +5076,7 @@ __metadata: react: 17.0.2 react-dom: 17.0.2 react-i18next: ~11.15.4 - checksum: dc39a01e3dd32e00427b15a2aeae0e3772b6963e3504e1bce971e29170ffccc91483f11ddc6956c6f075418f95715832ef03debdf6cc4d9221548dd6be4f1848 + checksum: 55fa3a754683fc0b267cdeb30eef113d927d7bb2a91d19a11a06f9161de371171a9ad4d3b416cdcf2b22807b7d4bfe78caf8911d8003ac9cf23c6901eac60f79 languageName: node linkType: hard @@ -5086,11 +5113,11 @@ __metadata: linkType: hard "@rocket.chat/string-helpers@npm:~0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/string-helpers@npm:0.31.12" + version: 0.31.13 + resolution: "@rocket.chat/string-helpers@npm:0.31.13" dependencies: tslib: ^2.3.1 - checksum: b252ed3ad266ac6542fc4c0f3d57ee3af5cd236f48b4a32eb2980e8257c5723f240b60d185a6844c540777d21be953a6eb9ae5054ad2e24416881bb81ec41db5 + checksum: 3c1b28fc613948d014b79bd31e29d1cf064b27e3746e83683f6e29dea765ed20564ccd2b804a97dd8486ad2e937c2f01a78d8aeba2c6dbfb69fdc3d862272c35 languageName: node linkType: hard @@ -5113,16 +5140,6 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/styled@npm:^0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/styled@npm:0.31.12" - dependencies: - "@rocket.chat/css-in-js": ^0.31.12 - tslib: ^2.3.1 - checksum: 53b65682914872a34a58980a1df0aecea7c5b94e0075ea5a01c2340e6f89d2d0f745a36f301f5ea4a0f36294cbf9461b42a4ee856d2f96a599d04d84d60e5ec5 - languageName: node - linkType: hard - "@rocket.chat/styled@npm:^0.31.13": version: 0.31.13 resolution: "@rocket.chat/styled@npm:0.31.13" @@ -5133,6 +5150,16 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/styled@npm:~0.31.14-dev.1": + version: 0.31.14-dev.1 + resolution: "@rocket.chat/styled@npm:0.31.14-dev.1" + dependencies: + "@rocket.chat/css-in-js": ~0.31.14-dev.1 + tslib: ^2.3.1 + checksum: acab9cc3c904383884025809de7ef189f76cb11971f3c0a2ba4b32077d1f3fdac9bb41948f6c1d9717a6f643a72c97499664b299f33551842656d4f84dfb2a86 + languageName: node + linkType: hard + "@rocket.chat/stylis-logical-props-middleware@npm:^0.31.11": version: 0.31.11 resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.11" @@ -5145,27 +5172,27 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/stylis-logical-props-middleware@npm:^0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.12" +"@rocket.chat/stylis-logical-props-middleware@npm:^0.31.13": + version: 0.31.13 + resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.13" dependencies: - "@rocket.chat/css-supports": ^0.31.12 + "@rocket.chat/css-supports": ^0.31.13 tslib: ^2.3.1 peerDependencies: stylis: 4.0.10 - checksum: 378b8cbfd5e9ebb21f05450afc67e692270b7527895ef70b63c5f72c03aeba7df4fe79d7306f8fa070bf803bc9b09f04424af1a0e67f7c40f3fefc1d5112989c + checksum: 343dd4dd31154c77512cdeacf709d5ba681c2ccfdba852bb1ef94c28cf3ea6cde409d2122d538b9af8e8f9a37ca2a2927eeef182ac25f47a18bb67512cbb8b5c languageName: node linkType: hard -"@rocket.chat/stylis-logical-props-middleware@npm:^0.31.13": - version: 0.31.13 - resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.13" +"@rocket.chat/stylis-logical-props-middleware@npm:~0.31.14-dev.1": + version: 0.31.14-dev.1 + resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.14-dev.1" dependencies: - "@rocket.chat/css-supports": ^0.31.13 + "@rocket.chat/css-supports": ~0.31.14-dev.1 tslib: ^2.3.1 peerDependencies: stylis: 4.0.10 - checksum: 343dd4dd31154c77512cdeacf709d5ba681c2ccfdba852bb1ef94c28cf3ea6cde409d2122d538b9af8e8f9a37ca2a2927eeef182ac25f47a18bb67512cbb8b5c + checksum: 6afa245f653637eca01f64fc2139ed8e4133f66bef4e50b3598e98a1258cc1f07b788b3db9dbb73333eaa90ed15a2220a665bac14cc412571cdd73a6e0e146e8 languageName: node linkType: hard @@ -5204,13 +5231,6 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/ui-kit@npm:^0.31.12, @rocket.chat/ui-kit@npm:~0.31.12": - version: 0.31.12 - resolution: "@rocket.chat/ui-kit@npm:0.31.12" - checksum: 923a562a42e454d177ecbaaf3c4ca3b341da9d9e1fa573fcd7659d2788ad47f7d094ffe5faca2448c4488685d720859b7b7cff3501fcee2a47d5d7505871c8fa - languageName: node - linkType: hard - "@rocket.chat/ui-kit@npm:^0.31.6, @rocket.chat/ui-kit@npm:~0.31.9": version: 0.31.11 resolution: "@rocket.chat/ui-kit@npm:0.31.11" @@ -5218,6 +5238,20 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/ui-kit@npm:~0.31.12": + version: 0.31.13 + resolution: "@rocket.chat/ui-kit@npm:0.31.13" + checksum: 94926dee4687e69b2a51a3570d09ba051b0638b3364499daed864e36480b56c538a20e3b66b02563492c7c2fe15b101ab03850d86bdac46f3fab442a9f93ef10 + languageName: node + linkType: hard + +"@rocket.chat/ui-kit@npm:~0.31.14-dev.1": + version: 0.31.14-dev.1 + resolution: "@rocket.chat/ui-kit@npm:0.31.14-dev.1" + checksum: 9f807601eb6b90a975e61c78fc1af2663fe42998b931f825e694e5843a0bc048f679dfe7c264e772819824a7b57e5c7f6df30048d88bbc797dceab8d6e766e2a + languageName: node + linkType: hard + "@selderee/plugin-htmlparser2@npm:^0.6.0": version: 0.6.0 resolution: "@selderee/plugin-htmlparser2@npm:0.6.0" @@ -6423,8 +6457,6 @@ __metadata: version: 6.4.22 resolution: "@storybook/postinstall@npm:6.4.22" dependencies: - "@types/npmlog": ^4.1.2 - chalk: ^4.1.0 core-js: ^3.8.2 checksum: d406b2fdfc4350d52bcfe2f2447e90f66ae82bddaa659456e8d8211c335a3bf18968b2701ec7aafc0a3640d816c61f0081f143438b75be9bd4da2c515f534fc5 languageName: node @@ -6935,24 +6967,6 @@ __metadata: languageName: node linkType: hard -"@types/bn.js@npm:*": - version: 5.1.0 - resolution: "@types/bn.js@npm:5.1.0" - dependencies: - "@types/node": "*" - checksum: 1dc1cbbd7a1e8bf3614752e9602f558762a901031f499f3055828b5e3e2bba16e5b88c27b3c4152ad795248fbe4086c731a5c4b0f29bb243f1875beeeabee59c - languageName: node - linkType: hard - -"@types/bn.js@npm:^4.11.5": - version: 4.11.6 - resolution: "@types/bn.js@npm:4.11.6" - dependencies: - "@types/node": "*" - checksum: 7f66f2c7b7b9303b3205a57184261974b114495736b77853af5b18d857c0b33e82ce7146911e86e87a87837de8acae28986716fd381ac7c301fd6e8d8b6c811f - languageName: node - linkType: hard - "@types/body-parser@npm:*, @types/body-parser@npm:^1.19.0": version: 1.19.2 resolution: "@types/body-parser@npm:1.19.2" @@ -7086,15 +7100,6 @@ __metadata: languageName: node linkType: hard -"@types/elliptic@npm:^6.4.9": - version: 6.4.14 - resolution: "@types/elliptic@npm:6.4.14" - dependencies: - "@types/bn.js": "*" - checksum: d5a64f540e0ed4b74a12dfa5cc88c0aa7b531eab3b7a9fab17948ffbfc6e01814230e63d7417ce1b607dbd8b5d70e1b64f5afac632deabf96e44875aaac0ae1b - languageName: node - linkType: hard - "@types/eslint-visitor-keys@npm:^1.0.0": version: 1.0.0 resolution: "@types/eslint-visitor-keys@npm:1.0.0" @@ -7523,24 +7528,10 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:10.12.18": - version: 10.12.18 - resolution: "@types/node@npm:10.12.18" - checksum: 333cedae77961347d44329d4042ab0b04569366c4659923bbc3434252d01d63a660375b4e64681336e1caf805d2ab141f08ced39b9bd2d01e30608385f46d8c1 - languageName: node - linkType: hard - -"@types/node@npm:11.11.6": - version: 11.11.6 - resolution: "@types/node@npm:11.11.6" - checksum: 075f1c011cf568e49701419acbcb55c24906b3bb5a34d9412a3b88f228a7a78401a5ad4d3e1cd6855c99aaea5ef96e37fc86ca097e50f06da92cf822befc1fff - languageName: node - linkType: hard - "@types/node@npm:>=12.0.0, @types/node@npm:>=8.9.0": - version: 17.0.35 - resolution: "@types/node@npm:17.0.35" - checksum: 7a24946ae7fd20267ed92466384f594e448bfb151081158d565cc635d406ecb29ea8fb85fcd2a1f71efccf26fb5bd3c6f509bde56077eb8b832b847a6664bc62 + version: 17.0.40 + resolution: "@types/node@npm:17.0.40" + checksum: e3b2fe876672fbe4be84ce17773944eb2f5eaba50e2c6c0536bdf6d4972ed6488581580581f154183fdc8f2d56fa42a42e3d6e83b9b71ee25adea16a84765e92 languageName: node linkType: hard @@ -7552,9 +7543,9 @@ __metadata: linkType: hard "@types/node@npm:^14.18.15": - version: 14.18.18 - resolution: "@types/node@npm:14.18.18" - checksum: a165225cd2603f6e62af8407449e4a4407305e03b41c1adf6b186fdf546e1a03c8214217659b5b36c556947c0c06234993ac880d4db6378136a7a810d47e0742 + version: 14.18.20 + resolution: "@types/node@npm:14.18.20" + checksum: 999d8ef25c983c9ca7c3365d6878a7f9387a90e10fdec9b6fc26764ae0b52768b8ca4f7e3fcab6056326dcc613b730f2a58b59acacdc5d5863fa4b7a09c1f85f languageName: node linkType: hard @@ -7671,6 +7662,13 @@ __metadata: languageName: node linkType: hard +"@types/prometheus-gc-stats@npm:^0.6.2": + version: 0.6.2 + resolution: "@types/prometheus-gc-stats@npm:0.6.2" + checksum: 403b3dbd792b83e592376e2002260cf57fb18f98c8b8528a24dc65e545cb8d0e9bf9941dc28edfa397b670b9a7336913da991005ef0278611209dde9b51406db + languageName: node + linkType: hard + "@types/prop-types@npm:*": version: 15.7.4 resolution: "@types/prop-types@npm:15.7.4" @@ -7933,15 +7931,6 @@ __metadata: languageName: node linkType: hard -"@types/toastr@npm:^2.1.39": - version: 2.1.39 - resolution: "@types/toastr@npm:2.1.39" - dependencies: - "@types/jquery": "*" - checksum: a8b3c3630d9fb2b14f170337d1c860ff43f8526672c25a0c342330527a20d1698eb53182ca1ce0398d0195568f09303fe1534d7c3a51a25adb7e4e8486df5ed6 - languageName: node - linkType: hard - "@types/tough-cookie@npm:*": version: 4.0.1 resolution: "@types/tough-cookie@npm:4.0.1" @@ -8695,7 +8684,7 @@ __metadata: human-interval: ~1.0.0 moment-timezone: ~0.5.27 mongodb: ~3.5.0 - checksum: acb4ebb7e7356f6e53e810d821eb6aa3d88bbfb9e85183e707517bee6d1eea1f189f38bdf0dd2b91360492ab7643134d510c320d2523d86596498ab98e59735b + checksum: f5f68008298f9482631f1f494e392cd6b8ba7971a3b0ece81ae2abe60f53d67973ff4476156fa5c9c41b8b58c4ccd284e95c545e0523996dfd05f9a80b843e07 languageName: node linkType: hard @@ -8793,16 +8782,6 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^4.11.5": - version: 4.11.8 - resolution: "ajv@npm:4.11.8" - dependencies: - co: ^4.6.0 - json-stable-stringify: ^1.0.1 - checksum: 1a4fb38ebccc2ff3ab507d5507b133705d056f9db28cb00a59f0753a5f11e809d959b732edcd52c02fed628638ffb9486ee6bd13bf027400b5c9acf9c33e25f2 - languageName: node - linkType: hard - "ajv@npm:^6.1.0, ajv@npm:^6.10.0, ajv@npm:^6.10.2, ajv@npm:^6.12.2, ajv@npm:^6.12.3, ajv@npm:^6.12.4, ajv@npm:^6.12.5": version: 6.12.6 resolution: "ajv@npm:6.12.6" @@ -9404,7 +9383,7 @@ __metadata: languageName: node linkType: hard -"asn1.js@npm:^5.0.1, asn1.js@npm:^5.2.0": +"asn1.js@npm:^5.2.0": version: 5.4.1 resolution: "asn1.js@npm:5.4.1" dependencies: @@ -9572,7 +9551,7 @@ __metadata: languageName: node linkType: hard -"async@npm:^2.6.2, async@npm:^2.6.3, async@npm:~2.6.1, async@npm:~2.6.3": +"async@npm:^2.6.2, async@npm:^2.6.3, async@npm:~2.6.1": version: 2.6.4 resolution: "async@npm:2.6.4" dependencies: @@ -9666,8 +9645,8 @@ __metadata: linkType: hard "aws-sdk@npm:^2.1121.0": - version: 2.1140.0 - resolution: "aws-sdk@npm:2.1140.0" + version: 2.1149.0 + resolution: "aws-sdk@npm:2.1149.0" dependencies: buffer: 4.9.2 events: 1.1.1 @@ -9676,9 +9655,9 @@ __metadata: querystring: 0.2.0 sax: 1.2.1 url: 0.10.3 - uuid: 3.3.2 + uuid: 8.0.0 xml2js: 0.4.19 - checksum: 5c81ff6486e818b21b56b117bc3aede6b74f2844c9485a25963b0b960e998bf5348a48f0dfc2ed0ad1d9479c8e3ca793a1eb5a30e360944ce3cfec47a5631ee5 + checksum: 2c9efa7acbeab10da6c39d3151a6e2885add7266924f6b50e5aa139e87c80ae50fb22e1bfe9c588e7c1fa0f439fdbe354c74e3ed3ce69582ebaad5a948b5881c languageName: node linkType: hard @@ -10133,13 +10112,6 @@ __metadata: languageName: node linkType: hard -"base64url@npm:^3.0.1": - version: 3.0.1 - resolution: "base64url@npm:3.0.1" - checksum: a77b2a3a526b3343e25be424de3ae0aa937d78f6af7c813ef9020ef98001c0f4e2323afcd7d8b2d2978996bf8c42445c3e9f60c218c622593e5fdfd54a3d6e18 - languageName: node - linkType: hard - "base@npm:^0.11.1": version: 0.11.2 resolution: "base@npm:0.11.2" @@ -10197,13 +10169,6 @@ __metadata: languageName: node linkType: hard -"bech32@npm:^1.1.2": - version: 1.1.4 - resolution: "bech32@npm:1.1.4" - checksum: 0e98db619191548390d6f09ff68b0253ba7ae6a55db93dfdbb070ba234c1fd3308c0606fbcc95fad50437227b10011e2698b89f0181f6e7f845c499bd14d0f4b - languageName: node - linkType: hard - "better-opn@npm:^2.1.1": version: 2.1.1 resolution: "better-opn@npm:2.1.1" @@ -10322,7 +10287,7 @@ __metadata: languageName: node linkType: hard -"bindings@npm:^1.3.0, bindings@npm:^1.5.0": +"bindings@npm:^1.5.0": version: 1.5.0 resolution: "bindings@npm:1.5.0" dependencies: @@ -10338,79 +10303,6 @@ __metadata: languageName: node linkType: hard -"bip174@npm:^2.0.1": - version: 2.0.1 - resolution: "bip174@npm:2.0.1" - checksum: 1611f74dd9b973449c55412e0a6e6cd24bf55110fde581d508fddc60d0f2d54eb6a8e69ddc6eb60810a0e44c755b3577d563bf3e3a2b6513d3dee0569342e463 - languageName: node - linkType: hard - -"bip32@npm:^2.0.4": - version: 2.0.6 - resolution: "bip32@npm:2.0.6" - dependencies: - "@types/node": 10.12.18 - bs58check: ^2.1.1 - create-hash: ^1.2.0 - create-hmac: ^1.1.7 - tiny-secp256k1: ^1.1.3 - typeforce: ^1.11.5 - wif: ^2.0.6 - checksum: 1c654a93836d8ed0bf5aa18a9b7b8dc3fe65e6a607a736d2acdb7927276c03db4bf8068324b9907e362759f9307d8b2b61c2547c282a2bc5198305f5654ed554 - languageName: node - linkType: hard - -"bip39@npm:^3.0.2": - version: 3.0.4 - resolution: "bip39@npm:3.0.4" - dependencies: - "@types/node": 11.11.6 - create-hash: ^1.1.0 - pbkdf2: ^3.0.9 - randombytes: ^2.0.1 - checksum: 79ce1600a03d1ba5053bdd4e6323f9463ec340764c7e52918b6c6b9dca81221940f2d9a65656447f108f9bc2c8d9ae8df319cca83bbd1dad63f53ef2768d9bae - languageName: node - linkType: hard - -"bip66@npm:^1.1.0": - version: 1.1.5 - resolution: "bip66@npm:1.1.5" - dependencies: - safe-buffer: ^5.0.1 - checksum: 956cff6e51d7206571ef8ce875bc5fa61b5c181589790b9155799b7edcae4b20dbb3eed43b188ff3eec27cdbe98e0b7e0ec9f1cb2e4f5370c119028b248ad859 - languageName: node - linkType: hard - -"bitcoin-ops@npm:^1.3.0, bitcoin-ops@npm:^1.4.0": - version: 1.4.1 - resolution: "bitcoin-ops@npm:1.4.1" - checksum: 3daa3303d6af49c0727041b5d7801a20c5806d00f1cc1afa2d53099974e30a7b1e7e9e578723dd25f5e120903f2725c595c0205d5d99a6578ad65213d74d806d - languageName: node - linkType: hard - -"bitcoinjs-lib@npm:^5.1.2": - version: 5.2.0 - resolution: "bitcoinjs-lib@npm:5.2.0" - dependencies: - bech32: ^1.1.2 - bip174: ^2.0.1 - bip32: ^2.0.4 - bip66: ^1.1.0 - bitcoin-ops: ^1.4.0 - bs58check: ^2.0.0 - create-hash: ^1.1.0 - create-hmac: ^1.1.3 - merkle-lib: ^2.0.10 - pushdata-bitcoin: ^1.0.1 - randombytes: ^2.0.1 - tiny-secp256k1: ^1.1.1 - typeforce: ^1.11.3 - varuint-bitcoin: ^1.0.4 - wif: ^2.0.1 - checksum: 947a9a65694b8d469cb643c0ef2793d807a2b948c6e54c96bbd586b48b2de81afeda40e6ae389e031be03c390804d54ed4805b2d90af713842ebe7f85a08a502 - languageName: node - linkType: hard - "bl@npm:^1.0.0": version: 1.2.3 resolution: "bl@npm:1.2.3" @@ -10460,32 +10352,6 @@ __metadata: languageName: node linkType: hard -"blockstack@npm:19.3.0": - version: 19.3.0 - resolution: "blockstack@npm:19.3.0" - dependencies: - "@types/bn.js": ^4.11.5 - "@types/elliptic": ^6.4.9 - ajv: ^4.11.5 - bip39: ^3.0.2 - bitcoinjs-lib: ^5.1.2 - bn.js: ^4.11.8 - cheerio: ^0.22.0 - cross-fetch: ^2.2.2 - elliptic: ^6.4.1 - form-data: ^2.3.3 - jsontokens: ^2.0.2 - query-string: ^6.3.0 - request: ^2.88.0 - ripemd160: ^2.0.2 - schema-inspector: ^1.6.8 - triplesec: ^3.0.26 - uuid: ^3.3.2 - zone-file: ^1.0.0 - checksum: 0cf8ab7fa8d320319e7fd3b2f8fb2ec40e8822af666916dd049739e38e374f7604a741a3403d0b1a5de703ace449337ba12e601b889c662d3ab0badc3f5c5773 - languageName: node - linkType: hard - "bluebird@npm:^3.1.5, bluebird@npm:^3.3.5, bluebird@npm:^3.5.0, bluebird@npm:^3.5.5": version: 3.7.2 resolution: "bluebird@npm:3.7.2" @@ -10493,7 +10359,7 @@ __metadata: languageName: node linkType: hard -"bn.js@npm:^4.0.0, bn.js@npm:^4.1.0, bn.js@npm:^4.11.8, bn.js@npm:^4.11.9": +"bn.js@npm:^4.0.0, bn.js@npm:^4.1.0, bn.js@npm:^4.11.9": version: 4.12.0 resolution: "bn.js@npm:4.12.0" checksum: 39afb4f15f4ea537b55eaf1446c896af28ac948fdcf47171961475724d1bb65118cca49fa6e3d67706e4790955ec0e74de584e45c8f1ef89f46c812bee5b5a12 @@ -10800,7 +10666,7 @@ __metadata: languageName: node linkType: hard -"bs58@npm:^4.0.0, bs58@npm:^4.0.1": +"bs58@npm:^4.0.1": version: 4.0.1 resolution: "bs58@npm:4.0.1" dependencies: @@ -10809,17 +10675,6 @@ __metadata: languageName: node linkType: hard -"bs58check@npm:<3.0.0, bs58check@npm:^2.0.0, bs58check@npm:^2.1.1": - version: 2.1.2 - resolution: "bs58check@npm:2.1.2" - dependencies: - bs58: ^4.0.0 - create-hash: ^1.1.0 - safe-buffer: ^5.1.2 - checksum: 43bdf08a5dd04581b78f040bc4169480e17008da482ffe2a6507327bbc4fc5c28de0501f7faf22901cfe57fbca79cbb202ca529003fedb4cb8dccd265b38e54d - languageName: node - linkType: hard - "bser@npm:2.1.1": version: 2.1.1 resolution: "bser@npm:2.1.1" @@ -11552,9 +11407,9 @@ __metadata: linkType: hard "chart.js@npm:^3.7.1": - version: 3.7.1 - resolution: "chart.js@npm:3.7.1" - checksum: f9d118d3b7dd3c36b6da7a8d71ac9e5d9673b81095cc66c3f61ff91674e20020c6700f8c9c6f93713fa8474eb471ded106114346ccc6afa88b4a7d0eb73dcea4 + version: 3.8.0 + resolution: "chart.js@npm:3.8.0" + checksum: 0360212bf5d534effc8475a1aa705ba7257a315af368b5e8eecf476f0bd57a6bb80ad740e870d552f2d11e134dd1497ccef02950d7e626c21a400ff00ecf59af languageName: node linkType: hard @@ -11591,30 +11446,6 @@ __metadata: languageName: node linkType: hard -"cheerio@npm:^0.22.0": - version: 0.22.0 - resolution: "cheerio@npm:0.22.0" - dependencies: - css-select: ~1.2.0 - dom-serializer: ~0.1.0 - entities: ~1.1.1 - htmlparser2: ^3.9.1 - lodash.assignin: ^4.0.9 - lodash.bind: ^4.1.4 - lodash.defaults: ^4.0.1 - lodash.filter: ^4.4.0 - lodash.flatten: ^4.2.0 - lodash.foreach: ^4.3.0 - lodash.map: ^4.4.0 - lodash.merge: ^4.4.0 - lodash.pick: ^4.2.1 - lodash.reduce: ^4.4.0 - lodash.reject: ^4.4.0 - lodash.some: ^4.4.0 - checksum: b0a6cfa61eb7ae96e4cb8cfeeb14eb45bb790fa40098509268629c4cecca5b99124aabe6daa1154c497ac8def47bc3f9706cef5f0e8a6177a0c137d4bdaaf8b7 - languageName: node - linkType: hard - "cheerio@npm:^1.0.0-rc.3": version: 1.0.0-rc.10 resolution: "cheerio@npm:1.0.0-rc.10" @@ -12530,12 +12361,12 @@ __metadata: linkType: hard "core-js-compat@npm:^3.22.1": - version: 3.22.6 - resolution: "core-js-compat@npm:3.22.6" + version: 3.22.8 + resolution: "core-js-compat@npm:3.22.8" dependencies: browserslist: ^4.20.3 semver: 7.0.0 - checksum: 6b83b87abeb04c08b54bdc6a6756ad6d1503aeadebc598a162bfe1044a31183864bb3016f16c839d40235545c009dc8aea6421ada0d2e18b5fdf93c6059eb380 + checksum: 0c82d9110dcb267c2f5547c61b62f8043793d203523048169176b8badf0b73f3792624342b85d9c923df8eb8971b4aa468b160abb81a023d183c5951e4f05a66 languageName: node linkType: hard @@ -12709,7 +12540,7 @@ __metadata: languageName: node linkType: hard -"create-hmac@npm:^1.1.0, create-hmac@npm:^1.1.3, create-hmac@npm:^1.1.4, create-hmac@npm:^1.1.7": +"create-hmac@npm:^1.1.0, create-hmac@npm:^1.1.4, create-hmac@npm:^1.1.7": version: 1.1.7 resolution: "create-hmac@npm:1.1.7" dependencies: @@ -12767,16 +12598,6 @@ __metadata: languageName: node linkType: hard -"cross-fetch@npm:^2.2.2": - version: 2.2.5 - resolution: "cross-fetch@npm:2.2.5" - dependencies: - node-fetch: 2.6.1 - whatwg-fetch: 2.0.4 - checksum: dc48ded8c8836db74107aee77c6e8eb751151beb8545ce0e044eb5befc4cb687d996cecb62fc12b19be80924fd72bcc851d90e785cfd3d6056cd45f43507a66d - languageName: node - linkType: hard - "cross-spawn@npm:^4.0.0": version: 4.0.2 resolution: "cross-spawn@npm:4.0.2" @@ -12984,18 +12805,6 @@ __metadata: languageName: node linkType: hard -"css-select@npm:~1.2.0": - version: 1.2.0 - resolution: "css-select@npm:1.2.0" - dependencies: - boolbase: ~1.0.0 - css-what: 2.1 - domutils: 1.5.1 - nth-check: ~1.0.1 - checksum: 607cca60d2f5c56701fe5f800bbe668b114395c503d4e4808edbbbe70b8be3c96a6407428dc0227fcbdf335b20468e6a9e7fd689185edfb57d402e1e4837c9b7 - languageName: node - linkType: hard - "css-tree@npm:1.0.0-alpha.37": version: 1.0.0-alpha.37 resolution: "css-tree@npm:1.0.0-alpha.37" @@ -13033,13 +12842,6 @@ __metadata: languageName: node linkType: hard -"css-what@npm:2.1": - version: 2.1.3 - resolution: "css-what@npm:2.1.3" - checksum: a52d56c591a7e1c37506d0d8c4fdef72537fb8eb4cb68711485997a88d76b5a3342b73a7c79176268f95b428596c447ad7fa3488224a6b8b532e2f1f2ee8545c - languageName: node - linkType: hard - "css-what@npm:^3.2.1": version: 3.4.2 resolution: "css-what@npm:3.4.2" @@ -13199,9 +13001,9 @@ __metadata: linkType: hard "csv-parse@npm:^5.0.4": - version: 5.0.4 - resolution: "csv-parse@npm:5.0.4" - checksum: e38b4fb8dec7a64b891d78ab3cf7f59b721e4027e3c773a2b0311dc538a82681f4f01aaa03c209ac47eb37e26c00a1134bf3844ade1685bf53ce85ffb17a63e3 + version: 5.1.0 + resolution: "csv-parse@npm:5.1.0" + checksum: c64dec952823a25508fdbbc40036bbf832dbc9df559abbc7cdc62e94d4733f97e2a3a896e2fb6bb028b997a766da4a1cb15521b8754a0d7db3dfcb6d764d9a23 languageName: node linkType: hard @@ -14254,7 +14056,7 @@ __metadata: languageName: node linkType: hard -"domutils@npm:1.5, domutils@npm:1.5.1": +"domutils@npm:1.5": version: 1.5.1 resolution: "domutils@npm:1.5.1" dependencies: @@ -14484,7 +14286,7 @@ __metadata: languageName: node linkType: hard -"elliptic@npm:^6.4.0, elliptic@npm:^6.4.1, elliptic@npm:^6.5.3, elliptic@npm:^6.5.4": +"elliptic@npm:^6.5.3, elliptic@npm:^6.5.4": version: 6.5.4 resolution: "elliptic@npm:6.5.4" dependencies: @@ -15138,13 +14940,13 @@ __metadata: linkType: hard "eslint-plugin-testing-library@npm:^5.3.1": - version: 5.5.0 - resolution: "eslint-plugin-testing-library@npm:5.5.0" + version: 5.5.1 + resolution: "eslint-plugin-testing-library@npm:5.5.1" dependencies: "@typescript-eslint/utils": ^5.13.0 peerDependencies: eslint: ^7.5.0 || ^8.0.0 - checksum: 7f42e2af84a0b5d1bba86fe9838abdbfa1c4f5dae66db215f592a216f82a2164a23181841228872d7116f38398bbc671e60a1e3b9840f0a8da1972c7aac8bdcd + checksum: 558994da12e6a9ff0c4f71c2e63a23746b6323d171062032843591e0fca6ce3811f979cf82e11db003c8b4f1d9842cb75301bfaa9e88d1a399b11ea6686aadcc languageName: node linkType: hard @@ -15371,8 +15173,8 @@ __metadata: linkType: hard "eslint@npm:^8.14.0": - version: 8.16.0 - resolution: "eslint@npm:8.16.0" + version: 8.17.0 + resolution: "eslint@npm:8.17.0" dependencies: "@eslint/eslintrc": ^1.3.0 "@humanwhocodes/config-array": ^0.9.2 @@ -15411,7 +15213,7 @@ __metadata: v8-compile-cache: ^2.0.3 bin: eslint: bin/eslint.js - checksum: 654a0200b49dc07280673fee13cdfb04326466790e031dfa9660b69fba3b1cf766a51504328f9de56bd18e6b5eb7578985cf29dc7f016c5ec851220ff9db95eb + checksum: b484c96681c6b19f5b437f664623f1cd310d3ee9be88400d8450e086e664cd968a9dc202f0b0678578fd50e7a445b92586efe8c787de5073ff2f83213b00bb7b languageName: node linkType: hard @@ -16623,12 +16425,12 @@ __metadata: linkType: hard "follow-redirects@npm:^1.14.9": - version: 1.15.0 - resolution: "follow-redirects@npm:1.15.0" + version: 1.15.1 + resolution: "follow-redirects@npm:1.15.1" peerDependenciesMeta: debug: optional: true - checksum: eaec81c3e0ae57aae2422e38ad3539d0e7279b3a63f9681eeea319bb683dea67502c4e097136b8ce9721542b4e236e092b6b49e34e326cdd7733c274f0a3f378 + checksum: 6aa4e3e3cdfa3b9314801a1cd192ba756a53479d9d8cca65bf4db3a3e8834e62139245cd2f9566147c8dfe2efff1700d3e6aefd103de4004a7b99985e71dd533 languageName: node linkType: hard @@ -18497,7 +18299,7 @@ __metadata: languageName: node linkType: hard -"htmlparser2@npm:^3.10.0, htmlparser2@npm:^3.9.1": +"htmlparser2@npm:^3.10.0": version: 3.10.1 resolution: "htmlparser2@npm:3.10.1" dependencies: @@ -18794,29 +18596,6 @@ __metadata: languageName: node linkType: hard -"iced-error@npm:>=0.0.9": - version: 0.0.13 - resolution: "iced-error@npm:0.0.13" - checksum: b5829a0c6810dd8963fd5e6d3b5c152affb6c42eb10b4de8e466be757dc1ce8642dbe7a7321b1bb8ce34147b6170b2b1ea426cbd1b3dd9c79ad1bf918ff6b148 - languageName: node - linkType: hard - -"iced-lock@npm:^1.0.1": - version: 1.1.0 - resolution: "iced-lock@npm:1.1.0" - dependencies: - iced-runtime: ^1.0.0 - checksum: f642b53a5a66c6c507220c333cbd68d602679ad0f6a31f28cf2125f383f143585b86fbb69a77066f3b7ea023a23576e0942f4428fec8d80bce048fbf74d6d383 - languageName: node - linkType: hard - -"iced-runtime@npm:>=0.0.1, iced-runtime@npm:^1.0.0, iced-runtime@npm:^1.0.2": - version: 1.0.4 - resolution: "iced-runtime@npm:1.0.4" - checksum: b9497c4c6e23a8e161d26f7fb4bc071d1ddedfcf6edcb55cba5d05bb30375d27054d7ff0bfda53c9e559a15671f4941593e47e36087265c19e483f04cff774cc - languageName: node - linkType: hard - "iconv-lite@npm:0.4.24, iconv-lite@npm:^0.4.24, iconv-lite@npm:^0.4.4": version: 0.4.24 resolution: "iconv-lite@npm:0.4.24" @@ -20995,7 +20774,7 @@ __metadata: languageName: node linkType: hard -"jquery@npm:>=1.12.0, jquery@npm:^3.6.0": +"jquery@npm:^3.6.0": version: 3.6.0 resolution: "jquery@npm:3.6.0" checksum: 8fd5fef4aa48fd374ec716dd1c1df1af407814a228e15c1260ca140de3a697c2a77c30c54ff1d238b6a3ab4ddc445ddeef9adce6c6d28e4869d85eb9d3951c0e @@ -21211,15 +20990,6 @@ __metadata: languageName: node linkType: hard -"json-stable-stringify@npm:^1.0.1": - version: 1.0.1 - resolution: "json-stable-stringify@npm:1.0.1" - dependencies: - jsonify: ~0.0.0 - checksum: 65d6cbf0fca72a4136999f65f4401cf39a129f7aeff0fdd987ac3d3423a2113659294045fb8377e6e20d865cac32b1b8d70f3d87346c9786adcee60661d96ca5 - languageName: node - linkType: hard - "json-stringify-safe@npm:^5.0.1, json-stringify-safe@npm:~5.0.1": version: 5.0.1 resolution: "json-stringify-safe@npm:5.0.1" @@ -21293,13 +21063,6 @@ __metadata: languageName: node linkType: hard -"jsonify@npm:~0.0.0": - version: 0.0.0 - resolution: "jsonify@npm:0.0.0" - checksum: d8d4ed476c116e6987a460dcb82f22284686caae9f498ac87b0502c1765ac1522f4f450a4cad4cc368d202fd3b27a3860735140a82867fc6d558f5f199c38bce - languageName: node - linkType: hard - "jsonpointer@npm:^5.0.0": version: 5.0.0 resolution: "jsonpointer@npm:5.0.0" @@ -21307,20 +21070,6 @@ __metadata: languageName: node linkType: hard -"jsontokens@npm:^2.0.2": - version: 2.0.2 - resolution: "jsontokens@npm:2.0.2" - dependencies: - "@types/elliptic": ^6.4.9 - asn1.js: ^5.0.1 - base64url: ^3.0.1 - ecdsa-sig-formatter: ^1.0.11 - elliptic: ^6.4.1 - key-encoder: ^2.0.2 - checksum: 7339c58a5fb50467e90d6a8759128ec41ebe922e7d900d65cc5ae8741ff7940dfe431f5afc8ebe2175846b4563083319c2144d4fd5d88fac30c2670fb32c9ac3 - languageName: node - linkType: hard - "jsonwebtoken@npm:^8.1.0, jsonwebtoken@npm:^8.5.1": version: 8.5.1 resolution: "jsonwebtoken@npm:8.5.1" @@ -21352,9 +21101,9 @@ __metadata: linkType: hard "jsrsasign@npm:^10.5.19": - version: 10.5.22 - resolution: "jsrsasign@npm:10.5.22" - checksum: c41fe2b4adf88d4fab1e90e3f0a38a0b034afdc100f2bd1828a5d003968e80a866117f7cc249e531998f78130460882728010eeeeb043c50b9dd27bb27a0cbb3 + version: 10.5.24 + resolution: "jsrsasign@npm:10.5.24" + checksum: 745d7945fe72d15ef4310bf77c3537439f53f355febd481d978aa4a2e677206e7eb40df018f756498a3532aeb4232eabb8c9491fe0dd35c8a4de4f5e648313d8 languageName: node linkType: hard @@ -21450,18 +21199,6 @@ __metadata: languageName: node linkType: hard -"key-encoder@npm:^2.0.2": - version: 2.0.3 - resolution: "key-encoder@npm:2.0.3" - dependencies: - "@types/elliptic": ^6.4.9 - asn1.js: ^5.0.1 - bn.js: ^4.11.8 - elliptic: ^6.4.1 - checksum: da0b297965224c814a72d6a0850c9d05a43f85515a6a9047b24379c91eb1a510ee6d373c76b985f99ac189f0ea7ac17d223df00718d7201220c83347b7e58f58 - languageName: node - linkType: hard - "keyv@npm:3.0.0": version: 3.0.0 resolution: "keyv@npm:3.0.0" @@ -21964,20 +21701,6 @@ __metadata: languageName: node linkType: hard -"lodash.assignin@npm:^4.0.9": - version: 4.2.0 - resolution: "lodash.assignin@npm:4.2.0" - checksum: 4b55bc1d65ccd7648fdba8a4316d10546929bf0beb5950830d86c559948cf170f0e65b77c95e66b45b511b85a31161714de8b2008d2537627ef3c7759afe36a6 - languageName: node - linkType: hard - -"lodash.bind@npm:^4.1.4": - version: 4.2.1 - resolution: "lodash.bind@npm:4.2.1" - checksum: cf0e41de2fca7704fc0adadc00f7fc871f8cf428990972f072136e4cd153c4d42d88c1418218121380914021c5547be05e4252e61f6280c736a2195cc8b6f4e5 - languageName: node - linkType: hard - "lodash.clonedeep@npm:^4.5.0": version: 4.5.0 resolution: "lodash.clonedeep@npm:4.5.0" @@ -21992,7 +21715,7 @@ __metadata: languageName: node linkType: hard -"lodash.defaults@npm:^4.0.1, lodash.defaults@npm:^4.2.0": +"lodash.defaults@npm:^4.2.0": version: 4.2.0 resolution: "lodash.defaults@npm:4.2.0" checksum: 84923258235592c8886e29de5491946ff8c2ae5c82a7ac5cddd2e3cb697e6fbdfbbb6efcca015795c86eec2bb953a5a2ee4016e3735a3f02720428a40efbb8f1 @@ -22006,27 +21729,13 @@ __metadata: languageName: node linkType: hard -"lodash.filter@npm:^4.4.0": - version: 4.6.0 - resolution: "lodash.filter@npm:4.6.0" - checksum: f21d245d24818e15b560cb6cadc8404a1bf98bd87d037e5e51858aad57ca2b9db64d87e450a23c8f72dd2c66968efd09b034055ce86d93eef4a4eb6f1bbaf100 - languageName: node - linkType: hard - -"lodash.flatten@npm:^4.2.0, lodash.flatten@npm:^4.4.0": +"lodash.flatten@npm:^4.4.0": version: 4.4.0 resolution: "lodash.flatten@npm:4.4.0" checksum: 0ac34a393d4b795d4b7421153d27c13ae67e08786c9cbb60ff5b732210d46f833598eee3fb3844bb10070e8488efe390ea53bb567377e0cb47e9e630bf0811cb languageName: node linkType: hard -"lodash.foreach@npm:^4.3.0": - version: 4.5.0 - resolution: "lodash.foreach@npm:4.5.0" - checksum: a940386b158ca0d62994db41fc16529eb8ae67138f29ced38e91f912cb5435d1b0ed34b18e6f7b9ddfc32ab676afc6dfec60d1e22633d8e3e4b33413402ab4ad - languageName: node - linkType: hard - "lodash.get@npm:^4.4.2": version: 4.4.2 resolution: "lodash.get@npm:4.4.2" @@ -22083,13 +21792,6 @@ __metadata: languageName: node linkType: hard -"lodash.map@npm:^4.4.0": - version: 4.6.0 - resolution: "lodash.map@npm:4.6.0" - checksum: 7369a41d7d24d15ce3bbd02a7faa3a90f6266c38184e64932571b9b21b758bd10c04ffd117d1859be1a44156f29b94df5045eff172bf8a97fddf68bf1002d12f - languageName: node - linkType: hard - "lodash.memoize@npm:4.x, lodash.memoize@npm:^4.1.2": version: 4.1.2 resolution: "lodash.memoize@npm:4.1.2" @@ -22097,7 +21799,7 @@ __metadata: languageName: node linkType: hard -"lodash.merge@npm:^4.4.0, lodash.merge@npm:^4.6.2": +"lodash.merge@npm:^4.6.2": version: 4.6.2 resolution: "lodash.merge@npm:4.6.2" checksum: ad580b4bdbb7ca1f7abf7e1bce63a9a0b98e370cf40194b03380a46b4ed799c9573029599caebc1b14e3f24b111aef72b96674a56cfa105e0f5ac70546cdc005 @@ -22111,34 +21813,6 @@ __metadata: languageName: node linkType: hard -"lodash.pick@npm:^4.2.1": - version: 4.4.0 - resolution: "lodash.pick@npm:4.4.0" - checksum: 2c36cab7da6b999a20bd3373b40e31a3ef81fa264f34a6979c852c5bc8ac039379686b27380f0cb8e3781610844fafec6949c6fbbebc059c98f8fa8570e3675f - languageName: node - linkType: hard - -"lodash.reduce@npm:^4.4.0": - version: 4.6.0 - resolution: "lodash.reduce@npm:4.6.0" - checksum: 81f2a1045440554f8427f895ef479f1de5c141edd7852dde85a894879312801efae0295116e5cf830c531c1a51cdab8f3628c3ad39fa21a9874bb9158d9ea075 - languageName: node - linkType: hard - -"lodash.reject@npm:^4.4.0": - version: 4.6.0 - resolution: "lodash.reject@npm:4.6.0" - checksum: 730acc78d29ab0a60e0f3cd87bbfe9071625a835791ef66daac7a405c43ec21209fd795fdf9b7485aecead4869f645801bd65c27b9acadce80dee26393793111 - languageName: node - linkType: hard - -"lodash.some@npm:^4.4.0": - version: 4.6.0 - resolution: "lodash.some@npm:4.6.0" - checksum: 4469e76a389446d1166a29f844fb21398c36060d00258ce799710e046c55ed3c1af150c31b4856504e252bc813ba3fdcb6f255c490d9846738dd363a44665322 - languageName: node - linkType: hard - "lodash.throttle@npm:^4.1.1": version: 4.1.1 resolution: "lodash.throttle@npm:4.1.1" @@ -23011,13 +22685,6 @@ __metadata: languageName: node linkType: hard -"merkle-lib@npm:^2.0.10": - version: 2.0.10 - resolution: "merkle-lib@npm:2.0.10" - checksum: 057331fe5e15a12a35c94c40bcc956c6b2d38cf6a3c69858b05a55434a9ac7be552595be5955491d3c380c7a91c522e429c7d13db7b676463b729de05c07b9e1 - languageName: node - linkType: hard - "meteor-blaze-tools@npm:^1.2.0, meteor-blaze-tools@npm:^1.2.4": version: 1.5.0 resolution: "meteor-blaze-tools@npm:1.5.0" @@ -23222,7 +22889,7 @@ __metadata: languageName: node linkType: hard -"mime@npm:^2.2.0, mime@npm:^2.4.4, mime@npm:^2.4.6, mime@npm:^2.5.0": +"mime@npm:2.6.0, mime@npm:^2.2.0, mime@npm:^2.4.4, mime@npm:^2.4.6": version: 2.6.0 resolution: "mime@npm:2.6.0" bin: @@ -23821,15 +23488,6 @@ __metadata: languageName: node linkType: hard -"more-entropy@npm:>=0.0.7": - version: 0.0.7 - resolution: "more-entropy@npm:0.0.7" - dependencies: - iced-runtime: ">=0.0.1" - checksum: c3fc40748199bf95885878cbf49be5d331047d51ecb65f7e636a5c586d519bec004133c9b3c9851ae3da70d59efc2c541970fa6b6d3c3dae31199b4e8193ec17 - languageName: node - linkType: hard - "morgan@npm:^1.10.0": version: 1.10.0 resolution: "morgan@npm:1.10.0" @@ -24017,11 +23675,11 @@ __metadata: linkType: hard "nats@npm:^2.6.1": - version: 2.7.0 - resolution: "nats@npm:2.7.0" + version: 2.7.1 + resolution: "nats@npm:2.7.1" dependencies: nkeys.js: ^1.0.0-9 - checksum: cf9a68cbcbc8566094a3f891eebc10127ab1e71c4615184647355e129d1b3730364267b27c23c5b356f2c0dc3e71c2a33ddc30f6dfb4b9f51b259a7a5711b2c1 + checksum: 6022d8b924d947f51d58e25f7790f3b532c26b1dd1ffddf1139c1ac8ab54c2c41ad5423127809f5bbbce54df63adb808a3a1cf5715a4d75f807fafc63ca294ac languageName: node linkType: hard @@ -24223,13 +23881,6 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:2.6.1": - version: 2.6.1 - resolution: "node-fetch@npm:2.6.1" - checksum: 91075bedd57879117e310fbcc36983ad5d699e522edb1ebcdc4ee5294c982843982652925c3532729fdc86b2d64a8a827797a745f332040d91823c8752ee4d7c - languageName: node - linkType: hard - "node-fetch@npm:2.6.7, node-fetch@npm:^2.3.0, node-fetch@npm:^2.6.0, node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.7": version: 2.6.7 resolution: "node-fetch@npm:2.6.7" @@ -24656,7 +24307,7 @@ __metadata: languageName: node linkType: hard -"nth-check@npm:^1.0.2, nth-check@npm:~1.0.0, nth-check@npm:~1.0.1": +"nth-check@npm:^1.0.2, nth-check@npm:~1.0.0": version: 1.0.2 resolution: "nth-check@npm:1.0.2" dependencies: @@ -25909,7 +25560,7 @@ __metadata: languageName: node linkType: hard -"pbkdf2@npm:^3.0.3, pbkdf2@npm:^3.0.9": +"pbkdf2@npm:^3.0.3": version: 3.1.2 resolution: "pbkdf2@npm:3.1.2" dependencies: @@ -27254,13 +26905,6 @@ __metadata: languageName: node linkType: hard -"progress@npm:~1.1.2": - version: 1.1.8 - resolution: "progress@npm:1.1.8" - checksum: 789c824156e03a7353b190fc63da46bc42b210250cebaa2dca447a6a740f5469f34ed30f768cdef088ca720a8c3c42dd743958e8bc6a35b2d2a1a83171ad2c56 - languageName: node - linkType: hard - "prom-client@npm:^14.0.0, prom-client@npm:^14.0.1": version: 14.0.1 resolution: "prom-client@npm:14.0.1" @@ -27540,15 +27184,6 @@ __metadata: languageName: node linkType: hard -"pushdata-bitcoin@npm:^1.0.1": - version: 1.0.1 - resolution: "pushdata-bitcoin@npm:1.0.1" - dependencies: - bitcoin-ops: ^1.3.0 - checksum: 8452106d4b39ea1b335cd8f319c5e704b19aca72afb8bda4eee3df4602e3ad14cb9746d228712cdf0dcfec68e055dad4fc51cddf14cf072caf698c6ba4b34be2 - languageName: node - linkType: hard - "q@npm:2.0.x": version: 2.0.3 resolution: "q@npm:2.0.3" @@ -27567,7 +27202,7 @@ __metadata: languageName: node linkType: hard -"qs@npm:6.10.3, qs@npm:^6.10.0, qs@npm:^6.10.3, qs@npm:^6.5.1, qs@npm:^6.9.4, qs@npm:^6.9.6": +"qs@npm:6.10.3, qs@npm:^6.10.0, qs@npm:^6.5.1, qs@npm:^6.9.4, qs@npm:^6.9.6": version: 6.10.3 resolution: "qs@npm:6.10.3" dependencies: @@ -27590,6 +27225,15 @@ __metadata: languageName: node linkType: hard +"qs@npm:^6.10.3": + version: 6.10.4 + resolution: "qs@npm:6.10.4" + dependencies: + side-channel: ^1.0.4 + checksum: 31e4fedd759d01eae52dde6692abab175f9af3e639993c5caaa513a2a3607b34d8058d3ae52ceeccf37c3025f22ed5e90e9ddd6c2537e19c0562ddd10dc5b1eb + languageName: node + linkType: hard + "qs@npm:~6.5.2": version: 6.5.3 resolution: "qs@npm:6.5.3" @@ -27618,7 +27262,7 @@ __metadata: languageName: node linkType: hard -"query-string@npm:^6.13.1, query-string@npm:^6.13.8, query-string@npm:^6.3.0": +"query-string@npm:^6.13.1, query-string@npm:^6.13.8": version: 6.14.1 resolution: "query-string@npm:6.14.1" dependencies: @@ -29342,7 +28986,7 @@ __metadata: languageName: node linkType: hard -"ripemd160@npm:^2.0.0, ripemd160@npm:^2.0.1, ripemd160@npm:^2.0.2": +"ripemd160@npm:^2.0.0, ripemd160@npm:^2.0.1": version: 2.0.2 resolution: "ripemd160@npm:2.0.2" dependencies: @@ -29649,15 +29293,6 @@ __metadata: languageName: node linkType: hard -"schema-inspector@npm:^1.6.8": - version: 1.7.0 - resolution: "schema-inspector@npm:1.7.0" - dependencies: - async: ~2.6.3 - checksum: e21eef460ad1666f8de44d843ce122114d09e5a5bdf930b3cf2af970ccc1b1933b79c2af9c1c508a3c5399d1660196ba61d5201493f9c4b559af78905ab78087 - languageName: node - linkType: hard - "schema-utils@npm:2.7.0": version: 2.7.0 resolution: "schema-utils@npm:2.7.0" @@ -31490,8 +31125,8 @@ __metadata: linkType: hard "superagent@npm:^7.1.3": - version: 7.1.3 - resolution: "superagent@npm:7.1.3" + version: 7.1.6 + resolution: "superagent@npm:7.1.6" dependencies: component-emitter: ^1.3.0 cookiejar: ^2.1.3 @@ -31500,11 +31135,11 @@ __metadata: form-data: ^4.0.0 formidable: ^2.0.1 methods: ^1.1.2 - mime: ^2.5.0 + mime: 2.6.0 qs: ^6.10.3 readable-stream: ^3.6.0 semver: ^7.3.7 - checksum: 436045d555d35c282de7bcba85102b1421470bdc80781c9a0b7ab7c639675b4eca026a71301974935f3de0d33782a0392274e24f3915335b81a78a04b48eeee5 + checksum: b73316836003219f1a4886a6d77dd28551a6784c30e871009fb7bad699fae772b20370d39d2ccb5a543c9335ce12b43a76b959a3ca983f1d6365cb4b5682c08f languageName: node linkType: hard @@ -32061,20 +31696,6 @@ __metadata: languageName: node linkType: hard -"tiny-secp256k1@npm:^1.1.1, tiny-secp256k1@npm:^1.1.3": - version: 1.1.6 - resolution: "tiny-secp256k1@npm:1.1.6" - dependencies: - bindings: ^1.3.0 - bn.js: ^4.11.8 - create-hmac: ^1.1.7 - elliptic: ^6.4.0 - nan: ^2.13.2 - node-gyp: latest - checksum: f8f705f8a76dc9ccc9aa46f7bc353c00be63940c0a1198175fd77c9b85bdf24eb6db3d72c4756d24af320900290313c580c07695cda645d98410822f94ee01f5 - languageName: node - linkType: hard - "tinykeys@npm:^1.4.0": version: 1.4.0 resolution: "tinykeys@npm:1.4.0" @@ -32202,15 +31823,6 @@ __metadata: languageName: node linkType: hard -"toastr@npm:^2.1.4": - version: 2.1.4 - resolution: "toastr@npm:2.1.4" - dependencies: - jquery: ">=1.12.0" - checksum: 54e67385cfcdd88cce656c986a4894fd9484824d42549b646ce82b8780621ee1eccc0fb2ec89668dc67de4ae54de8f34a1c8b6f0f217940060d040d3fdb4491f - languageName: node - linkType: hard - "toggle-selection@npm:^1.0.6": version: 1.0.6 resolution: "toggle-selection@npm:1.0.6" @@ -32344,20 +31956,6 @@ __metadata: languageName: node linkType: hard -"triplesec@npm:^3.0.26": - version: 3.0.27 - resolution: "triplesec@npm:3.0.27" - dependencies: - iced-error: ">=0.0.9" - iced-lock: ^1.0.1 - iced-runtime: ^1.0.2 - more-entropy: ">=0.0.7" - progress: ~1.1.2 - uglify-js: ^3.1.9 - checksum: 5995e1f5fdbefa8744c1760a0c93557589a0028744d167b914e5b641456f77f3192ab5961e23887644c4a9c334ce008403fe147d9c844071c0091dcdd92d5908 - languageName: node - linkType: hard - "trough@npm:^1.0.0": version: 1.0.5 resolution: "trough@npm:1.0.5" @@ -32850,13 +32448,6 @@ __metadata: languageName: node linkType: hard -"typeforce@npm:^1.11.3, typeforce@npm:^1.11.5": - version: 1.18.0 - resolution: "typeforce@npm:1.18.0" - checksum: e3b21e27e76cb05f32285bef7c30a29760e79c622cfe4aa3c179ce49d1c7895b7154c8deedb9fe4599b1fd0428d35860d43e0776da1c04861168f3ad7ed99c70 - languageName: node - linkType: hard - "typescript@npm:^4.6.3": version: 4.6.3 resolution: "typescript@npm:4.6.3" @@ -32918,7 +32509,7 @@ __metadata: languageName: node linkType: hard -"uglify-js@npm:^3.1.4, uglify-js@npm:^3.1.9": +"uglify-js@npm:^3.1.4": version: 3.15.3 resolution: "uglify-js@npm:3.15.3" bin: @@ -32979,9 +32570,9 @@ __metadata: linkType: hard "underscore@npm:^1.13.3": - version: 1.13.3 - resolution: "underscore@npm:1.13.3" - checksum: 1ea0b333ee20fdb3dcf20883d505817bf9de3dc67f0a674c1c49428cec5e480178ce5f6b7c9f72c3a8fe05a1e344dcec5c918a7f89aa1661632aa378612a2264 + version: 1.13.4 + resolution: "underscore@npm:1.13.4" + checksum: 6b04f66cd454e8793a552dc49c71e24e5208a29b9d9c0af988a96948af79103399c36fb15db43f3629bfed152f8b1fe94f44e1249e9d196069c0fc7edfadb636 languageName: node linkType: hard @@ -33634,6 +33225,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:8.0.0": + version: 8.0.0 + resolution: "uuid@npm:8.0.0" + bin: + uuid: dist/bin/uuid + checksum: 56d4e23aa7ac26fa2db6bd1778db34cb8c9f5a10df1770a27167874bf6705fc8f14a4ac414af58a0d96c7653b2bd4848510b29d1c2ef8c91ccb17429c1872b5e + languageName: node + linkType: hard + "uuid@npm:^3.0.1, uuid@npm:^3.1.0, uuid@npm:^3.2.1, uuid@npm:^3.3.2": version: 3.4.0 resolution: "uuid@npm:3.4.0" @@ -33703,15 +33303,6 @@ __metadata: languageName: node linkType: hard -"varuint-bitcoin@npm:^1.0.4": - version: 1.1.2 - resolution: "varuint-bitcoin@npm:1.1.2" - dependencies: - safe-buffer: ^5.1.1 - checksum: 1c900bf08f2408ae33a6094dc5d809bdb6673eaf6039062d88c230155873e51e29c760053611f93ccd024854d04ebd92ed95c744720e94a79ca4e1150fcce071 - languageName: node - linkType: hard - "vary@npm:^1, vary@npm:~1.1.2": version: 1.1.2 resolution: "vary@npm:1.1.2" @@ -34205,13 +33796,6 @@ __metadata: languageName: node linkType: hard -"whatwg-fetch@npm:2.0.4": - version: 2.0.4 - resolution: "whatwg-fetch@npm:2.0.4" - checksum: de7c65a68d7d62e2f144a6b30293370b3ad82b65ebcd68f2ac8e8bbe7ede90febd98ba9486b78c1cbc950e0e8838fa5c2727f939899ab3fc7b71a04be52d33a5 - languageName: node - linkType: hard - "whatwg-fetch@npm:>=0.10.0, whatwg-fetch@npm:^3.4.0": version: 3.6.2 resolution: "whatwg-fetch@npm:3.6.2" @@ -34347,15 +33931,6 @@ __metadata: languageName: node linkType: hard -"wif@npm:^2.0.1, wif@npm:^2.0.6": - version: 2.0.6 - resolution: "wif@npm:2.0.6" - dependencies: - bs58check: <3.0.0 - checksum: 8c3147ef98d56f394d66f0477f699fba7fc18dd0d1c2c5d0f8408be41acffed589fa82447d80eae5afc9a3cbd943bc3eebb337b9f114955adeaad02a244f4f9a - languageName: node - linkType: hard - "winston-daily-rotate-file@npm:^4.5.1": version: 4.6.1 resolution: "winston-daily-rotate-file@npm:4.6.1" @@ -35006,13 +34581,6 @@ __metadata: languageName: node linkType: hard -"zone-file@npm:^1.0.0": - version: 1.0.0 - resolution: "zone-file@npm:1.0.0" - checksum: f7b56525f3e9a01bc896e9c39bbda089d2ba4b89ce6ea5f26548e75e2c53f1dc2ff1fc28bde9ce00dc0284411eb5097f60e4dc795047952687a1f66ec17bb6d5 - languageName: node - linkType: hard - "zwitch@npm:^1.0.0": version: 1.0.5 resolution: "zwitch@npm:1.0.5"