From c5f23abd01ea6e4954552fcacec04ee5b62d1e69 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 3 Jan 2025 17:08:09 -0300 Subject: [PATCH] chore: bump meteor and node version (#34048) Co-authored-by: Diego Sampaio Co-authored-by: Marcos Spessatto Defendi --- .github/workflows/ci-code-check.yml | 21 + .github/workflows/ci-deploy-gh-pages.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/new-release.yml | 2 +- .github/workflows/pr-update-description.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/release-candidate.yml | 2 +- .../workflows/update-version-durability.yml | 2 +- .../mongodb-npm-4.17.2-40d1286d70.patch | 13 - ...ch => mongodb-npm-6.10.0-b914157c35.patch} | 8 +- apps/meteor/.docker-mongo/Dockerfile | 2 +- apps/meteor/.docker/Dockerfile.alpine | 2 +- apps/meteor/.docker/Dockerfile.debian | 2 +- apps/meteor/.meteor/packages | 16 +- apps/meteor/.meteor/release | 2 +- apps/meteor/.meteor/versions | 32 +- apps/meteor/app/api/server/lib/emailInbox.ts | 6 +- .../app/apps/server/bridges/scheduler.ts | 4 +- .../app/apps/server/bridges/settings.ts | 2 +- apps/meteor/app/assets/server/assets.ts | 3 +- .../hooks/propagateDiscussionMetadata.ts | 2 +- .../provideUsersSuggestedGroupKeys.ts | 7 +- .../app/e2e/server/functions/resetRoomKey.ts | 8 +- .../app/e2e/server/methods/updateGroupKey.ts | 2 +- .../server/lib/RocketChat.ErrorHandler.ts | 2 +- apps/meteor/app/file-upload/server/index.ts | 1 - .../app/file-upload/server/lib/proxy.ts | 113 -- .../app/file-upload/server/lib/requests.ts | 6 +- apps/meteor/app/file/server/file.server.ts | 15 +- .../app/importer-csv/server/CsvImporter.ts | 2 +- .../server/SlackUsersImporter.ts | 2 +- .../importer-slack/server/SlackImporter.ts | 2 +- .../app/importer/server/classes/Importer.ts | 2 +- .../incoming/updateIncomingIntegration.ts | 6 +- .../outgoing/updateOutgoingIntegration.ts | 6 +- .../server/functions/sendInvitationEmail.ts | 2 +- .../app/lib/server/functions/deleteMessage.ts | 2 +- .../app/lib/server/lib/notifyListener.ts | 3 +- .../app/livechat/server/api/v1/videoCall.ts | 2 +- apps/meteor/app/livechat/server/lib/Helper.ts | 10 +- .../app/livechat/server/lib/Visitors.ts | 4 +- .../server/lib/contacts/updateContact.ts | 2 +- apps/meteor/app/mailer/server/api.ts | 2 +- .../server/functions/updateStatsCounter.ts | 2 +- .../externals/meteor/rocketchat-streamer.d.ts | 24 + .../server/api/lib/priorities.ts | 9 +- .../server/lib/Department.ts | 5 +- .../livechat-enterprise/server/lib/units.ts | 2 +- .../apps/storage/AppGridFSSourceStorage.ts | 45 +- .../ee/server/models/raw/LivechatInquiry.ts | 18 +- .../meteor/ee/server/patches/mergeContacts.ts | 2 +- apps/meteor/ee/server/services/Dockerfile | 4 +- apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 12 +- .../rocketchat-livechat/plugin/build.sh | 2 +- apps/meteor/server/email/IMAPInterceptor.ts | 2 +- apps/meteor/server/lib/migrations.ts | 2 +- .../modules/watchers/watchers.module.ts | 4 +- .../avatar/middlewares/browserVersion.ts | 8 +- .../infrastructure/rocket-chat/well-known.ts | 6 +- apps/meteor/server/services/nps/service.ts | 2 +- apps/meteor/server/startup/watchDb.ts | 4 +- apps/meteor/server/ufs/ufs-gridfs.ts | 6 +- .../tests/e2e/fixtures/inject-initial-data.ts | 2 +- apps/meteor/tests/end-to-end/api/users.ts | 2 +- .../app/lib/server/lib/notifyListener.spec.ts | 14 +- apps/meteor/tsconfig.typecheck.json | 13 - ee/apps/account-service/Dockerfile | 2 +- ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/Dockerfile | 2 +- ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/Dockerfile | 2 +- ee/apps/ddp-streamer/package.json | 4 +- ee/apps/omnichannel-transcript/Dockerfile | 2 +- ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/Dockerfile | 2 +- ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/Dockerfile | 2 +- ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/Dockerfile | 2 +- ee/apps/stream-hub-service/package.json | 2 +- ee/apps/stream-hub-service/src/StreamHub.ts | 2 +- ee/apps/stream-hub-service/src/service.ts | 3 +- ee/packages/omnichannel-services/package.json | 2 +- ee/packages/presence/package.json | 2 +- package.json | 6 +- packages/agenda/package.json | 2 +- packages/agenda/src/Agenda.ts | 32 +- packages/core-services/package.json | 2 +- packages/core-services/src/index.ts | 6 - packages/core-typings/package.json | 2 +- packages/cron/package.json | 2 +- packages/instance-status/package.json | 2 +- packages/instance-status/src/index.ts | 2 +- packages/model-typings/package.json | 2 +- .../model-typings/src/models/IBaseModel.ts | 5 +- .../src/models/IEmailInboxModel.ts | 6 +- .../src/models/IInstanceStatusModel.ts | 4 +- .../src/models/ILivechatAgentActivityModel.ts | 4 +- .../src/models/ILivechatPriorityModel.ts | 4 +- .../src/models/ILivechatVisitorsModel.ts | 4 +- .../src/models/IMessagesModel.ts | 6 +- .../model-typings/src/models/IRoomsModel.ts | 4 +- .../src/models/ISettingsModel.ts | 4 +- .../src/models/ISubscriptionsModel.ts | 8 +- .../model-typings/src/models/IUsersModel.ts | 4 +- .../models/src}/DatabaseWatcher.ts | 8 +- .../models/src}/convertChangeStreamPayload.ts | 0 .../models/src}/convertOplogPayload.ts | 0 packages/models/src/dummy/BaseDummy.ts | 15 +- packages/models/src/index.ts | 7 + packages/models/src/models/BaseRaw.ts | 9 +- packages/models/src/models/EmailInbox.ts | 13 +- packages/models/src/models/InstanceStatus.ts | 4 +- .../models/src/models/IntegrationHistory.ts | 3 +- .../src/models/LivechatAgentActivity.ts | 6 +- .../models/src/models/LivechatContacts.ts | 4 +- .../src/models/LivechatDepartmentAgents.ts | 8 +- packages/models/src/models/LivechatInquiry.ts | 31 +- .../models/src/models/LivechatPriority.ts | 4 +- packages/models/src/models/LivechatRooms.ts | 3 +- .../models/src/models/LivechatVisitors.ts | 8 +- packages/models/src/models/Messages.ts | 6 +- .../models/src/models/NotificationQueue.ts | 2 +- packages/models/src/models/Nps.ts | 2 +- packages/models/src/models/Roles.ts | 5 +- packages/models/src/models/Rooms.ts | 4 +- packages/models/src/models/Settings.ts | 4 +- packages/models/src/models/Subscriptions.ts | 18 +- packages/models/src/models/Users.js | 12 +- packages/models/src/models/VideoConference.ts | 2 +- .../models/src}/watchCollections.ts | 4 +- packages/rest-typings/package.json | 2 +- packages/ui-contexts/package.json | 2 +- turbo.json | 6 - yarn.lock | 1087 ++--------------- 136 files changed, 480 insertions(+), 1471 deletions(-) delete mode 100644 .yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch rename .yarn/patches/{mongodb-npm-4.17.1-a2fe811ff1.patch => mongodb-npm-6.10.0-b914157c35.patch} (68%) delete mode 100644 apps/meteor/app/file-upload/server/lib/proxy.ts delete mode 100644 apps/meteor/tsconfig.typecheck.json rename {apps/meteor/server/database => packages/models/src}/DatabaseWatcher.ts (96%) rename {apps/meteor/server/database => packages/models/src}/convertChangeStreamPayload.ts (100%) rename {apps/meteor/server/database => packages/models/src}/convertOplogPayload.ts (100%) rename {apps/meteor/server/database => packages/models/src}/watchCollections.ts (95%) diff --git a/.github/workflows/ci-code-check.yml b/.github/workflows/ci-code-check.yml index ccdd37cf6ac4..3d4940e5cb0d 100644 --- a/.github/workflows/ci-code-check.yml +++ b/.github/workflows/ci-code-check.yml @@ -65,6 +65,27 @@ jobs: typecheck-cache-${{ runner.OS }} typecheck-cache + - name: Install Meteor + if: matrix.check == 'ts' + shell: bash + run: | + # Restore bin from cache + set +e + METEOR_SYMLINK_TARGET=$(readlink ~/.meteor/meteor) + METEOR_TOOL_DIRECTORY=$(dirname "$METEOR_SYMLINK_TARGET") + set -e + LAUNCHER=$HOME/.meteor/$METEOR_TOOL_DIRECTORY/scripts/admin/launch-meteor + if [ -e $LAUNCHER ] + then + echo "Cached Meteor bin found, restoring it" + sudo cp "$LAUNCHER" "/usr/local/bin/meteor" + else + echo "No cached Meteor bin found." + fi + + # only install meteor if bin isn't found + command -v meteor >/dev/null 2>&1 || curl https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh + - name: TS TypeCheck if: matrix.check == 'ts' run: yarn turbo run typecheck diff --git a/.github/workflows/ci-deploy-gh-pages.yml b/.github/workflows/ci-deploy-gh-pages.yml index abfe62d51389..6a343dd8476b 100644 --- a/.github/workflows/ci-deploy-gh-pages.yml +++ b/.github/workflows/ci-deploy-gh-pages.yml @@ -17,7 +17,7 @@ jobs: - name: Setup NodeJS uses: ./.github/actions/setup-node with: - node-version: 20.18.0 + node-version: 22.11.0 deno-version: 1.37.1 cache-modules: true install: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c304cf836e17..b99c954aaa5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -199,7 +199,7 @@ jobs: uses: ./.github/actions/setup-node if: github.event.action != 'closed' with: - node-version: 20.18.0 + node-version: 22.11.0 deno-version: 1.37.1 cache-modules: true install: true diff --git a/.github/workflows/new-release.yml b/.github/workflows/new-release.yml index b3ead30e8966..73774c18cee2 100644 --- a/.github/workflows/new-release.yml +++ b/.github/workflows/new-release.yml @@ -34,7 +34,7 @@ jobs: - name: Setup NodeJS uses: ./.github/actions/setup-node with: - node-version: 20.18.0 + node-version: 22.11.0 deno-version: 1.37.1 cache-modules: true install: true diff --git a/.github/workflows/pr-update-description.yml b/.github/workflows/pr-update-description.yml index 7a0d8650a97f..0163404fb5e0 100644 --- a/.github/workflows/pr-update-description.yml +++ b/.github/workflows/pr-update-description.yml @@ -21,7 +21,7 @@ jobs: - name: Setup NodeJS uses: ./.github/actions/setup-node with: - node-version: 20.18.0 + node-version: 22.11.0 deno-version: 1.37.1 cache-modules: true install: true diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 2f803576ef51..e45b88d5bca9 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -24,7 +24,7 @@ jobs: - name: Setup NodeJS uses: ./.github/actions/setup-node with: - node-version: 20.18.0 + node-version: 22.11.0 deno-version: 1.37.1 cache-modules: true install: true diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml index 506f4cc1e5dd..640574d3eca3 100644 --- a/.github/workflows/release-candidate.yml +++ b/.github/workflows/release-candidate.yml @@ -15,7 +15,7 @@ jobs: - name: Setup NodeJS uses: ./.github/actions/setup-node with: - node-version: 20.18.0 + node-version: 22.11.0 deno-version: 1.37.1 cache-modules: true install: true diff --git a/.github/workflows/update-version-durability.yml b/.github/workflows/update-version-durability.yml index 45fd4859502b..1972e8181c71 100644 --- a/.github/workflows/update-version-durability.yml +++ b/.github/workflows/update-version-durability.yml @@ -19,7 +19,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v4.1.0 with: - node-version: '20.18.0' + node-version: '22.11.0' - name: Install dependencies run: | diff --git a/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch b/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch deleted file mode 100644 index b34fbe1aa665..000000000000 --- a/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/mongodb.d.ts b/mongodb.d.ts -index 9696a0d0104095e8e4dfa4a4fe05fe81fd8b50c7..f5aa6e76fe6f2e6a55e6e2a720be15b7a6f98107 100644 ---- a/mongodb.d.ts -+++ b/mongodb.d.ts -@@ -5535,7 +5535,7 @@ export declare interface MonitorOptions extends Omit = Depth['length'] extends 8 ? [] : Type extends string | number | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | { -+export declare type NestedPaths = Depth['length'] extends 3 ? [] : Type extends string | number | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | { - _bsontype: string; - } ? [] : Type extends ReadonlyArray ? [] | [number, ...NestedPaths] : Type extends Map ? [string] : Type extends object ? { - [Key in Extract]: Type[Key] extends Type ? [Key] : Type extends Type[Key] ? [Key] : Type[Key] extends ReadonlyArray ? Type extends ArrayType ? [Key] : ArrayType extends Type ? [Key] : [ diff --git a/.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch b/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch similarity index 68% rename from .yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch rename to .yarn/patches/mongodb-npm-6.10.0-b914157c35.patch index 501881370244..61cde9288c60 100644 --- a/.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch +++ b/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch @@ -1,13 +1,13 @@ diff --git a/mongodb.d.ts b/mongodb.d.ts -index dd080b553309594c28093365ea101adec5c0a20c..20a616de8c97ec68629c01a848ea8df4fe122bf2 100644 +index 8d68644d312c22d8c8c992ef0bc78431bffa2cf4..3f0a5664cd04bb2abb155288e3c245be72e8549f 100644 --- a/mongodb.d.ts +++ b/mongodb.d.ts -@@ -5539,7 +5539,7 @@ export declare interface MonitorOptions extends Omit = Depth['length'] extends 8 ? [] : Type extends string | number | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | { -+export declare type NestedPaths = Depth['length'] extends 1 ? [] : Type extends string | number | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | { +-export declare type NestedPaths = Depth['length'] extends 8 ? [] : Type extends string | number | bigint | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | { ++export declare type NestedPaths = Depth['length'] extends 4 ? [] : Type extends string | number | bigint | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | { _bsontype: string; } ? [] : Type extends ReadonlyArray ? [] | [number, ...NestedPaths] : Type extends Map ? [string] : Type extends object ? { [Key in Extract]: Type[Key] extends Type ? [Key] : Type extends Type[Key] ? [Key] : Type[Key] extends ReadonlyArray ? Type extends ArrayType ? [Key] : ArrayType extends Type ? [Key] : [ diff --git a/apps/meteor/.docker-mongo/Dockerfile b/apps/meteor/.docker-mongo/Dockerfile index 560fde4a69dc..faa3c6138ca9 100644 --- a/apps/meteor/.docker-mongo/Dockerfile +++ b/apps/meteor/.docker-mongo/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.18.0-bullseye-slim +FROM node:22.11.0-bullseye-slim LABEL maintainer="buildmaster@rocket.chat" diff --git a/apps/meteor/.docker/Dockerfile.alpine b/apps/meteor/.docker/Dockerfile.alpine index 0f1e170f9570..b76acb7028c5 100644 --- a/apps/meteor/.docker/Dockerfile.alpine +++ b/apps/meteor/.docker/Dockerfile.alpine @@ -1,4 +1,4 @@ -FROM node:20.18.0-alpine3.20 +FROM node:22.11.0-alpine3.20 LABEL maintainer="buildmaster@rocket.chat" diff --git a/apps/meteor/.docker/Dockerfile.debian b/apps/meteor/.docker/Dockerfile.debian index 22134532ece0..7b1094b46508 100644 --- a/apps/meteor/.docker/Dockerfile.debian +++ b/apps/meteor/.docker/Dockerfile.debian @@ -2,7 +2,7 @@ ARG DENO_VERSION="1.37.1" FROM denoland/deno:bin-${DENO_VERSION} as deno -FROM node:20.18.0-bullseye-slim +FROM node:22.11.0-bullseye-slim LABEL maintainer="buildmaster@rocket.chat" diff --git a/apps/meteor/.meteor/packages b/apps/meteor/.meteor/packages index ead1cc41fd09..1580bfe8365d 100644 --- a/apps/meteor/.meteor/packages +++ b/apps/meteor/.meteor/packages @@ -20,7 +20,7 @@ accounts-github@1.5.1 accounts-google@1.4.1 accounts-meteor-developer@1.5.1 accounts-oauth@1.4.5 -accounts-password@3.0.2 +accounts-password@3.0.3 accounts-twitter@1.5.2 google-oauth@1.4.5 @@ -30,18 +30,18 @@ oauth2@1.3.3 check@1.4.4 ddp-rate-limiter@1.2.2 rate-limit@1.1.2 -email@3.1.0 +email@3.1.1 meteor-base@1.5.2 ddp-common@1.4.4 -webapp@2.0.3 +webapp@2.0.4 -mongo@2.0.2 +mongo@2.0.3 reload@1.3.2 service-configuration@1.3.5 session@1.2.2 -shell-server@0.6.0 +shell-server@0.6.1 dispatch:run-as-user ostrio:cookies @@ -59,11 +59,11 @@ tracker@1.3.4 reactive-dict@1.3.2 reactive-var@1.0.13 -babel-compiler@7.11.1 +babel-compiler@7.11.2 standard-minifier-css@1.9.3 dynamic-import@0.7.4 -ecmascript@0.16.9 -typescript@5.4.3 +ecmascript@0.16.10 +typescript@5.6.3 autoupdate@2.0.0 diff --git a/apps/meteor/.meteor/release b/apps/meteor/.meteor/release index b1e86a359f7c..8d20e1a2d3a8 100644 --- a/apps/meteor/.meteor/release +++ b/apps/meteor/.meteor/release @@ -1 +1 @@ -METEOR@3.0.4 +METEOR@3.1 diff --git a/apps/meteor/.meteor/versions b/apps/meteor/.meteor/versions index 0f8f733b3148..5a84dc401a9b 100644 --- a/apps/meteor/.meteor/versions +++ b/apps/meteor/.meteor/versions @@ -4,11 +4,11 @@ accounts-github@1.5.1 accounts-google@1.4.1 accounts-meteor-developer@1.5.1 accounts-oauth@1.4.5 -accounts-password@3.0.2 +accounts-password@3.0.3 accounts-twitter@1.5.2 allow-deny@2.0.0 autoupdate@2.0.0 -babel-compiler@7.11.1 +babel-compiler@7.11.2 babel-runtime@1.5.2 base64@1.0.13 binary-heap@1.0.12 @@ -17,19 +17,19 @@ callback-hook@1.6.0 check@1.4.4 core-runtime@1.0.0 ddp@1.4.2 -ddp-client@3.0.2 +ddp-client@3.0.3 ddp-common@1.4.4 ddp-rate-limiter@1.2.2 -ddp-server@3.0.2 +ddp-server@3.0.3 diff-sequence@1.1.3 dispatch:run-as-user@1.1.1 dynamic-import@0.7.4 -ecmascript@0.16.9 +ecmascript@0.16.10 ecmascript-runtime@0.8.3 ecmascript-runtime-client@0.12.2 ecmascript-runtime-server@0.11.1 ejson@1.1.4 -email@3.1.0 +email@3.1.1 es5-shim@4.8.1 facebook-oauth@1.11.4 facts-base@1.0.2 @@ -44,20 +44,20 @@ inter-process-messaging@0.1.2 kadira:flow-router@2.12.1 localstorage@1.2.1 logging@1.3.5 -meteor@2.0.1 +meteor@2.0.2 meteor-base@1.5.2 meteor-developer-oauth@1.3.3 meteorhacks:inject-initial@1.0.5 minifier-css@2.0.0 -minimongo@2.0.1 +minimongo@2.0.2 modern-browsers@0.1.11 -modules@0.20.2 +modules@0.20.3 modules-runtime@0.13.2 -mongo@2.0.2 -mongo-decimal@0.1.4-beta300.7 +mongo@2.0.3 +mongo-decimal@0.2.0 mongo-dev-server@1.1.1 mongo-id@1.0.9 -npm-mongo@4.17.4 +npm-mongo@6.10.0 oauth@3.0.0 oauth1@1.5.2 oauth2@1.3.3 @@ -82,15 +82,15 @@ routepolicy@1.1.2 service-configuration@1.3.5 session@1.2.2 sha@1.0.10 -shell-server@0.6.0 +shell-server@0.6.1 socket-stream-client@0.5.3 standard-minifier-css@1.9.3 tracker@1.3.4 twitter-oauth@1.3.4 -typescript@5.4.3 +typescript@5.6.3 underscore@1.6.4 -url@1.3.4 -webapp@2.0.3 +url@1.3.5 +webapp@2.0.4 webapp-hashing@1.1.2 zodern:caching-minifier@0.5.0 zodern:standard-minifier-js@5.2.0 diff --git a/apps/meteor/app/api/server/lib/emailInbox.ts b/apps/meteor/app/api/server/lib/emailInbox.ts index 304d297261af..b3012fe1a6cb 100644 --- a/apps/meteor/app/api/server/lib/emailInbox.ts +++ b/apps/meteor/app/api/server/lib/emailInbox.ts @@ -78,19 +78,19 @@ export const updateEmailInbox = async ( const updatedResponse = await EmailInbox.updateById(_id, updateEmailInbox); - if (!updatedResponse.value) { + if (!updatedResponse) { throw new Error('error-invalid-email-inbox'); } void notifyOnEmailInboxChanged( { - ...updatedResponse.value, + ...updatedResponse, ...(department === 'All' && { department: undefined }), }, 'updated', ); - return updatedResponse.value; + return updatedResponse; }; export const removeEmailInbox = async (emailInboxId: IEmailInbox['_id']): Promise => { diff --git a/apps/meteor/app/apps/server/bridges/scheduler.ts b/apps/meteor/app/apps/server/bridges/scheduler.ts index 2f4799c79d70..6fdd3d69f953 100644 --- a/apps/meteor/app/apps/server/bridges/scheduler.ts +++ b/apps/meteor/app/apps/server/bridges/scheduler.ts @@ -4,7 +4,7 @@ import type { IAppServerOrchestrator } from '@rocket.chat/apps'; import type { IProcessor, IOnetimeSchedule, IRecurringSchedule, IJobContext } from '@rocket.chat/apps-engine/definition/scheduler'; import { StartupType } from '@rocket.chat/apps-engine/definition/scheduler'; import { SchedulerBridge } from '@rocket.chat/apps-engine/server/bridges/SchedulerBridge'; -import { ObjectID } from 'bson'; +import { ObjectId } from 'bson'; import { MongoInternals } from 'meteor/mongo'; function _callProcessor(processor: IProcessor['processor']): (job: Job) => Promise { @@ -159,7 +159,7 @@ export class AppSchedulerBridge extends SchedulerBridge { let cancelQuery; try { - cancelQuery = { _id: new ObjectID(jobId.split('_')[0]) }; + cancelQuery = { _id: new ObjectId(jobId.split('_')[0]) }; } catch (jobDocIdError) { // it is not a valid objectid, so it won't try to cancel by document id cancelQuery = { name: jobId }; diff --git a/apps/meteor/app/apps/server/bridges/settings.ts b/apps/meteor/app/apps/server/bridges/settings.ts index cada833aadbd..b3e6aaff32a4 100644 --- a/apps/meteor/app/apps/server/bridges/settings.ts +++ b/apps/meteor/app/apps/server/bridges/settings.ts @@ -75,7 +75,7 @@ export class AppSettingBridge extends ServerSettingBridge { throw new Error(`The setting "${id}" is not readable.`); } - const { value: setting } = await Settings.incrementValueById(id, value, { returnDocument: 'after' }); + const setting = await Settings.incrementValueById(id, value, { returnDocument: 'after' }); if (setting) { void notifyOnSettingChanged(setting); } diff --git a/apps/meteor/app/assets/server/assets.ts b/apps/meteor/app/assets/server/assets.ts index e9160b0ece61..c6df82fcc793 100644 --- a/apps/meteor/app/assets/server/assets.ts +++ b/apps/meteor/app/assets/server/assets.ts @@ -434,7 +434,8 @@ const listener = (req: IncomingMessage, res: ServerResponse, next: NextHandleFun if (asset && Array.isArray(asset.constraints.extensions) && !asset.constraints.extensions.includes(format)) { res.writeHead(403); - return res.end(); + res.end(); + return; } if (!file) { const defaultUrl = asset?.defaultUrl; diff --git a/apps/meteor/app/discussion/server/hooks/propagateDiscussionMetadata.ts b/apps/meteor/app/discussion/server/hooks/propagateDiscussionMetadata.ts index 1ff9ed1dc1ba..f2f02ce8a2c2 100644 --- a/apps/meteor/app/discussion/server/hooks/propagateDiscussionMetadata.ts +++ b/apps/meteor/app/discussion/server/hooks/propagateDiscussionMetadata.ts @@ -6,7 +6,7 @@ import { deleteRoom } from '../../../lib/server/functions/deleteRoom'; import { notifyOnMessageChange } from '../../../lib/server/lib/notifyListener'; const updateAndNotifyParentRoomWithParentMessage = async (room: IRoom): Promise => { - const { value: parentMessage } = await Messages.refreshDiscussionMetadata(room); + const parentMessage = await Messages.refreshDiscussionMetadata(room); if (!parentMessage) { return; } diff --git a/apps/meteor/app/e2e/server/functions/provideUsersSuggestedGroupKeys.ts b/apps/meteor/app/e2e/server/functions/provideUsersSuggestedGroupKeys.ts index c5b54e368823..44563daa2cc3 100644 --- a/apps/meteor/app/e2e/server/functions/provideUsersSuggestedGroupKeys.ts +++ b/apps/meteor/app/e2e/server/functions/provideUsersSuggestedGroupKeys.ts @@ -22,12 +22,7 @@ export const provideUsersSuggestedGroupKeys = async ( const usersWithSuggestedKeys = []; for await (const user of usersSuggestedGroupKeys[roomId]) { - const { value } = await Subscriptions.setGroupE2ESuggestedKeyAndOldRoomKeys( - user._id, - roomId, - user.key, - parseOldKeysDates(user.oldKeys), - ); + const value = await Subscriptions.setGroupE2ESuggestedKeyAndOldRoomKeys(user._id, roomId, user.key, parseOldKeysDates(user.oldKeys)); if (!value) { continue; } diff --git a/apps/meteor/app/e2e/server/functions/resetRoomKey.ts b/apps/meteor/app/e2e/server/functions/resetRoomKey.ts index 89a0058e48ae..ba9704c5c1a5 100644 --- a/apps/meteor/app/e2e/server/functions/resetRoomKey.ts +++ b/apps/meteor/app/e2e/server/functions/resetRoomKey.ts @@ -80,11 +80,11 @@ export async function resetRoomKey(roomId: string, userId: string, newRoomKey: s // And set the new key to the user that called the func const result = await Subscriptions.setE2EKeyByUserIdAndRoomId(userId, roomId, newRoomKey); - if (result.value) { - void notifyOnSubscriptionChanged(result.value); + if (result) { + void notifyOnSubscriptionChanged(result); } - if (roomResult.value) { - void notifyOnRoomChanged(roomResult.value); + if (roomResult) { + void notifyOnRoomChanged(roomResult); } } diff --git a/apps/meteor/app/e2e/server/methods/updateGroupKey.ts b/apps/meteor/app/e2e/server/methods/updateGroupKey.ts index 5f7860107bd9..f59a3d836d3b 100644 --- a/apps/meteor/app/e2e/server/methods/updateGroupKey.ts +++ b/apps/meteor/app/e2e/server/methods/updateGroupKey.ts @@ -40,7 +40,7 @@ export async function updateGroupKey(rid: string, uid: string, key: string, call } // uid also has subscription to this room - const { value } = await Subscriptions.setGroupE2ESuggestedKey(uid, rid, key); + const value = await Subscriptions.setGroupE2ESuggestedKey(uid, rid, key); if (value) { void notifyOnSubscriptionChanged(value); } diff --git a/apps/meteor/app/error-handler/server/lib/RocketChat.ErrorHandler.ts b/apps/meteor/app/error-handler/server/lib/RocketChat.ErrorHandler.ts index 24224a599abf..68300cb24e59 100644 --- a/apps/meteor/app/error-handler/server/lib/RocketChat.ErrorHandler.ts +++ b/apps/meteor/app/error-handler/server/lib/RocketChat.ErrorHandler.ts @@ -7,7 +7,7 @@ import { settings } from '../../../settings/server'; const incException = throttledCounter((counter) => { Settings.incrementValueById('Uncaught_Exceptions_Count', counter, { returnDocument: 'after' }) - .then(({ value }) => { + .then((value) => { if (value) { settings.set(value); } diff --git a/apps/meteor/app/file-upload/server/index.ts b/apps/meteor/app/file-upload/server/index.ts index 52a2b7f21da8..ff2fc4fabf36 100644 --- a/apps/meteor/app/file-upload/server/index.ts +++ b/apps/meteor/app/file-upload/server/index.ts @@ -1,6 +1,5 @@ import '../lib/FileUploadBase'; import { FileUpload } from './lib/FileUpload'; -import './lib/proxy'; import './lib/requests'; import './config/_configUploadStorage'; import './methods/sendFileMessage'; diff --git a/apps/meteor/app/file-upload/server/lib/proxy.ts b/apps/meteor/app/file-upload/server/lib/proxy.ts deleted file mode 100644 index dd9e692f0f98..000000000000 --- a/apps/meteor/app/file-upload/server/lib/proxy.ts +++ /dev/null @@ -1,113 +0,0 @@ -import http from 'http'; -import URL from 'url'; - -import { InstanceStatus } from '@rocket.chat/instance-status'; -import { Logger } from '@rocket.chat/logger'; -import { InstanceStatus as InstanceStatusModel } from '@rocket.chat/models'; -import type { NextFunction } from 'connect'; -import type createServer from 'connect'; -import { WebApp } from 'meteor/webapp'; - -import { UploadFS } from '../../../../server/ufs'; -import { isDocker } from '../../../utils/server/functions/isDocker'; - -const logger = new Logger('UploadProxy'); - -async function handle(req: createServer.IncomingMessage, res: http.ServerResponse, next: NextFunction) { - // Quick check to see if request should be catch - if (!req.url?.includes(`/${UploadFS.config.storesPath}/`)) { - return next(); - } - - logger.debug({ msg: 'Upload URL:', url: req.url }); - - if (req.method !== 'POST') { - return next(); - } - - // Remove store path - const parsedUrl = URL.parse(req.url); - const path = parsedUrl.pathname?.substr(UploadFS.config.storesPath.length + 1) || ''; - - // Get store - const regExp = new RegExp('^/([^/?]+)/([^/?]+)$'); - const match = regExp.exec(path); - - // Request is not valid - if (match === null) { - res.writeHead(400); - res.end(); - return; - } - - // Get store - const store = UploadFS.getStore(match[1]); - if (!store) { - res.writeHead(404); - res.end(); - return; - } - - // Get file - const fileId = match[2]; - const file = await store.getCollection().findOne({ _id: fileId }); - if (!file) { - res.writeHead(404); - res.end(); - return; - } - - if (!file.instanceId || file.instanceId === InstanceStatus.id()) { - logger.debug('Correct instance'); - return next(); - } - - // Proxy to other instance - const instance = await InstanceStatusModel.findOneById(file.instanceId); - - if (instance == null) { - res.writeHead(404); - res.end(); - return; - } - - if (instance.extraInformation.host === process.env.INSTANCE_IP && isDocker() === false) { - instance.extraInformation.host = 'localhost'; - } - - logger.debug(`Wrong instance, proxing to ${instance.extraInformation.host}:${instance.extraInformation.port}`); - - const options = { - hostname: instance.extraInformation.host, - port: instance.extraInformation.port, - path: req.originalUrl, - method: 'POST', - }; - - logger.warn( - 'UFS proxy middleware is deprecated as this upload method is not being used by Web/Mobile Clients. See this: https://docs.rocket.chat/api/rest-api/methods/rooms/upload', - ); - // eslint-disable-next-line @typescript-eslint/naming-convention - const proxy = http.request(options, (proxy_res) => { - proxy_res.pipe(res, { - end: true, - }); - }); - - req.pipe(proxy, { - end: true, - }); -} - -// @ts-expect-error - l -const dummyRouter = WebApp.connectHandlers._router; - -// Create a dummy route -dummyRouter.route('*'); -// fetch the newly created "layer" -const stackedRoute = dummyRouter.stack.pop(); -stackedRoute.handle = handle; - -// Move the layer to the top :) -// @ts-expect-error - l -WebApp.connectHandlers._router.stack.unshift(stackedRoute); diff --git a/apps/meteor/app/file-upload/server/lib/requests.ts b/apps/meteor/app/file-upload/server/lib/requests.ts index d50a7d594ca7..ad780116de0f 100644 --- a/apps/meteor/app/file-upload/server/lib/requests.ts +++ b/apps/meteor/app/file-upload/server/lib/requests.ts @@ -12,12 +12,14 @@ WebApp.connectHandlers.use(FileUpload.getPath(), async (req, res, next) => { if (file) { if (!(await FileUpload.requestCanAccessFiles(req, file))) { res.writeHead(403); - return res.end(); + res.end(); + return; } res.setHeader('Content-Security-Policy', "default-src 'none'"); res.setHeader('Cache-Control', 'max-age=31536000'); - return FileUpload.get(file, req, res, next); + await FileUpload.get(file, req, res, next); + return; } } diff --git a/apps/meteor/app/file/server/file.server.ts b/apps/meteor/app/file/server/file.server.ts index 3d4f6cf02609..94163e314145 100644 --- a/apps/meteor/app/file/server/file.server.ts +++ b/apps/meteor/app/file/server/file.server.ts @@ -2,14 +2,13 @@ import type { ReadStream } from 'fs'; import fs from 'fs'; import fsp from 'fs/promises'; import path from 'path'; -import stream from 'stream'; +import { Readable } from 'stream'; import type { ObjectId } from 'bson'; import { MongoInternals } from 'meteor/mongo'; +import { NpmModuleMongodb } from 'meteor/npm-mongo'; import mime from 'mime-type/with-db'; import mkdirp from 'mkdirp'; -import type { GridFSBucketReadStream } from 'mongodb'; -import { GridFSBucket } from 'mongodb'; const { db } = MongoInternals.defaultRemoteCollectionDriver().mongo; @@ -29,7 +28,7 @@ interface IRocketChatFileStore { getFileWithReadStream(fileName: string): Promise< | { - readStream: GridFSBucketReadStream | ReadStream; + readStream: NpmModuleMongodb.GridFSBucketReadStream | ReadStream; contentType?: string; length: number; uploadDate?: Date; @@ -45,12 +44,12 @@ interface IRocketChatFileStore { class GridFS implements IRocketChatFileStore { private name: string; - private bucket: GridFSBucket; + private bucket: NpmModuleMongodb.GridFSBucket; constructor({ name = 'file' } = {}) { this.name = name; - this.bucket = new GridFSBucket(db, { bucketName: this.name }); + this.bucket = new NpmModuleMongodb.GridFSBucket(db as any, { bucketName: this.name }); } private async findOne(filename: string) { @@ -207,9 +206,7 @@ class FileSystem implements IRocketChatFileStore { export const RocketChatFile = { bufferToStream(buffer: Buffer) { - const bufferStream = new stream.PassThrough(); - bufferStream.end(buffer); - return bufferStream; + return Readable.from(buffer); }, dataURIParse(dataURI: string | Buffer) { diff --git a/apps/meteor/app/importer-csv/server/CsvImporter.ts b/apps/meteor/app/importer-csv/server/CsvImporter.ts index 88cd39a84758..4f5eeba7d88b 100644 --- a/apps/meteor/app/importer-csv/server/CsvImporter.ts +++ b/apps/meteor/app/importer-csv/server/CsvImporter.ts @@ -251,7 +251,7 @@ export class CsvImporter extends Importer { } if (usersCount) { - const { value } = await Settings.incrementValueById('CSV_Importer_Count', usersCount, { returnDocument: 'after' }); + const value = await Settings.incrementValueById('CSV_Importer_Count', usersCount, { returnDocument: 'after' }); if (value) { void notifyOnSettingChanged(value); } diff --git a/apps/meteor/app/importer-slack-users/server/SlackUsersImporter.ts b/apps/meteor/app/importer-slack-users/server/SlackUsersImporter.ts index ae8df1859086..c05c6da8d690 100644 --- a/apps/meteor/app/importer-slack-users/server/SlackUsersImporter.ts +++ b/apps/meteor/app/importer-slack-users/server/SlackUsersImporter.ts @@ -95,7 +95,7 @@ export class SlackUsersImporter extends Importer { await super.updateProgress(ProgressStep.USER_SELECTION); await super.addCountToTotal(userCount); - const { value } = await Settings.incrementValueById('Slack_Users_Importer_Count', userCount, { returnDocument: 'after' }); + const value = await Settings.incrementValueById('Slack_Users_Importer_Count', userCount, { returnDocument: 'after' }); if (value) { void notifyOnSettingChanged(value); } diff --git a/apps/meteor/app/importer-slack/server/SlackImporter.ts b/apps/meteor/app/importer-slack/server/SlackImporter.ts index 59c07d26e969..c7e1b7c624ce 100644 --- a/apps/meteor/app/importer-slack/server/SlackImporter.ts +++ b/apps/meteor/app/importer-slack/server/SlackImporter.ts @@ -338,7 +338,7 @@ export class SlackImporter extends Importer { } if (userCount) { - const { value } = await Settings.incrementValueById('Slack_Importer_Count', userCount, { returnDocument: 'after' }); + const value = await Settings.incrementValueById('Slack_Importer_Count', userCount, { returnDocument: 'after' }); if (value) { void notifyOnSettingChanged(value); } diff --git a/apps/meteor/app/importer/server/classes/Importer.ts b/apps/meteor/app/importer/server/classes/Importer.ts index 32834ed15c4a..5629daab0508 100644 --- a/apps/meteor/app/importer/server/classes/Importer.ts +++ b/apps/meteor/app/importer/server/classes/Importer.ts @@ -184,7 +184,7 @@ export class Importer { }; const afterContactsBatchFn = async (successCount: number) => { - const { value } = await Settings.incrementValueById('Contacts_Importer_Count', successCount, { returnDocument: 'after' }); + const value = await Settings.incrementValueById('Contacts_Importer_Count', successCount, { returnDocument: 'after' }); if (value) { void notifyOnSettingChanged(value); } diff --git a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts index cdf0d4465309..1ce65a03deb0 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts @@ -194,10 +194,10 @@ Meteor.methods({ }, ); - if (updatedIntegration.value) { - void notifyOnIntegrationChanged(updatedIntegration.value); + if (updatedIntegration) { + void notifyOnIntegrationChanged(updatedIntegration); } - return updatedIntegration.value; + return updatedIntegration; }, }); diff --git a/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts index 6ee39d81a588..e4c1c48e0487 100644 --- a/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts @@ -111,10 +111,10 @@ Meteor.methods({ }, ); - if (updatedIntegration.value) { - await notifyOnIntegrationChanged(updatedIntegration.value); + if (updatedIntegration) { + await notifyOnIntegrationChanged(updatedIntegration); } - return updatedIntegration.value; + return updatedIntegration; }, }); diff --git a/apps/meteor/app/invites/server/functions/sendInvitationEmail.ts b/apps/meteor/app/invites/server/functions/sendInvitationEmail.ts index 87b8133e3491..900aeea9fdb1 100644 --- a/apps/meteor/app/invites/server/functions/sendInvitationEmail.ts +++ b/apps/meteor/app/invites/server/functions/sendInvitationEmail.ts @@ -54,7 +54,7 @@ export const sendInvitationEmail = async (userId: string, emails: string[]) => { }, }); - const { value } = await Settings.incrementValueById('Invitation_Email_Count', 1, { returnDocument: 'after' }); + const value = await Settings.incrementValueById('Invitation_Email_Count', 1, { returnDocument: 'after' }); if (value) { void notifyOnSettingChanged(value); } diff --git a/apps/meteor/app/lib/server/functions/deleteMessage.ts b/apps/meteor/app/lib/server/functions/deleteMessage.ts index 30044dadb81c..391ba936241f 100644 --- a/apps/meteor/app/lib/server/functions/deleteMessage.ts +++ b/apps/meteor/app/lib/server/functions/deleteMessage.ts @@ -109,7 +109,7 @@ export async function deleteMessage(message: IMessage, user: IUser): Promise { - const { value: updatedParentMessage } = await Messages.decreaseReplyCountById(message.tmid, -1); + const updatedParentMessage = await Messages.decreaseReplyCountById(message.tmid, -1); if (room) { const { modifiedCount } = await Subscriptions.removeUnreadThreadsByRoomId(room._id, [message.tmid]); diff --git a/apps/meteor/app/lib/server/lib/notifyListener.ts b/apps/meteor/app/lib/server/lib/notifyListener.ts index 6a28fabe5c51..0ff13deaf0d1 100644 --- a/apps/meteor/app/lib/server/lib/notifyListener.ts +++ b/apps/meteor/app/lib/server/lib/notifyListener.ts @@ -1,4 +1,4 @@ -import { api, dbWatchersDisabled } from '@rocket.chat/core-services'; +import { api } from '@rocket.chat/core-services'; import type { IRocketChatRecord, IRoom, @@ -24,6 +24,7 @@ import type { ILivechatContact, } from '@rocket.chat/core-typings'; import { + dbWatchersDisabled, Rooms, LivechatRooms, Permissions, diff --git a/apps/meteor/app/livechat/server/api/v1/videoCall.ts b/apps/meteor/app/livechat/server/api/v1/videoCall.ts index dd9c701e6495..01bda33724d1 100644 --- a/apps/meteor/app/livechat/server/api/v1/videoCall.ts +++ b/apps/meteor/app/livechat/server/api/v1/videoCall.ts @@ -46,7 +46,7 @@ API.v1.addRoute( let { callStatus } = room; if (!callStatus || callStatus === 'ended' || callStatus === 'declined') { - const { value } = await Settings.incrementValueById('WebRTC_Calls_Count', 1, { returnDocument: 'after' }); + const value = await Settings.incrementValueById('WebRTC_Calls_Count', 1, { returnDocument: 'after' }); if (value) { void notifyOnSettingChanged(value); } diff --git a/apps/meteor/app/livechat/server/lib/Helper.ts b/apps/meteor/app/livechat/server/lib/Helper.ts index 7eaf800a05df..b6a07024c989 100644 --- a/apps/meteor/app/livechat/server/lib/Helper.ts +++ b/apps/meteor/app/livechat/server/lib/Helper.ts @@ -72,7 +72,7 @@ export const createLivechatRoom = async ( guest: ILivechatVisitor, roomInfo: IOmnichannelRoomInfo = { source: { type: OmnichannelSourceType.OTHER } }, extraData?: IOmnichannelRoomExtraData, -) => { +): Promise => { check(rid, String); check( guest, @@ -157,14 +157,14 @@ export const createLivechatRoom = async ( }, ); - if (!result.value) { + if (!result) { throw new Error('Room not created'); } await callbacks.run('livechat.newRoom', room); await Message.saveSystemMessageAndNotifyUser('livechat-started', rid, '', { _id, username }, { groupable: false, token: guest.token }); - return result.value as IOmnichannelRoom; + return result as IOmnichannelRoom; }; export const createLivechatInquiry = async ({ @@ -239,11 +239,11 @@ export const createLivechatInquiry = async ({ ); logger.debug(`Inquiry ${result} created for visitor ${_id}`); - if (!result.value) { + if (!result) { throw new Error('Inquiry not created'); } - return result.value as ILivechatInquiryRecord; + return result; }; export const createLivechatSubscription = async ( diff --git a/apps/meteor/app/livechat/server/lib/Visitors.ts b/apps/meteor/app/livechat/server/lib/Visitors.ts index c7b4430df363..ccf4a13bd472 100644 --- a/apps/meteor/app/livechat/server/lib/Visitors.ts +++ b/apps/meteor/app/livechat/server/lib/Visitors.ts @@ -100,11 +100,11 @@ export const Visitors = { returnDocument: 'after', }); - if (!upsertedLivechatVisitor.value) { + if (!upsertedLivechatVisitor) { logger.debug(`No visitor found after upsert`); return null; } - return upsertedLivechatVisitor.value; + return upsertedLivechatVisitor; }, }; diff --git a/apps/meteor/app/livechat/server/lib/contacts/updateContact.ts b/apps/meteor/app/livechat/server/lib/contacts/updateContact.ts index 023568bd11de..6c344274386e 100644 --- a/apps/meteor/app/livechat/server/lib/contacts/updateContact.ts +++ b/apps/meteor/app/livechat/server/lib/contacts/updateContact.ts @@ -41,7 +41,7 @@ export async function updateContact(params: UpdateContactParams): Promise { - const { value } = await Settings.incrementValueById(data.settingsId, 1, { returnDocument: 'after' }); + const value = await Settings.incrementValueById(data.settingsId, 1, { returnDocument: 'after' }); if (value) { void notifyOnSettingChanged(value); } diff --git a/apps/meteor/definition/externals/meteor/rocketchat-streamer.d.ts b/apps/meteor/definition/externals/meteor/rocketchat-streamer.d.ts index 1de8f5413b9f..70b5d18b837d 100644 --- a/apps/meteor/definition/externals/meteor/rocketchat-streamer.d.ts +++ b/apps/meteor/definition/externals/meteor/rocketchat-streamer.d.ts @@ -19,6 +19,30 @@ declare module 'meteor/rocketchat:streamer' { userId?: string; send: (payload: string) => void; }; + + onStop(func: Function): void; + /** + * Call inside the publish function. Informs the subscriber that an initial, complete snapshot of the record set has been sent. This will trigger a call on the client to the `onReady` + * callback passed to `Meteor.subscribe`, if any. + */ + ready(): void; + /** + * Call inside the publish function. Informs the subscriber that a document has been removed from the record set. + * @param collection The name of the collection that the document has been removed from. + * @param id The ID of the document that has been removed. + */ + removed(collection: string, id: string): void; + /** + * Access inside the publish function. The incoming connection for this subscription. + */ + stop(): void; + /** + * Call inside the publish function. Allows subsequent methods or subscriptions for the client of this subscription + * to begin running without waiting for the publishing to become ready. + */ + unblock(): void; + /** Access inside the publish function. The id of the logged-in user, or `null` if no user is logged in. */ + userId: string | null; } type Rule = (this: IPublication, eventName: K, ...args: any) => Promise; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/api/lib/priorities.ts b/apps/meteor/ee/app/livechat-enterprise/server/api/lib/priorities.ts index 3f81aa325e23..09d9ab14212c 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/api/lib/priorities.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/api/lib/priorities.ts @@ -40,10 +40,7 @@ export async function findPriority({ }; } -export async function updatePriority( - _id: string, - data: Pick & { reset?: boolean }, -): Promise { +export async function updatePriority(_id: string, data: Pick & { reset?: boolean }): Promise { if (data.name) { // If we want to enforce translated duplicates we need to change this const priority = await LivechatPriority.findOneNameUsingRegex(data.name, { projection: { name: 1 } }); @@ -54,12 +51,12 @@ export async function updatePriority( const createdResult = await LivechatPriority.updatePriority(_id, data.reset || false, data.name); - if (!createdResult.ok || !createdResult.value) { + if (!createdResult) { logger.error(`Error updating priority: ${_id}. Unsuccessful result from mongodb. Result`, createdResult); throw Error('error-unable-to-update-priority'); } - return createdResult.value; + return createdResult; } export const updateRoomPriority = async ( diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/Department.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/Department.ts index 094f0c9000d4..f1ab72fa1e33 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/Department.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/Department.ts @@ -1,6 +1,7 @@ import type { ILivechatDepartment } from '@rocket.chat/core-typings'; import { LivechatDepartment } from '@rocket.chat/models'; import { escapeRegExp } from '@rocket.chat/string-helpers'; +import type { Filter } from 'mongodb'; import { callbacks } from '../../../../../lib/callbacks'; @@ -14,9 +15,9 @@ export const findAllDepartmentsAvailable = async ( ): Promise<{ departments: ILivechatDepartment[]; total: number }> => { const filterReg = new RegExp(escapeRegExp(text || ''), 'i'); - let query = { + let query: Filter = { type: { $ne: 'u' }, - $or: [{ ancestors: { $in: [[unitId], null, []] } }, { ancestors: { $exists: false } }], + $or: [{ ancestors: { $in: [[unitId], undefined, []] } }, { ancestors: { $exists: false } }], ...(text && { name: filterReg }), }; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/units.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/units.ts index 309834f2d1e8..a9006642e60f 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/units.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/units.ts @@ -10,7 +10,7 @@ async function hasUnits(): Promise { // Units should't change really often, so we can cache the result const memoizedHasUnits = mem(hasUnits, { maxAge: process.env.TEST_MODE ? 1 : 10000 }); -export async function getUnitsFromUser(): Promise<{ [k: string]: any }[] | undefined> { +export async function getUnitsFromUser(): Promise { if (!(await memoizedHasUnits())) { return; } diff --git a/apps/meteor/ee/server/apps/storage/AppGridFSSourceStorage.ts b/apps/meteor/ee/server/apps/storage/AppGridFSSourceStorage.ts index 7838990d4c0d..6f887971f0d8 100644 --- a/apps/meteor/ee/server/apps/storage/AppGridFSSourceStorage.ts +++ b/apps/meteor/ee/server/apps/storage/AppGridFSSourceStorage.ts @@ -1,22 +1,22 @@ import type { IAppStorageItem } from '@rocket.chat/apps-engine/server/storage'; import { AppSourceStorage } from '@rocket.chat/apps-engine/server/storage'; import { MongoInternals } from 'meteor/mongo'; -import type { GridFSBucketWriteStream } from 'mongodb'; -import { ObjectId, GridFSBucket } from 'mongodb'; +import { NpmModuleMongodb } from 'meteor/npm-mongo'; +import { ObjectId } from 'mongodb'; import { streamToBuffer } from '../../../../app/file-upload/server/lib/streamToBuffer'; export class AppGridFSSourceStorage extends AppSourceStorage { private pathPrefix = 'GridFS:/'; - private bucket: GridFSBucket; + private bucket: NpmModuleMongodb.GridFSBucket; constructor() { super(); const { db } = MongoInternals.defaultRemoteCollectionDriver().mongo; - this.bucket = new GridFSBucket(db, { + this.bucket = new NpmModuleMongodb.GridFSBucket(db as any, { bucketName: 'rocketchat_apps_packages', chunkSizeBytes: 1024 * 255, }); @@ -25,10 +25,10 @@ export class AppGridFSSourceStorage extends AppSourceStorage { public async store(item: IAppStorageItem, zip: Buffer): Promise { return new Promise((resolve, reject) => { const filename = this.itemToFilename(item); - const writeStream: GridFSBucketWriteStream = this.bucket + const writeStream: NpmModuleMongodb.GridFSBucketWriteStream = this.bucket .openUploadStream(filename) .on('finish', () => resolve(this.idToPath(writeStream.id))) - .on('error', (error) => reject(error)); + .on('error', (error: any) => reject(error)); writeStream.write(zip); writeStream.end(); @@ -42,7 +42,7 @@ export class AppGridFSSourceStorage extends AppSourceStorage { public async update(item: IAppStorageItem, zip: Buffer): Promise { return new Promise((resolve, reject) => { const fileId = this.itemToFilename(item); - const writeStream: GridFSBucketWriteStream = this.bucket + const writeStream: NpmModuleMongodb.GridFSBucketWriteStream = this.bucket .openUploadStream(fileId) .on('finish', () => { resolve(this.idToPath(writeStream.id)); @@ -51,7 +51,7 @@ export class AppGridFSSourceStorage extends AppSourceStorage { this.remove(item).catch(() => {}); }) - .on('error', (error) => reject(error)); + .on('error', (error: any) => reject(error)); writeStream.write(zip); writeStream.end(); @@ -59,29 +59,24 @@ export class AppGridFSSourceStorage extends AppSourceStorage { } public async remove(item: IAppStorageItem): Promise { - return new Promise((resolve, reject) => { - this.bucket.delete(this.itemToObjectId(item), (error) => { - if (error) { - if (error.message.includes('File not found for id')) { - console.warn( - `This instance could not remove the ${item.info.name} app package. If you are running Rocket.Chat in a cluster with multiple instances, possibly other instance removed the package. If this is not the case, it is possible that the file in the database got renamed or removed manually.`, - ); - return resolve(); - } - - return reject(error); - } - - resolve(); - }); - }); + try { + await this.bucket.delete(this.itemToObjectId(item)); + } catch (error: any) { + if (error.message.includes('File not found for id')) { + console.warn( + `This instance could not remove the ${item.info.name} app package. If you are running Rocket.Chat in a cluster with multiple instances, possibly other instance removed the package. If this is not the case, it is possible that the file in the database got renamed or removed manually.`, + ); + return; + } + throw error; + } } private itemToFilename(item: IAppStorageItem): string { return `${item.info.nameSlug}-${item.info.version}.package`; } - private idToPath(id: GridFSBucketWriteStream['id']): string { + private idToPath(id: NpmModuleMongodb.GridFSBucketWriteStream['id']): string { return this.pathPrefix + id; } diff --git a/apps/meteor/ee/server/models/raw/LivechatInquiry.ts b/apps/meteor/ee/server/models/raw/LivechatInquiry.ts index 12a6c60b9ed3..1f6471af1bce 100644 --- a/apps/meteor/ee/server/models/raw/LivechatInquiry.ts +++ b/apps/meteor/ee/server/models/raw/LivechatInquiry.ts @@ -2,21 +2,21 @@ import type { ILivechatInquiryRecord, ILivechatPriority } from '@rocket.chat/cor import { DEFAULT_SLA_CONFIG, LivechatPriorityWeight } from '@rocket.chat/core-typings'; import type { ILivechatInquiryModel } from '@rocket.chat/model-typings'; import { LivechatInquiryRaw } from '@rocket.chat/models'; -import type { ModifyResult, UpdateResult, Document } from 'mongodb'; +import type { UpdateResult, Document, WithId } from 'mongodb'; declare module '@rocket.chat/model-typings' { interface ILivechatInquiryModel { - setSlaForRoom(rid: string, sla: { estimatedWaitingTimeQueue: number; slaId: string }): Promise>; - unsetSlaForRoom(rid: string): Promise>; + setSlaForRoom(rid: string, sla: { estimatedWaitingTimeQueue: number; slaId: string }): Promise>; + unsetSlaForRoom(rid: string): Promise>; bulkUnsetSla(roomIds: string[]): Promise; - setPriorityForRoom(rid: string, priority: Pick): Promise>; - unsetPriorityForRoom(rid: string): Promise>; + setPriorityForRoom(rid: string, priority: Pick): Promise>; + unsetPriorityForRoom(rid: string): Promise>; } } // Note: Expect a circular dependency error here 😓 export class LivechatInquiryRawEE extends LivechatInquiryRaw implements ILivechatInquiryModel { - setSlaForRoom(rid: string, sla: { estimatedWaitingTimeQueue: number; slaId: string }): Promise> { + setSlaForRoom(rid: string, sla: { estimatedWaitingTimeQueue: number; slaId: string }): Promise> { const { estimatedWaitingTimeQueue, slaId } = sla; return this.findOneAndUpdate( @@ -30,7 +30,7 @@ export class LivechatInquiryRawEE extends LivechatInquiryRaw implements ILivecha ); } - unsetSlaForRoom(rid: string): Promise> { + unsetSlaForRoom(rid: string): Promise> { return this.findOneAndUpdate( { rid }, { @@ -60,7 +60,7 @@ export class LivechatInquiryRawEE extends LivechatInquiryRaw implements ILivecha ); } - setPriorityForRoom(rid: string, priority: Pick): Promise> { + setPriorityForRoom(rid: string, priority: Pick): Promise> { return this.findOneAndUpdate( { rid }, { @@ -72,7 +72,7 @@ export class LivechatInquiryRawEE extends LivechatInquiryRaw implements ILivecha ); } - unsetPriorityForRoom(rid: string): Promise> { + unsetPriorityForRoom(rid: string): Promise> { return this.findOneAndUpdate( { rid }, { diff --git a/apps/meteor/ee/server/patches/mergeContacts.ts b/apps/meteor/ee/server/patches/mergeContacts.ts index 30d5b03d0cfb..f692011a8a6c 100644 --- a/apps/meteor/ee/server/patches/mergeContacts.ts +++ b/apps/meteor/ee/server/patches/mergeContacts.ts @@ -43,7 +43,7 @@ export const runMergeContacts = async ( const similarContactIds = similarContacts.map((c) => c._id); const { deletedCount } = await LivechatContacts.deleteMany({ _id: { $in: similarContactIds } }, { session }); - const { value } = await Settings.incrementValueById('Merged_Contacts_Count', similarContacts.length, { returnDocument: 'after' }); + const value = await Settings.incrementValueById('Merged_Contacts_Count', similarContacts.length, { returnDocument: 'after' }); if (value) { void notifyOnSettingChanged(value); } diff --git a/apps/meteor/ee/server/services/Dockerfile b/apps/meteor/ee/server/services/Dockerfile index 017a41dfd6d2..55e1157c0985 100644 --- a/apps/meteor/ee/server/services/Dockerfile +++ b/apps/meteor/ee/server/services/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.18.0 as build +FROM node:22.11.0 as build WORKDIR /app @@ -28,7 +28,7 @@ COPY ./tsconfig.base.json . RUN yarn workspace @rocket.chat/core-typings run build \ && yarn workspace @rocket.chat/rest-typings run build -FROM node:20.18.0-alpine3.20 +FROM node:22.11.0-alpine3.20 ARG SERVICE diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 3e7b581401f4..25057034f113 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -39,7 +39,7 @@ "jaeger-client": "^3.19.0", "mem": "^8.1.1", "moleculer": "^0.14.35", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "nats": "^2.28.2", "pino": "^8.21.0", "sodium-native": "^4.3.1", diff --git a/apps/meteor/package.json b/apps/meteor/package.json index b8281142848c..a3905332f202 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -3,6 +3,7 @@ "description": "The Ultimate Open Source WebChat Platform", "version": "7.2.0-develop", "private": true, + "type": "commonjs", "author": { "name": "Rocket.Chat", "url": "https://rocket.chat/" @@ -30,7 +31,7 @@ "obj:dev": "TEST_MODE=true yarn dev", "stylelint": "stylelint \"app/**/*.css\" \"client/**/*.css\"", "stylelint:fix": "stylelint --fix \"app/**/*.css\" \"client/**/*.css\"", - "typecheck": "cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" tsc -p tsconfig.typecheck.json", + "typecheck": "meteor lint && cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" tsc --noEmit --skipLibCheck", "coverage": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' nyc -r html mocha --config ./.mocharc.js", "test:e2e": "playwright test", "test:e2e:federation": "playwright test --config=playwright-federation.config.ts", @@ -124,7 +125,6 @@ "@types/lodash.get": "^4.4.9", "@types/mailparser": "^3.4.5", "@types/marked": "^4.3.2", - "@types/meteor": "^2.9.8", "@types/meteor-collection-hooks": "^0.8.9", "@types/mkdirp": "^1.0.2", "@types/mocha": "github:whitecolor/mocha-types", @@ -152,6 +152,7 @@ "@types/supports-color": "~7.2.1", "@types/textarea-caret": "^3.0.3", "@types/ua-parser-js": "^0.7.39", + "@types/underscore": "^1.13.0", "@types/use-sync-external-store": "^0.0.6", "@types/uuid": "^10.0.0", "@types/xml-crypto": "~1.4.6", @@ -296,6 +297,7 @@ "@slack/bolt": "^4.1.0", "@slack/rtm-api": "^7.0.1", "@tanstack/react-query": "patch:@tanstack/react-query@npm%3A5.60.5#~/.yarn/patches/@tanstack-react-query-npm-5.60.5-04c500b172.patch", + "@types/meteor": "^2.9.8", "@vector-im/matrix-bot-sdk": "0.7.1-element.6", "@xmldom/xmldom": "^0.8.10", "adm-zip": "0.5.16", @@ -309,7 +311,7 @@ "bad-words": "^3.0.4", "bcrypt": "^5.1.1", "body-parser": "1.20.3", - "bson": "^4.7.2", + "bson": "^6.7.0", "busboy": "^1.6.0", "bytebuffer": "5.0.1", "chalk": "^4.1.2", @@ -360,7 +362,7 @@ "imap": "^0.8.19", "ip-range-check": "^0.2.0", "is-svg": "^4.4.0", - "isolated-vm": "4.7.2", + "isolated-vm": "5.0.1", "jschardet": "^3.1.4", "jsdom": "^16.7.0", "jsrsasign": "^11.1.0", @@ -387,7 +389,7 @@ "moment": "^2.30.1", "moment-timezone": "^0.5.46", "mongo-message-queue": "^1.1.0", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "nats": "^2.28.2", "node-dogstatsd": "^0.0.7", "node-fetch": "2.7.0", diff --git a/apps/meteor/packages/rocketchat-livechat/plugin/build.sh b/apps/meteor/packages/rocketchat-livechat/plugin/build.sh index b4f2a4e0dd77..b309442b55d0 100644 --- a/apps/meteor/packages/rocketchat-livechat/plugin/build.sh +++ b/apps/meteor/packages/rocketchat-livechat/plugin/build.sh @@ -15,7 +15,7 @@ mkdir $LIVECHAT_ASSETS_DIR echo "Installing Livechat ${LATEST_LIVECHAT_VERSION}..." cd $LIVECHAT_DIR -cp -a $ROOT/node_modules/\@rocket.chat/livechat/dist/. ./ +cp -a $ROOT/../../packages/livechat/dist/. ./ # change to lowercase so all injected junk from rocket.chat is not sent: https://github.com/meteorhacks/meteor-inject-initial/blob/master/lib/inject-core.js#L10 # this is not harmful since doctype is case-insesitive: https://www.w3.org/TR/html5/syntax.html#the-doctype meteor node -e 'fs.writeFileSync("index.html", fs.readFileSync("index.html").toString().replace(" Promise): Promise(event: T, ...args: Parameters) => Promise; diff --git a/apps/meteor/server/routes/avatar/middlewares/browserVersion.ts b/apps/meteor/server/routes/avatar/middlewares/browserVersion.ts index a0095581240e..dac619df3b34 100644 --- a/apps/meteor/server/routes/avatar/middlewares/browserVersion.ts +++ b/apps/meteor/server/routes/avatar/middlewares/browserVersion.ts @@ -21,12 +21,14 @@ export const handleBrowserVersionCheck = (request: IncomingMessage, res: ServerR const browserVersionCheck = cookies.get('browser_version_check', req.headers.cookie); if (browserVersionCheck === 'bypass') { - return next(); + next(); + return; } const userAgent = parser(req.headers['user-agent']); if (browserVersionCheck !== 'force' && !isIEOlderThan11(userAgent)) { - return next(); + next(); + return; } res.setHeader('content-type', 'text/html; charset=utf-8'); @@ -141,5 +143,5 @@ export const handleBrowserVersionCheck = (request: IncomingMessage, res: ServerR `); - return res.end(); + res.end(); }; diff --git a/apps/meteor/server/services/federation/infrastructure/rocket-chat/well-known.ts b/apps/meteor/server/services/federation/infrastructure/rocket-chat/well-known.ts index b1088c2f6ff9..57218dafdc41 100644 --- a/apps/meteor/server/services/federation/infrastructure/rocket-chat/well-known.ts +++ b/apps/meteor/server/services/federation/infrastructure/rocket-chat/well-known.ts @@ -7,7 +7,8 @@ import { settings } from '../../../../../app/settings/server'; async function returnMatrixServerJSON(_: IncomingMessage, res: ServerResponse) { if (!settings.get('Federation_Matrix_enabled') || !settings.get('Federation_Matrix_serve_well_known')) { - return res.writeHead(404).end(); + res.writeHead(404).end(); + return; } const homeserverUrl = settings.get('Federation_Matrix_homeserver_url'); @@ -22,7 +23,8 @@ async function returnMatrixServerJSON(_: IncomingMessage, res: ServerResponse) { async function returnMatrixClientJSON(_: IncomingMessage, res: ServerResponse) { if (!settings.get('Federation_Matrix_enabled') || !settings.get('Federation_Matrix_serve_well_known')) { - return res.writeHead(404).end(); + res.writeHead(404).end(); + return; } const homeserverUrl = settings.get('Federation_Matrix_homeserver_url'); diff --git a/apps/meteor/server/services/nps/service.ts b/apps/meteor/server/services/nps/service.ts index 68d94a821997..c6a89f689d07 100644 --- a/apps/meteor/server/services/nps/service.ts +++ b/apps/meteor/server/services/nps/service.ts @@ -85,7 +85,7 @@ export class NPSService extends ServiceClassInternal implements INPSService { const sending = await Promise.all( votesToSend.map(async (vote) => { - const { value } = await NpsVote.findOneAndUpdate( + const value = await NpsVote.findOneAndUpdate( { _id: vote._id, status: INpsVoteStatus.NEW, diff --git a/apps/meteor/server/startup/watchDb.ts b/apps/meteor/server/startup/watchDb.ts index f60f1e5949fd..55e0408a4b9f 100644 --- a/apps/meteor/server/startup/watchDb.ts +++ b/apps/meteor/server/startup/watchDb.ts @@ -1,9 +1,9 @@ -import { api, dbWatchersDisabled } from '@rocket.chat/core-services'; +import { api } from '@rocket.chat/core-services'; import { Logger } from '@rocket.chat/logger'; +import { dbWatchersDisabled, DatabaseWatcher } from '@rocket.chat/models'; import { MongoInternals } from 'meteor/mongo'; import { metrics } from '../../app/metrics/server/lib/metrics'; -import { DatabaseWatcher } from '../database/DatabaseWatcher'; import { db } from '../database/utils'; import { SystemLogger } from '../lib/logger/system'; import { initWatchers } from '../modules/watchers/watchers.module'; diff --git a/apps/meteor/server/ufs/ufs-gridfs.ts b/apps/meteor/server/ufs/ufs-gridfs.ts index 294fcfda5218..f93f11695d5b 100644 --- a/apps/meteor/server/ufs/ufs-gridfs.ts +++ b/apps/meteor/server/ufs/ufs-gridfs.ts @@ -1,7 +1,7 @@ import type { IUpload } from '@rocket.chat/core-typings'; import { MongoInternals } from 'meteor/mongo'; +import { NpmModuleMongodb } from 'meteor/npm-mongo'; import type { ObjectId } from 'mongodb'; -import { GridFSBucket } from 'mongodb'; import { UploadFS } from './ufs'; import type { StoreOptions } from './ufs-store'; @@ -41,14 +41,14 @@ export class GridFSStore extends UploadFS.Store { // const mongo = MongoInternals.NpmModule; const { db } = MongoInternals.defaultRemoteCollectionDriver().mongo; - const mongoStore = new GridFSBucket(db, { + const mongoStore = new NpmModuleMongodb.GridFSBucket(db as any, { bucketName: options.collectionName, chunkSizeBytes: this.chunkSize, }); this.delete = async function (fileId) { const collectionName = `${options.collectionName}.files`; - const file = await db.collection(collectionName).findOne({ _id: fileId }); + const file = await db.collection(collectionName).findOne({ _id: fileId as any }); if (file) { await mongoStore.delete(fileId as unknown as ObjectId); diff --git a/apps/meteor/tests/e2e/fixtures/inject-initial-data.ts b/apps/meteor/tests/e2e/fixtures/inject-initial-data.ts index 38659303903c..b37354a1c8ca 100644 --- a/apps/meteor/tests/e2e/fixtures/inject-initial-data.ts +++ b/apps/meteor/tests/e2e/fixtures/inject-initial-data.ts @@ -74,7 +74,7 @@ export default async function injectInitialData() { connection .db() .collection('rocketchat_settings') - .updateOne({ _id: setting._id }, { $set: { value: setting.value } }), + .updateOne({ _id: setting._id as any }, { $set: { value: setting.value } }), ), ); diff --git a/apps/meteor/tests/end-to-end/api/users.ts b/apps/meteor/tests/end-to-end/api/users.ts index 87e4bd673323..84c52e7596fe 100644 --- a/apps/meteor/tests/end-to-end/api/users.ts +++ b/apps/meteor/tests/end-to-end/api/users.ts @@ -173,7 +173,7 @@ const updateUserInDb = async (userId: IUser['_id'], userData: Partial) => await connection .db() .collection('users') - .updateOne({ _id: userId }, { $set: { ...userData } }); + .updateOne({ _id: userId as any }, { $set: { ...userData } }); await connection.close(); }; diff --git a/apps/meteor/tests/unit/app/lib/server/lib/notifyListener.spec.ts b/apps/meteor/tests/unit/app/lib/server/lib/notifyListener.spec.ts index 60b01dcefd12..2b8626401d01 100644 --- a/apps/meteor/tests/unit/app/lib/server/lib/notifyListener.spec.ts +++ b/apps/meteor/tests/unit/app/lib/server/lib/notifyListener.spec.ts @@ -23,7 +23,7 @@ describe('Message Broadcast Tests', () => { _updatedAt: new Date(), }; - const modelsStubs = () => ({ + const modelsStubs = (dbWatchersDisabled: boolean) => ({ Messages: { findOneById: messagesFindOneStub, }, @@ -33,13 +33,13 @@ describe('Message Broadcast Tests', () => { Settings: { getValueById: getSettingValueByIdStub, }, + dbWatchersDisabled, }); - const coreStubs = (dbWatchersDisabled: boolean) => ({ + const coreStubs = () => ({ api: { broadcast: broadcastStub, }, - dbWatchersDisabled, }); beforeEach(() => { @@ -50,8 +50,8 @@ describe('Message Broadcast Tests', () => { memStub = sinon.stub().callsFake((fn: any) => fn); const proxyMock = proxyquire.noPreserveCache().load('../../../../../../app/lib/server/lib/notifyListener', { - '@rocket.chat/models': modelsStubs(), - '@rocket.chat/core-services': coreStubs(false), + '@rocket.chat/models': modelsStubs(false), + '@rocket.chat/core-services': coreStubs(), 'mem': memStub, }); @@ -203,8 +203,8 @@ describe('Message Broadcast Tests', () => { describe('notifyOnMessageChange', () => { const setupProxyMock = (dbWatchersDisabled: boolean) => { const proxyMock = proxyquire.noCallThru().load('../../../../../../app/lib/server/lib/notifyListener', { - '@rocket.chat/models': modelsStubs(), - '@rocket.chat/core-services': coreStubs(dbWatchersDisabled), + '@rocket.chat/models': modelsStubs(dbWatchersDisabled), + '@rocket.chat/core-services': coreStubs(), 'mem': memStub, }); notifyOnMessageChange = proxyMock.notifyOnMessageChange; diff --git a/apps/meteor/tsconfig.typecheck.json b/apps/meteor/tsconfig.typecheck.json deleted file mode 100644 index 33699e98affb..000000000000 --- a/apps/meteor/tsconfig.typecheck.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "skipLibCheck": true, - "noEmit": true, - "incremental": true, - "allowImportingTsExtensions": true, - "paths": { - "mongodb": ["node_modules/mongodb"] - } - }, - "exclude": [".meteor", "./packages", "./imports/client", "./ee/server/services", "public/", "private"] -} diff --git a/ee/apps/account-service/Dockerfile b/ee/apps/account-service/Dockerfile index 4adc86ff1bc9..4c031c6f8eb2 100644 --- a/ee/apps/account-service/Dockerfile +++ b/ee/apps/account-service/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.18.0-alpine3.20 +FROM node:22.11.0-alpine3.20 ARG SERVICE diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index 35b7bd119516..186d037b2e76 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -34,7 +34,7 @@ "gc-stats": "^1.4.1", "mem": "^8.1.1", "moleculer": "^0.14.35", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2", diff --git a/ee/apps/authorization-service/Dockerfile b/ee/apps/authorization-service/Dockerfile index 18ad2653a631..1d9a6dfc7364 100644 --- a/ee/apps/authorization-service/Dockerfile +++ b/ee/apps/authorization-service/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.18.0-alpine3.20 +FROM node:22.11.0-alpine3.20 ARG SERVICE diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 40fd480b0a0f..e78727e433eb 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -32,7 +32,7 @@ "gc-stats": "^1.4.1", "mem": "^8.1.1", "moleculer": "^0.14.35", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2" diff --git a/ee/apps/ddp-streamer/Dockerfile b/ee/apps/ddp-streamer/Dockerfile index 411d25ff7c3c..68b93b380045 100644 --- a/ee/apps/ddp-streamer/Dockerfile +++ b/ee/apps/ddp-streamer/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.18.0-alpine3.20 +FROM node:22.11.0-alpine3.20 ARG SERVICE diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 8f33978fae06..b822ae13426c 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -34,7 +34,7 @@ "jaeger-client": "^3.19.0", "mem": "^8.1.1", "moleculer": "^0.14.35", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2", @@ -49,9 +49,9 @@ "@rocket.chat/eslint-config": "workspace:^", "@types/ejson": "^2.2.2", "@types/gc-stats": "^1.4.3", - "@types/meteor": "^2.9.8", "@types/node": "~20.17.8", "@types/polka": "^0.5.7", + "@types/underscore": "^1.13.0", "@types/uuid": "^10.0.0", "@types/ws": "^8.5.13", "eslint": "~8.45.0", diff --git a/ee/apps/omnichannel-transcript/Dockerfile b/ee/apps/omnichannel-transcript/Dockerfile index eb709d2f3ed0..7a2cbd804813 100644 --- a/ee/apps/omnichannel-transcript/Dockerfile +++ b/ee/apps/omnichannel-transcript/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.18.0-alpine3.20 +FROM node:22.11.0-alpine3.20 ARG SERVICE diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index 4ecd44666cd5..ea35f4eb748b 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -37,7 +37,7 @@ "moleculer": "^0.14.35", "moment-timezone": "^0.5.46", "mongo-message-queue": "^1.1.0", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2" diff --git a/ee/apps/presence-service/Dockerfile b/ee/apps/presence-service/Dockerfile index f32a2a636064..29721db8b0e9 100644 --- a/ee/apps/presence-service/Dockerfile +++ b/ee/apps/presence-service/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.18.0-alpine3.20 +FROM node:22.11.0-alpine3.20 ARG SERVICE diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index 091b1ed03aa4..59075a1574e6 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -32,7 +32,7 @@ "gc-stats": "^1.4.1", "mem": "^8.1.1", "moleculer": "^0.14.35", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2" diff --git a/ee/apps/queue-worker/Dockerfile b/ee/apps/queue-worker/Dockerfile index eb709d2f3ed0..7a2cbd804813 100644 --- a/ee/apps/queue-worker/Dockerfile +++ b/ee/apps/queue-worker/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.18.0-alpine3.20 +FROM node:22.11.0-alpine3.20 ARG SERVICE diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index 3282b96bcb31..0051a5538bd3 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -34,7 +34,7 @@ "moleculer": "^0.14.35", "moment-timezone": "^0.5.46", "mongo-message-queue": "^1.1.0", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2" diff --git a/ee/apps/stream-hub-service/Dockerfile b/ee/apps/stream-hub-service/Dockerfile index 18ad2653a631..1d9a6dfc7364 100644 --- a/ee/apps/stream-hub-service/Dockerfile +++ b/ee/apps/stream-hub-service/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.18.0-alpine3.20 +FROM node:22.11.0-alpine3.20 ARG SERVICE diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index 5eee33643175..3a1fa59c76ad 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -31,7 +31,7 @@ "gc-stats": "^1.4.1", "mem": "^8.1.1", "moleculer": "^0.14.35", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2" diff --git a/ee/apps/stream-hub-service/src/StreamHub.ts b/ee/apps/stream-hub-service/src/StreamHub.ts index 4d0fffb57049..dfc32611f50a 100755 --- a/ee/apps/stream-hub-service/src/StreamHub.ts +++ b/ee/apps/stream-hub-service/src/StreamHub.ts @@ -1,8 +1,8 @@ import type { IServiceClass } from '@rocket.chat/core-services'; import { ServiceClass } from '@rocket.chat/core-services'; import type { Logger } from '@rocket.chat/logger'; +import type { DatabaseWatcher } from '@rocket.chat/models'; -import type { DatabaseWatcher } from '../../../../apps/meteor/server/database/DatabaseWatcher'; import { initWatchers } from '../../../../apps/meteor/server/modules/watchers/watchers.module'; export class StreamHub extends ServiceClass implements IServiceClass { diff --git a/ee/apps/stream-hub-service/src/service.ts b/ee/apps/stream-hub-service/src/service.ts index 1827cfeccff1..576e4e5e9be0 100755 --- a/ee/apps/stream-hub-service/src/service.ts +++ b/ee/apps/stream-hub-service/src/service.ts @@ -1,12 +1,11 @@ import { api, getConnection, getTrashCollection } from '@rocket.chat/core-services'; import { Logger } from '@rocket.chat/logger'; -import { registerServiceModels } from '@rocket.chat/models'; +import { DatabaseWatcher, registerServiceModels } from '@rocket.chat/models'; import { broker } from '@rocket.chat/network-broker'; import { startTracing } from '@rocket.chat/tracing'; import polka from 'polka'; import { StreamHub } from './StreamHub'; -import { DatabaseWatcher } from '../../../../apps/meteor/server/database/DatabaseWatcher'; const PORT = process.env.PORT || 3035; diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 91c7f58a835d..f48723ab4896 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -29,7 +29,7 @@ "mem": "^8.1.1", "moment-timezone": "^0.5.46", "mongo-message-queue": "^1.1.0", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "pino": "^8.21.0" }, "scripts": { diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 032f374cd43c..59e7eb3be06e 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -35,6 +35,6 @@ "@rocket.chat/core-services": "workspace:^", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/models": "workspace:^", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" } } diff --git a/package.json b/package.json index db4c79e048e0..60f0783bfc4a 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "homepage": "https://github.com/RocketChat/Rocket.Chat#readme", "engines": { "yarn": "4.5.3", - "node": "20.18.0", + "node": "22.11.0", "npm": "Use yarn instead" }, "packageManager": "yarn@4.5.3", @@ -54,7 +54,7 @@ ] }, "volta": { - "node": "20.18.0", + "node": "22.11.0", "yarn": "1.22.18" }, "resolutions": { @@ -65,7 +65,7 @@ "mongodb@^4.17.1": "patch:mongodb@npm:4.17.1#.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch", "typia@~6.9.0": "patch:typia@npm%3A6.9.0#./.yarn/patches/typia-npm-6.9.0-2fd4d85f25.patch", "moleculer@^0.14.34": "patch:moleculer@npm%3A0.14.34#./.yarn/patches/moleculer-npm-0.14.34-440e26767d.patch", - "mongodb@npm:^4.3.1": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + "mongodb": "6.10.0" }, "dependencies": { "@types/stream-buffers": "^3.0.7", diff --git a/packages/agenda/package.json b/packages/agenda/package.json index 6dfbc3e02eae..e5c28755b72c 100644 --- a/packages/agenda/package.json +++ b/packages/agenda/package.json @@ -9,7 +9,7 @@ "debug": "~4.3.7", "human-interval": "^2.0.1", "moment-timezone": "~0.5.46", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" }, "devDependencies": { "@types/debug": "^4.1.12", diff --git a/packages/agenda/src/Agenda.ts b/packages/agenda/src/Agenda.ts index 4cf17fa22cf0..d0c4e807aeed 100644 --- a/packages/agenda/src/Agenda.ts +++ b/packages/agenda/src/Agenda.ts @@ -3,7 +3,7 @@ import { EventEmitter } from 'events'; import debugInitializer from 'debug'; import humanInterval from 'human-interval'; import { MongoClient } from 'mongodb'; -import type { MongoClientOptions, Db, Document, Collection, ModifyResult, InsertOneResult } from 'mongodb'; +import type { MongoClientOptions, Db, Document, Collection, InsertOneResult } from 'mongodb'; import { Job } from './Job'; import { JobProcessingQueue } from './JobProcessingQueue'; @@ -428,21 +428,21 @@ export class Agenda extends EventEmitter { return record !== null; } - private async _processDbResult(job: Job, result: ModifyResult | InsertOneResult): Promise { + private async _processDbResult(job: Job, result: Document | InsertOneResult | null): Promise { + if (!result) { + return; + } + debug('processDbResult() called with success, checking whether to process job immediately or not'); // We have a result from the above calls // findOneAndUpdate() returns different results than insertOne() so check for that const res = await (async (): Promise => { - if ('value' in result) { - return result.value; - } - if ('insertedId' in result) { return this.getCollection().findOne({ _id: result.insertedId }); } - return null; + return result; })(); if (!res) { @@ -468,9 +468,9 @@ export class Agenda extends EventEmitter { // Update the job and process the resulting data' debug('job already has _id, calling findOneAndUpdate() using _id as query'); - const result = await this.getCollection().findOneAndUpdate({ _id: id }, update, { returnDocument: 'after' }); + const result = await this.getCollection().findOneAndUpdate({ _id: id } as any, update, { returnDocument: 'after' }); - return this._processDbResult(job, result); + result && this._processDbResult(job, result); } private async _saveSingleJob(job: Job, props: Record, now: Date): Promise { @@ -595,7 +595,7 @@ export class Agenda extends EventEmitter { } debug('about to unlock jobs with ids: %O', jobIds); - await this.getCollection().updateMany({ _id: { $in: jobIds } }, { $set: { lockedAt: null } }); + await this.getCollection().updateMany({ _id: { $in: jobIds } } as any, { $set: { lockedAt: null } }); this._lockedJobs = []; } @@ -662,9 +662,9 @@ export class Agenda extends EventEmitter { }); let job; - if (result.value) { - debug('found a job available to lock, creating a new job on Agenda with id [%s]', result.value._id); - job = createJob(this, result.value as unknown as IJob); + if (result) { + debug('found a job available to lock, creating a new job on Agenda with id [%s]', result._id); + job = createJob(this, result as unknown as IJob); } return job; @@ -748,10 +748,10 @@ export class Agenda extends EventEmitter { const update = { $set: { lockedAt: now } }; // Lock the job in MongoDB! - const resp = await this.getCollection().findOneAndUpdate(criteria, update, { returnDocument: 'after' }); + const resp = await this.getCollection().findOneAndUpdate(criteria as any, update, { returnDocument: 'after' }); - if (resp.value) { - const job = createJob(this, resp.value as unknown as IJob); + if (resp) { + const job = createJob(this, resp as unknown as IJob); debug('found job [%s] that can be locked on the fly', job.attrs.name); this._lockedJobs.push(job); this._definitions[job.attrs.name].locked++; diff --git a/packages/core-services/package.json b/packages/core-services/package.json index cdd8523ef524..8fe858931a1e 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -13,7 +13,7 @@ "babel-jest": "^29.7.0", "eslint": "~8.45.0", "jest": "~29.7.0", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "prettier": "~3.3.3", "typescript": "~5.7.2" }, diff --git a/packages/core-services/src/index.ts b/packages/core-services/src/index.ts index 2d490dfc19a8..dedbe3571aaa 100644 --- a/packages/core-services/src/index.ts +++ b/packages/core-services/src/index.ts @@ -148,12 +148,6 @@ export { IUserService, }; -const disabledEnvVar = String(process.env.DISABLE_DB_WATCHERS).toLowerCase(); - -export const dbWatchersDisabled = - (process.env.NODE_ENV === 'production' && ['yes', 'true'].includes(disabledEnvVar)) || - (process.env.NODE_ENV !== 'production' && !['no', 'false'].includes(disabledEnvVar)); - // TODO think in a way to not have to pass the service name to proxify here as well export const Authorization = proxify('authorization'); export const Apps = proxify('apps-engine'); diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index d8a871935c08..c98560888bf9 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -7,7 +7,7 @@ "@rocket.chat/apps-engine": "workspace:^", "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "prettier": "~3.3.3", "typescript": "~5.7.2" }, diff --git a/packages/cron/package.json b/packages/cron/package.json index 13b695799920..eddce50ed4b5 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -22,6 +22,6 @@ "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/models": "workspace:^", "@rocket.chat/random": "workspace:^", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" } } diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 91c105ae4266..ac70bce83dda 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -5,7 +5,7 @@ "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "prettier": "~3.3.3", "typescript": "~5.7.2" }, diff --git a/packages/instance-status/src/index.ts b/packages/instance-status/src/index.ts index 86f638e089c3..0f6869853501 100644 --- a/packages/instance-status/src/index.ts +++ b/packages/instance-status/src/index.ts @@ -35,7 +35,7 @@ let createIndexes = async () => { .then((result) => result.some((index) => { if (index.key && index.key._updatedAt === 1) { - if (index.expireAfterSeconds !== indexExpire) { + if (index.expireAfterSeconds !== indexExpire && index.name) { InstanceStatusModel.col.dropIndex(index.name); return false; } diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index a9a3255546f9..9f612a7d3a81 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -5,7 +5,7 @@ "devDependencies": { "@types/node-rsa": "^1.1.4", "eslint": "~8.45.0", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "typescript": "~5.7.2" }, "scripts": { diff --git a/packages/model-typings/src/models/IBaseModel.ts b/packages/model-typings/src/models/IBaseModel.ts index ad5aba3f8a15..9c40721d7501 100644 --- a/packages/model-typings/src/models/IBaseModel.ts +++ b/packages/model-typings/src/models/IBaseModel.ts @@ -15,7 +15,6 @@ import type { InsertManyResult, InsertOneOptions, InsertOneResult, - ModifyResult, OptionalId, UpdateFilter, UpdateOptions, @@ -54,8 +53,8 @@ export interface IBaseModel< getUpdater(): Updater; updateFromUpdater(query: Filter, updater: Updater): Promise; - findOneAndDelete(filter: Filter, options?: FindOneAndDeleteOptions): Promise>; - findOneAndUpdate(query: Filter, update: UpdateFilter | T, options?: FindOneAndUpdateOptions): Promise>; + findOneAndDelete(filter: Filter, options?: FindOneAndDeleteOptions): Promise>; + findOneAndUpdate(query: Filter, update: UpdateFilter | T, options?: FindOneAndUpdateOptions): Promise>; findOneById(_id: T['_id'], options?: FindOptions | undefined): Promise; findOneById

(_id: T['_id'], options?: FindOptions

): Promise

; diff --git a/packages/model-typings/src/models/IEmailInboxModel.ts b/packages/model-typings/src/models/IEmailInboxModel.ts index 93145041af74..94f0f761081f 100644 --- a/packages/model-typings/src/models/IEmailInboxModel.ts +++ b/packages/model-typings/src/models/IEmailInboxModel.ts @@ -1,12 +1,12 @@ import type { IEmailInbox } from '@rocket.chat/core-typings'; -import type { FindCursor, InsertOneResult, ModifyResult, UpdateFilter } from 'mongodb'; +import type { FindCursor, InsertOneResult, WithId, UpdateFilter } from 'mongodb'; import type { IBaseModel } from './IBaseModel'; export interface IEmailInboxModel extends IBaseModel { - setDisabledById(id: IEmailInbox['_id']): Promise>; + setDisabledById(id: IEmailInbox['_id']): Promise>; create(emailInbox: Omit): Promise>; - updateById(id: IEmailInbox['_id'], data: UpdateFilter): Promise>>; + updateById(id: IEmailInbox['_id'], data: UpdateFilter): Promise>>; findActive(): FindCursor; findByEmail(email: IEmailInbox['email']): Promise; } diff --git a/packages/model-typings/src/models/IInstanceStatusModel.ts b/packages/model-typings/src/models/IInstanceStatusModel.ts index f514ba074666..6d383e6da6a9 100644 --- a/packages/model-typings/src/models/IInstanceStatusModel.ts +++ b/packages/model-typings/src/models/IInstanceStatusModel.ts @@ -1,5 +1,5 @@ import type { IInstanceStatus } from '@rocket.chat/core-typings'; -import type { DeleteResult, ModifyResult, UpdateResult } from 'mongodb'; +import type { DeleteResult, UpdateResult } from 'mongodb'; import type { IBaseModel } from './IBaseModel'; @@ -8,6 +8,6 @@ export interface IInstanceStatusModel extends IBaseModel { getActiveInstancesAddress(): Promise; removeInstanceById(_id: IInstanceStatus['_id']): Promise; setDocumentHeartbeat(documentId: string): Promise; - upsertInstance(instance: Partial): Promise>; + upsertInstance(instance: Partial): Promise; updateConnections(_id: IInstanceStatus['_id'], conns: number): Promise; } diff --git a/packages/model-typings/src/models/ILivechatAgentActivityModel.ts b/packages/model-typings/src/models/ILivechatAgentActivityModel.ts index 8d14e3b6e423..58cd1299b90e 100644 --- a/packages/model-typings/src/models/ILivechatAgentActivityModel.ts +++ b/packages/model-typings/src/models/ILivechatAgentActivityModel.ts @@ -1,5 +1,5 @@ import type { ILivechatAgentActivity, IServiceHistory } from '@rocket.chat/core-typings'; -import type { AggregationCursor, FindCursor, Document, ModifyResult, UpdateResult } from 'mongodb'; +import type { AggregationCursor, FindCursor, Document, WithId, UpdateResult } from 'mongodb'; import type { IBaseModel } from './IBaseModel'; @@ -8,7 +8,7 @@ export interface ILivechatAgentActivityModel extends IBaseModel>, - ): Promise | undefined>; + ): Promise | undefined>; updateLastStoppedAt( params: Pick, diff --git a/packages/model-typings/src/models/ILivechatPriorityModel.ts b/packages/model-typings/src/models/ILivechatPriorityModel.ts index 18cf9c8aa2d9..a93deb838dc5 100644 --- a/packages/model-typings/src/models/ILivechatPriorityModel.ts +++ b/packages/model-typings/src/models/ILivechatPriorityModel.ts @@ -1,5 +1,5 @@ import type { ILivechatPriority } from '@rocket.chat/core-typings'; -import type { FindCursor, ModifyResult } from 'mongodb'; +import type { FindCursor, WithId } from 'mongodb'; import type { IBaseModel } from './IBaseModel'; @@ -9,5 +9,5 @@ export interface ILivechatPriorityModel extends IBaseModel { findByDirty(): FindCursor>; canResetPriorities(): Promise; resetPriorities(ids: ILivechatPriority['_id'][]): Promise; - updatePriority(_id: string, reset: boolean, name?: string): Promise>; + updatePriority(_id: string, reset: boolean, name?: string): Promise>; } diff --git a/packages/model-typings/src/models/ILivechatVisitorsModel.ts b/packages/model-typings/src/models/ILivechatVisitorsModel.ts index 998d9106cdf7..3289b31b03e9 100644 --- a/packages/model-typings/src/models/ILivechatVisitorsModel.ts +++ b/packages/model-typings/src/models/ILivechatVisitorsModel.ts @@ -8,7 +8,7 @@ import type { Document, UpdateFilter, FindOneAndUpdateOptions, - ModifyResult, + WithId, } from 'mongodb'; import type { FindPaginated, IBaseModel } from './IBaseModel'; @@ -56,7 +56,7 @@ export interface ILivechatVisitorsModel extends IBaseModel { updateById(_id: string, update: UpdateFilter): Promise; - updateOneByIdOrToken(update: UpdateFilter, options?: FindOneAndUpdateOptions): Promise>; + updateOneByIdOrToken(update: UpdateFilter, options?: FindOneAndUpdateOptions): Promise>; saveGuestEmailPhoneById(_id: string, emails: string[], phones: string[]): Promise; diff --git a/packages/model-typings/src/models/IMessagesModel.ts b/packages/model-typings/src/models/IMessagesModel.ts index f5452e957e8f..c5957a113ee3 100644 --- a/packages/model-typings/src/models/IMessagesModel.ts +++ b/packages/model-typings/src/models/IMessagesModel.ts @@ -18,7 +18,7 @@ import type { UpdateResult, Document, Filter, - ModifyResult, + WithId, } from 'mongodb'; import type { FindPaginated, IBaseModel } from './IBaseModel'; @@ -274,7 +274,7 @@ export interface IMessagesModel extends IBaseModel { getMessageByFileId(fileID: string): Promise; setThreadMessagesAsRead(tmid: string, until: Date): Promise; updateRepliesByThreadId(tmid: string, replies: string[], ts: Date): Promise; - refreshDiscussionMetadata(room: Pick): Promise>; + refreshDiscussionMetadata(room: Pick): Promise>; findUnreadThreadMessagesByDate( tmid: string, userId: string, @@ -290,7 +290,7 @@ export interface IMessagesModel extends IBaseModel { removeThreadFollowerByThreadId(tmid: string, userId: string): Promise; findThreadsByRoomId(rid: string, skip: number, limit: number): FindCursor; - decreaseReplyCountById(_id: string, inc?: number): Promise>; + decreaseReplyCountById(_id: string, inc?: number): Promise; countPinned(options?: CountDocumentsOptions): Promise; countStarred(options?: CountDocumentsOptions): Promise; } diff --git a/packages/model-typings/src/models/IRoomsModel.ts b/packages/model-typings/src/models/IRoomsModel.ts index 83932626ed6e..7db171804a41 100644 --- a/packages/model-typings/src/models/IRoomsModel.ts +++ b/packages/model-typings/src/models/IRoomsModel.ts @@ -7,8 +7,8 @@ import type { FindOptions, UpdateOptions, UpdateResult, - ModifyResult, CountDocumentsOptions, + WithId, } from 'mongodb'; import type { Updater } from '../updater'; @@ -308,7 +308,7 @@ export interface IRoomsModel extends IBaseModel { roomId: string, e2eKeyId: string, e2eQueue?: IRoom['usersWaitingForE2EKeys'], - ): Promise>; + ): Promise | null>; countGroupDMsByUids(uids: NonNullable): Promise; countByCreatedOTR(options?: CountDocumentsOptions): Promise; countByBroadcast(options?: CountDocumentsOptions): Promise; diff --git a/packages/model-typings/src/models/ISettingsModel.ts b/packages/model-typings/src/models/ISettingsModel.ts index c333cdf00f6f..19e7966dac5d 100644 --- a/packages/model-typings/src/models/ISettingsModel.ts +++ b/packages/model-typings/src/models/ISettingsModel.ts @@ -6,7 +6,7 @@ import type { Document, FindOptions, FindOneAndUpdateOptions, - ModifyResult, + WithId, UpdateOptions, } from 'mongodb'; @@ -32,7 +32,7 @@ export interface ISettingsModel extends IBaseModel { value?: (ISetting['value'] extends undefined ? never : ISetting['value']) | null, ): Promise; - incrementValueById(_id: ISetting['_id'], value?: ISetting['value'], options?: FindOneAndUpdateOptions): Promise>; + incrementValueById(_id: ISetting['_id'], value?: ISetting['value'], options?: FindOneAndUpdateOptions): Promise>; updateOptionsById( _id: ISetting['_id'], diff --git a/packages/model-typings/src/models/ISubscriptionsModel.ts b/packages/model-typings/src/models/ISubscriptionsModel.ts index ec01eccdbf81..e17831d282d1 100644 --- a/packages/model-typings/src/models/ISubscriptionsModel.ts +++ b/packages/model-typings/src/models/ISubscriptionsModel.ts @@ -12,7 +12,7 @@ import type { AggregationCursor, DeleteOptions, CountDocumentsOptions, - ModifyResult, + WithId, } from 'mongodb'; import type { IBaseModel } from './IBaseModel'; @@ -122,14 +122,14 @@ export interface ISubscriptionsModel extends IBaseModel { setGroupE2EKeyAndOldRoomKeys(_id: string, key: string, oldRoomKeys: ISubscription['oldRoomKeys']): Promise; - setGroupE2ESuggestedKey(uid: string, rid: string, key: string): Promise>; + setGroupE2ESuggestedKey(uid: string, rid: string, key: string): Promise>; setGroupE2ESuggestedKeyAndOldRoomKeys( uid: string, rid: string, key: string, suggestedOldRoomKeys: ISubscription['suggestedOldRoomKeys'], - ): Promise>; + ): Promise>; unsetGroupE2ESuggestedKeyAndOldRoomKeys(_id: string): Promise; @@ -324,6 +324,6 @@ export interface ISubscriptionsModel extends IBaseModel { openByRoomIdAndUserId(roomId: string, userId: string): Promise; countByRoomIdAndNotUserId(rid: string, uid: string): Promise; countByRoomIdWhenUsernameExists(rid: string): Promise; - setE2EKeyByUserIdAndRoomId(userId: string, rid: string, key: string): Promise>; + setE2EKeyByUserIdAndRoomId(userId: string, rid: string, key: string): Promise>; countUsersInRoles(roles: IRole['_id'][], rid: IRoom['_id'] | undefined): Promise; } diff --git a/packages/model-typings/src/models/IUsersModel.ts b/packages/model-typings/src/models/IUsersModel.ts index 315941a5bc68..b7b0b618b2c8 100644 --- a/packages/model-typings/src/models/IUsersModel.ts +++ b/packages/model-typings/src/models/IUsersModel.ts @@ -17,7 +17,7 @@ import type { Filter, InsertOneResult, DeleteResult, - ModifyResult, + WithId, UpdateOptions, } from 'mongodb'; @@ -404,7 +404,7 @@ export interface IUsersModel extends IBaseModel { ): Promise<{ sortedResults: (T & { departments: string[] })[]; totalCount: { total: number }[] }[]>; countByRole(roleName: string): Promise; removeEmailCodeOfUserId(userId: string): Promise; - incrementInvalidEmailCodeAttempt(userId: string): Promise>; + incrementInvalidEmailCodeAttempt(userId: string): Promise | null>; findOnlineButNotAvailableAgents(userIds: string[] | null): FindCursor>; findAgentsAvailableWithoutBusinessHours(userIds: string[] | null): FindCursor>; updateLivechatStatusByAgentIds(userIds: string[], status: ILivechatAgentStatus): Promise; diff --git a/apps/meteor/server/database/DatabaseWatcher.ts b/packages/models/src/DatabaseWatcher.ts similarity index 96% rename from apps/meteor/server/database/DatabaseWatcher.ts rename to packages/models/src/DatabaseWatcher.ts index a31027d71074..74344f8641af 100644 --- a/apps/meteor/server/database/DatabaseWatcher.ts +++ b/packages/models/src/DatabaseWatcher.ts @@ -44,9 +44,9 @@ export class DatabaseWatcher extends EventEmitter { /** * Last doc timestamp received from a real time event */ - private lastDocTS: Date; + private lastDocTS: Date | undefined; - private watchCollections: string[]; + private watchCollections: string[] | undefined; // eslint-disable-next-line @typescript-eslint/naming-convention constructor({ db, _oplogHandle, metrics, logger: LoggerClass }: { db: Db; _oplogHandle?: any; metrics?: any; logger: typeof Logger }) { @@ -127,7 +127,7 @@ export class DatabaseWatcher extends EventEmitter { const stream = cursor.stream(); stream.on('data', (doc) => { - const doesMatter = this.watchCollections.some((collection) => doc.ns === `${dbName}.${collection}`); + const doesMatter = this.watchCollections?.some((collection) => doc.ns === `${dbName}.${collection}`); if (!doesMatter) { return; } @@ -149,7 +149,7 @@ export class DatabaseWatcher extends EventEmitter { this.logger.startup('Using Meteor oplog'); - this.watchCollections.forEach((collection) => { + this.watchCollections?.forEach((collection) => { this._oplogHandle.onOplogEntry({ collection }, (event: any) => { this.emitDoc(collection, convertOplogPayload(event)); }); diff --git a/apps/meteor/server/database/convertChangeStreamPayload.ts b/packages/models/src/convertChangeStreamPayload.ts similarity index 100% rename from apps/meteor/server/database/convertChangeStreamPayload.ts rename to packages/models/src/convertChangeStreamPayload.ts diff --git a/apps/meteor/server/database/convertOplogPayload.ts b/packages/models/src/convertOplogPayload.ts similarity index 100% rename from apps/meteor/server/database/convertOplogPayload.ts rename to packages/models/src/convertOplogPayload.ts diff --git a/packages/models/src/dummy/BaseDummy.ts b/packages/models/src/dummy/BaseDummy.ts index c30208df4d6c..c161b23584b6 100644 --- a/packages/models/src/dummy/BaseDummy.ts +++ b/packages/models/src/dummy/BaseDummy.ts @@ -13,7 +13,6 @@ import type { InsertManyResult, InsertOneOptions, InsertOneResult, - ModifyResult, UpdateFilter, UpdateOptions, UpdateResult, @@ -54,18 +53,12 @@ export class BaseDummy< return this.collectionName; } - async findOneAndDelete(): Promise> { - return { - value: null, - ok: 1, - }; + async findOneAndDelete(): Promise | null> { + return null; } - async findOneAndUpdate(): Promise> { - return { - value: null, - ok: 1, - }; + async findOneAndUpdate(): Promise | null> { + return null; } findOneById(_id: T['_id'], options?: FindOptions | undefined): Promise; diff --git a/packages/models/src/index.ts b/packages/models/src/index.ts index d8f8c67ad3b2..38a6bc192a02 100644 --- a/packages/models/src/index.ts +++ b/packages/models/src/index.ts @@ -123,7 +123,14 @@ export function getCollectionName(name: string): string { return `${prefix}${name}`; } +const disabledEnvVar = String(process.env.DISABLE_DB_WATCHERS).toLowerCase(); + +export const dbWatchersDisabled = + (process.env.NODE_ENV === 'production' && ['yes', 'true'].includes(disabledEnvVar)) || + (process.env.NODE_ENV !== 'production' && !['no', 'false'].includes(disabledEnvVar)); + export * from './modelClasses'; +export * from './DatabaseWatcher'; export * from './dummy/ReadReceipts'; diff --git a/packages/models/src/models/BaseRaw.ts b/packages/models/src/models/BaseRaw.ts index b1d8eb352a1c..b3045c9cc2a0 100644 --- a/packages/models/src/models/BaseRaw.ts +++ b/packages/models/src/models/BaseRaw.ts @@ -12,7 +12,6 @@ import type { FindOneAndUpdateOptions, IndexDescription, InsertOneOptions, - ModifyResult, OptionalUnlessRequiredId, UpdateFilter, WithId, @@ -175,7 +174,7 @@ export abstract class BaseRaw< }; } - public findOneAndUpdate(query: Filter, update: UpdateFilter | T, options?: FindOneAndUpdateOptions): Promise> { + public findOneAndUpdate(query: Filter, update: UpdateFilter | T, options?: FindOneAndUpdateOptions): Promise | null> { this.setUpdatedAt(update); return this.col.findOneAndUpdate(query, update, options || {}); } @@ -325,14 +324,14 @@ export abstract class BaseRaw< return this.col.deleteOne(filter); } - async findOneAndDelete(filter: Filter, options?: FindOneAndDeleteOptions): Promise> { + async findOneAndDelete(filter: Filter, options?: FindOneAndDeleteOptions): Promise | null> { if (!this.trash) { return this.col.findOneAndDelete(filter, options || {}); } const doc = await this.col.findOne(filter); if (!doc) { - return { ok: 1, value: null }; + return null; } const { _id, ...record } = doc; @@ -353,7 +352,7 @@ export abstract class BaseRaw< throw e; } - return { ok: 1, value: doc }; + return doc as WithId; } async deleteMany(filter: Filter, options?: DeleteOptions & { onTrash?: (record: ResultFields) => void }): Promise { diff --git a/packages/models/src/models/EmailInbox.ts b/packages/models/src/models/EmailInbox.ts index edb17c8f8616..2e45f33743b4 100644 --- a/packages/models/src/models/EmailInbox.ts +++ b/packages/models/src/models/EmailInbox.ts @@ -1,6 +1,6 @@ import type { IEmailInbox, RocketChatRecordDeleted } from '@rocket.chat/core-typings'; import type { IEmailInboxModel } from '@rocket.chat/model-typings'; -import type { Collection, Db, FindCursor, IndexDescription, InsertOneResult, ModifyResult, UpdateFilter } from 'mongodb'; +import type { Collection, Db, FindCursor, IndexDescription, InsertOneResult, UpdateFilter, WithId } from 'mongodb'; import { BaseRaw } from './BaseRaw'; @@ -13,7 +13,7 @@ export class EmailInboxRaw extends BaseRaw implements IEmailInboxMo return [{ key: { email: 1 }, unique: true }]; } - async setDisabledById(id: IEmailInbox['_id']): Promise> { + async setDisabledById(id: IEmailInbox['_id']): Promise> { return this.findOneAndUpdate({ _id: id, active: true }, { $set: { active: false } }, { returnDocument: 'after' }); } @@ -21,11 +21,12 @@ export class EmailInboxRaw extends BaseRaw implements IEmailInboxMo return this.insertOne(emailInbox); } - async updateById(id: IEmailInbox['_id'], data: UpdateFilter): Promise>> { + async updateById(id: IEmailInbox['_id'], data: UpdateFilter): Promise>> { // findOneAndUpdate doesn't accept generics, so we had to type cast - return this.findOneAndUpdate({ _id: id }, data, { returnDocument: 'after', projection: { _id: 1 } }) as unknown as Promise< - ModifyResult> - >; + return this.findOneAndUpdate({ _id: id }, data, { + returnDocument: 'after', + projection: { _id: 1 }, + }) as unknown as Promise>>; } findActive(): FindCursor { diff --git a/packages/models/src/models/InstanceStatus.ts b/packages/models/src/models/InstanceStatus.ts index 86aed7fbc128..55acda7c9195 100644 --- a/packages/models/src/models/InstanceStatus.ts +++ b/packages/models/src/models/InstanceStatus.ts @@ -1,6 +1,6 @@ import type { IInstanceStatus } from '@rocket.chat/core-typings'; import type { IInstanceStatusModel } from '@rocket.chat/model-typings'; -import type { Db, ModifyResult, UpdateResult, DeleteResult } from 'mongodb'; +import type { Db, UpdateResult, DeleteResult } from 'mongodb'; import { BaseRaw } from './BaseRaw'; @@ -31,7 +31,7 @@ export class InstanceStatusRaw extends BaseRaw implements IInst return this.updateOne({ _id: documentId }, { $currentDate: { _updatedAt: true } }); } - async upsertInstance(instance: Partial): Promise> { + async upsertInstance(instance: Partial): Promise { return this.findOneAndUpdate( { _id: instance._id, diff --git a/packages/models/src/models/IntegrationHistory.ts b/packages/models/src/models/IntegrationHistory.ts index 317bdf41caf0..09007df7ee04 100644 --- a/packages/models/src/models/IntegrationHistory.ts +++ b/packages/models/src/models/IntegrationHistory.ts @@ -33,7 +33,6 @@ export class IntegrationHistoryRaw extends BaseRaw implemen data: Partial, options?: FindOneAndUpdateOptions, ): Promise { - const response = await this.findOneAndUpdate({ _id }, { $set: data }, { returnDocument: 'after', ...options }); - return response.value; + return this.findOneAndUpdate({ _id }, { $set: data }, { returnDocument: 'after', ...options }); } } diff --git a/packages/models/src/models/LivechatAgentActivity.ts b/packages/models/src/models/LivechatAgentActivity.ts index c40f5e15e238..9c6fbc074a4e 100644 --- a/packages/models/src/models/LivechatAgentActivity.ts +++ b/packages/models/src/models/LivechatAgentActivity.ts @@ -1,7 +1,7 @@ import type { ILivechatAgentActivity, IServiceHistory, RocketChatRecordDeleted } from '@rocket.chat/core-typings'; import type { ILivechatAgentActivityModel } from '@rocket.chat/model-typings'; import moment from 'moment'; -import type { AggregationCursor, Collection, Document, FindCursor, Db, ModifyResult, IndexDescription, UpdateResult } from 'mongodb'; +import type { AggregationCursor, Collection, Document, FindCursor, Db, WithId, IndexDescription, UpdateResult } from 'mongodb'; import { BaseRaw } from './BaseRaw'; import { readSecondaryPreferred } from '../readSecondaryPreferred'; @@ -21,11 +21,11 @@ export class LivechatAgentActivityRaw extends BaseRaw im async createOrUpdate( data: Partial> = {}, - ): Promise | undefined> { + ): Promise> { const { date, agentId, lastStartedAt } = data; if (!date || !agentId) { - return; + return null; } return this.findOneAndUpdate( diff --git a/packages/models/src/models/LivechatContacts.ts b/packages/models/src/models/LivechatContacts.ts index ed84fd64d18c..584b7aa0acb7 100644 --- a/packages/models/src/models/LivechatContacts.ts +++ b/packages/models/src/models/LivechatContacts.ts @@ -115,7 +115,7 @@ export class LivechatContactsRaw extends BaseRaw implements IL { $set: { ...data, unknown: false, ...(data.channels && { preRegistration: !data.channels.length }) } }, { returnDocument: 'after', ...options }, ); - return updatedValue.value as ILivechatContact; + return updatedValue as ILivechatContact; } updateById(contactId: string, update: UpdateFilter, options?: UpdateOptions): Promise { @@ -278,7 +278,7 @@ export class LivechatContactsRaw extends BaseRaw implements IL async addEmail(contactId: string, email: string): Promise { const updatedContact = await this.findOneAndUpdate({ _id: contactId }, { $addToSet: { emails: { address: email } } }); - return updatedContact.value; + return updatedContact; } countByContactInfo({ contactId, email, phone }: { contactId?: string; email?: string; phone?: string }): Promise { diff --git a/packages/models/src/models/LivechatDepartmentAgents.ts b/packages/models/src/models/LivechatDepartmentAgents.ts index 62e9db5bc265..ddba2ac933f9 100644 --- a/packages/models/src/models/LivechatDepartmentAgents.ts +++ b/packages/models/src/models/LivechatDepartmentAgents.ts @@ -223,9 +223,7 @@ export class LivechatDepartmentAgentsRaw extends BaseRaw { @@ -351,9 +349,7 @@ export class LivechatDepartmentAgentsRaw extends BaseRaw { diff --git a/packages/models/src/models/LivechatInquiry.ts b/packages/models/src/models/LivechatInquiry.ts index f79e234db84b..3caee4626d27 100644 --- a/packages/models/src/models/LivechatInquiry.ts +++ b/packages/models/src/models/LivechatInquiry.ts @@ -7,7 +7,6 @@ import type { Document, FindOptions, DistinctOptions, - ModifyResult, UpdateResult, Filter, DeleteResult, @@ -15,6 +14,7 @@ import type { FindCursor, UpdateFilter, DeleteOptions, + WithId, } from 'mongodb'; import { BaseRaw } from './BaseRaw'; @@ -138,13 +138,11 @@ export class LivechatInquiryRaw extends BaseRaw implemen } async setDepartmentByInquiryId(inquiryId: string, department: string): Promise { - const updated = await this.findOneAndUpdate({ _id: inquiryId }, { $set: { department } }, { returnDocument: 'after' }); - return updated?.value; + return this.findOneAndUpdate({ _id: inquiryId }, { $set: { department } }, { returnDocument: 'after' }); } async setLastMessageByRoomId(rid: ILivechatInquiryRecord['rid'], message: IMessage): Promise { - const updated = await this.findOneAndUpdate({ rid }, { $set: { lastMessage: message } }, { returnDocument: 'after' }); - return updated?.value; + return this.findOneAndUpdate({ rid }, { $set: { lastMessage: message } }, { returnDocument: 'after' }); } async findNextAndLock( @@ -152,7 +150,7 @@ export class LivechatInquiryRaw extends BaseRaw implemen department?: string, ): Promise { const date = new Date(); - const result = await this.findOneAndUpdate( + return this.findOneAndUpdate( { status: LivechatInquiryStatus.QUEUED, ...(department ? { department } : { department: { $exists: false } }), @@ -179,8 +177,6 @@ export class LivechatInquiryRaw extends BaseRaw implemen sort: queueSortBy, }, ); - - return result.value; } async unlock(inquiryId: string): Promise { @@ -264,11 +260,11 @@ export class LivechatInquiryRaw extends BaseRaw implemen .toArray(); } - setSlaForRoom(_rid: string, _data: { estimatedWaitingTimeQueue: number; slaId: string }): Promise> { + setSlaForRoom(_rid: string, _data: { estimatedWaitingTimeQueue: number; slaId: string }): Promise> { throw new Error('Method not implemented on the community edition.'); } - unsetSlaForRoom(_roomId: string): Promise> { + unsetSlaForRoom(_roomId: string): Promise> { throw new Error('Method not implemented on the community edition.'); } @@ -276,11 +272,11 @@ export class LivechatInquiryRaw extends BaseRaw implemen throw new Error('Method not implemented on the community edition.'); } - setPriorityForRoom(_rid: string, _priority: Pick): Promise> { + setPriorityForRoom(_rid: string, _priority: Pick): Promise> { throw new Error('Method not implemented on the community edition.'); } - unsetPriorityForRoom(_rid: string): Promise> { + unsetPriorityForRoom(_rid: string): Promise> { throw new Error('Method not implemented on the community edition.'); } @@ -316,7 +312,7 @@ export class LivechatInquiryRaw extends BaseRaw implemen } async queueInquiry(inquiryId: string): Promise { - const result = await this.findOneAndUpdate( + return this.findOneAndUpdate( { _id: inquiryId, }, @@ -326,8 +322,6 @@ export class LivechatInquiryRaw extends BaseRaw implemen }, { returnDocument: 'after' }, ); - - return result?.value; } queueInquiryAndRemoveDefaultAgent(inquiryId: string): Promise { @@ -410,11 +404,11 @@ export class LivechatInquiryRaw extends BaseRaw implemen }, ); - if (!result.value) { + if (!result) { throw new Error('error-failed-to-set-inquiry-status'); } - return result.value; + return result; } setNameByRoomId(rid: string, name: string): Promise { @@ -457,8 +451,7 @@ export class LivechatInquiryRaw extends BaseRaw implemen } async markInquiryActiveForPeriod(rid: ILivechatInquiryRecord['rid'], period: string): Promise { - const updated = await this.findOneAndUpdate({ rid }, { $addToSet: { 'v.activity': period } }); - return updated?.value; + return this.findOneAndUpdate({ rid }, { $addToSet: { 'v.activity': period } }); } updateNameByVisitorIds(visitorIds: string[], name: string): Promise { diff --git a/packages/models/src/models/LivechatPriority.ts b/packages/models/src/models/LivechatPriority.ts index d7a8d172e518..13da14b300fe 100644 --- a/packages/models/src/models/LivechatPriority.ts +++ b/packages/models/src/models/LivechatPriority.ts @@ -1,7 +1,7 @@ import type { ILivechatPriority } from '@rocket.chat/core-typings'; import type { ILivechatPriorityModel } from '@rocket.chat/model-typings'; import { escapeRegExp } from '@rocket.chat/string-helpers'; -import type { Db, UpdateFilter, ModifyResult, IndexDescription, FindCursor } from 'mongodb'; +import type { Db, UpdateFilter, WithId, IndexDescription, FindCursor } from 'mongodb'; import { BaseRaw } from './BaseRaw'; @@ -60,7 +60,7 @@ export class LivechatPriorityRaw extends BaseRaw implements I await this.updateMany({ _id: { $in: ids } }, [{ $set: { dirty: false } }, { $unset: 'name' }]); } - async updatePriority(_id: string, reset: boolean, name?: string): Promise> { + async updatePriority(_id: string, reset: boolean, name?: string): Promise> { const query = { _id, }; diff --git a/packages/models/src/models/LivechatRooms.ts b/packages/models/src/models/LivechatRooms.ts index 6e03b422cc78..ea3124200afc 100644 --- a/packages/models/src/models/LivechatRooms.ts +++ b/packages/models/src/models/LivechatRooms.ts @@ -1908,8 +1908,7 @@ export class LivechatRoomsRaw extends BaseRaw implements ILive } async updateRoomCount() { - const livechatCount = await Settings.incrementValueById('Livechat_Room_Count', 1, { returnDocument: 'after' }); - return livechatCount.value; + return Settings.incrementValueById('Livechat_Room_Count', 1, { returnDocument: 'after' }); } findOpenByVisitorToken(visitorToken: string, options: FindOptions = {}, extraQuery: Filter = {}) { diff --git a/packages/models/src/models/LivechatVisitors.ts b/packages/models/src/models/LivechatVisitors.ts index d6d9f45ef778..56c3bb76c1f2 100644 --- a/packages/models/src/models/LivechatVisitors.ts +++ b/packages/models/src/models/LivechatVisitors.ts @@ -13,7 +13,7 @@ import type { IndexDescription, DeleteResult, UpdateFilter, - ModifyResult, + WithId, FindOneAndUpdateOptions, } from 'mongodb'; import { ObjectId } from 'mongodb'; @@ -125,11 +125,11 @@ export class LivechatVisitorsRaw extends BaseRaw implements IL // TODO remove dependency from another model - this logic should be inside a service/function const livechatCount = await Settings.incrementValueById('Livechat_guest_count', 1, { returnDocument: 'after' }); - if (!livechatCount.value) { + if (!livechatCount) { throw new Error("Can't find Livechat_guest_count setting"); } - return `guest-${livechatCount.value.value}`; + return `guest-${livechatCount.value}`; } findByNameRegexWithExceptionsAndConditions

( @@ -289,7 +289,7 @@ export class LivechatVisitorsRaw extends BaseRaw implements IL async updateOneByIdOrToken( update: Partial, options?: FindOneAndUpdateOptions, - ): Promise> { + ): Promise> { let query: Filter = {}; if (update._id) { diff --git a/packages/models/src/models/Messages.ts b/packages/models/src/models/Messages.ts index 22e3243bdca2..305556d77718 100644 --- a/packages/models/src/models/Messages.ts +++ b/packages/models/src/models/Messages.ts @@ -27,7 +27,7 @@ import type { UpdateResult, Document, UpdateFilter, - ModifyResult, + WithId, } from 'mongodb'; import { BaseRaw } from './BaseRaw'; @@ -1641,7 +1641,7 @@ export class MessagesRaw extends BaseRaw implements IMessagesModel { * to race conditions: If multiple updates occur, the current state will be updated * only if the new state of the discussion room is really newer. */ - async refreshDiscussionMetadata(room: Pick): Promise> { + async refreshDiscussionMetadata(room: Pick): Promise> { const { _id: drid, msgs: dcount, lm: dlm } = room; const query = { @@ -1774,7 +1774,7 @@ export class MessagesRaw extends BaseRaw implements IMessagesModel { return this.col.countDocuments(query); } - decreaseReplyCountById(_id: string, inc = -1): Promise> { + decreaseReplyCountById(_id: string, inc = -1): Promise { const query = { _id }; const update: UpdateFilter = { $inc: { diff --git a/packages/models/src/models/NotificationQueue.ts b/packages/models/src/models/NotificationQueue.ts index 0832844a21bf..e3af2d80d4b9 100644 --- a/packages/models/src/models/NotificationQueue.ts +++ b/packages/models/src/models/NotificationQueue.ts @@ -97,6 +97,6 @@ export class NotificationQueueRaw extends BaseRaw implements INot }, ); - return result.value; + return result; } } diff --git a/packages/models/src/models/Nps.ts b/packages/models/src/models/Nps.ts index 1a12f68bff21..22588760c632 100644 --- a/packages/models/src/models/Nps.ts +++ b/packages/models/src/models/Nps.ts @@ -27,7 +27,7 @@ export class NpsRaw extends BaseRaw implements INpsModel { status: NPSStatus.SENDING, }, }; - const { value } = await this.findOneAndUpdate(query, update, { sort: { expireAt: 1 } }); + const value = await this.findOneAndUpdate(query, update, { sort: { expireAt: 1 } }); return value; } diff --git a/packages/models/src/models/Roles.ts b/packages/models/src/models/Roles.ts index d731cf54fe72..cda6984c5456 100644 --- a/packages/models/src/models/Roles.ts +++ b/packages/models/src/models/Roles.ts @@ -172,11 +172,12 @@ export class RolesRaw extends BaseRaw implements IRolesModel { { upsert: true, returnDocument: 'after' }, ); - if (!response.value) { + if (!response) { + console.log('Role not found', _id, name); throw new Error('Role not found'); } - return response.value; + return response; } findUsersInRole(roleId: IRole['_id'], scope?: IRoom['_id']): Promise>; diff --git a/packages/models/src/models/Rooms.ts b/packages/models/src/models/Rooms.ts index b010f58e2e23..5393187f9f46 100644 --- a/packages/models/src/models/Rooms.ts +++ b/packages/models/src/models/Rooms.ts @@ -23,7 +23,7 @@ import type { UpdateFilter, UpdateOptions, UpdateResult, - ModifyResult, + WithId, CountDocumentsOptions, } from 'mongodb'; @@ -2199,7 +2199,7 @@ export class RoomsRaw extends BaseRaw implements IRoomsModel { roomId: string, e2eKeyId: string, e2eQueue?: IRoom['usersWaitingForE2EKeys'], - ): Promise> { + ): Promise> { return this.findOneAndUpdate( { _id: roomId }, { $set: { e2eKeyId, ...(Array.isArray(e2eQueue) && { usersWaitingForE2EKeys: e2eQueue }) } }, diff --git a/packages/models/src/models/Settings.ts b/packages/models/src/models/Settings.ts index a9c0e0a31269..dc434f480b37 100644 --- a/packages/models/src/models/Settings.ts +++ b/packages/models/src/models/Settings.ts @@ -10,7 +10,7 @@ import type { Document, FindOptions, FindOneAndUpdateOptions, - ModifyResult, + WithId, UpdateOptions, } from 'mongodb'; @@ -105,7 +105,7 @@ export class SettingsRaw extends BaseRaw implements ISettingsModel { _id: ISetting['_id'], value?: ISetting['value'], options?: FindOneAndUpdateOptions, - ): Promise> { + ): Promise> { return this.findOneAndUpdate( { blocked: { $ne: true }, diff --git a/packages/models/src/models/Subscriptions.ts b/packages/models/src/models/Subscriptions.ts index ba28b6da843a..0b63c694f8b9 100644 --- a/packages/models/src/models/Subscriptions.ts +++ b/packages/models/src/models/Subscriptions.ts @@ -29,7 +29,7 @@ import type { AggregationCursor, CountDocumentsOptions, DeleteOptions, - ModifyResult, + WithId, } from 'mongodb'; import { Rooms, Users } from '../index'; @@ -628,13 +628,13 @@ export class SubscriptionsRaw extends BaseRaw implements ISubscri return this.updateOne(query, update); } - setGroupE2ESuggestedKey(uid: string, rid: string, key: string): Promise> { + setGroupE2ESuggestedKey(uid: string, rid: string, key: string): Promise> { const query = { rid, 'u._id': uid }; const update = { $set: { E2ESuggestedKey: key } }; return this.findOneAndUpdate(query, update, { returnDocument: 'after' }); } - setE2EKeyByUserIdAndRoomId(userId: string, rid: string, key: string): Promise> { + setE2EKeyByUserIdAndRoomId(userId: string, rid: string, key: string): Promise> { const query = { rid, 'u._id': userId }; const update = { $set: { E2EKey: key } }; @@ -646,7 +646,7 @@ export class SubscriptionsRaw extends BaseRaw implements ISubscri rid: string, key: string, suggestedOldRoomKeys?: ISubscription['suggestedOldRoomKeys'], - ): Promise> { + ): Promise> { const query = { rid, 'u._id': uid }; const update = { $set: { E2ESuggestedKey: key, ...(suggestedOldRoomKeys && { suggestedOldRoomKeys }) } }; return this.findOneAndUpdate(query, update, { returnDocument: 'after' }); @@ -899,7 +899,6 @@ export class SubscriptionsRaw extends BaseRaw implements ISubscri [notificationPrefOrigin]: 1, }; } else { - // @ts-expect-error TODO: fix this update.$set = { [notificationField]: notificationPref.value, [notificationPrefOrigin]: notificationPref.origin, @@ -1236,12 +1235,10 @@ export class SubscriptionsRaw extends BaseRaw implements ISubscri } findByRoomIdAndUserIdsOrAllMessages(roomId: string, userIds: string[]): FindCursor { - const query = { + return this.find({ rid: roomId, $or: [{ 'u._id': { $in: userIds } }, { emailNotifications: 'all' }], - }; - - return this.find(query); + }); } findByRoomIdWhenUserIdExists(rid: string, options?: FindOptions): FindCursor { @@ -1771,7 +1768,6 @@ export class SubscriptionsRaw extends BaseRaw implements ISubscri }; const update: UpdateFilter = { - // @ts-expect-error - :( $set: { [notificationField]: userPref, [notificationOriginField]: 'user', @@ -1924,7 +1920,7 @@ export class SubscriptionsRaw extends BaseRaw implements ISubscri 'u._id': userId, }; - const { value: doc } = await this.findOneAndDelete(query); + const doc = await this.findOneAndDelete(query); if (doc) { await Rooms.incUsersCountById(roomId, -1); diff --git a/packages/models/src/models/Users.js b/packages/models/src/models/Users.js index 88b872d4fced..891b927bb9cd 100644 --- a/packages/models/src/models/Users.js +++ b/packages/models/src/models/Users.js @@ -1707,10 +1707,10 @@ export class UsersRaw extends BaseRaw { }; const user = await this.findOneAndUpdate(query, update, { sort, returnDocument: 'after' }); - if (user && user.value) { + if (user) { return { - agentId: user.value._id, - username: user.value.username, + agentId: user._id, + username: user.username, }; } return null; @@ -1737,10 +1737,10 @@ export class UsersRaw extends BaseRaw { }; const user = await this.findOneAndUpdate(query, update, { sort, returnDocument: 'after' }); - if (user?.value) { + if (user) { return { - agentId: user.value._id, - username: user.value.username, + agentId: user._id, + username: user.username, }; } return null; diff --git a/packages/models/src/models/VideoConference.ts b/packages/models/src/models/VideoConference.ts index 0f631cf2d301..2d2175926c7b 100644 --- a/packages/models/src/models/VideoConference.ts +++ b/packages/models/src/models/VideoConference.ts @@ -141,7 +141,7 @@ export class VideoConferenceRaw extends BaseRaw implements IVid const { externalId, ...data } = call; const doc = await this.findOneAndUpdate({ externalId }, { $set: data }, { upsert: true, returnDocument: 'after' }); - return doc.value?._id; + return doc?._id; } public updateOneById( diff --git a/apps/meteor/server/database/watchCollections.ts b/packages/models/src/watchCollections.ts similarity index 95% rename from apps/meteor/server/database/watchCollections.ts rename to packages/models/src/watchCollections.ts index b7bdf13c28b8..495a64f5dbfd 100644 --- a/apps/meteor/server/database/watchCollections.ts +++ b/packages/models/src/watchCollections.ts @@ -1,5 +1,5 @@ -import { dbWatchersDisabled } from '@rocket.chat/core-services'; import { + dbWatchersDisabled, Messages, Users, Subscriptions, @@ -16,7 +16,7 @@ import { PbxEvents, Permissions, LivechatPriority, -} from '@rocket.chat/models'; +} from './index'; const { DBWATCHER_EXCLUDE_COLLECTIONS = '', DBWATCHER_ONLY_COLLECTIONS = '' } = process.env; diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 8d97ba675f24..65466dea4245 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -7,7 +7,7 @@ "@types/jest": "~29.5.14", "eslint": "~8.45.0", "jest": "~29.7.0", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "typescript": "~5.7.2" }, "scripts": { diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 12b57338c08f..7e3570a9c3d5 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -14,7 +14,7 @@ "@types/use-sync-external-store": "^0.0.6", "eslint": "~8.45.0", "eslint-plugin-react-hooks": "^5.0.0", - "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", + "mongodb": "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch", "react": "~17.0.2", "typescript": "~5.7.2", "use-sync-external-store": "^1.2.2" diff --git a/turbo.json b/turbo.json index 0ae903f9250d..321147885024 100644 --- a/turbo.json +++ b/turbo.json @@ -47,12 +47,6 @@ "@rocket.chat/meteor#build:ci": { "dependsOn": ["^build"], "cache": false - }, - - "@rocket.chat/ddp-streamer#build": { - "dependsOn": ["^build"], - "outputs": ["dist/**"], - "inputs": ["../../../apps/meteor/server/**", "./src/**"] } } } diff --git a/yarn.lock b/yarn.lock index f89635795d11..cc569d59c4b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -100,871 +100,6 @@ __metadata: languageName: node linkType: hard -"@aws-crypto/ie11-detection@npm:^2.0.0": - version: 2.0.2 - resolution: "@aws-crypto/ie11-detection@npm:2.0.2" - dependencies: - tslib: "npm:^1.11.1" - checksum: 10/5da691461f4d3666fb5f93b863c5a959fd8e50dc3dab442326cf35febb2266fd7a37793fc592961e84dd09fb94c6d616787240d1287450fd23eac73c8d3e6b33 - languageName: node - linkType: hard - -"@aws-crypto/sha256-browser@npm:2.0.0": - version: 2.0.0 - resolution: "@aws-crypto/sha256-browser@npm:2.0.0" - dependencies: - "@aws-crypto/ie11-detection": "npm:^2.0.0" - "@aws-crypto/sha256-js": "npm:^2.0.0" - "@aws-crypto/supports-web-crypto": "npm:^2.0.0" - "@aws-crypto/util": "npm:^2.0.0" - "@aws-sdk/types": "npm:^3.1.0" - "@aws-sdk/util-locate-window": "npm:^3.0.0" - "@aws-sdk/util-utf8-browser": "npm:^3.0.0" - tslib: "npm:^1.11.1" - checksum: 10/285eaed27ba3356daa86c63e440553b2b35f11d829033bba6376a6c084f3707aa14ede39bceba7ba516fc7e67094fbb86ff99ee8915fe6f7c9aeb178be7f5c1c - languageName: node - linkType: hard - -"@aws-crypto/sha256-js@npm:2.0.0": - version: 2.0.0 - resolution: "@aws-crypto/sha256-js@npm:2.0.0" - dependencies: - "@aws-crypto/util": "npm:^2.0.0" - "@aws-sdk/types": "npm:^3.1.0" - tslib: "npm:^1.11.1" - checksum: 10/91115f2ddbf7d5549df225b84f059005ea6d9c6dbe03948f2088ec6d959eae9652b29484458fae8e11429467bc065dc5ef031f006b8faac3d1341c0e3393fbf1 - languageName: node - linkType: hard - -"@aws-crypto/sha256-js@npm:^2.0.0": - version: 2.0.2 - resolution: "@aws-crypto/sha256-js@npm:2.0.2" - dependencies: - "@aws-crypto/util": "npm:^2.0.2" - "@aws-sdk/types": "npm:^3.110.0" - tslib: "npm:^1.11.1" - checksum: 10/bd1a8e9eb346a97d073c655e17eab991072479a92f850fb0e40bb1a25609342cae1071cf480439bec288fb624667c8a0b2bb97641fc02ac6b6ed4ab37c49b7de - languageName: node - linkType: hard - -"@aws-crypto/supports-web-crypto@npm:^2.0.0": - version: 2.0.2 - resolution: "@aws-crypto/supports-web-crypto@npm:2.0.2" - dependencies: - tslib: "npm:^1.11.1" - checksum: 10/077877a46cf455c72f7d9ba19e70365d42fae5f9cee865ec3543cda0755d9cccb8fa2054d26c3280fb44760605f1b0875c56891a339b07ab77ff5450e81a147c - languageName: node - linkType: hard - -"@aws-crypto/util@npm:^2.0.0, @aws-crypto/util@npm:^2.0.2": - version: 2.0.2 - resolution: "@aws-crypto/util@npm:2.0.2" - dependencies: - "@aws-sdk/types": "npm:^3.110.0" - "@aws-sdk/util-utf8-browser": "npm:^3.0.0" - tslib: "npm:^1.11.1" - checksum: 10/26b18ca19e2fae731be2b602d3b21b3ff40058431b8a4e41b12249d28dabadffcb5fde76ab04762408cfecf5d8a8e964b335d69eb22774e1d5ab6a1c154893f7 - languageName: node - linkType: hard - -"@aws-sdk/abort-controller@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/abort-controller@npm:3.215.0" - dependencies: - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/667e261fe7a2899092e0ece8f80feb44bba33492829e2fc817c1a1bb5549f4adee361a8bb2476219ea83ee38a207782beda9a503590b1b1547d8e3b03b50108a - languageName: node - linkType: hard - -"@aws-sdk/client-cognito-identity@npm:3.218.0": - version: 3.218.0 - resolution: "@aws-sdk/client-cognito-identity@npm:3.218.0" - dependencies: - "@aws-crypto/sha256-browser": "npm:2.0.0" - "@aws-crypto/sha256-js": "npm:2.0.0" - "@aws-sdk/client-sts": "npm:3.218.0" - "@aws-sdk/config-resolver": "npm:3.215.0" - "@aws-sdk/credential-provider-node": "npm:3.218.0" - "@aws-sdk/fetch-http-handler": "npm:3.215.0" - "@aws-sdk/hash-node": "npm:3.215.0" - "@aws-sdk/invalid-dependency": "npm:3.215.0" - "@aws-sdk/middleware-content-length": "npm:3.215.0" - "@aws-sdk/middleware-endpoint": "npm:3.215.0" - "@aws-sdk/middleware-host-header": "npm:3.215.0" - "@aws-sdk/middleware-logger": "npm:3.215.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.215.0" - "@aws-sdk/middleware-retry": "npm:3.215.0" - "@aws-sdk/middleware-serde": "npm:3.215.0" - "@aws-sdk/middleware-signing": "npm:3.215.0" - "@aws-sdk/middleware-stack": "npm:3.215.0" - "@aws-sdk/middleware-user-agent": "npm:3.215.0" - "@aws-sdk/node-config-provider": "npm:3.215.0" - "@aws-sdk/node-http-handler": "npm:3.215.0" - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/smithy-client": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - "@aws-sdk/url-parser": "npm:3.215.0" - "@aws-sdk/util-base64": "npm:3.208.0" - "@aws-sdk/util-body-length-browser": "npm:3.188.0" - "@aws-sdk/util-body-length-node": "npm:3.208.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.215.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.215.0" - "@aws-sdk/util-endpoints": "npm:3.216.0" - "@aws-sdk/util-user-agent-browser": "npm:3.215.0" - "@aws-sdk/util-user-agent-node": "npm:3.215.0" - "@aws-sdk/util-utf8-browser": "npm:3.188.0" - "@aws-sdk/util-utf8-node": "npm:3.208.0" - tslib: "npm:^2.3.1" - checksum: 10/452a400fe2eb764c40c11f795bbb41115f7eb1916e0b94c5232a10c594ce13560f4cb5360396cc9e075c5fb736441df201c9ecbbf92131acfff10caa45e894c5 - languageName: node - linkType: hard - -"@aws-sdk/client-sso-oidc@npm:3.216.0": - version: 3.216.0 - resolution: "@aws-sdk/client-sso-oidc@npm:3.216.0" - dependencies: - "@aws-crypto/sha256-browser": "npm:2.0.0" - "@aws-crypto/sha256-js": "npm:2.0.0" - "@aws-sdk/config-resolver": "npm:3.215.0" - "@aws-sdk/fetch-http-handler": "npm:3.215.0" - "@aws-sdk/hash-node": "npm:3.215.0" - "@aws-sdk/invalid-dependency": "npm:3.215.0" - "@aws-sdk/middleware-content-length": "npm:3.215.0" - "@aws-sdk/middleware-endpoint": "npm:3.215.0" - "@aws-sdk/middleware-host-header": "npm:3.215.0" - "@aws-sdk/middleware-logger": "npm:3.215.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.215.0" - "@aws-sdk/middleware-retry": "npm:3.215.0" - "@aws-sdk/middleware-serde": "npm:3.215.0" - "@aws-sdk/middleware-stack": "npm:3.215.0" - "@aws-sdk/middleware-user-agent": "npm:3.215.0" - "@aws-sdk/node-config-provider": "npm:3.215.0" - "@aws-sdk/node-http-handler": "npm:3.215.0" - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/smithy-client": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - "@aws-sdk/url-parser": "npm:3.215.0" - "@aws-sdk/util-base64": "npm:3.208.0" - "@aws-sdk/util-body-length-browser": "npm:3.188.0" - "@aws-sdk/util-body-length-node": "npm:3.208.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.215.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.215.0" - "@aws-sdk/util-endpoints": "npm:3.216.0" - "@aws-sdk/util-user-agent-browser": "npm:3.215.0" - "@aws-sdk/util-user-agent-node": "npm:3.215.0" - "@aws-sdk/util-utf8-browser": "npm:3.188.0" - "@aws-sdk/util-utf8-node": "npm:3.208.0" - tslib: "npm:^2.3.1" - checksum: 10/236ddcc75dede8fd9e3dbfafa88022311fe5b7a88601bfb77758e50523ff3c820358348af5eb4f856a5b1910de3e5f50e098f8ef87a935c1f08469bfe72f5ef1 - languageName: node - linkType: hard - -"@aws-sdk/client-sso@npm:3.218.0": - version: 3.218.0 - resolution: "@aws-sdk/client-sso@npm:3.218.0" - dependencies: - "@aws-crypto/sha256-browser": "npm:2.0.0" - "@aws-crypto/sha256-js": "npm:2.0.0" - "@aws-sdk/config-resolver": "npm:3.215.0" - "@aws-sdk/fetch-http-handler": "npm:3.215.0" - "@aws-sdk/hash-node": "npm:3.215.0" - "@aws-sdk/invalid-dependency": "npm:3.215.0" - "@aws-sdk/middleware-content-length": "npm:3.215.0" - "@aws-sdk/middleware-endpoint": "npm:3.215.0" - "@aws-sdk/middleware-host-header": "npm:3.215.0" - "@aws-sdk/middleware-logger": "npm:3.215.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.215.0" - "@aws-sdk/middleware-retry": "npm:3.215.0" - "@aws-sdk/middleware-serde": "npm:3.215.0" - "@aws-sdk/middleware-stack": "npm:3.215.0" - "@aws-sdk/middleware-user-agent": "npm:3.215.0" - "@aws-sdk/node-config-provider": "npm:3.215.0" - "@aws-sdk/node-http-handler": "npm:3.215.0" - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/smithy-client": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - "@aws-sdk/url-parser": "npm:3.215.0" - "@aws-sdk/util-base64": "npm:3.208.0" - "@aws-sdk/util-body-length-browser": "npm:3.188.0" - "@aws-sdk/util-body-length-node": "npm:3.208.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.215.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.215.0" - "@aws-sdk/util-endpoints": "npm:3.216.0" - "@aws-sdk/util-user-agent-browser": "npm:3.215.0" - "@aws-sdk/util-user-agent-node": "npm:3.215.0" - "@aws-sdk/util-utf8-browser": "npm:3.188.0" - "@aws-sdk/util-utf8-node": "npm:3.208.0" - tslib: "npm:^2.3.1" - checksum: 10/47ab71b4b3ed0b07d1af859c642eed2003d48386082ce55e6cbd2ef9217f2cdbffac2aeb4e8fa74fcedc342894417a5d8cf3c8656aa8746047b20bcae34c052d - languageName: node - linkType: hard - -"@aws-sdk/client-sts@npm:3.218.0": - version: 3.218.0 - resolution: "@aws-sdk/client-sts@npm:3.218.0" - dependencies: - "@aws-crypto/sha256-browser": "npm:2.0.0" - "@aws-crypto/sha256-js": "npm:2.0.0" - "@aws-sdk/config-resolver": "npm:3.215.0" - "@aws-sdk/credential-provider-node": "npm:3.218.0" - "@aws-sdk/fetch-http-handler": "npm:3.215.0" - "@aws-sdk/hash-node": "npm:3.215.0" - "@aws-sdk/invalid-dependency": "npm:3.215.0" - "@aws-sdk/middleware-content-length": "npm:3.215.0" - "@aws-sdk/middleware-endpoint": "npm:3.215.0" - "@aws-sdk/middleware-host-header": "npm:3.215.0" - "@aws-sdk/middleware-logger": "npm:3.215.0" - "@aws-sdk/middleware-recursion-detection": "npm:3.215.0" - "@aws-sdk/middleware-retry": "npm:3.215.0" - "@aws-sdk/middleware-sdk-sts": "npm:3.215.0" - "@aws-sdk/middleware-serde": "npm:3.215.0" - "@aws-sdk/middleware-signing": "npm:3.215.0" - "@aws-sdk/middleware-stack": "npm:3.215.0" - "@aws-sdk/middleware-user-agent": "npm:3.215.0" - "@aws-sdk/node-config-provider": "npm:3.215.0" - "@aws-sdk/node-http-handler": "npm:3.215.0" - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/smithy-client": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - "@aws-sdk/url-parser": "npm:3.215.0" - "@aws-sdk/util-base64": "npm:3.208.0" - "@aws-sdk/util-body-length-browser": "npm:3.188.0" - "@aws-sdk/util-body-length-node": "npm:3.208.0" - "@aws-sdk/util-defaults-mode-browser": "npm:3.215.0" - "@aws-sdk/util-defaults-mode-node": "npm:3.215.0" - "@aws-sdk/util-endpoints": "npm:3.216.0" - "@aws-sdk/util-user-agent-browser": "npm:3.215.0" - "@aws-sdk/util-user-agent-node": "npm:3.215.0" - "@aws-sdk/util-utf8-browser": "npm:3.188.0" - "@aws-sdk/util-utf8-node": "npm:3.208.0" - fast-xml-parser: "npm:4.0.11" - tslib: "npm:^2.3.1" - checksum: 10/a161e87bbceff812f58fa9ec15d936e11e0d82b0ac6c5617abc9ae75ad5d5be637aa4d808d11f92de0cb3eecc1a0b009908ce403ee93c8cc658f268df690f8a5 - languageName: node - linkType: hard - -"@aws-sdk/config-resolver@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/config-resolver@npm:3.215.0" - dependencies: - "@aws-sdk/signature-v4": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - "@aws-sdk/util-config-provider": "npm:3.208.0" - "@aws-sdk/util-middleware": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/f515d9e5c320340cfef7c18fe87a5736028c6909f0818381a062959ba7fdc2b08c8fa4eedccbc6cffc62a6d7fbd01d3213510b75a774797ea4257dcf5a225415 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-cognito-identity@npm:3.218.0": - version: 3.218.0 - resolution: "@aws-sdk/credential-provider-cognito-identity@npm:3.218.0" - dependencies: - "@aws-sdk/client-cognito-identity": "npm:3.218.0" - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/7cc3abb2da40f7ce0db53685a4db34db6313c31a41de986cb88002313dbd90f12e3c39bc3dd2939ae2ac6560a0d7f20849b7e339beed6ec659cc5ac4ab56fa68 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-env@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/credential-provider-env@npm:3.215.0" - dependencies: - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/3b834406003dcdc3e8ef1925bcf5d9ad00a46d13f60e94a44b692aa9891b1472c2c197681e4842d114a376499792822ce242ded65b65f84ec7816da6ed796d03 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-imds@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/credential-provider-imds@npm:3.215.0" - dependencies: - "@aws-sdk/node-config-provider": "npm:3.215.0" - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - "@aws-sdk/url-parser": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/5a5535b498777d3d9de2ddfdc2cc30a7980365ed2d6e4d0bd8386b3af5024b93db3b2de458abc056f2cc6c9fd81cc38cbfa0324899b04daa142a7dee6a542368 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-ini@npm:3.218.0": - version: 3.218.0 - resolution: "@aws-sdk/credential-provider-ini@npm:3.218.0" - dependencies: - "@aws-sdk/credential-provider-env": "npm:3.215.0" - "@aws-sdk/credential-provider-imds": "npm:3.215.0" - "@aws-sdk/credential-provider-sso": "npm:3.218.0" - "@aws-sdk/credential-provider-web-identity": "npm:3.215.0" - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/0840126f624469bc1a82199cadfd954acb9643d23d4c11748026f64cefb42cf882033701e2f3d8af5b10624a3b079fdc92c68a8b07cd70fc8acd2e4efbf2a443 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-node@npm:3.218.0": - version: 3.218.0 - resolution: "@aws-sdk/credential-provider-node@npm:3.218.0" - dependencies: - "@aws-sdk/credential-provider-env": "npm:3.215.0" - "@aws-sdk/credential-provider-imds": "npm:3.215.0" - "@aws-sdk/credential-provider-ini": "npm:3.218.0" - "@aws-sdk/credential-provider-process": "npm:3.215.0" - "@aws-sdk/credential-provider-sso": "npm:3.218.0" - "@aws-sdk/credential-provider-web-identity": "npm:3.215.0" - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/9b272f67159c41cdc61b0a5479afee48194ccd48665e82bdddbbaef8f2cd4cf0021ee4ce035d2930e513f2deabcc36ed2a644d67f1514c18b04a1f5c99015e42 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-process@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/credential-provider-process@npm:3.215.0" - dependencies: - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/bc5813bd2656557671357d892014866bedffcecaaf60b02485178813e8f0595f3213ecafa985e4595e235974d8e1cb1f528e7ad38fd9cc594667f9547bcf9362 - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-sso@npm:3.218.0": - version: 3.218.0 - resolution: "@aws-sdk/credential-provider-sso@npm:3.218.0" - dependencies: - "@aws-sdk/client-sso": "npm:3.218.0" - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.215.0" - "@aws-sdk/token-providers": "npm:3.216.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/85c1b06bbecd9aefd52f8141c4c35a55dd2c2ac6d16f22e0bfd79cc63044551497cfafb6948f594f4d2cbc9e8a4fdae254a545b417bf06cbc82db26bcd9b64eb - languageName: node - linkType: hard - -"@aws-sdk/credential-provider-web-identity@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/credential-provider-web-identity@npm:3.215.0" - dependencies: - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/710575b7f5f775c76965e4410b9840cc0d862c23c62e8255c8de29d4c65d1306596709a0c775f6f9d5565d92c36132c09d579484b3ccda159fb3237934e63504 - languageName: node - linkType: hard - -"@aws-sdk/credential-providers@npm:^3.186.0": - version: 3.218.0 - resolution: "@aws-sdk/credential-providers@npm:3.218.0" - dependencies: - "@aws-sdk/client-cognito-identity": "npm:3.218.0" - "@aws-sdk/client-sso": "npm:3.218.0" - "@aws-sdk/client-sts": "npm:3.218.0" - "@aws-sdk/credential-provider-cognito-identity": "npm:3.218.0" - "@aws-sdk/credential-provider-env": "npm:3.215.0" - "@aws-sdk/credential-provider-imds": "npm:3.215.0" - "@aws-sdk/credential-provider-ini": "npm:3.218.0" - "@aws-sdk/credential-provider-node": "npm:3.218.0" - "@aws-sdk/credential-provider-process": "npm:3.215.0" - "@aws-sdk/credential-provider-sso": "npm:3.218.0" - "@aws-sdk/credential-provider-web-identity": "npm:3.215.0" - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/8a2f00410eed668c1f0a559a2f5510bb90ae22ac35fba28e3757cb468f622d43908d3b69b98cccd171cea9a540edaf495e15bb2659bba108881158e1be61328e - languageName: node - linkType: hard - -"@aws-sdk/fetch-http-handler@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/fetch-http-handler@npm:3.215.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/querystring-builder": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - "@aws-sdk/util-base64": "npm:3.208.0" - tslib: "npm:^2.3.1" - checksum: 10/ff96f48cd00d6cc65d2c600dd6eeb1ee54a54dbede9a7441353e4f4e7de36a8cb4b29a4138f0e80f67106888b75c479cdc173f6010a2f09c15eff291aee89a93 - languageName: node - linkType: hard - -"@aws-sdk/hash-node@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/hash-node@npm:3.215.0" - dependencies: - "@aws-sdk/types": "npm:3.215.0" - "@aws-sdk/util-buffer-from": "npm:3.208.0" - tslib: "npm:^2.3.1" - checksum: 10/46ea5ab90973c54ea5248b6a9c11dcf50cf064685183d5e40cf6a1a1e2aa7a334fad59808427fa3e43b9e53544710f2c0aae548b958335e9bc21cb14dbeca146 - languageName: node - linkType: hard - -"@aws-sdk/invalid-dependency@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/invalid-dependency@npm:3.215.0" - dependencies: - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/dd4f3edde57ebe7704b78820fe8d33c98ff3290782dad40ecaeceabbc047cd18bdbf9828616a74763096777669264eeed1ad0f3f510aa44aae204a914af44baf - languageName: node - linkType: hard - -"@aws-sdk/is-array-buffer@npm:3.201.0": - version: 3.201.0 - resolution: "@aws-sdk/is-array-buffer@npm:3.201.0" - dependencies: - tslib: "npm:^2.3.1" - checksum: 10/6f11bbfb85f676536dd0244ae3c77d21453593dce0ca7cf4c926bbd1606d9fcd2dd6b2dd4e7243ede319977b3482c5a4b19a7c88b530403e6e7aaabce2bee03f - languageName: node - linkType: hard - -"@aws-sdk/middleware-content-length@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/middleware-content-length@npm:3.215.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/95974d65be78e830a5cb8f0dbee8a4b04dacb82cdea3388e2d534e286027a362b2fce79879b4656ddbd2c5bd7567faacd9af8ebca435b03c7b789d87551116e4 - languageName: node - linkType: hard - -"@aws-sdk/middleware-endpoint@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/middleware-endpoint@npm:3.215.0" - dependencies: - "@aws-sdk/middleware-serde": "npm:3.215.0" - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/signature-v4": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - "@aws-sdk/url-parser": "npm:3.215.0" - "@aws-sdk/util-config-provider": "npm:3.208.0" - "@aws-sdk/util-middleware": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/6ac04f2530314f1319dd08036e00b78e25e2189124dc290813188315ae46f1f4ac27132820412eb1cdd5d009583aa88e62fee02b7ba7fddc93dbd99890c9f06a - languageName: node - linkType: hard - -"@aws-sdk/middleware-host-header@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/middleware-host-header@npm:3.215.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/864e2cd0beb58f2a3cf116a0c5279094b6bcf5f718535217a4d1bbdcc1c07034efc6772191aa173eed57f26dde8974f9764649d45ab6be084dbc3909be6e4276 - languageName: node - linkType: hard - -"@aws-sdk/middleware-logger@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/middleware-logger@npm:3.215.0" - dependencies: - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/db83d157dc560c08ea067b483bf2b3019bf0b030d475bfccb7e4bab1ff7dd1ee037cde46e09511feb9947a824c845718673a5381b7c7c66e59f9a058bf820cf2 - languageName: node - linkType: hard - -"@aws-sdk/middleware-recursion-detection@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/middleware-recursion-detection@npm:3.215.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/c0bfb610070e3c7fe29187eadc8f8f309327c7110895986685bf59fead421eb03d687c44058ae77bee78e24e96d6da1c6ce89811c1cede1894724faf78ec10c6 - languageName: node - linkType: hard - -"@aws-sdk/middleware-retry@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/middleware-retry@npm:3.215.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/service-error-classification": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - "@aws-sdk/util-middleware": "npm:3.215.0" - tslib: "npm:^2.3.1" - uuid: "npm:^8.3.2" - checksum: 10/b773a7ab5d91e20536c5c805404cfe39aac08b239082d3d61849b4ac244b8735c3f416e41d3ab1fffb083bdac6a450a074e58a8289d3fb8891f9a298f5da724d - languageName: node - linkType: hard - -"@aws-sdk/middleware-sdk-sts@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/middleware-sdk-sts@npm:3.215.0" - dependencies: - "@aws-sdk/middleware-signing": "npm:3.215.0" - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/signature-v4": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/e99e835c5125474c4343ab2c20fa0d096284068d09bf2ec42902776041137fbddacbade5f1bcafcda952ae475922243849121a2b41f30ecada54d9753dfc49fd - languageName: node - linkType: hard - -"@aws-sdk/middleware-serde@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/middleware-serde@npm:3.215.0" - dependencies: - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/9e9a16f506eb0c6e3cf73947335823732bc5df07e56a2c6dad4900218ad1fbb249b20455d943c374391e8715782a59bb0568aa70b06a5c6374466275f09462e4 - languageName: node - linkType: hard - -"@aws-sdk/middleware-signing@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/middleware-signing@npm:3.215.0" - dependencies: - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/signature-v4": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - "@aws-sdk/util-middleware": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/e9dd88b352bd956fa75d8f24bfe3502a5db157c66ddb77f3f19d68821c428c2ff48ed33f16b8965fee4a53b74baf94d03ba54119522164d2eb74e564af84f5e4 - languageName: node - linkType: hard - -"@aws-sdk/middleware-stack@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/middleware-stack@npm:3.215.0" - dependencies: - tslib: "npm:^2.3.1" - checksum: 10/817d54ef70e89ce3d2304b22436bf21ff0bacfaad2fd9b5b31c521be37546d864d998a842e9355e58b8904f4b5e33d47a44946e671ef921009248c0138946661 - languageName: node - linkType: hard - -"@aws-sdk/middleware-user-agent@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/middleware-user-agent@npm:3.215.0" - dependencies: - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/e7a09aa05d60047aa7865c2a4fa9fc922f7ab0bb02d62fe4ee35e0175ddd7b14397143734015bb0ed78b5a740fc7be690099c257fe5f104c87a377eb7f5efb6b - languageName: node - linkType: hard - -"@aws-sdk/node-config-provider@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/node-config-provider@npm:3.215.0" - dependencies: - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/f4efb5fa4a8a649cd88f8f0d241713b930ed0ddc510d0be1f8c9c8d42684d95b61a86dc5be2d21c69249eea80d586ff18cb986c9fa9f82327ca3081fca6aa93d - languageName: node - linkType: hard - -"@aws-sdk/node-http-handler@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/node-http-handler@npm:3.215.0" - dependencies: - "@aws-sdk/abort-controller": "npm:3.215.0" - "@aws-sdk/protocol-http": "npm:3.215.0" - "@aws-sdk/querystring-builder": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/3c7d57adedc10cc6745340b942017a8c728cf64fcdc4e5248e50dd6441ae02a445b03d9a5ec4b990c11fcbe14a40c8fdf98546c63271205c17c4cc35755d8deb - languageName: node - linkType: hard - -"@aws-sdk/property-provider@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/property-provider@npm:3.215.0" - dependencies: - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/11654042df360bc61c158be23f853ee12deb3928860c401fe3fe28174dcd48df56302e05b4458b11bab23806551863ce7dabf7701350be23dd5608ca0ac09ea0 - languageName: node - linkType: hard - -"@aws-sdk/protocol-http@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/protocol-http@npm:3.215.0" - dependencies: - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/b3a66dd347482a20033f7c8684af6e936c7e728a934f7e014d3f17be8cc40c335435de42de709da0579fdc55dc0f401eb36bb287a5ca25f3c3efc2a4034e04cd - languageName: node - linkType: hard - -"@aws-sdk/querystring-builder@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/querystring-builder@npm:3.215.0" - dependencies: - "@aws-sdk/types": "npm:3.215.0" - "@aws-sdk/util-uri-escape": "npm:3.201.0" - tslib: "npm:^2.3.1" - checksum: 10/26173ddae62c5a3534fe72da2fb64ff87154344addb24899705c6ddbefa56c31b074b0d73d2b3e5cc00e85a77dd1155e5a2118d1f5ce87a0fbee032506a8e1bd - languageName: node - linkType: hard - -"@aws-sdk/querystring-parser@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/querystring-parser@npm:3.215.0" - dependencies: - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/aa52f80dd016242d2add6256e215728f20bccc1df13ed0b4e3206c59d4b14a435c521ea5f9ce5e4634405cc8c61a1e4c44600e1866ad0d0a25c09ffa2366e3d5 - languageName: node - linkType: hard - -"@aws-sdk/service-error-classification@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/service-error-classification@npm:3.215.0" - checksum: 10/6e1999b0fd039bbec2575ece93502c9ae3420cd389c90b674823d45cc7109709103898d3525a443d6b0ecf1be5495fc8496f90acd1978f01b2c786a07aaa6559 - languageName: node - linkType: hard - -"@aws-sdk/shared-ini-file-loader@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/shared-ini-file-loader@npm:3.215.0" - dependencies: - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/bed77857a8eb7a294788b2ef1fe80c4454fac65a4fcfc800e38b0476a5b04f5bb62f64520974524732304ae90464e321f03aa98a92ab186e0f14ea61bdc734ff - languageName: node - linkType: hard - -"@aws-sdk/signature-v4@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/signature-v4@npm:3.215.0" - dependencies: - "@aws-sdk/is-array-buffer": "npm:3.201.0" - "@aws-sdk/types": "npm:3.215.0" - "@aws-sdk/util-hex-encoding": "npm:3.201.0" - "@aws-sdk/util-middleware": "npm:3.215.0" - "@aws-sdk/util-uri-escape": "npm:3.201.0" - tslib: "npm:^2.3.1" - checksum: 10/6a087c0097b5fa5fd0c5eeb5eb342a9bd2372e0408d5cba3f7a84429739776d710313d82c70d50f3bd628e117916a36ca34f34dc7e8f693d16080e2c1a925a0b - languageName: node - linkType: hard - -"@aws-sdk/smithy-client@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/smithy-client@npm:3.215.0" - dependencies: - "@aws-sdk/middleware-stack": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/6144af566689cccdb1d91a72fcb6da8da051e1aff56176c3e7466f67aaf26d11ba7648fed5ee1362dcdbbdefb5a27664e0b24a97810db0c81071a2b595b88d21 - languageName: node - linkType: hard - -"@aws-sdk/token-providers@npm:3.216.0": - version: 3.216.0 - resolution: "@aws-sdk/token-providers@npm:3.216.0" - dependencies: - "@aws-sdk/client-sso-oidc": "npm:3.216.0" - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/shared-ini-file-loader": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/69c76df17af7fe1b68c4ed75ba1830eba524908575b247145b375375d702c8e6d3f295e068be54d67720fce08809acced1468ecc5a608afd0c5e2fe9643abcd3 - languageName: node - linkType: hard - -"@aws-sdk/types@npm:3.215.0, @aws-sdk/types@npm:^3.1.0, @aws-sdk/types@npm:^3.110.0": - version: 3.215.0 - resolution: "@aws-sdk/types@npm:3.215.0" - checksum: 10/5943e8fa4d4b20ed012803ed9386ac00246e57564340d3b8e5004bb25a0c848707ff3b591436fac578183da7e9a46ceb963237dad2a2bf4d7b7f863db40d0d46 - languageName: node - linkType: hard - -"@aws-sdk/url-parser@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/url-parser@npm:3.215.0" - dependencies: - "@aws-sdk/querystring-parser": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/0b4fbdbd6986f7e78c1059ae3fa645fca28778533ada91df46f1172b63b4a6f25fbf0c824a5a39692676459cdb2d8234183eea540e6c489565648a1e4b2b50e9 - languageName: node - linkType: hard - -"@aws-sdk/util-base64@npm:3.208.0": - version: 3.208.0 - resolution: "@aws-sdk/util-base64@npm:3.208.0" - dependencies: - "@aws-sdk/util-buffer-from": "npm:3.208.0" - tslib: "npm:^2.3.1" - checksum: 10/cedbcd28b948e04ea1f9f1e8197c4eb6cefcf49a946be9d68ee42cc339d6a5a928c091a939ef8129d49b4152631dfd837f7db3727faaf4ca744b6d3363af150b - languageName: node - linkType: hard - -"@aws-sdk/util-body-length-browser@npm:3.188.0": - version: 3.188.0 - resolution: "@aws-sdk/util-body-length-browser@npm:3.188.0" - dependencies: - tslib: "npm:^2.3.1" - checksum: 10/37a2d55b4f100256b2ed3052adee318892d88a93a30773e28bade8c386c4e4f09ca2a0204d5d2f81cccfc5199d70d4d84fea24733300a8bb02624af8b40e5f89 - languageName: node - linkType: hard - -"@aws-sdk/util-body-length-node@npm:3.208.0": - version: 3.208.0 - resolution: "@aws-sdk/util-body-length-node@npm:3.208.0" - dependencies: - tslib: "npm:^2.3.1" - checksum: 10/7b475b74dec85e67d9d9bb5964f4b732690520008267489d43823218fb6ba1854bdd2fe6ec106a0fd5c7545b89b60e20f9c375f5d3915c5fe9a91e415c6ad330 - languageName: node - linkType: hard - -"@aws-sdk/util-buffer-from@npm:3.208.0": - version: 3.208.0 - resolution: "@aws-sdk/util-buffer-from@npm:3.208.0" - dependencies: - "@aws-sdk/is-array-buffer": "npm:3.201.0" - tslib: "npm:^2.3.1" - checksum: 10/5d4b6e775b06eb29b030bb00e02db098213115dc2e76764fad7344f3864ecc8a81890916c0ea985074bb1d365b408f3f077be16a3493b2bf52efd34d6a3a05a5 - languageName: node - linkType: hard - -"@aws-sdk/util-config-provider@npm:3.208.0": - version: 3.208.0 - resolution: "@aws-sdk/util-config-provider@npm:3.208.0" - dependencies: - tslib: "npm:^2.3.1" - checksum: 10/733aeb5e3d582e0e81be9fedbcdad352deb85fc8e7343697702274a9ec84fd4159f4a2b8ed1ff88a3695516f2a58f900d484d4bd02cf28297fcdea7647d7a09c - languageName: node - linkType: hard - -"@aws-sdk/util-defaults-mode-browser@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/util-defaults-mode-browser@npm:3.215.0" - dependencies: - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - bowser: "npm:^2.11.0" - tslib: "npm:^2.3.1" - checksum: 10/b69af8dea2213f0ec7f4fe3b712e4198907c324043d3b1ba84f8f1ad14a205533f2adaa062e73c56872d75a0844aa8b237fbafb42a0d8183e94763362b0b2588 - languageName: node - linkType: hard - -"@aws-sdk/util-defaults-mode-node@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/util-defaults-mode-node@npm:3.215.0" - dependencies: - "@aws-sdk/config-resolver": "npm:3.215.0" - "@aws-sdk/credential-provider-imds": "npm:3.215.0" - "@aws-sdk/node-config-provider": "npm:3.215.0" - "@aws-sdk/property-provider": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/e353c4427aaa25425ae18f848a34a462964b4028212cdbe4cee10f44c63f145283c85d7a23dd8548928f56d4da117722278e711153406716d1439f32307259c8 - languageName: node - linkType: hard - -"@aws-sdk/util-endpoints@npm:3.216.0": - version: 3.216.0 - resolution: "@aws-sdk/util-endpoints@npm:3.216.0" - dependencies: - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - checksum: 10/12845bf1ec3a16578faefe696df7e08303f4267d4d8b6d396bce79be9fdc9067070760b443e0e89aebf753324f0e0770bd78ff00d99b85fe1794629b2a20539d - languageName: node - linkType: hard - -"@aws-sdk/util-hex-encoding@npm:3.201.0": - version: 3.201.0 - resolution: "@aws-sdk/util-hex-encoding@npm:3.201.0" - dependencies: - tslib: "npm:^2.3.1" - checksum: 10/4edf0eb71100f96541d13355f15654441240fda3ef6bc44b5394709bc71fdd4a0dbb92c8453842ad0902bfddf190f50817bf2fbb5b26a387ec6eb27dba715f3e - languageName: node - linkType: hard - -"@aws-sdk/util-locate-window@npm:^3.0.0": - version: 3.208.0 - resolution: "@aws-sdk/util-locate-window@npm:3.208.0" - dependencies: - tslib: "npm:^2.3.1" - checksum: 10/add2bc50d8f9601aac3665238fad85618dcb0a30b37109cf0c0d09aadc274aab61661462fff2eb2503147dbbf2fde5b3ee78c7c995e4c37e6f01c2227a3a7363 - languageName: node - linkType: hard - -"@aws-sdk/util-middleware@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/util-middleware@npm:3.215.0" - dependencies: - tslib: "npm:^2.3.1" - checksum: 10/699eb14b1502fe2658f539074480dd318bf522a033e969efea8d0a3421965e9fe86e1f14eec9de6172f075aff66f17d4fa3e67346d1027371eed5e796b6c203c - languageName: node - linkType: hard - -"@aws-sdk/util-uri-escape@npm:3.201.0": - version: 3.201.0 - resolution: "@aws-sdk/util-uri-escape@npm:3.201.0" - dependencies: - tslib: "npm:^2.3.1" - checksum: 10/2effee6996fe646663c9a13af513844e497099ddce92fa8f34434b1f3b4fff36199e377b6d781a76703e431b7af0f15c2269222ab23f14829e65acd9ac00f24c - languageName: node - linkType: hard - -"@aws-sdk/util-user-agent-browser@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/util-user-agent-browser@npm:3.215.0" - dependencies: - "@aws-sdk/types": "npm:3.215.0" - bowser: "npm:^2.11.0" - tslib: "npm:^2.3.1" - checksum: 10/377d33592aa80b48ab836135ea31227914cfe5ea00aafe0016580080f9c1737cf1e68a35d079e4595c357b641d79f76101f2e3501226b272ec00b8a4ec0919c9 - languageName: node - linkType: hard - -"@aws-sdk/util-user-agent-node@npm:3.215.0": - version: 3.215.0 - resolution: "@aws-sdk/util-user-agent-node@npm:3.215.0" - dependencies: - "@aws-sdk/node-config-provider": "npm:3.215.0" - "@aws-sdk/types": "npm:3.215.0" - tslib: "npm:^2.3.1" - peerDependencies: - aws-crt: ">=1.0.0" - peerDependenciesMeta: - aws-crt: - optional: true - checksum: 10/92ecb4b6e3bb02bf7997ad7128d385a1d0f063229d96ddab01fcee20dbbbae1fa038622cfc850b43e81b696b7373ce24a321939286bbf274b5f38cd5a3957f16 - languageName: node - linkType: hard - -"@aws-sdk/util-utf8-browser@npm:3.188.0, @aws-sdk/util-utf8-browser@npm:^3.0.0": - version: 3.188.0 - resolution: "@aws-sdk/util-utf8-browser@npm:3.188.0" - dependencies: - tslib: "npm:^2.3.1" - checksum: 10/ee5d2c005ca2bb6514526869c88b2d794572eb8de3d43a5bafd0843dfc93dd0060596f852159bc3fcfbb9b443c6d0fbf5613cfbcde0e43331a3a105d462f7788 - languageName: node - linkType: hard - -"@aws-sdk/util-utf8-node@npm:3.208.0": - version: 3.208.0 - resolution: "@aws-sdk/util-utf8-node@npm:3.208.0" - dependencies: - "@aws-sdk/util-buffer-from": "npm:3.208.0" - tslib: "npm:^2.3.1" - checksum: 10/8a0be8ceeef1fcb2c2e3c72eb0d5b78f6c42d3f096f709876015f816072a79ba78cd2407e4e117e95679242f56e339f05bfcde3518417bce482ea662c402d386 - languageName: node - linkType: hard - "@axe-core/playwright@npm:^4.10.1": version: 4.10.1 resolution: "@axe-core/playwright@npm:4.10.1" @@ -4895,12 +4030,12 @@ __metadata: languageName: node linkType: hard -"@mongodb-js/saslprep@npm:^1.1.0": - version: 1.1.0 - resolution: "@mongodb-js/saslprep@npm:1.1.0" +"@mongodb-js/saslprep@npm:^1.1.9": + version: 1.1.9 + resolution: "@mongodb-js/saslprep@npm:1.1.9" dependencies: sparse-bitfield: "npm:^3.0.3" - checksum: 10/1a631b92d21691626a508e5eafafb43229d2d9bdafc454cda182ed8626f046df0ef8cf4fe545403f75bbeb991954dcef0554a51f2551dbadc54ced35f1df0192 + checksum: 10/6a0d5e9068635fff59815de387d71be0e3b9d683f1d299876b2760ac18bbf0a1d4b26eff6b1ab89ff8802c20ffb15c047ba675b2cc306a51077a013286c2694a languageName: node linkType: hard @@ -8289,7 +7424,7 @@ __metadata: gc-stats: "npm:^1.4.1" mem: "npm:^8.1.1" moleculer: "npm:^0.14.35" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" nats: "npm:^2.28.2" pino: "npm:^8.21.0" polka: "npm:^0.5.2" @@ -8319,7 +7454,7 @@ __metadata: eslint: "npm:~8.45.0" human-interval: "npm:^2.0.1" moment-timezone: "npm:~0.5.46" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" typescript: "npm:~5.7.2" languageName: unknown linkType: soft @@ -8422,7 +7557,7 @@ __metadata: gc-stats: "npm:^1.4.1" mem: "npm:^8.1.1" moleculer: "npm:^0.14.35" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" nats: "npm:^2.28.2" pino: "npm:^8.21.0" polka: "npm:^0.5.2" @@ -8478,7 +7613,7 @@ __metadata: babel-jest: "npm:^29.7.0" eslint: "npm:~8.45.0" jest: "npm:~29.7.0" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" prettier: "npm:~3.3.3" typescript: "npm:~5.7.2" languageName: unknown @@ -8495,7 +7630,7 @@ __metadata: "@rocket.chat/ui-kit": "workspace:~" "@types/express": "npm:^4.17.21" eslint: "npm:~8.45.0" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" prettier: "npm:~3.3.3" typescript: "npm:~5.7.2" languageName: unknown @@ -8510,7 +7645,7 @@ __metadata: "@rocket.chat/models": "workspace:^" "@rocket.chat/random": "workspace:^" eslint: "npm:~8.45.0" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" typescript: "npm:~5.7.2" languageName: unknown linkType: soft @@ -8577,9 +7712,9 @@ __metadata: "@rocket.chat/tracing": "workspace:^" "@types/ejson": "npm:^2.2.2" "@types/gc-stats": "npm:^1.4.3" - "@types/meteor": "npm:^2.9.8" "@types/node": "npm:~20.17.8" "@types/polka": "npm:^0.5.7" + "@types/underscore": "npm:^1.13.0" "@types/uuid": "npm:^10.0.0" "@types/ws": "npm:^8.5.13" colorette: "npm:^1.4.0" @@ -8591,7 +7726,7 @@ __metadata: jaeger-client: "npm:^3.19.0" mem: "npm:^8.1.1" moleculer: "npm:^0.14.35" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" nats: "npm:^2.28.2" pino: "npm:^8.21.0" pino-pretty: "npm:^7.6.1" @@ -8888,7 +8023,7 @@ __metadata: "@rocket.chat/models": "workspace:^" "@rocket.chat/tracing": "workspace:^" eslint: "npm:~8.45.0" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" prettier: "npm:~3.3.3" typescript: "npm:~5.7.2" languageName: unknown @@ -9303,6 +8438,7 @@ __metadata: "@types/supports-color": "npm:~7.2.1" "@types/textarea-caret": "npm:^3.0.3" "@types/ua-parser-js": "npm:^0.7.39" + "@types/underscore": "npm:^1.13.0" "@types/use-sync-external-store": "npm:^0.0.6" "@types/uuid": "npm:^10.0.0" "@types/xml-crypto": "npm:~1.4.6" @@ -9326,7 +8462,7 @@ __metadata: bad-words: "npm:^3.0.4" bcrypt: "npm:^5.1.1" body-parser: "npm:1.20.3" - bson: "npm:^4.7.2" + bson: "npm:^6.7.0" busboy: "npm:^1.6.0" bytebuffer: "npm:5.0.1" chai: "npm:^4.5.0" @@ -9398,7 +8534,7 @@ __metadata: imap: "npm:^0.8.19" ip-range-check: "npm:^0.2.0" is-svg: "npm:^4.4.0" - isolated-vm: "npm:4.7.2" + isolated-vm: "npm:5.0.1" jest: "npm:~29.7.0" jschardet: "npm:^3.1.4" jsdom: "npm:^16.7.0" @@ -9428,7 +8564,7 @@ __metadata: moment: "npm:^2.30.1" moment-timezone: "npm:^0.5.46" mongo-message-queue: "npm:^1.1.0" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" nats: "npm:^2.28.2" node-dogstatsd: "npm:^0.0.7" node-fetch: "npm:2.7.0" @@ -9548,7 +8684,7 @@ __metadata: "@rocket.chat/core-typings": "workspace:^" "@types/node-rsa": "npm:^1.1.4" eslint: "npm:~8.45.0" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" typescript: "npm:~5.7.2" languageName: unknown linkType: soft @@ -9629,7 +8765,7 @@ __metadata: mem: "npm:^8.1.1" moment-timezone: "npm:^0.5.46" mongo-message-queue: "npm:^1.1.0" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" pino: "npm:^8.21.0" typescript: "npm:~5.7.2" languageName: unknown @@ -9665,7 +8801,7 @@ __metadata: moleculer: "npm:^0.14.35" moment-timezone: "npm:^0.5.46" mongo-message-queue: "npm:^1.1.0" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" nats: "npm:^2.28.2" pino: "npm:^8.21.0" polka: "npm:^0.5.2" @@ -9804,7 +8940,7 @@ __metadata: gc-stats: "npm:^1.4.1" mem: "npm:^8.1.1" moleculer: "npm:^0.14.35" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" nats: "npm:^2.28.2" pino: "npm:^8.21.0" polka: "npm:^0.5.2" @@ -9830,7 +8966,7 @@ __metadata: babel-jest: "npm:^29.7.0" eslint: "npm:~8.45.0" jest: "npm:~29.7.0" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" typescript: "npm:~5.7.2" languageName: unknown linkType: soft @@ -9871,7 +9007,7 @@ __metadata: moleculer: "npm:^0.14.35" moment-timezone: "npm:^0.5.46" mongo-message-queue: "npm:^1.1.0" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" nats: "npm:^2.28.2" pino: "npm:^8.21.0" polka: "npm:^0.5.2" @@ -9944,7 +9080,7 @@ __metadata: ajv-formats: "npm:^3.0.1" eslint: "npm:~8.45.0" jest: "npm:~29.7.0" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" typescript: "npm:~5.7.2" languageName: unknown linkType: soft @@ -10016,7 +9152,7 @@ __metadata: gc-stats: "npm:^1.4.1" mem: "npm:^8.1.1" moleculer: "npm:^0.14.35" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" nats: "npm:^2.28.2" pino: "npm:^8.21.0" polka: "npm:^0.5.2" @@ -10206,7 +9342,7 @@ __metadata: "@types/use-sync-external-store": "npm:^0.0.6" eslint: "npm:~8.45.0" eslint-plugin-react-hooks: "npm:^5.0.0" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" react: "npm:~17.0.2" typescript: "npm:~5.7.2" use-sync-external-store: "npm:^1.2.2" @@ -12606,11 +11742,11 @@ __metadata: linkType: hard "@types/jquery@npm:*": - version: 3.5.14 - resolution: "@types/jquery@npm:3.5.14" + version: 3.5.32 + resolution: "@types/jquery@npm:3.5.32" dependencies: "@types/sizzle": "npm:*" - checksum: 10/a0ad2fe4fb3c14dbb02929b995203eb9d02db6dd6054d71058955ab62d659ae48fe3deca63ded0db16a2b99fa1827fffdddb9b4a1977cedfeaf1f8150829a81c + checksum: 10/2c67cac338828870ead5c5e608f5fa5ab8101598ed4572cf49b58c342adffe8918d2e2fc94d7954e6b98a889cef8c3f4e6f44b8fecb75e80854b0f9cf9dd18a1 languageName: node linkType: hard @@ -13030,11 +12166,11 @@ __metadata: linkType: hard "@types/nodemailer@npm:*": - version: 6.4.15 - resolution: "@types/nodemailer@npm:6.4.15" + version: 6.4.17 + resolution: "@types/nodemailer@npm:6.4.17" dependencies: "@types/node": "npm:*" - checksum: 10/1b400b694ed1bc51c242a719de44b484911481596c288407fff18b81ee76945d2d0c6e411371dfa4293747ebf4146a1f0df0e188ff7b9d2adaccd1183dfa1c2c + checksum: 10/bd090c9a81f15ee5e1e2123de1004593bacc24d385460dd56c51ec657d61dc1cfd4f44fc71baac060a1abcb487aef5027509e0afd646e7118d7a8a13a95bad9d languageName: node linkType: hard @@ -13353,9 +12489,9 @@ __metadata: linkType: hard "@types/sizzle@npm:*": - version: 2.3.3 - resolution: "@types/sizzle@npm:2.3.3" - checksum: 10/586a9fb1f6ff3e325e0f2cc1596a460615f0bc8a28f6e276ac9b509401039dd242fa8b34496d3a30c52f5b495873922d09a9e76c50c2ab2bcc70ba3fb9c4e160 + version: 2.3.9 + resolution: "@types/sizzle@npm:2.3.9" + checksum: 10/413811a79e7e9f1d8f47e6047ae0aea1530449d612304cdda1c30018e3d053b8544861ec2c70bdeca75a0a010192e6bb78efc6fb4caaafdd65c4eee90066686a languageName: node linkType: hard @@ -13496,10 +12632,10 @@ __metadata: languageName: node linkType: hard -"@types/underscore@npm:*": - version: 1.11.4 - resolution: "@types/underscore@npm:1.11.4" - checksum: 10/9105a02ac25085a8e5d60ee58eba6132067b132c988f5a861ee889610c1ae09cb4daed266abd644afe6435f6f0747a131fd124b3491ace2d455dc7c1db5f23e7 +"@types/underscore@npm:*, @types/underscore@npm:^1.13.0": + version: 1.13.0 + resolution: "@types/underscore@npm:1.13.0" + checksum: 10/938a6a0a878ce108046601a7cceeec9870428cc565a0c6d7891b7ad39e7570f1f75a1c02bf81baf23c7c7948ef0693d00ccd1a8e05894a52fed4c584a4b7172e languageName: node linkType: hard @@ -13582,13 +12718,12 @@ __metadata: languageName: node linkType: hard -"@types/whatwg-url@npm:^8.2.1": - version: 8.2.2 - resolution: "@types/whatwg-url@npm:8.2.2" +"@types/whatwg-url@npm:^11.0.2": + version: 11.0.5 + resolution: "@types/whatwg-url@npm:11.0.5" dependencies: - "@types/node": "npm:*" "@types/webidl-conversions": "npm:*" - checksum: 10/5dc5afe078dfa1a8a266745586fa3db9baa8ce7cc904789211d1dca1d34d7f3dd17d0b7423c36bc9beab9d98aa99338f1fc60798c0af6cbb8356f20e20d9f243 + checksum: 10/23a0c45aff51817807b473a6adb181d6e3bb0d27dde54e84883d5d5bc93358e95204d2188e7ff7fdc2cdaf157e97e1188ef0a22ec79228da300fc30d4a05b56a languageName: node linkType: hard @@ -16137,13 +15272,6 @@ __metadata: languageName: node linkType: hard -"bowser@npm:^2.11.0": - version: 2.11.0 - resolution: "bowser@npm:2.11.0" - checksum: 10/ef46500eafe35072455e7c3ae771244e97827e0626686a9a3601c436d16eb272dad7ccbd49e2130b599b617ca9daa67027de827ffc4c220e02f63c84b69a8751 - languageName: node - linkType: hard - "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -16425,12 +15553,17 @@ __metadata: languageName: node linkType: hard -"bson@npm:^4.7.2": - version: 4.7.2 - resolution: "bson@npm:4.7.2" - dependencies: - buffer: "npm:^5.6.0" - checksum: 10/9bc1a5c0e3774d171f291b5d44bcc6dacbdbba14184893eb810a5ca889b0dbcae5e0870fb2c731b069ce8ee77f3ebe3750669ed952d30de6a087baca59359781 +"bson@npm:^6.10.0": + version: 6.10.1 + resolution: "bson@npm:6.10.1" + checksum: 10/7b6d2a4c877bbe27d9e7fa0cd31e6b446ba08c5d70927403a6d42abf6e354fd12e79daf562fa5cc36e85cb8e701edc2ebdc2381c75c2376dde0f5e8d7ee3fd1b + languageName: node + linkType: hard + +"bson@npm:^6.7.0": + version: 6.7.0 + resolution: "bson@npm:6.7.0" + checksum: 10/d4bc1d9514c67dbcb8451b7be95704e6e7cb262f0d11c938715c21297ab5550b0e2f3badf5480d53c4b3f899a84f2ed8708f3f46cad83ec52059f076aad8e1cd languageName: node linkType: hard @@ -21723,17 +20856,6 @@ __metadata: languageName: node linkType: hard -"fast-xml-parser@npm:4.0.11": - version: 4.0.11 - resolution: "fast-xml-parser@npm:4.0.11" - dependencies: - strnum: "npm:^1.0.5" - bin: - fxparser: src/cli/cli.js - checksum: 10/ccc24272f08fa4bc2701dfaa1a364b5b0c014c1015c9496d2748e1d0ab3e03b872d19e52c249ecc05759665c2b060d20ce455ebe147dd2b98dee1655da99c8b3 - languageName: node - linkType: hard - "fast-xml-parser@npm:^3.19.0": version: 3.21.1 resolution: "fast-xml-parser@npm:3.21.1" @@ -25545,13 +24667,13 @@ __metadata: languageName: node linkType: hard -"isolated-vm@npm:4.7.2": - version: 4.7.2 - resolution: "isolated-vm@npm:4.7.2" +"isolated-vm@npm:5.0.1": + version: 5.0.1 + resolution: "isolated-vm@npm:5.0.1" dependencies: node-gyp: "npm:latest" prebuild-install: "npm:^7.1.1" - checksum: 10/02973e9cf1fbfa013988abda0e8fc3a1ba30054126036570a54576779680d30166b8e7b81579bb5bd6e0bb060defcd9a0dbb05215ec297b5d8a002fc73a8924d + checksum: 10/55c69e9ba8ae6adaf7f76b9bfe2614d0edfcabc273c6346598ac4c0801016e9eb31e01b821cb1f59797362640c9ca7a9d003035aa8d2a7a311380b9afbf4fb23 languageName: node linkType: hard @@ -28931,49 +28053,47 @@ __metadata: languageName: node linkType: hard -"mongodb-connection-string-url@npm:^2.6.0": - version: 2.6.0 - resolution: "mongodb-connection-string-url@npm:2.6.0" +"mongodb-connection-string-url@npm:^3.0.0": + version: 3.0.1 + resolution: "mongodb-connection-string-url@npm:3.0.1" dependencies: - "@types/whatwg-url": "npm:^8.2.1" - whatwg-url: "npm:^11.0.0" - checksum: 10/d0903b98240e3a32a96091fd78d59de0616070c5e39881b598ff1c3cc9cd3335473c43d30e8b33c679ad0ab6133ff1112a7465f8c2f81b0d13b1b3f2174c9fe7 + "@types/whatwg-url": "npm:^11.0.2" + whatwg-url: "npm:^13.0.0" + checksum: 10/f58918305637995c69a9a765ce3b442695195bb387d4deabfd9f1700bddc9d74e66136ff78e1d4aa24eb6877ae9b0f80c2699ebac8cadb0475b272da44a2623a languageName: node linkType: hard -"mongodb@npm:4.17.2": - version: 4.17.2 - resolution: "mongodb@npm:4.17.2" +"mongodb@npm:6.10.0": + version: 6.10.0 + resolution: "mongodb@npm:6.10.0" dependencies: - "@aws-sdk/credential-providers": "npm:^3.186.0" - "@mongodb-js/saslprep": "npm:^1.1.0" - bson: "npm:^4.7.2" - mongodb-connection-string-url: "npm:^2.6.0" - socks: "npm:^2.7.1" - dependenciesMeta: + "@mongodb-js/saslprep": "npm:^1.1.9" + bson: "npm:^6.10.0" + mongodb-connection-string-url: "npm:^3.0.0" + peerDependencies: + "@aws-sdk/credential-providers": ^3.188.0 + "@mongodb-js/zstd": ^1.1.0 + gcp-metadata: ^5.2.0 + kerberos: ^2.0.1 + mongodb-client-encryption: ">=6.0.0 <7" + snappy: ^7.2.2 + socks: ^2.7.1 + peerDependenciesMeta: "@aws-sdk/credential-providers": optional: true - "@mongodb-js/saslprep": + "@mongodb-js/zstd": optional: true - checksum: 10/e9f252c13a12b6339b5b4912c32d40f447eaeae77f0b0d0e36b7fbaa6800eae69ae68c6e6f005f97e90c90ad2a9f56369a0924963b83f959c83a4c1398093642 - languageName: node - linkType: hard - -"mongodb@patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch": - version: 4.17.2 - resolution: "mongodb@patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch::version=4.17.2&hash=e26c00" - dependencies: - "@aws-sdk/credential-providers": "npm:^3.186.0" - "@mongodb-js/saslprep": "npm:^1.1.0" - bson: "npm:^4.7.2" - mongodb-connection-string-url: "npm:^2.6.0" - socks: "npm:^2.7.1" - dependenciesMeta: - "@aws-sdk/credential-providers": + gcp-metadata: + optional: true + kerberos: optional: true - "@mongodb-js/saslprep": + mongodb-client-encryption: optional: true - checksum: 10/6fe983f51a6e7f2a621788d36630cf7a1e87d29ee72d3665186cebb661927b8d62471972d6a8182d40f226e54ebbcd895e09cb00bbbf65ae0050ae55b3009ce4 + snappy: + optional: true + socks: + optional: true + checksum: 10/cab3b9171de69078a69a969d9c17b78b14fd346ad7579e8e88369d0494cd9bfb3a58e78d312d8480b94c601907aa57b5fa89fe44531de94839a04b79ea856ae0 languageName: node linkType: hard @@ -32491,7 +31611,7 @@ __metadata: languageName: node linkType: hard -"punycode@npm:^2.3.1": +"punycode@npm:^2.3.0, punycode@npm:^2.3.1": version: 2.3.1 resolution: "punycode@npm:2.3.1" checksum: 10/febdc4362bead22f9e2608ff0171713230b57aff9dddc1c273aa2a651fbd366f94b7d6a71d78342a7c0819906750351ca7f2edd26ea41b626d87d6a13d1bd059 @@ -34246,7 +33366,7 @@ __metadata: jaeger-client: "npm:^3.19.0" mem: "npm:^8.1.1" moleculer: "npm:^0.14.35" - mongodb: "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch" + mongodb: "patch:mongodb@npm%3A6.10.0#~/.yarn/patches/mongodb-npm-6.10.0-b914157c35.patch" nats: "npm:^2.28.2" npm-run-all: "npm:^4.1.5" pino: "npm:^8.21.0" @@ -35279,7 +34399,7 @@ __metadata: languageName: node linkType: hard -"socks@npm:^2.6.1, socks@npm:^2.7.1": +"socks@npm:^2.6.1": version: 2.7.1 resolution: "socks@npm:2.7.1" dependencies: @@ -37436,6 +36556,15 @@ __metadata: languageName: node linkType: hard +"tr46@npm:^4.1.1": + version: 4.1.1 + resolution: "tr46@npm:4.1.1" + dependencies: + punycode: "npm:^2.3.0" + checksum: 10/ca811409c46de84618e4e7f90469184b50d16618b2f027a5ebeccb0d83ee7f51eca229e71f5b15cdec008ca247ad2ccabfdd3daf861604fcc7e341d0c35c30ca + languageName: node + linkType: hard + "tr46@npm:~0.0.3": version: 0.0.3 resolution: "tr46@npm:0.0.3" @@ -37702,14 +36831,14 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^1.11.1, tslib@npm:^1.8.1": +"tslib@npm:^1.8.1": version: 1.14.1 resolution: "tslib@npm:1.14.1" checksum: 10/7dbf34e6f55c6492637adb81b555af5e3b4f9cc6b998fb440dac82d3b42bdc91560a35a5fb75e20e24a076c651438234da6743d139e4feabf0783f3cdfe1dddb languageName: node linkType: hard -"tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.2.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.6.2": +"tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.2.0, tslib@npm:^2.4.0, tslib@npm:^2.6.2": version: 2.7.0 resolution: "tslib@npm:2.7.0" checksum: 10/9a5b47ddac65874fa011c20ff76db69f97cf90c78cff5934799ab8894a5342db2d17b4e7613a087046bc1d133d21547ddff87ac558abeec31ffa929c88b7fce6 @@ -39460,6 +38589,16 @@ __metadata: languageName: node linkType: hard +"whatwg-url@npm:^13.0.0": + version: 13.0.0 + resolution: "whatwg-url@npm:13.0.0" + dependencies: + tr46: "npm:^4.1.1" + webidl-conversions: "npm:^7.0.0" + checksum: 10/1675f5b786bbc2809de8bde5e0c99790cd50c36227942c851b1c2445cc1860a26fd15a4d6eca2cd996882bfde93b66fbc88864cd9b84f2c725427afd81e0f024 + languageName: node + linkType: hard + "whatwg-url@npm:^5.0.0": version: 5.0.0 resolution: "whatwg-url@npm:5.0.0"