From 7a5ab89bfba6cc2c80807ff9a3b2c7ac17ae7988 Mon Sep 17 00:00:00 2001 From: Tasso Date: Tue, 23 Jul 2024 12:44:40 -0300 Subject: [PATCH 1/4] Fix some package references --- apps/meteor/app/utils/client/lib/SDKClient.ts | 6 ++---- ee/apps/ddp-streamer/Dockerfile | 3 --- ee/apps/ddp-streamer/package.json | 2 +- ee/apps/ddp-streamer/src/Streamer.ts | 2 +- ee/apps/omnichannel-transcript/package.json | 1 - ee/apps/presence-service/Dockerfile | 3 --- ee/packages/ddp-client/package.json | 1 + ee/packages/ddp-client/src/index.ts | 5 +++++ packages/livechat/src/widget.ts | 2 +- packages/ui-contexts/package.json | 1 + .../src/ServerContext/ServerContext.ts | 10 ++++++++-- packages/ui-contexts/src/hooks/useMethod.ts | 2 +- packages/ui-contexts/src/hooks/useStream.ts | 2 +- packages/ui-contexts/src/index.ts | 17 ++--------------- yarn.lock | 9 +++++---- 15 files changed, 29 insertions(+), 37 deletions(-) diff --git a/apps/meteor/app/utils/client/lib/SDKClient.ts b/apps/meteor/app/utils/client/lib/SDKClient.ts index c174f9125f49..09748af414da 100644 --- a/apps/meteor/app/utils/client/lib/SDKClient.ts +++ b/apps/meteor/app/utils/client/lib/SDKClient.ts @@ -1,7 +1,5 @@ import type { RestClientInterface } from '@rocket.chat/api-client'; -import type { SDK } from '@rocket.chat/ddp-client/src/DDPSDK'; -import type { ClientStream } from '@rocket.chat/ddp-client/src/types/ClientStream'; -import type { StreamKeys, StreamNames, StreamerCallbackArgs } from '@rocket.chat/ddp-client/src/types/streams'; +import type { SDK, ClientStream, StreamKeys, StreamNames, StreamerCallbackArgs } from '@rocket.chat/ddp-client'; import { Emitter } from '@rocket.chat/emitter'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { DDPCommon } from 'meteor/ddp-common'; @@ -9,7 +7,7 @@ import { Meteor } from 'meteor/meteor'; import { APIClient } from './RestApiClient'; -declare module '@rocket.chat/ddp-client/src/DDPSDK' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface SDK { stream>( diff --git a/ee/apps/ddp-streamer/Dockerfile b/ee/apps/ddp-streamer/Dockerfile index 893fdcff858b..f556cbde6752 100644 --- a/ee/apps/ddp-streamer/Dockerfile +++ b/ee/apps/ddp-streamer/Dockerfile @@ -26,9 +26,6 @@ COPY ./packages/peggy-loader/dist packages/peggy-loader/dist COPY ./packages/password-policies/package.json packages/password-policies/package.json COPY ./packages/password-policies/dist packages/password-policies/dist -COPY ./packages/ui-contexts/package.json packages/ui-contexts/package.json -COPY ./packages/ui-contexts/dist packages/ui-contexts/dist - COPY ./packages/model-typings/package.json packages/model-typings/package.json COPY ./packages/model-typings/dist packages/model-typings/dist diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index b20066036c20..de01610d2d77 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -25,7 +25,6 @@ "@rocket.chat/models": "workspace:^", "@rocket.chat/rest-typings": "workspace:^", "@rocket.chat/string-helpers": "~0.31.25", - "@rocket.chat/ui-contexts": "workspace:^", "colorette": "^1.4.0", "ejson": "^2.2.3", "event-loop-stats": "^1.4.1", @@ -45,6 +44,7 @@ "ws": "^8.8.1" }, "devDependencies": { + "@rocket.chat/ddp-client": "workspace:~", "@rocket.chat/eslint-config": "workspace:^", "@types/ejson": "^2.2.1", "@types/gc-stats": "^1.4.2", diff --git a/ee/apps/ddp-streamer/src/Streamer.ts b/ee/apps/ddp-streamer/src/Streamer.ts index fcb2d9decf5e..686e3224d7ef 100644 --- a/ee/apps/ddp-streamer/src/Streamer.ts +++ b/ee/apps/ddp-streamer/src/Streamer.ts @@ -1,5 +1,5 @@ import { api } from '@rocket.chat/core-services'; -import type { StreamNames } from '@rocket.chat/ui-contexts'; +import type { StreamNames } from '@rocket.chat/ddp-client'; import type { DDPSubscription, Connection, TransformMessage } from 'meteor/rocketchat:streamer'; import WebSocket from 'ws'; diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index 5acae19a3660..50a5dd0ea29e 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -43,7 +43,6 @@ }, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", - "@rocket.chat/ui-contexts": "workspace:^", "@types/gc-stats": "^1.4.2", "@types/polka": "^0.5.6", "eslint": "~8.45.0", diff --git a/ee/apps/presence-service/Dockerfile b/ee/apps/presence-service/Dockerfile index a6b6e641a39d..aa9c1c0bd6c9 100644 --- a/ee/apps/presence-service/Dockerfile +++ b/ee/apps/presence-service/Dockerfile @@ -43,9 +43,6 @@ COPY ./packages/server-cloud-communication/ packages/server-cloud-communication/ COPY ./ee/packages/license/package.json packages/license/package.json COPY ./ee/packages/license/dist packages/license/dist -COPY ./packages/ui-contexts/package.json packages/ui-contexts/package.json -COPY ./packages/ui-contexts/dist packages/ui-contexts/dist - COPY ./packages/ui-kit/package.json packages/ui-kit/package.json COPY ./packages/ui-kit/dist packages/ui-kit/dist diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index 394a0b436180..b5068cd89bd0 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -35,6 +35,7 @@ }, "dependencies": { "@rocket.chat/api-client": "workspace:^", + "@rocket.chat/core-typings": "workspace:~", "@rocket.chat/rest-typings": "workspace:^" } } diff --git a/ee/packages/ddp-client/src/index.ts b/ee/packages/ddp-client/src/index.ts index 2c0fec409180..15f13add5a3a 100644 --- a/ee/packages/ddp-client/src/index.ts +++ b/ee/packages/ddp-client/src/index.ts @@ -1,3 +1,8 @@ export * from './DDPSDK'; export * from './legacy/RocketchatSDKLegacy'; export * from './livechat/LivechatClientImpl'; +export * from './livechat/types/LivechatSDK'; +export * from './types/ClientStream'; +export * from './types/methods'; +export * from './types/streams'; +export type { SDK } from './types/SDK'; diff --git a/packages/livechat/src/widget.ts b/packages/livechat/src/widget.ts index 47f073aaff0a..9a7af87de95d 100644 --- a/packages/livechat/src/widget.ts +++ b/packages/livechat/src/widget.ts @@ -1,5 +1,5 @@ import type { UserStatus } from '@rocket.chat/core-typings'; -import type { LivechatRoomEvents } from '@rocket.chat/ddp-client/dist/livechat/types/LivechatSDK'; +import type { LivechatRoomEvents } from '@rocket.chat/ddp-client'; import mitt from 'mitt'; import { isDefined } from './helpers/isDefined'; diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index c7d7e31780f3..8aded6efc02b 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -4,6 +4,7 @@ "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", + "@rocket.chat/ddp-client": "workspace:~", "@rocket.chat/emitter": "~0.31.25", "@rocket.chat/fuselage-hooks": "^0.33.1", "@rocket.chat/i18n": "workspace:~", diff --git a/packages/ui-contexts/src/ServerContext/ServerContext.ts b/packages/ui-contexts/src/ServerContext/ServerContext.ts index 14a2b0e1a3ea..e5b7fd63c1c5 100644 --- a/packages/ui-contexts/src/ServerContext/ServerContext.ts +++ b/packages/ui-contexts/src/ServerContext/ServerContext.ts @@ -1,6 +1,12 @@ import type { IServerInfo, Serialized } from '@rocket.chat/core-typings'; -import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn } from '@rocket.chat/ddp-client/src/types/methods'; -import type { StreamKeys, StreamNames, StreamerCallbackArgs } from '@rocket.chat/ddp-client/src/types/streams'; +import type { + ServerMethodName, + ServerMethodParameters, + ServerMethodReturn, + StreamKeys, + StreamNames, + StreamerCallbackArgs, +} from '@rocket.chat/ddp-client'; import type { Method, OperationParams, OperationResult, PathFor, PathPattern, UrlParams } from '@rocket.chat/rest-typings'; import { createContext } from 'react'; diff --git a/packages/ui-contexts/src/hooks/useMethod.ts b/packages/ui-contexts/src/hooks/useMethod.ts index 0d71f2883972..491ed1e02819 100644 --- a/packages/ui-contexts/src/hooks/useMethod.ts +++ b/packages/ui-contexts/src/hooks/useMethod.ts @@ -1,4 +1,4 @@ -import type { ServerMethodFunction, ServerMethodParameters, ServerMethods } from '@rocket.chat/ddp-client/src/types/methods'; +import type { ServerMethodFunction, ServerMethodParameters, ServerMethods } from '@rocket.chat/ddp-client'; import { useCallback, useContext } from 'react'; import { ServerContext } from '../ServerContext'; diff --git a/packages/ui-contexts/src/hooks/useStream.ts b/packages/ui-contexts/src/hooks/useStream.ts index d6fb5e76be78..cb008eea468a 100644 --- a/packages/ui-contexts/src/hooks/useStream.ts +++ b/packages/ui-contexts/src/hooks/useStream.ts @@ -1,4 +1,4 @@ -import type { StreamNames, StreamerEvents, StreamKeys, StreamerCallbackArgs } from '@rocket.chat/ddp-client/src/types/streams'; +import type { StreamNames, StreamerEvents, StreamKeys, StreamerCallbackArgs } from '@rocket.chat/ddp-client'; import { useContext, useMemo } from 'react'; import { ServerContext } from '../ServerContext'; diff --git a/packages/ui-contexts/src/index.ts b/packages/ui-contexts/src/index.ts index e433aadaf1a6..cb3b3e976990 100644 --- a/packages/ui-contexts/src/index.ts +++ b/packages/ui-contexts/src/index.ts @@ -92,21 +92,8 @@ export { useSetOutputMediaDevice } from './hooks/useSetOutputMediaDevice'; export { useSetInputMediaDevice } from './hooks/useSetInputMediaDevice'; export { useAccountsCustomFields } from './hooks/useAccountsCustomFields'; -export { - ServerMethods, - ServerMethodName, - ServerMethodParameters, - ServerMethodReturn, - ServerMethodFunction, -} from '@rocket.chat/ddp-client/src/types/methods'; -export { - StreamerEvents, - StreamNames, - StreamKeys, - StreamerConfigs, - StreamerConfig, - StreamerCallbackArgs, -} from '@rocket.chat/ddp-client/src/types/streams'; +export { ServerMethods, ServerMethodName, ServerMethodParameters, ServerMethodReturn, ServerMethodFunction } from '@rocket.chat/ddp-client'; +export { StreamerEvents, StreamNames, StreamKeys, StreamerConfigs, StreamerConfig, StreamerCallbackArgs } from '@rocket.chat/ddp-client'; export { UploadResult } from './ServerContext'; export { TranslationKey, TranslationLanguage } from './TranslationContext'; export { Fields } from './UserContext'; diff --git a/yarn.lock b/yarn.lock index 05788b5fed94..8de2a76ed66c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8636,7 +8636,7 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/core-typings@workspace:^, @rocket.chat/core-typings@workspace:packages/core-typings": +"@rocket.chat/core-typings@workspace:^, @rocket.chat/core-typings@workspace:packages/core-typings, @rocket.chat/core-typings@workspace:~": version: 0.0.0-use.local resolution: "@rocket.chat/core-typings@workspace:packages/core-typings" dependencies: @@ -8691,11 +8691,12 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/ddp-client@workspace:^, @rocket.chat/ddp-client@workspace:ee/packages/ddp-client": +"@rocket.chat/ddp-client@workspace:^, @rocket.chat/ddp-client@workspace:ee/packages/ddp-client, @rocket.chat/ddp-client@workspace:~": version: 0.0.0-use.local resolution: "@rocket.chat/ddp-client@workspace:ee/packages/ddp-client" dependencies: "@rocket.chat/api-client": "workspace:^" + "@rocket.chat/core-typings": "workspace:~" "@rocket.chat/rest-typings": "workspace:^" "@swc/core": ^1.3.95 "@swc/jest": ^0.2.29 @@ -8720,6 +8721,7 @@ __metadata: "@rocket.chat/apps-engine": alpha "@rocket.chat/core-services": "workspace:^" "@rocket.chat/core-typings": "workspace:^" + "@rocket.chat/ddp-client": "workspace:~" "@rocket.chat/emitter": ~0.31.25 "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/instance-status": "workspace:^" @@ -8728,7 +8730,6 @@ __metadata: "@rocket.chat/models": "workspace:^" "@rocket.chat/rest-typings": "workspace:^" "@rocket.chat/string-helpers": ~0.31.25 - "@rocket.chat/ui-contexts": "workspace:^" "@types/ejson": ^2.2.1 "@types/gc-stats": ^1.4.2 "@types/meteor": ^2.9.8 @@ -9824,7 +9825,6 @@ __metadata: "@rocket.chat/omnichannel-services": "workspace:^" "@rocket.chat/pdf-worker": "workspace:^" "@rocket.chat/tools": "workspace:^" - "@rocket.chat/ui-contexts": "workspace:^" "@types/gc-stats": ^1.4.2 "@types/node": ^14.18.63 "@types/polka": ^0.5.6 @@ -10379,6 +10379,7 @@ __metadata: resolution: "@rocket.chat/ui-contexts@workspace:packages/ui-contexts" dependencies: "@rocket.chat/core-typings": "workspace:^" + "@rocket.chat/ddp-client": "workspace:~" "@rocket.chat/emitter": ~0.31.25 "@rocket.chat/fuselage-hooks": ^0.33.1 "@rocket.chat/i18n": "workspace:~" From 7098a4f3a3e9706a0ac4979fc46b2f9a3df57a24 Mon Sep 17 00:00:00 2001 From: Tasso Date: Tue, 23 Jul 2024 17:38:56 -0300 Subject: [PATCH 2/4] Replace some `@rocket.chat/ui-contexts` type imports with `@rocket.chat/ddp-client` --- apps/meteor/app/2fa/server/methods/checkCodesRemaining.ts | 4 ++-- apps/meteor/app/2fa/server/methods/disable.ts | 4 ++-- apps/meteor/app/2fa/server/methods/enable.ts | 4 ++-- apps/meteor/app/2fa/server/methods/regenerateCodes.ts | 4 ++-- apps/meteor/app/2fa/server/methods/validateTempToken.ts | 4 ++-- apps/meteor/app/assets/server/assets.ts | 4 ++-- .../authorization/server/methods/addPermissionToRole.ts | 4 ++-- .../app/authorization/server/methods/addUserToRole.ts | 4 ++-- .../meteor/app/authorization/server/methods/deleteRole.ts | 4 ++-- .../server/methods/removeRoleFromPermission.ts | 4 ++-- .../authorization/server/methods/removeUserFromRole.ts | 4 ++-- .../authorization/server/streamer/permissions/index.ts | 4 ++-- .../autotranslate/server/methods/getProviderUiMetadata.ts | 4 ++-- .../autotranslate/server/methods/getSupportedLanguages.ts | 4 ++-- .../app/autotranslate/server/methods/saveSettings.ts | 4 ++-- .../app/autotranslate/server/methods/translateMessage.ts | 4 ++-- apps/meteor/app/bot-helpers/server/index.ts | 4 ++-- .../channel-settings/server/methods/saveRoomSettings.ts | 4 ++-- apps/meteor/app/cloud/server/methods.ts | 4 ++-- apps/meteor/app/crowd/server/methods.ts | 5 +++-- .../app/custom-sounds/server/methods/deleteCustomSound.ts | 4 ++-- .../custom-sounds/server/methods/insertOrUpdateSound.ts | 4 ++-- .../app/custom-sounds/server/methods/listCustomSounds.ts | 4 ++-- .../app/custom-sounds/server/methods/uploadCustomSound.ts | 4 ++-- .../app/discussion/server/methods/createDiscussion.ts | 4 ++-- apps/meteor/app/e2e/server/methods/fetchMyKeys.ts | 4 ++-- .../app/e2e/server/methods/getUsersOfRoomWithoutKey.ts | 4 ++-- .../app/e2e/server/methods/requestSubscriptionKeys.ts | 4 ++-- apps/meteor/app/e2e/server/methods/resetOwnE2EKey.ts | 4 ++-- apps/meteor/app/e2e/server/methods/setRoomKeyID.ts | 4 ++-- .../app/e2e/server/methods/setUserPublicAndPrivateKeys.ts | 4 ++-- apps/meteor/app/e2e/server/methods/updateGroupKey.ts | 4 ++-- .../app/emoji-custom/server/methods/deleteEmojiCustom.ts | 4 ++-- .../emoji-custom/server/methods/insertOrUpdateEmoji.ts | 4 ++-- .../app/emoji-custom/server/methods/listEmojiCustom.ts | 4 ++-- .../app/emoji-custom/server/methods/uploadEmojiCustom.ts | 4 ++-- apps/meteor/app/federation/server/methods/dashboard.ts | 4 ++-- .../app/federation/server/methods/loadContextEvents.ts | 4 ++-- apps/meteor/app/federation/server/methods/testSetup.ts | 4 ++-- .../meteor/app/file-upload/server/methods/getS3FileUrl.ts | 4 ++-- .../app/file-upload/server/methods/sendFileMessage.ts | 4 ++-- apps/meteor/app/iframe-login/server/iframe_server.ts | 4 ++-- .../importer/server/methods/downloadPublicImportFile.ts | 4 ++-- .../app/importer/server/methods/getImportFileData.ts | 4 ++-- .../app/importer/server/methods/getImportProgress.ts | 4 ++-- .../importer/server/methods/getLatestImportOperations.ts | 4 ++-- apps/meteor/app/importer/server/methods/startImport.ts | 4 ++-- .../app/importer/server/methods/uploadImportFile.ts | 4 ++-- .../server/methods/clearIntegrationHistory.ts | 4 ++-- .../server/methods/incoming/addIncomingIntegration.ts | 4 ++-- .../server/methods/incoming/deleteIncomingIntegration.ts | 4 ++-- .../server/methods/incoming/updateIncomingIntegration.ts | 4 ++-- .../server/methods/outgoing/addOutgoingIntegration.ts | 4 ++-- .../server/methods/outgoing/deleteOutgoingIntegration.ts | 4 ++-- .../server/methods/outgoing/replayOutgoingIntegration.ts | 4 ++-- .../server/methods/outgoing/updateOutgoingIntegration.ts | 4 ++-- apps/meteor/app/irc/server/methods/resetIrcConnection.ts | 4 ++-- apps/meteor/app/lib/client/methods/sendMessage.ts | 2 +- apps/meteor/app/lib/server/methods/addOAuthService.ts | 4 ++-- apps/meteor/app/lib/server/methods/addUserToRoom.ts | 4 ++-- apps/meteor/app/lib/server/methods/addUsersToRoom.ts | 4 ++-- apps/meteor/app/lib/server/methods/archiveRoom.ts | 4 ++-- apps/meteor/app/lib/server/methods/blockUser.ts | 4 ++-- .../app/lib/server/methods/checkRegistrationSecretURL.ts | 2 +- .../app/lib/server/methods/checkUsernameAvailability.ts | 4 ++-- apps/meteor/app/lib/server/methods/cleanRoomHistory.ts | 4 ++-- apps/meteor/app/lib/server/methods/createChannel.ts | 4 ++-- apps/meteor/app/lib/server/methods/createPrivateGroup.ts | 4 ++-- apps/meteor/app/lib/server/methods/createToken.ts | 4 ++-- apps/meteor/app/lib/server/methods/deleteMessage.ts | 4 ++-- .../meteor/app/lib/server/methods/deleteUserOwnAccount.ts | 4 ++-- .../app/lib/server/methods/executeSlashCommandPreview.ts | 4 ++-- apps/meteor/app/lib/server/methods/getChannelHistory.ts | 4 ++-- apps/meteor/app/lib/server/methods/getMessages.ts | 4 ++-- apps/meteor/app/lib/server/methods/getRoomJoinCode.ts | 4 ++-- apps/meteor/app/lib/server/methods/getRoomRoles.ts | 4 ++-- apps/meteor/app/lib/server/methods/getSingleMessage.ts | 4 ++-- .../app/lib/server/methods/getSlashCommandPreviews.ts | 4 ++-- apps/meteor/app/lib/server/methods/getUserRoles.ts | 4 ++-- .../app/lib/server/methods/getUsernameSuggestion.ts | 4 ++-- apps/meteor/app/lib/server/methods/insertOrUpdateUser.ts | 4 ++-- apps/meteor/app/lib/server/methods/joinDefaultChannels.ts | 4 ++-- apps/meteor/app/lib/server/methods/joinRoom.ts | 4 ++-- apps/meteor/app/lib/server/methods/leaveRoom.ts | 4 ++-- apps/meteor/app/lib/server/methods/refreshOAuthService.ts | 4 ++-- apps/meteor/app/lib/server/methods/removeOAuthService.ts | 4 ++-- apps/meteor/app/lib/server/methods/restartServer.ts | 4 ++-- apps/meteor/app/lib/server/methods/saveCustomFields.ts | 4 ++-- apps/meteor/app/lib/server/methods/saveSetting.ts | 4 ++-- apps/meteor/app/lib/server/methods/saveSettings.ts | 4 ++-- apps/meteor/app/lib/server/methods/sendMessage.ts | 4 ++-- apps/meteor/app/lib/server/methods/sendSMTPTestEmail.ts | 4 ++-- apps/meteor/app/lib/server/methods/setAdminStatus.ts | 4 ++-- apps/meteor/app/lib/server/methods/setEmail.ts | 4 ++-- apps/meteor/app/lib/server/methods/setRealName.ts | 4 ++-- apps/meteor/app/lib/server/methods/setUsername.ts | 4 ++-- apps/meteor/app/lib/server/methods/unarchiveRoom.ts | 4 ++-- apps/meteor/app/lib/server/methods/unblockUser.ts | 4 ++-- apps/meteor/app/lib/server/methods/updateMessage.ts | 4 ++-- .../app/livechat/client/externalFrame/generateNewKey.ts | 2 +- .../app/livechat/server/externalFrame/generateNewKey.ts | 4 ++-- apps/meteor/app/livechat/server/methods/addAgent.ts | 4 ++-- apps/meteor/app/livechat/server/methods/addManager.ts | 4 ++-- .../app/livechat/server/methods/changeLivechatStatus.ts | 4 ++-- apps/meteor/app/livechat/server/methods/closeRoom.ts | 4 ++-- .../app/livechat/server/methods/discardTranscript.ts | 4 ++-- apps/meteor/app/livechat/server/methods/getAgentData.ts | 4 ++-- .../app/livechat/server/methods/getAgentOverviewData.ts | 4 ++-- .../app/livechat/server/methods/getAnalyticsChartData.ts | 4 ++-- .../livechat/server/methods/getAnalyticsOverviewData.ts | 4 ++-- .../meteor/app/livechat/server/methods/getCustomFields.ts | 4 ++-- .../server/methods/getDepartmentForwardRestrictions.ts | 4 ++-- .../app/livechat/server/methods/getFirstRoomMessage.ts | 4 ++-- apps/meteor/app/livechat/server/methods/getNextAgent.ts | 4 ++-- .../app/livechat/server/methods/getRoutingConfig.ts | 4 ++-- apps/meteor/app/livechat/server/methods/getTagsList.ts | 4 ++-- apps/meteor/app/livechat/server/methods/loadHistory.ts | 4 ++-- apps/meteor/app/livechat/server/methods/loginByToken.ts | 4 ++-- apps/meteor/app/livechat/server/methods/pageVisited.ts | 4 ++-- apps/meteor/app/livechat/server/methods/registerGuest.ts | 4 ++-- apps/meteor/app/livechat/server/methods/removeAgent.ts | 4 ++-- .../app/livechat/server/methods/removeAllClosedRooms.ts | 4 ++-- .../app/livechat/server/methods/removeCustomField.ts | 4 ++-- .../app/livechat/server/methods/removeDepartment.ts | 4 ++-- apps/meteor/app/livechat/server/methods/removeManager.ts | 4 ++-- apps/meteor/app/livechat/server/methods/removeRoom.ts | 4 ++-- apps/meteor/app/livechat/server/methods/removeTrigger.ts | 4 ++-- .../app/livechat/server/methods/requestTranscript.ts | 4 ++-- .../meteor/app/livechat/server/methods/returnAsInquiry.ts | 4 ++-- apps/meteor/app/livechat/server/methods/saveAgentInfo.ts | 4 ++-- apps/meteor/app/livechat/server/methods/saveAppearance.ts | 4 ++-- .../app/livechat/server/methods/saveBusinessHour.ts | 4 ++-- .../meteor/app/livechat/server/methods/saveCustomField.ts | 4 ++-- apps/meteor/app/livechat/server/methods/saveDepartment.ts | 4 ++-- .../app/livechat/server/methods/saveDepartmentAgents.ts | 4 ++-- apps/meteor/app/livechat/server/methods/saveInfo.ts | 4 ++-- .../meteor/app/livechat/server/methods/saveIntegration.ts | 4 ++-- .../app/livechat/server/methods/saveSurveyFeedback.ts | 4 ++-- apps/meteor/app/livechat/server/methods/saveTrigger.ts | 4 ++-- apps/meteor/app/livechat/server/methods/searchAgent.ts | 4 ++-- .../livechat/server/methods/sendFileLivechatMessage.ts | 4 ++-- .../app/livechat/server/methods/sendMessageLivechat.ts | 4 ++-- .../app/livechat/server/methods/sendOfflineMessage.ts | 4 ++-- apps/meteor/app/livechat/server/methods/sendTranscript.ts | 4 ++-- apps/meteor/app/livechat/server/methods/setCustomField.ts | 4 ++-- .../livechat/server/methods/setDepartmentForVisitor.ts | 4 ++-- .../meteor/app/livechat/server/methods/setUpConnection.ts | 4 ++-- apps/meteor/app/livechat/server/methods/takeInquiry.ts | 4 ++-- apps/meteor/app/livechat/server/methods/transfer.ts | 4 ++-- apps/meteor/app/livechat/server/methods/webhookTest.ts | 4 ++-- apps/meteor/app/mail-messages/server/methods/sendMail.ts | 4 ++-- .../app/mail-messages/server/methods/unsubscribe.ts | 4 ++-- .../mentions/server/methods/getUserMentionsByChannel.ts | 4 ++-- .../app/message-mark-as-unread/server/unreadMessages.ts | 4 ++-- apps/meteor/app/message-pin/server/pinMessage.ts | 4 ++-- apps/meteor/app/message-star/server/starMessage.ts | 4 ++-- .../meteor-accounts-saml/server/methods/addSamlService.ts | 4 ++-- .../app/meteor-accounts-saml/server/methods/samlLogout.ts | 4 ++-- apps/meteor/app/notifications/server/lib/Notifications.ts | 2 +- apps/meteor/app/notifications/server/lib/Presence.ts | 2 +- .../server/admin/methods/addOAuthApp.ts | 4 ++-- .../server/admin/methods/deleteOAuthApp.ts | 4 ++-- .../server/admin/methods/updateOAuthApp.ts | 4 ++-- .../meteor/app/otr/server/methods/deleteOldOTRMessages.ts | 4 ++-- apps/meteor/app/otr/server/methods/sendSystemMessages.ts | 4 ++-- apps/meteor/app/otr/server/methods/updateOTRAck.ts | 4 ++-- .../server/methods/saveNotificationSettings.ts | 4 ++-- apps/meteor/app/push/server/methods.ts | 4 ++-- apps/meteor/app/reactions/client/methods/setReaction.ts | 2 +- apps/meteor/app/reactions/server/setReaction.ts | 4 ++-- apps/meteor/app/search/server/methods.ts | 4 ++-- apps/meteor/app/slackbridge/server/removeChannelLinks.ts | 4 ++-- .../meteor/app/statistics/server/methods/getStatistics.ts | 4 ++-- apps/meteor/app/threads/server/methods/followMessage.ts | 4 ++-- .../app/threads/server/methods/getThreadMessages.ts | 4 ++-- apps/meteor/app/threads/server/methods/getThreadsList.ts | 4 ++-- apps/meteor/app/threads/server/methods/unfollowMessage.ts | 4 ++-- .../client/models/CachedCollection.ts | 2 +- .../user-status/server/methods/deleteCustomUserStatus.ts | 4 ++-- .../app/user-status/server/methods/getUserStatusText.ts | 4 ++-- .../server/methods/insertOrUpdateUserStatus.ts | 4 ++-- .../user-status/server/methods/listCustomUserStatus.ts | 4 ++-- .../app/user-status/server/methods/setUserStatus.ts | 4 ++-- apps/meteor/app/utils/client/lib/SDKClient.ts | 3 +-- apps/meteor/app/utils/lib/slashCommand.ts | 2 +- apps/meteor/app/utils/server/slashCommand.ts | 2 +- .../app/version-check/server/methods/banner_dismiss.ts | 4 ++-- apps/meteor/app/webdav/server/methods/addWebdavAccount.ts | 4 ++-- .../meteor/app/webdav/server/methods/getFileFromWebdav.ts | 6 +++--- .../meteor/app/webdav/server/methods/getWebdavFileList.ts | 4 ++-- .../app/webdav/server/methods/getWebdavFilePreview.ts | 4 ++-- .../app/webdav/server/methods/removeWebdavAccount.ts | 4 ++-- .../app/webdav/server/methods/uploadFileToWebdav.ts | 5 +++-- apps/meteor/client/lib/utils/callWithErrorHandling.ts | 2 +- apps/meteor/client/methods/hideRoom.ts | 2 +- apps/meteor/client/methods/openRoom.ts | 2 +- apps/meteor/client/methods/pinMessage.ts | 2 +- apps/meteor/client/methods/setUserActiveStatus.ts | 2 +- apps/meteor/client/methods/starMessage.ts | 2 +- apps/meteor/client/methods/toggleFavorite.ts | 2 +- apps/meteor/client/methods/unpinMessage.ts | 2 +- apps/meteor/client/methods/updateMessage.ts | 2 +- apps/meteor/client/providers/ServerProvider.tsx | 6 +++--- apps/meteor/client/stories/contexts/ServerContextMock.tsx | 3 ++- .../admin/settings/inputs/ActionSettingInput.stories.tsx | 3 ++- .../views/admin/settings/inputs/ActionSettingInput.tsx | 3 ++- apps/meteor/definition/externals/meteor/meteor.d.ts | 2 +- .../server/methods/removeCannedResponse.ts | 4 ++-- .../canned-responses/server/methods/saveCannedResponse.ts | 4 ++-- apps/meteor/ee/app/license/server/methods.ts | 4 ++-- .../app/livechat-enterprise/server/methods/addMonitor.ts | 4 ++-- .../server/methods/getUnitsFromUserRoles.ts | 4 ++-- .../server/methods/removeBusinessHour.ts | 4 ++-- .../livechat-enterprise/server/methods/removeMonitor.ts | 4 ++-- .../app/livechat-enterprise/server/methods/removeTag.ts | 4 ++-- .../app/livechat-enterprise/server/methods/removeUnit.ts | 4 ++-- .../livechat-enterprise/server/methods/resumeOnHold.ts | 4 ++-- .../ee/app/livechat-enterprise/server/methods/saveTag.ts | 4 ++-- .../ee/app/livechat-enterprise/server/methods/saveUnit.ts | 4 ++-- apps/meteor/ee/server/lib/audit/methods.ts | 4 ++-- apps/meteor/ee/server/methods/getReadReceipts.ts | 4 ++-- .../server/api/methods/generateToken.ts | 4 ++-- .../server/api/methods/regenerateToken.ts | 4 ++-- .../server/api/methods/removeToken.ts | 4 ++-- apps/meteor/server/lib/pushConfig.ts | 4 ++-- apps/meteor/server/methods/OEmbedCacheCleanup.ts | 4 ++-- apps/meteor/server/methods/addAllUserToRoom.ts | 4 ++-- apps/meteor/server/methods/addRoomLeader.ts | 4 ++-- apps/meteor/server/methods/addRoomModerator.ts | 4 ++-- apps/meteor/server/methods/addRoomOwner.ts | 4 ++-- apps/meteor/server/methods/afterVerifyEmail.ts | 4 ++-- apps/meteor/server/methods/browseChannels.ts | 4 ++-- apps/meteor/server/methods/canAccessRoom.ts | 4 ++-- apps/meteor/server/methods/channelsList.ts | 4 ++-- apps/meteor/server/methods/createDirectMessage.ts | 4 ++-- apps/meteor/server/methods/deleteFileMessage.ts | 4 ++-- apps/meteor/server/methods/deleteUser.ts | 4 ++-- apps/meteor/server/methods/eraseRoom.ts | 4 ++-- apps/meteor/server/methods/getAvatarSuggestion.ts | 4 ++-- apps/meteor/server/methods/getPasswordPolicy.ts | 5 +++-- apps/meteor/server/methods/getRoomById.ts | 4 ++-- apps/meteor/server/methods/getRoomIdByNameOrId.ts | 4 ++-- apps/meteor/server/methods/getRoomNameById.ts | 4 ++-- apps/meteor/server/methods/getSetupWizardParameters.ts | 4 ++-- apps/meteor/server/methods/getTotalChannels.ts | 4 ++-- apps/meteor/server/methods/getUsersOfRoom.ts | 4 ++-- apps/meteor/server/methods/hideRoom.ts | 4 ++-- apps/meteor/server/methods/ignoreUser.ts | 4 ++-- apps/meteor/server/methods/loadHistory.ts | 4 ++-- apps/meteor/server/methods/loadLocale.ts | 4 ++-- apps/meteor/server/methods/loadMissedMessages.ts | 4 ++-- apps/meteor/server/methods/loadNextMessages.ts | 4 ++-- apps/meteor/server/methods/loadSurroundingMessages.ts | 4 ++-- apps/meteor/server/methods/logoutCleanUp.ts | 4 ++-- apps/meteor/server/methods/messageSearch.ts | 4 ++-- apps/meteor/server/methods/muteUserInRoom.ts | 4 ++-- apps/meteor/server/methods/openRoom.ts | 4 ++-- apps/meteor/server/methods/readMessages.ts | 4 ++-- apps/meteor/server/methods/readThreads.ts | 4 ++-- apps/meteor/server/methods/registerUser.ts | 4 ++-- apps/meteor/server/methods/removeRoomLeader.ts | 4 ++-- apps/meteor/server/methods/removeRoomModerator.ts | 4 ++-- apps/meteor/server/methods/removeRoomOwner.ts | 4 ++-- apps/meteor/server/methods/removeUserFromRoom.ts | 4 ++-- apps/meteor/server/methods/reportMessage.ts | 4 ++-- apps/meteor/server/methods/requestDataDownload.ts | 4 ++-- apps/meteor/server/methods/resetAvatar.ts | 4 ++-- apps/meteor/server/methods/roomNameExists.ts | 4 ++-- apps/meteor/server/methods/saveUserPreferences.ts | 4 ++-- apps/meteor/server/methods/saveUserProfile.ts | 4 ++-- apps/meteor/server/methods/sendConfirmationEmail.ts | 2 +- apps/meteor/server/methods/sendForgotPasswordEmail.ts | 4 ++-- apps/meteor/server/methods/setAvatarFromService.ts | 4 ++-- apps/meteor/server/methods/setUserActiveStatus.ts | 4 ++-- apps/meteor/server/methods/setUserPassword.ts | 4 ++-- apps/meteor/server/methods/toggleFavorite.ts | 4 ++-- apps/meteor/server/methods/unmuteUserInRoom.ts | 4 ++-- apps/meteor/server/methods/userPresence.ts | 4 ++-- apps/meteor/server/methods/userSetUtcOffset.ts | 4 ++-- .../server/modules/notifications/notifications.module.ts | 4 ++-- apps/meteor/server/modules/streamer/streamer.module.ts | 2 +- apps/meteor/server/publications/messages.ts | 4 ++-- apps/meteor/server/publications/room/index.ts | 4 ++-- apps/meteor/server/publications/settings/index.ts | 4 ++-- apps/meteor/server/publications/spotlight.ts | 4 ++-- apps/meteor/server/publications/subscription/index.ts | 4 ++-- ee/packages/ddp-client/src/types/methods.ts | 4 ---- packages/livechat/src/providers/ServerProvider.tsx | 8 ++++---- packages/mock-providers/package.json | 1 + packages/mock-providers/src/MockedAppRootBuilder.tsx | 4 +--- packages/mock-providers/src/MockedServerContext.tsx | 2 +- packages/ui-contexts/src/hooks/useMethod.ts | 6 +++++- packages/ui-contexts/src/index.ts | 2 -- yarn.lock | 1 + 294 files changed, 568 insertions(+), 565 deletions(-) diff --git a/apps/meteor/app/2fa/server/methods/checkCodesRemaining.ts b/apps/meteor/app/2fa/server/methods/checkCodesRemaining.ts index 219a78483cea..f5f5b0e1f275 100644 --- a/apps/meteor/app/2fa/server/methods/checkCodesRemaining.ts +++ b/apps/meteor/app/2fa/server/methods/checkCodesRemaining.ts @@ -1,7 +1,7 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { '2fa:checkCodesRemaining': () => { remaining: number }; diff --git a/apps/meteor/app/2fa/server/methods/disable.ts b/apps/meteor/app/2fa/server/methods/disable.ts index 0927b3f854ac..d2c71febdc35 100644 --- a/apps/meteor/app/2fa/server/methods/disable.ts +++ b/apps/meteor/app/2fa/server/methods/disable.ts @@ -1,10 +1,10 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { TOTP } from '../lib/totp'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { '2fa:disable': (code: string) => Promise; diff --git a/apps/meteor/app/2fa/server/methods/enable.ts b/apps/meteor/app/2fa/server/methods/enable.ts index 3b9f35dfcd9d..7649df3c3714 100644 --- a/apps/meteor/app/2fa/server/methods/enable.ts +++ b/apps/meteor/app/2fa/server/methods/enable.ts @@ -1,10 +1,10 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { TOTP } from '../lib/totp'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { '2fa:enable': () => Promise<{ secret: string; url: string }>; diff --git a/apps/meteor/app/2fa/server/methods/regenerateCodes.ts b/apps/meteor/app/2fa/server/methods/regenerateCodes.ts index e0f4cfaa4797..6968abfb93c2 100644 --- a/apps/meteor/app/2fa/server/methods/regenerateCodes.ts +++ b/apps/meteor/app/2fa/server/methods/regenerateCodes.ts @@ -1,10 +1,10 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { TOTP } from '../lib/totp'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { '2fa:regenerateCodes': (userToken: string) => { codes: string[] } | undefined; diff --git a/apps/meteor/app/2fa/server/methods/validateTempToken.ts b/apps/meteor/app/2fa/server/methods/validateTempToken.ts index cc2b44372a04..840fadc8cbf7 100644 --- a/apps/meteor/app/2fa/server/methods/validateTempToken.ts +++ b/apps/meteor/app/2fa/server/methods/validateTempToken.ts @@ -1,11 +1,11 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { notifyOnUserChangeAsync } from '../../../lib/server/lib/notifyListener'; import { TOTP } from '../lib/totp'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { '2fa:validateTempToken': (userToken: string) => { codes: string[] } | undefined; diff --git a/apps/meteor/app/assets/server/assets.ts b/apps/meteor/app/assets/server/assets.ts index b9653a2f1b9a..5d627a4b1d29 100644 --- a/apps/meteor/app/assets/server/assets.ts +++ b/apps/meteor/app/assets/server/assets.ts @@ -2,8 +2,8 @@ import crypto from 'crypto'; import type { ServerResponse, IncomingMessage } from 'http'; import type { IRocketChatAssets, IRocketChatAsset, ISetting } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Settings } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import type { NextHandleFunction } from 'connect'; import sizeOf from 'image-size'; import { Meteor } from 'meteor/meteor'; @@ -406,7 +406,7 @@ Meteor.startup(() => { }, 200); }); -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { refreshClients(): boolean; diff --git a/apps/meteor/app/authorization/server/methods/addPermissionToRole.ts b/apps/meteor/app/authorization/server/methods/addPermissionToRole.ts index 13a114732bd2..9a336478ca3e 100644 --- a/apps/meteor/app/authorization/server/methods/addPermissionToRole.ts +++ b/apps/meteor/app/authorization/server/methods/addPermissionToRole.ts @@ -1,12 +1,12 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Permissions } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { notifyOnPermissionChangedById } from '../../../lib/server/lib/notifyListener'; import { CONSTANTS, AuthorizationUtils } from '../../lib'; import { hasPermissionAsync } from '../functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'authorization:addPermissionToRole'(permissionId: string, role: string): void; diff --git a/apps/meteor/app/authorization/server/methods/addUserToRole.ts b/apps/meteor/app/authorization/server/methods/addUserToRole.ts index 02ccc76373f1..81582dd7e9fb 100644 --- a/apps/meteor/app/authorization/server/methods/addUserToRole.ts +++ b/apps/meteor/app/authorization/server/methods/addUserToRole.ts @@ -1,14 +1,14 @@ import { api } from '@rocket.chat/core-services'; import type { IRole, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Roles, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { settings } from '../../../settings/server'; import { hasPermissionAsync } from '../functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'authorization:addUserToRole'(roleId: IRole['_id'], username: IUser['username'], scope: string | undefined): Promise; diff --git a/apps/meteor/app/authorization/server/methods/deleteRole.ts b/apps/meteor/app/authorization/server/methods/deleteRole.ts index 2ff09deadf68..140852e0f1ec 100644 --- a/apps/meteor/app/authorization/server/methods/deleteRole.ts +++ b/apps/meteor/app/authorization/server/methods/deleteRole.ts @@ -1,13 +1,13 @@ import type { IRole } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Roles } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import type { DeleteResult } from 'mongodb'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { hasPermissionAsync } from '../functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'authorization:deleteRole'(roleId: IRole['_id'] | IRole['name']): Promise; diff --git a/apps/meteor/app/authorization/server/methods/removeRoleFromPermission.ts b/apps/meteor/app/authorization/server/methods/removeRoleFromPermission.ts index 91a4df1eddf7..68ca11ef9fb5 100644 --- a/apps/meteor/app/authorization/server/methods/removeRoleFromPermission.ts +++ b/apps/meteor/app/authorization/server/methods/removeRoleFromPermission.ts @@ -1,12 +1,12 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Permissions } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { notifyOnPermissionChangedById } from '../../../lib/server/lib/notifyListener'; import { CONSTANTS } from '../../lib'; import { hasPermissionAsync } from '../functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'authorization:removeRoleFromPermission'(permissionId: string, role: string): void; diff --git a/apps/meteor/app/authorization/server/methods/removeUserFromRole.ts b/apps/meteor/app/authorization/server/methods/removeUserFromRole.ts index d5dba40a1e53..56f0c2e307ab 100644 --- a/apps/meteor/app/authorization/server/methods/removeUserFromRole.ts +++ b/apps/meteor/app/authorization/server/methods/removeUserFromRole.ts @@ -1,14 +1,14 @@ import { api } from '@rocket.chat/core-services'; import type { IRole, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Roles, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { settings } from '../../../settings/server'; import { hasPermissionAsync } from '../functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'authorization:removeUserFromRole'(roleId: IRole['_id'], username: IUser['username'], scope?: string): Promise; diff --git a/apps/meteor/app/authorization/server/streamer/permissions/index.ts b/apps/meteor/app/authorization/server/streamer/permissions/index.ts index ff8fd3c93262..e74cf37869fd 100644 --- a/apps/meteor/app/authorization/server/streamer/permissions/index.ts +++ b/apps/meteor/app/authorization/server/streamer/permissions/index.ts @@ -1,11 +1,11 @@ import type { IPermission, RocketChatRecordDeleted } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Permissions } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check, Match } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import type { WithId } from 'mongodb'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'permissions/get'( diff --git a/apps/meteor/app/autotranslate/server/methods/getProviderUiMetadata.ts b/apps/meteor/app/autotranslate/server/methods/getProviderUiMetadata.ts index 30760e854ed1..1d443c21d210 100644 --- a/apps/meteor/app/autotranslate/server/methods/getProviderUiMetadata.ts +++ b/apps/meteor/app/autotranslate/server/methods/getProviderUiMetadata.ts @@ -1,9 +1,9 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { TranslationProviderRegistry } from '../autotranslate'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'autoTranslate.getProviderUiMetadata'(): Record; diff --git a/apps/meteor/app/autotranslate/server/methods/getSupportedLanguages.ts b/apps/meteor/app/autotranslate/server/methods/getSupportedLanguages.ts index e0118e8d95a4..7b9614da7739 100644 --- a/apps/meteor/app/autotranslate/server/methods/getSupportedLanguages.ts +++ b/apps/meteor/app/autotranslate/server/methods/getSupportedLanguages.ts @@ -1,5 +1,5 @@ import type { ISupportedLanguage } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { Meteor } from 'meteor/meteor'; @@ -7,7 +7,7 @@ import { TranslationProviderRegistry } from '..'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { settings } from '../../../settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'autoTranslate.getSupportedLanguages'(targetLanguage: string): ISupportedLanguage[] | undefined; diff --git a/apps/meteor/app/autotranslate/server/methods/saveSettings.ts b/apps/meteor/app/autotranslate/server/methods/saveSettings.ts index e396d78887a9..2f119c948263 100644 --- a/apps/meteor/app/autotranslate/server/methods/saveSettings.ts +++ b/apps/meteor/app/autotranslate/server/methods/saveSettings.ts @@ -1,11 +1,11 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'autoTranslate.saveSettings'(rid: string, field: string, value: string, options: { defaultLanguage: string }): boolean; diff --git a/apps/meteor/app/autotranslate/server/methods/translateMessage.ts b/apps/meteor/app/autotranslate/server/methods/translateMessage.ts index d90cad90ce77..551eba57c005 100644 --- a/apps/meteor/app/autotranslate/server/methods/translateMessage.ts +++ b/apps/meteor/app/autotranslate/server/methods/translateMessage.ts @@ -1,11 +1,11 @@ import type { IMessage } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { TranslationProviderRegistry } from '..'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'autoTranslate.translateMessage'(message: IMessage | undefined, targetLanguage: string): Promise; diff --git a/apps/meteor/app/bot-helpers/server/index.ts b/apps/meteor/app/bot-helpers/server/index.ts index 5e19e1652454..6c0984ae483d 100644 --- a/apps/meteor/app/bot-helpers/server/index.ts +++ b/apps/meteor/app/bot-helpers/server/index.ts @@ -1,7 +1,7 @@ import type { IUser } from '@rocket.chat/core-typings'; import { UserStatus } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import type { Filter, FindCursor } from 'mongodb'; @@ -194,7 +194,7 @@ settings.watch('BotHelpers_userFields', (value) => { botHelpers.setupCursors(value); }); -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { botRequest: (prop: keyof BotHelpers, ...params: unknown[]) => Promise; diff --git a/apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts b/apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts index e17faebea384..e3f45daa5b18 100644 --- a/apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts +++ b/apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts @@ -1,8 +1,8 @@ import { Team } from '@rocket.chat/core-services'; import type { IRoom, IRoomWithRetentionPolicy, IUser, MessageTypesValues } from '@rocket.chat/core-typings'; import { TEAM_TYPE } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -304,7 +304,7 @@ const settingSavers: RoomSettingsSavers = { }, }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { saveRoomSettings(rid: IRoom['_id'], settings: Partial): Promise<{ result: true; rid: IRoom['_id'] }>; diff --git a/apps/meteor/app/cloud/server/methods.ts b/apps/meteor/app/cloud/server/methods.ts index 0e47a8ba8754..29daefe0d58c 100644 --- a/apps/meteor/app/cloud/server/methods.ts +++ b/apps/meteor/app/cloud/server/methods.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -13,7 +13,7 @@ import { startRegisterWorkspace } from './functions/startRegisterWorkspace'; import { syncWorkspace } from './functions/syncWorkspace'; import { userLogout } from './functions/userLogout'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'cloud:checkRegisterStatus': () => { diff --git a/apps/meteor/app/crowd/server/methods.ts b/apps/meteor/app/crowd/server/methods.ts index a621e3c8d027..48faa2fcbcab 100644 --- a/apps/meteor/app/crowd/server/methods.ts +++ b/apps/meteor/app/crowd/server/methods.ts @@ -1,4 +1,5 @@ -import type { ServerMethods, TranslationKey } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; +import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../authorization/server/functions/hasPermission'; @@ -6,7 +7,7 @@ import { settings } from '../../settings/server'; import { CROWD } from './crowd'; import { logger } from './logger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { crowd_test_connection(): { message: TranslationKey; params: string[] }; diff --git a/apps/meteor/app/custom-sounds/server/methods/deleteCustomSound.ts b/apps/meteor/app/custom-sounds/server/methods/deleteCustomSound.ts index 5ddf0cc66e52..1c63c7a67d9f 100644 --- a/apps/meteor/app/custom-sounds/server/methods/deleteCustomSound.ts +++ b/apps/meteor/app/custom-sounds/server/methods/deleteCustomSound.ts @@ -1,13 +1,13 @@ import { api } from '@rocket.chat/core-services'; import type { ICustomSound } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { CustomSounds } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { RocketChatFileCustomSoundsInstance } from '../startup/custom-sounds'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { deleteCustomSound(_id: ICustomSound['_id']): Promise; diff --git a/apps/meteor/app/custom-sounds/server/methods/insertOrUpdateSound.ts b/apps/meteor/app/custom-sounds/server/methods/insertOrUpdateSound.ts index 4b48a64dc14c..1b922c6b162e 100644 --- a/apps/meteor/app/custom-sounds/server/methods/insertOrUpdateSound.ts +++ b/apps/meteor/app/custom-sounds/server/methods/insertOrUpdateSound.ts @@ -1,6 +1,6 @@ import { api } from '@rocket.chat/core-services'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { CustomSounds } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -20,7 +20,7 @@ export type ICustomSoundData = { random?: number; }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { insertOrUpdateSound(soundData: ICustomSoundData): Promise; diff --git a/apps/meteor/app/custom-sounds/server/methods/listCustomSounds.ts b/apps/meteor/app/custom-sounds/server/methods/listCustomSounds.ts index 2c2130fc0d30..eda1325d7733 100644 --- a/apps/meteor/app/custom-sounds/server/methods/listCustomSounds.ts +++ b/apps/meteor/app/custom-sounds/server/methods/listCustomSounds.ts @@ -1,9 +1,9 @@ import type { ICustomSound } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { CustomSounds } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { listCustomSounds(): ICustomSound[]; diff --git a/apps/meteor/app/custom-sounds/server/methods/uploadCustomSound.ts b/apps/meteor/app/custom-sounds/server/methods/uploadCustomSound.ts index eee693634d7d..f955f373ed4d 100644 --- a/apps/meteor/app/custom-sounds/server/methods/uploadCustomSound.ts +++ b/apps/meteor/app/custom-sounds/server/methods/uploadCustomSound.ts @@ -1,6 +1,6 @@ import { api } from '@rocket.chat/core-services'; import type { RequiredField } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; @@ -8,7 +8,7 @@ import { RocketChatFile } from '../../../file/server'; import { RocketChatFileCustomSoundsInstance } from '../startup/custom-sounds'; import type { ICustomSoundData } from './insertOrUpdateSound'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { uploadCustomSound(binaryContent: string, contentType: string, soundData: RequiredField): void; diff --git a/apps/meteor/app/discussion/server/methods/createDiscussion.ts b/apps/meteor/app/discussion/server/methods/createDiscussion.ts index 18b42ba1a31f..6e670d723ec9 100644 --- a/apps/meteor/app/discussion/server/methods/createDiscussion.ts +++ b/apps/meteor/app/discussion/server/methods/createDiscussion.ts @@ -1,8 +1,8 @@ import { Message } from '@rocket.chat/core-services'; import type { IMessage, IRoom, IUser, MessageAttachmentDefault } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, Rooms, Users } from '@rocket.chat/models'; import { Random } from '@rocket.chat/random'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../../lib/callbacks'; @@ -196,7 +196,7 @@ const create = async ({ return discussion; }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { createDiscussion: typeof create; diff --git a/apps/meteor/app/e2e/server/methods/fetchMyKeys.ts b/apps/meteor/app/e2e/server/methods/fetchMyKeys.ts index 519317cb40fe..df1150cee846 100644 --- a/apps/meteor/app/e2e/server/methods/fetchMyKeys.ts +++ b/apps/meteor/app/e2e/server/methods/fetchMyKeys.ts @@ -1,8 +1,8 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'e2e.fetchMyKeys'(): { public_key?: string; private_key?: string }; diff --git a/apps/meteor/app/e2e/server/methods/getUsersOfRoomWithoutKey.ts b/apps/meteor/app/e2e/server/methods/getUsersOfRoomWithoutKey.ts index cc586676482f..1f1a21262de8 100644 --- a/apps/meteor/app/e2e/server/methods/getUsersOfRoomWithoutKey.ts +++ b/apps/meteor/app/e2e/server/methods/getUsersOfRoomWithoutKey.ts @@ -1,12 +1,12 @@ import type { IRoom, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomIdAsync } from '../../../authorization/server/functions/canAccessRoom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'e2e.getUsersOfRoomWithoutKey'(rid: IRoom['_id']): { users: Pick[] }; diff --git a/apps/meteor/app/e2e/server/methods/requestSubscriptionKeys.ts b/apps/meteor/app/e2e/server/methods/requestSubscriptionKeys.ts index 8c5add77a0bf..cf899a5d64ad 100644 --- a/apps/meteor/app/e2e/server/methods/requestSubscriptionKeys.ts +++ b/apps/meteor/app/e2e/server/methods/requestSubscriptionKeys.ts @@ -1,9 +1,9 @@ import { api } from '@rocket.chat/core-services'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'e2e.requestSubscriptionKeys'(): boolean; diff --git a/apps/meteor/app/e2e/server/methods/resetOwnE2EKey.ts b/apps/meteor/app/e2e/server/methods/resetOwnE2EKey.ts index 365feb1ac95d..b1d40e48bb5e 100644 --- a/apps/meteor/app/e2e/server/methods/resetOwnE2EKey.ts +++ b/apps/meteor/app/e2e/server/methods/resetOwnE2EKey.ts @@ -1,10 +1,10 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { resetUserE2EEncriptionKey } from '../../../../server/lib/resetUserE2EKey'; import { twoFactorRequired } from '../../../2fa/server/twoFactorRequired'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'e2e.resetOwnE2EKey'(): Promise; diff --git a/apps/meteor/app/e2e/server/methods/setRoomKeyID.ts b/apps/meteor/app/e2e/server/methods/setRoomKeyID.ts index 6b0e685616b5..b52913e4f984 100644 --- a/apps/meteor/app/e2e/server/methods/setRoomKeyID.ts +++ b/apps/meteor/app/e2e/server/methods/setRoomKeyID.ts @@ -1,13 +1,13 @@ import type { IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomIdAsync } from '../../../authorization/server/functions/canAccessRoom'; import { notifyOnRoomChangedById } from '../../../lib/server/lib/notifyListener'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'e2e.setRoomKeyID'(rid: IRoom['_id'], keyID: string): void; diff --git a/apps/meteor/app/e2e/server/methods/setUserPublicAndPrivateKeys.ts b/apps/meteor/app/e2e/server/methods/setUserPublicAndPrivateKeys.ts index 94d252601bc4..6ef35a063a28 100644 --- a/apps/meteor/app/e2e/server/methods/setUserPublicAndPrivateKeys.ts +++ b/apps/meteor/app/e2e/server/methods/setUserPublicAndPrivateKeys.ts @@ -1,8 +1,8 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'e2e.setUserPublicAndPrivateKeys'({ public_key, private_key }: { public_key: string; private_key: string; force?: boolean }): void; diff --git a/apps/meteor/app/e2e/server/methods/updateGroupKey.ts b/apps/meteor/app/e2e/server/methods/updateGroupKey.ts index c856f8cf708a..5764a021f54c 100644 --- a/apps/meteor/app/e2e/server/methods/updateGroupKey.ts +++ b/apps/meteor/app/e2e/server/methods/updateGroupKey.ts @@ -1,10 +1,10 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'e2e.updateGroupKey'(rid: string, uid: string, key: string): Promise; diff --git a/apps/meteor/app/emoji-custom/server/methods/deleteEmojiCustom.ts b/apps/meteor/app/emoji-custom/server/methods/deleteEmojiCustom.ts index 555d5544ab33..c16d3b82449b 100644 --- a/apps/meteor/app/emoji-custom/server/methods/deleteEmojiCustom.ts +++ b/apps/meteor/app/emoji-custom/server/methods/deleteEmojiCustom.ts @@ -1,13 +1,13 @@ import { api } from '@rocket.chat/core-services'; import type { ICustomEmojiDescriptor } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { EmojiCustom } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { RocketChatFileEmojiCustomInstance } from '../startup/emoji-custom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { deleteEmojiCustom(emojiID: ICustomEmojiDescriptor['_id']): boolean; diff --git a/apps/meteor/app/emoji-custom/server/methods/insertOrUpdateEmoji.ts b/apps/meteor/app/emoji-custom/server/methods/insertOrUpdateEmoji.ts index 874180097cb9..5d4a6742314b 100644 --- a/apps/meteor/app/emoji-custom/server/methods/insertOrUpdateEmoji.ts +++ b/apps/meteor/app/emoji-custom/server/methods/insertOrUpdateEmoji.ts @@ -1,6 +1,6 @@ import { api } from '@rocket.chat/core-services'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { EmojiCustom } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import limax from 'limax'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; @@ -9,7 +9,7 @@ import { trim } from '../../../../lib/utils/stringUtils'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { RocketChatFileEmojiCustomInstance } from '../startup/emoji-custom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { insertOrUpdateEmoji(emojiData: { diff --git a/apps/meteor/app/emoji-custom/server/methods/listEmojiCustom.ts b/apps/meteor/app/emoji-custom/server/methods/listEmojiCustom.ts index 485737b95f9b..a16d536d92d4 100644 --- a/apps/meteor/app/emoji-custom/server/methods/listEmojiCustom.ts +++ b/apps/meteor/app/emoji-custom/server/methods/listEmojiCustom.ts @@ -1,12 +1,12 @@ import type { IEmojiCustom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { EmojiCustom } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check, Match } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { listEmojiCustom(options?: { name?: string; aliases?: string[] }): IEmojiCustom[]; diff --git a/apps/meteor/app/emoji-custom/server/methods/uploadEmojiCustom.ts b/apps/meteor/app/emoji-custom/server/methods/uploadEmojiCustom.ts index ded98b7f5469..a46f457cd70f 100644 --- a/apps/meteor/app/emoji-custom/server/methods/uploadEmojiCustom.ts +++ b/apps/meteor/app/emoji-custom/server/methods/uploadEmojiCustom.ts @@ -1,5 +1,5 @@ import { api, Media } from '@rocket.chat/core-services'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import limax from 'limax'; import { Meteor } from 'meteor/meteor'; import sharp from 'sharp'; @@ -16,7 +16,7 @@ const getFile = async (file: Buffer, extension: string) => { return sharp(file).png().toBuffer(); }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { uploadEmojiCustom( diff --git a/apps/meteor/app/federation/server/methods/dashboard.ts b/apps/meteor/app/federation/server/methods/dashboard.ts index 90a050556893..eacb42b24cbb 100644 --- a/apps/meteor/app/federation/server/methods/dashboard.ts +++ b/apps/meteor/app/federation/server/methods/dashboard.ts @@ -1,10 +1,10 @@ import type { IFederationServer } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { federationGetServers, federationGetOverviewData } from '../functions/dashboard'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'federation:getServers': () => { data: IFederationServer[] }; diff --git a/apps/meteor/app/federation/server/methods/loadContextEvents.ts b/apps/meteor/app/federation/server/methods/loadContextEvents.ts index 9e286bbf913a..e20acb7e37c9 100644 --- a/apps/meteor/app/federation/server/methods/loadContextEvents.ts +++ b/apps/meteor/app/federation/server/methods/loadContextEvents.ts @@ -1,11 +1,11 @@ import type { IFederationEvent } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { FederationRoomEvents } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'federation:loadContextEvents'(latestEventTimestamp: number): IFederationEvent[]; diff --git a/apps/meteor/app/federation/server/methods/testSetup.ts b/apps/meteor/app/federation/server/methods/testSetup.ts index 93e501535474..bc50ef158194 100644 --- a/apps/meteor/app/federation/server/methods/testSetup.ts +++ b/apps/meteor/app/federation/server/methods/testSetup.ts @@ -1,11 +1,11 @@ import { eventTypes } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { dispatchEvent } from '../handler'; import { getFederationDomain } from '../lib/getFederationDomain'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { FEDERATION_Test_Setup(): { message: string }; diff --git a/apps/meteor/app/file-upload/server/methods/getS3FileUrl.ts b/apps/meteor/app/file-upload/server/methods/getS3FileUrl.ts index fdb8d131916d..3e9bcd192674 100644 --- a/apps/meteor/app/file-upload/server/methods/getS3FileUrl.ts +++ b/apps/meteor/app/file-upload/server/methods/getS3FileUrl.ts @@ -1,5 +1,5 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms, Uploads } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -7,7 +7,7 @@ import { UploadFS } from '../../../../server/ufs'; import { canAccessRoomAsync } from '../../../authorization/server'; import { settings } from '../../../settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getS3FileUrl(fileId: string): string; diff --git a/apps/meteor/app/file-upload/server/methods/sendFileMessage.ts b/apps/meteor/app/file-upload/server/methods/sendFileMessage.ts index 485528a5e62f..73dfd0216a73 100644 --- a/apps/meteor/app/file-upload/server/methods/sendFileMessage.ts +++ b/apps/meteor/app/file-upload/server/methods/sendFileMessage.ts @@ -7,8 +7,8 @@ import type { FilesAndAttachments, IMessage, } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms, Uploads, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -141,7 +141,7 @@ export const parseFileIntoMessageAttachments = async ( return { files, attachments }; }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { sendFileMessage: (roomId: string, _store: string, file: Partial, msgData?: Record) => boolean; diff --git a/apps/meteor/app/iframe-login/server/iframe_server.ts b/apps/meteor/app/iframe-login/server/iframe_server.ts index c7e67edf9deb..b3e661cf6ff3 100644 --- a/apps/meteor/app/iframe-login/server/iframe_server.ts +++ b/apps/meteor/app/iframe-login/server/iframe_server.ts @@ -1,5 +1,5 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Accounts } from 'meteor/accounts-base'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -23,7 +23,7 @@ Accounts.registerLoginHandler('iframe', async (result) => { } }); -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'OAuth.retrieveCredential'(credentialToken: string, credentialSecret: string): unknown; diff --git a/apps/meteor/app/importer/server/methods/downloadPublicImportFile.ts b/apps/meteor/app/importer/server/methods/downloadPublicImportFile.ts index 81e06ec8eb0f..d2da85c7cfd4 100644 --- a/apps/meteor/app/importer/server/methods/downloadPublicImportFile.ts +++ b/apps/meteor/app/importer/server/methods/downloadPublicImportFile.ts @@ -4,7 +4,7 @@ import https from 'https'; import { Import } from '@rocket.chat/core-services'; import type { IUser } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { Importers } from '..'; @@ -75,7 +75,7 @@ export const executeDownloadPublicImportFile = async (userId: IUser['_id'], file } }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { downloadPublicImportFile(fileUrl: string, importerKey: string): void; diff --git a/apps/meteor/app/importer/server/methods/getImportFileData.ts b/apps/meteor/app/importer/server/methods/getImportFileData.ts index 03f9a53abe6c..1d36f7fc5a5e 100644 --- a/apps/meteor/app/importer/server/methods/getImportFileData.ts +++ b/apps/meteor/app/importer/server/methods/getImportFileData.ts @@ -2,8 +2,8 @@ import fs from 'fs'; import path from 'path'; import type { IImportProgress, IImporterSelection } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Imports } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { Importers } from '..'; @@ -61,7 +61,7 @@ export const executeGetImportFileData = async (): Promise => { return instance.getProgress(); }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getImportProgress(): IImportProgress; diff --git a/apps/meteor/app/importer/server/methods/getLatestImportOperations.ts b/apps/meteor/app/importer/server/methods/getLatestImportOperations.ts index edf021a19eac..0471cb57955d 100644 --- a/apps/meteor/app/importer/server/methods/getLatestImportOperations.ts +++ b/apps/meteor/app/importer/server/methods/getLatestImportOperations.ts @@ -1,6 +1,6 @@ import type { IImport } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Imports } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; @@ -17,7 +17,7 @@ export const executeGetLatestImportOperations = async () => { return data.toArray(); }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getLatestImportOperations(): IImport[]; diff --git a/apps/meteor/app/importer/server/methods/startImport.ts b/apps/meteor/app/importer/server/methods/startImport.ts index af91295ede29..bbb5ce76ad1c 100644 --- a/apps/meteor/app/importer/server/methods/startImport.ts +++ b/apps/meteor/app/importer/server/methods/startImport.ts @@ -1,7 +1,7 @@ import type { IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Imports } from '@rocket.chat/models'; import type { StartImportParamsPOST } from '@rocket.chat/rest-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { Importers, Selection, SelectionChannel, SelectionUser } from '..'; @@ -32,7 +32,7 @@ export const executeStartImport = async ({ input }: StartImportParamsPOST, start await instance.startImport(selection, startedByUserId); }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { startImport(params: StartImportParamsPOST): void; diff --git a/apps/meteor/app/importer/server/methods/uploadImportFile.ts b/apps/meteor/app/importer/server/methods/uploadImportFile.ts index d6ded455793b..df5d2af883fa 100644 --- a/apps/meteor/app/importer/server/methods/uploadImportFile.ts +++ b/apps/meteor/app/importer/server/methods/uploadImportFile.ts @@ -1,6 +1,6 @@ import { Import } from '@rocket.chat/core-services'; import type { IUser } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { Importers } from '..'; @@ -55,7 +55,7 @@ export const executeUploadImportFile = async ( await instance.updateProgress(ProgressStep.FILE_LOADED); }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { uploadImportFile(binaryContent: string, contentType: string, fileName: string, importerKey: string): void; diff --git a/apps/meteor/app/integrations/server/methods/clearIntegrationHistory.ts b/apps/meteor/app/integrations/server/methods/clearIntegrationHistory.ts index 5b8f13ef1a3a..a30bb9b5ee9a 100644 --- a/apps/meteor/app/integrations/server/methods/clearIntegrationHistory.ts +++ b/apps/meteor/app/integrations/server/methods/clearIntegrationHistory.ts @@ -1,11 +1,11 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations, IntegrationHistory } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import notifications from '../../../notifications/server/lib/Notifications'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { clearIntegrationHistory(integrationId: string): Promise; diff --git a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts index db058bec960b..8f1f1b5dd576 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts @@ -1,7 +1,7 @@ import type { INewIncomingIntegration, IIncomingIntegration } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations, Roles, Subscriptions, Users, Rooms } from '@rocket.chat/models'; import { Random } from '@rocket.chat/random'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Babel } from 'meteor/babel-compiler'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -13,7 +13,7 @@ import { validateScriptEngine, isScriptEngineFrozen } from '../../lib/validateSc const validChannelChars = ['@', '#']; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { addIncomingIntegration(integration: INewIncomingIntegration): Promise; diff --git a/apps/meteor/app/integrations/server/methods/incoming/deleteIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/deleteIncomingIntegration.ts index e73a46bb27db..9a116f51bbaf 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/deleteIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/deleteIncomingIntegration.ts @@ -1,11 +1,11 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; import { notifyOnIntegrationChangedById } from '../../../../lib/server/lib/notifyListener'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { deleteIncomingIntegration(integrationId: string): Promise; diff --git a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts index 0ea5028130da..c94b7b9fd7a8 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts @@ -1,7 +1,7 @@ import type { IIntegration, INewIncomingIntegration, IUpdateIncomingIntegration } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations, Roles, Subscriptions, Users, Rooms } from '@rocket.chat/models'; import { wrapExceptions } from '@rocket.chat/tools'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Babel } from 'meteor/babel-compiler'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; @@ -12,7 +12,7 @@ import { isScriptEngineFrozen, validateScriptEngine } from '../../lib/validateSc const validChannelChars = ['@', '#']; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { updateIncomingIntegration( diff --git a/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts b/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts index c8dc31e08446..dc54c76b1897 100644 --- a/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts @@ -1,6 +1,6 @@ import type { INewOutgoingIntegration, IOutgoingIntegration } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -9,7 +9,7 @@ import { notifyOnIntegrationChanged } from '../../../../lib/server/lib/notifyLis import { validateOutgoingIntegration } from '../../lib/validateOutgoingIntegration'; import { validateScriptEngine } from '../../lib/validateScriptEngine'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { addOutgoingIntegration(integration: INewOutgoingIntegration): Promise; diff --git a/apps/meteor/app/integrations/server/methods/outgoing/deleteOutgoingIntegration.ts b/apps/meteor/app/integrations/server/methods/outgoing/deleteOutgoingIntegration.ts index c9f2211d835b..46d4c65159c0 100644 --- a/apps/meteor/app/integrations/server/methods/outgoing/deleteOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/outgoing/deleteOutgoingIntegration.ts @@ -1,11 +1,11 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations, IntegrationHistory } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; import { notifyOnIntegrationChangedById } from '../../../../lib/server/lib/notifyListener'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { deleteOutgoingIntegration(integrationId: string): Promise; diff --git a/apps/meteor/app/integrations/server/methods/outgoing/replayOutgoingIntegration.ts b/apps/meteor/app/integrations/server/methods/outgoing/replayOutgoingIntegration.ts index 417c308ca6cb..83c13f2d981b 100644 --- a/apps/meteor/app/integrations/server/methods/outgoing/replayOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/outgoing/replayOutgoingIntegration.ts @@ -1,11 +1,11 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations, IntegrationHistory } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; import { triggerHandler } from '../../lib/triggerHandler'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { replayOutgoingIntegration(params: { integrationId: string; historyId: string }): Promise; diff --git a/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts index 116dbd043039..c9b1f4ed7d64 100644 --- a/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts @@ -1,7 +1,7 @@ import type { IIntegration, INewOutgoingIntegration, IUpdateOutgoingIntegration } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Integrations, Users } from '@rocket.chat/models'; import { wrapExceptions } from '@rocket.chat/tools'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; @@ -9,7 +9,7 @@ import { notifyOnIntegrationChanged } from '../../../../lib/server/lib/notifyLis import { validateOutgoingIntegration } from '../../lib/validateOutgoingIntegration'; import { isScriptEngineFrozen, validateScriptEngine } from '../../lib/validateScriptEngine'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { updateOutgoingIntegration( diff --git a/apps/meteor/app/irc/server/methods/resetIrcConnection.ts b/apps/meteor/app/irc/server/methods/resetIrcConnection.ts index 24eef975d5d5..aaaeef1c06b8 100644 --- a/apps/meteor/app/irc/server/methods/resetIrcConnection.ts +++ b/apps/meteor/app/irc/server/methods/resetIrcConnection.ts @@ -1,12 +1,12 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Settings } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { notifyOnSettingChangedById } from '../../../lib/server/lib/notifyListener'; import { settings } from '../../../settings/server'; import Bridge from '../irc-bridge'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { resetIrcConnection(): { message: string; params: unknown[] }; diff --git a/apps/meteor/app/lib/client/methods/sendMessage.ts b/apps/meteor/app/lib/client/methods/sendMessage.ts index e824c9e491af..bdaca587493a 100644 --- a/apps/meteor/app/lib/client/methods/sendMessage.ts +++ b/apps/meteor/app/lib/client/methods/sendMessage.ts @@ -1,5 +1,5 @@ import type { IMessage, IUser } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { onClientMessageReceived } from '../../../../client/lib/onClientMessageReceived'; diff --git a/apps/meteor/app/lib/server/methods/addOAuthService.ts b/apps/meteor/app/lib/server/methods/addOAuthService.ts index 05b0e5a7e4e6..09287bb9bb74 100644 --- a/apps/meteor/app/lib/server/methods/addOAuthService.ts +++ b/apps/meteor/app/lib/server/methods/addOAuthService.ts @@ -1,11 +1,11 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { addOAuthService } from '../../../../server/lib/oauth/addOAuthService'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { addOAuthService(name: string): void; diff --git a/apps/meteor/app/lib/server/methods/addUserToRoom.ts b/apps/meteor/app/lib/server/methods/addUserToRoom.ts index 880b413d0618..8100cafc33b0 100644 --- a/apps/meteor/app/lib/server/methods/addUserToRoom.ts +++ b/apps/meteor/app/lib/server/methods/addUserToRoom.ts @@ -1,9 +1,9 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { addUsersToRoomMethod } from './addUsersToRoom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { addUserToRoom(data: { rid: string; username: string }): void; diff --git a/apps/meteor/app/lib/server/methods/addUsersToRoom.ts b/apps/meteor/app/lib/server/methods/addUsersToRoom.ts index 48b7f9db58f5..73fbf6e51a04 100644 --- a/apps/meteor/app/lib/server/methods/addUsersToRoom.ts +++ b/apps/meteor/app/lib/server/methods/addUsersToRoom.ts @@ -1,8 +1,8 @@ import { api } from '@rocket.chat/core-services'; import type { IUser } from '@rocket.chat/core-typings'; import { isRoomFederated } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Users, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -12,7 +12,7 @@ import { Federation } from '../../../../server/services/federation/Federation'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { addUserToRoom } from '../functions/addUserToRoom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { addUsersToRoom(data: { rid: string; users: string[] }): boolean; diff --git a/apps/meteor/app/lib/server/methods/archiveRoom.ts b/apps/meteor/app/lib/server/methods/archiveRoom.ts index c30014f59c11..dfa5a2c55412 100644 --- a/apps/meteor/app/lib/server/methods/archiveRoom.ts +++ b/apps/meteor/app/lib/server/methods/archiveRoom.ts @@ -1,6 +1,6 @@ import { isRegisterUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -9,7 +9,7 @@ import { roomCoordinator } from '../../../../server/lib/rooms/roomCoordinator'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { archiveRoom } from '../functions/archiveRoom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { archiveRoom(rid: string): Promise; diff --git a/apps/meteor/app/lib/server/methods/blockUser.ts b/apps/meteor/app/lib/server/methods/blockUser.ts index b65423edf25b..b967e35d7bc1 100644 --- a/apps/meteor/app/lib/server/methods/blockUser.ts +++ b/apps/meteor/app/lib/server/methods/blockUser.ts @@ -1,12 +1,12 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { RoomMemberActions } from '../../../../definition/IRoomTypeConfig'; import { roomCoordinator } from '../../../../server/lib/rooms/roomCoordinator'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { blockUser({ rid, blocked }: { rid: string; blocked: string }): boolean; diff --git a/apps/meteor/app/lib/server/methods/checkRegistrationSecretURL.ts b/apps/meteor/app/lib/server/methods/checkRegistrationSecretURL.ts index 3f349a8b43e6..ecba6844da26 100644 --- a/apps/meteor/app/lib/server/methods/checkRegistrationSecretURL.ts +++ b/apps/meteor/app/lib/server/methods/checkRegistrationSecretURL.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; diff --git a/apps/meteor/app/lib/server/methods/checkUsernameAvailability.ts b/apps/meteor/app/lib/server/methods/checkUsernameAvailability.ts index 34ad02ddb2cf..4df2706bb479 100644 --- a/apps/meteor/app/lib/server/methods/checkUsernameAvailability.ts +++ b/apps/meteor/app/lib/server/methods/checkUsernameAvailability.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -6,7 +6,7 @@ import { checkUsernameAvailabilityWithValidation } from '../functions/checkUsern import { RateLimiter } from '../lib'; import { methodDeprecationLogger } from '../lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { checkUsernameAvailability(username: string): boolean; diff --git a/apps/meteor/app/lib/server/methods/cleanRoomHistory.ts b/apps/meteor/app/lib/server/methods/cleanRoomHistory.ts index a724d1b38b2c..d6136eee9131 100644 --- a/apps/meteor/app/lib/server/methods/cleanRoomHistory.ts +++ b/apps/meteor/app/lib/server/methods/cleanRoomHistory.ts @@ -1,11 +1,11 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { cleanRoomHistory } from '../functions/cleanRoomHistory'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { cleanRoomHistory(data: { diff --git a/apps/meteor/app/lib/server/methods/createChannel.ts b/apps/meteor/app/lib/server/methods/createChannel.ts index 98cea517bed4..a490fa1e3c42 100644 --- a/apps/meteor/app/lib/server/methods/createChannel.ts +++ b/apps/meteor/app/lib/server/methods/createChannel.ts @@ -1,13 +1,13 @@ import type { ICreatedRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { createRoom } from '../functions/createRoom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { createChannel( diff --git a/apps/meteor/app/lib/server/methods/createPrivateGroup.ts b/apps/meteor/app/lib/server/methods/createPrivateGroup.ts index 75097b5c89b8..3b92b2607829 100644 --- a/apps/meteor/app/lib/server/methods/createPrivateGroup.ts +++ b/apps/meteor/app/lib/server/methods/createPrivateGroup.ts @@ -1,13 +1,13 @@ import type { ICreatedRoom, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { createRoom } from '../functions/createRoom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { createPrivateGroup( diff --git a/apps/meteor/app/lib/server/methods/createToken.ts b/apps/meteor/app/lib/server/methods/createToken.ts index ed665944415a..de60a7e37fe8 100644 --- a/apps/meteor/app/lib/server/methods/createToken.ts +++ b/apps/meteor/app/lib/server/methods/createToken.ts @@ -1,12 +1,12 @@ import { User } from '@rocket.chat/core-services'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Accounts } from 'meteor/accounts-base'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { createToken(userId: string): { userId: string; authToken: string }; diff --git a/apps/meteor/app/lib/server/methods/deleteMessage.ts b/apps/meteor/app/lib/server/methods/deleteMessage.ts index a1b1000c06b8..b0be64c245ef 100644 --- a/apps/meteor/app/lib/server/methods/deleteMessage.ts +++ b/apps/meteor/app/lib/server/methods/deleteMessage.ts @@ -1,11 +1,11 @@ import type { IMessage } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { deleteMessageValidatingPermission } from '../functions/deleteMessage'; import { methodDeprecationLogger } from '../lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { deleteMessage({ _id }: Pick): void; diff --git a/apps/meteor/app/lib/server/methods/deleteUserOwnAccount.ts b/apps/meteor/app/lib/server/methods/deleteUserOwnAccount.ts index 2d651950da19..7b5663185bc5 100644 --- a/apps/meteor/app/lib/server/methods/deleteUserOwnAccount.ts +++ b/apps/meteor/app/lib/server/methods/deleteUserOwnAccount.ts @@ -1,7 +1,7 @@ import { Apps, AppEvents } from '@rocket.chat/apps'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; import { SHA256 } from '@rocket.chat/sha256'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Accounts } from 'meteor/accounts-base'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -10,7 +10,7 @@ import { trim } from '../../../../lib/utils/stringUtils'; import { settings } from '../../../settings/server'; import { deleteUser } from '../functions/deleteUser'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { deleteUserOwnAccount(password: string, confirmRelinquish?: boolean): Promise; diff --git a/apps/meteor/app/lib/server/methods/executeSlashCommandPreview.ts b/apps/meteor/app/lib/server/methods/executeSlashCommandPreview.ts index 80b5428efbef..1c116863610d 100644 --- a/apps/meteor/app/lib/server/methods/executeSlashCommandPreview.ts +++ b/apps/meteor/app/lib/server/methods/executeSlashCommandPreview.ts @@ -1,10 +1,10 @@ import type { IMessage, RequiredField, SlashCommandPreviewItem } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { slashCommands } from '../../../utils/server/slashCommand'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { executeSlashCommandPreview( diff --git a/apps/meteor/app/lib/server/methods/getChannelHistory.ts b/apps/meteor/app/lib/server/methods/getChannelHistory.ts index 00ff01639593..8f1f4c586141 100644 --- a/apps/meteor/app/lib/server/methods/getChannelHistory.ts +++ b/apps/meteor/app/lib/server/methods/getChannelHistory.ts @@ -1,6 +1,6 @@ import type { IMessage, MessageTypesValues } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, Subscriptions, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; @@ -11,7 +11,7 @@ import { settings } from '../../../settings/server/cached'; import { normalizeMessagesForUser } from '../../../utils/server/lib/normalizeMessagesForUser'; import { getHiddenSystemMessages } from '../lib/getHiddenSystemMessages'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getChannelHistory(params: { diff --git a/apps/meteor/app/lib/server/methods/getMessages.ts b/apps/meteor/app/lib/server/methods/getMessages.ts index 909e3d0c656b..d8684f82453c 100644 --- a/apps/meteor/app/lib/server/methods/getMessages.ts +++ b/apps/meteor/app/lib/server/methods/getMessages.ts @@ -1,12 +1,12 @@ import type { IMessage } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomIdAsync } from '../../../authorization/server/functions/canAccessRoom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getMessages(messages: IMessage['_id'][]): Promise; diff --git a/apps/meteor/app/lib/server/methods/getRoomJoinCode.ts b/apps/meteor/app/lib/server/methods/getRoomJoinCode.ts index 75e4a4372f57..5ba4b3490722 100644 --- a/apps/meteor/app/lib/server/methods/getRoomJoinCode.ts +++ b/apps/meteor/app/lib/server/methods/getRoomJoinCode.ts @@ -1,12 +1,12 @@ import { isRoomWithJoinCode } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getRoomJoinCode(rid: string): string | false; diff --git a/apps/meteor/app/lib/server/methods/getRoomRoles.ts b/apps/meteor/app/lib/server/methods/getRoomRoles.ts index ac5fcc734d0f..b411ba8fedf5 100644 --- a/apps/meteor/app/lib/server/methods/getRoomRoles.ts +++ b/apps/meteor/app/lib/server/methods/getRoomRoles.ts @@ -1,6 +1,6 @@ import type { IRoom, ISubscription } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -8,7 +8,7 @@ import { getRoomRoles } from '../../../../server/lib/roles/getRoomRoles'; import { canAccessRoomAsync } from '../../../authorization/server'; import { settings } from '../../../settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getRoomRoles(rid: IRoom['_id']): ISubscription[]; diff --git a/apps/meteor/app/lib/server/methods/getSingleMessage.ts b/apps/meteor/app/lib/server/methods/getSingleMessage.ts index 1aaf2a652257..c4b6f065296b 100644 --- a/apps/meteor/app/lib/server/methods/getSingleMessage.ts +++ b/apps/meteor/app/lib/server/methods/getSingleMessage.ts @@ -1,12 +1,12 @@ import type { IMessage } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomIdAsync } from '../../../authorization/server/functions/canAccessRoom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getSingleMessage(mid: IMessage['_id']): Promise; diff --git a/apps/meteor/app/lib/server/methods/getSlashCommandPreviews.ts b/apps/meteor/app/lib/server/methods/getSlashCommandPreviews.ts index dcb39c466063..965c91cc502f 100644 --- a/apps/meteor/app/lib/server/methods/getSlashCommandPreviews.ts +++ b/apps/meteor/app/lib/server/methods/getSlashCommandPreviews.ts @@ -1,10 +1,10 @@ import type { IMessage, RequiredField, SlashCommandPreviews } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { slashCommands } from '../../../utils/server/slashCommand'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getSlashCommandPreviews(command: { diff --git a/apps/meteor/app/lib/server/methods/getUserRoles.ts b/apps/meteor/app/lib/server/methods/getUserRoles.ts index cc7588276c33..cbd4712930a2 100644 --- a/apps/meteor/app/lib/server/methods/getUserRoles.ts +++ b/apps/meteor/app/lib/server/methods/getUserRoles.ts @@ -1,9 +1,9 @@ import { Authorization } from '@rocket.chat/core-services'; import type { IUser, IRocketChatRecord } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getUserRoles(): (IRocketChatRecord & Pick)[]; diff --git a/apps/meteor/app/lib/server/methods/getUsernameSuggestion.ts b/apps/meteor/app/lib/server/methods/getUsernameSuggestion.ts index 5724449a5790..b42799f24081 100644 --- a/apps/meteor/app/lib/server/methods/getUsernameSuggestion.ts +++ b/apps/meteor/app/lib/server/methods/getUsernameSuggestion.ts @@ -1,9 +1,9 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { generateUsernameSuggestion } from '../functions/getUsernameSuggestion'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getUsernameSuggestion(): Promise; diff --git a/apps/meteor/app/lib/server/methods/insertOrUpdateUser.ts b/apps/meteor/app/lib/server/methods/insertOrUpdateUser.ts index 5a8b1c8d1a58..122b11172d57 100644 --- a/apps/meteor/app/lib/server/methods/insertOrUpdateUser.ts +++ b/apps/meteor/app/lib/server/methods/insertOrUpdateUser.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -6,7 +6,7 @@ import { twoFactorRequired } from '../../../2fa/server/twoFactorRequired'; import { saveUser } from '../functions/saveUser'; import { methodDeprecationLogger } from '../lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { insertOrUpdateUser(userData: Record): Promise; diff --git a/apps/meteor/app/lib/server/methods/joinDefaultChannels.ts b/apps/meteor/app/lib/server/methods/joinDefaultChannels.ts index 309ac4e449be..df654bc4aef0 100644 --- a/apps/meteor/app/lib/server/methods/joinDefaultChannels.ts +++ b/apps/meteor/app/lib/server/methods/joinDefaultChannels.ts @@ -1,11 +1,11 @@ import type { IUser } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { addUserToDefaultChannels } from '../functions/addUserToDefaultChannels'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { joinDefaultChannels(silenced?: boolean): void; diff --git a/apps/meteor/app/lib/server/methods/joinRoom.ts b/apps/meteor/app/lib/server/methods/joinRoom.ts index 0fa3ac0b3c3b..ef3f069ee614 100644 --- a/apps/meteor/app/lib/server/methods/joinRoom.ts +++ b/apps/meteor/app/lib/server/methods/joinRoom.ts @@ -1,11 +1,11 @@ import { Room } from '@rocket.chat/core-services'; import type { IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { joinRoom(rid: IRoom['_id'], code?: string): boolean | undefined; diff --git a/apps/meteor/app/lib/server/methods/leaveRoom.ts b/apps/meteor/app/lib/server/methods/leaveRoom.ts index ec1bb1638a21..4fc85b35fd05 100644 --- a/apps/meteor/app/lib/server/methods/leaveRoom.ts +++ b/apps/meteor/app/lib/server/methods/leaveRoom.ts @@ -1,6 +1,6 @@ import type { IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Roles, Subscriptions, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -10,7 +10,7 @@ import { hasPermissionAsync } from '../../../authorization/server/functions/hasP import { hasRoleAsync } from '../../../authorization/server/functions/hasRole'; import { removeUserFromRoom } from '../functions/removeUserFromRoom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { leaveRoom(rid: string): Promise; diff --git a/apps/meteor/app/lib/server/methods/refreshOAuthService.ts b/apps/meteor/app/lib/server/methods/refreshOAuthService.ts index e5b1c377a33e..1d547b770361 100644 --- a/apps/meteor/app/lib/server/methods/refreshOAuthService.ts +++ b/apps/meteor/app/lib/server/methods/refreshOAuthService.ts @@ -1,10 +1,10 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { refreshLoginServices } from '../../../../server/lib/refreshLoginServices'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { refreshOAuthService(): Promise; diff --git a/apps/meteor/app/lib/server/methods/removeOAuthService.ts b/apps/meteor/app/lib/server/methods/removeOAuthService.ts index 6e16dc8d2d5b..fee2caa911d2 100644 --- a/apps/meteor/app/lib/server/methods/removeOAuthService.ts +++ b/apps/meteor/app/lib/server/methods/removeOAuthService.ts @@ -1,13 +1,13 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Settings } from '@rocket.chat/models'; import { capitalize } from '@rocket.chat/string-helpers'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { notifyOnSettingChangedById } from '../lib/notifyListener'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { removeOAuthService(name: string): Promise; diff --git a/apps/meteor/app/lib/server/methods/restartServer.ts b/apps/meteor/app/lib/server/methods/restartServer.ts index 206824aebe7e..264ab4d1bee6 100644 --- a/apps/meteor/app/lib/server/methods/restartServer.ts +++ b/apps/meteor/app/lib/server/methods/restartServer.ts @@ -1,9 +1,9 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { restart_server(): { diff --git a/apps/meteor/app/lib/server/methods/saveCustomFields.ts b/apps/meteor/app/lib/server/methods/saveCustomFields.ts index a509c97bdb85..d683e59a905c 100644 --- a/apps/meteor/app/lib/server/methods/saveCustomFields.ts +++ b/apps/meteor/app/lib/server/methods/saveCustomFields.ts @@ -1,11 +1,11 @@ import type { IUser } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { saveCustomFields } from '../functions/saveCustomFields'; import { RateLimiter } from '../lib'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { saveCustomFields: (fields: IUser['customFields']) => Promise; diff --git a/apps/meteor/app/lib/server/methods/saveSetting.ts b/apps/meteor/app/lib/server/methods/saveSetting.ts index 7f900d1751d8..4f4d29b9fa24 100644 --- a/apps/meteor/app/lib/server/methods/saveSetting.ts +++ b/apps/meteor/app/lib/server/methods/saveSetting.ts @@ -1,6 +1,6 @@ import type { SettingValue } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Settings } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -9,7 +9,7 @@ import { getSettingPermissionId } from '../../../authorization/lib'; import { hasPermissionAsync, hasAllPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { notifyOnSettingChanged } from '../lib/notifyListener'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { saveSetting(_id: string, value: SettingValue, editor?: string): Promise; diff --git a/apps/meteor/app/lib/server/methods/saveSettings.ts b/apps/meteor/app/lib/server/methods/saveSettings.ts index 8c4f92cfb88f..dffa986b7217 100644 --- a/apps/meteor/app/lib/server/methods/saveSettings.ts +++ b/apps/meteor/app/lib/server/methods/saveSettings.ts @@ -1,7 +1,7 @@ import type { ISetting } from '@rocket.chat/core-typings'; import { isSettingCode } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Settings } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -11,7 +11,7 @@ import { hasPermissionAsync } from '../../../authorization/server/functions/hasP import { settings } from '../../../settings/server'; import { notifyOnSettingChangedById } from '../lib/notifyListener'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { saveSettings( diff --git a/apps/meteor/app/lib/server/methods/sendMessage.ts b/apps/meteor/app/lib/server/methods/sendMessage.ts index a490b5c4c67f..7fc2e056d86c 100644 --- a/apps/meteor/app/lib/server/methods/sendMessage.ts +++ b/apps/meteor/app/lib/server/methods/sendMessage.ts @@ -1,7 +1,7 @@ import { api } from '@rocket.chat/core-services'; import type { AtLeast, IMessage, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import moment from 'moment'; @@ -108,7 +108,7 @@ export async function executeSendMessage(uid: IUser['_id'], message: AtLeast, previewUrls?: string[]): any; diff --git a/apps/meteor/app/lib/server/methods/sendSMTPTestEmail.ts b/apps/meteor/app/lib/server/methods/sendSMTPTestEmail.ts index 2ede129dd380..5a04032ad82e 100644 --- a/apps/meteor/app/lib/server/methods/sendSMTPTestEmail.ts +++ b/apps/meteor/app/lib/server/methods/sendSMTPTestEmail.ts @@ -1,11 +1,11 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { Meteor } from 'meteor/meteor'; import * as Mailer from '../../../mailer/server/api'; import { settings } from '../../../settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { sendSMTPTestEmail(): { diff --git a/apps/meteor/app/lib/server/methods/setAdminStatus.ts b/apps/meteor/app/lib/server/methods/setAdminStatus.ts index 42ffdc91f85e..300aa735b014 100644 --- a/apps/meteor/app/lib/server/methods/setAdminStatus.ts +++ b/apps/meteor/app/lib/server/methods/setAdminStatus.ts @@ -1,12 +1,12 @@ import { isUserFederated } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { setAdminStatus(userId: string, admin?: boolean): void; diff --git a/apps/meteor/app/lib/server/methods/setEmail.ts b/apps/meteor/app/lib/server/methods/setEmail.ts index a172eba72555..26540db26b4c 100644 --- a/apps/meteor/app/lib/server/methods/setEmail.ts +++ b/apps/meteor/app/lib/server/methods/setEmail.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -6,7 +6,7 @@ import { settings } from '../../../settings/server'; import { setEmail } from '../functions/setEmail'; import { RateLimiter } from '../lib'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { setEmail(email: string): string; diff --git a/apps/meteor/app/lib/server/methods/setRealName.ts b/apps/meteor/app/lib/server/methods/setRealName.ts index 2a55bd102172..f347eef1580e 100644 --- a/apps/meteor/app/lib/server/methods/setRealName.ts +++ b/apps/meteor/app/lib/server/methods/setRealName.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -6,7 +6,7 @@ import { settings } from '../../../settings/server'; import { setRealName } from '../functions/setRealName'; import { RateLimiter } from '../lib'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { setRealName(name: string): string; diff --git a/apps/meteor/app/lib/server/methods/setUsername.ts b/apps/meteor/app/lib/server/methods/setUsername.ts index 900848f37783..58fac75ed3bd 100644 --- a/apps/meteor/app/lib/server/methods/setUsername.ts +++ b/apps/meteor/app/lib/server/methods/setUsername.ts @@ -1,11 +1,11 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { setUsernameWithValidation } from '../functions/setUsername'; import { RateLimiter } from '../lib'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { setUsername(username: string, param?: { joinDefaultChannelsSilenced?: boolean }): string; diff --git a/apps/meteor/app/lib/server/methods/unarchiveRoom.ts b/apps/meteor/app/lib/server/methods/unarchiveRoom.ts index 0f9349365f4f..74b74c11e54a 100644 --- a/apps/meteor/app/lib/server/methods/unarchiveRoom.ts +++ b/apps/meteor/app/lib/server/methods/unarchiveRoom.ts @@ -1,13 +1,13 @@ import { isRegisterUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { unarchiveRoom } from '../functions/unarchiveRoom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { unarchiveRoom(rid: string): Promise; diff --git a/apps/meteor/app/lib/server/methods/unblockUser.ts b/apps/meteor/app/lib/server/methods/unblockUser.ts index 6c8a9d486bab..2eec5a082109 100644 --- a/apps/meteor/app/lib/server/methods/unblockUser.ts +++ b/apps/meteor/app/lib/server/methods/unblockUser.ts @@ -1,9 +1,9 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { unblockUser({ rid, blocked }: { rid: string; blocked: string }): boolean; diff --git a/apps/meteor/app/lib/server/methods/updateMessage.ts b/apps/meteor/app/lib/server/methods/updateMessage.ts index 161a168a2cdc..aff5e563f666 100644 --- a/apps/meteor/app/lib/server/methods/updateMessage.ts +++ b/apps/meteor/app/lib/server/methods/updateMessage.ts @@ -1,6 +1,6 @@ import type { IEditedMessage, IMessage, IUser, AtLeast } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import moment from 'moment'; @@ -90,7 +90,7 @@ export async function executeUpdateMessage(uid: IUser['_id'], message: AtLeast; diff --git a/apps/meteor/app/livechat/server/methods/addManager.ts b/apps/meteor/app/livechat/server/methods/addManager.ts index 347c4f07d63f..a954d8111773 100644 --- a/apps/meteor/app/livechat/server/methods/addManager.ts +++ b/apps/meteor/app/livechat/server/methods/addManager.ts @@ -1,12 +1,12 @@ import type { IUser } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:addManager'(username: string): Promise; diff --git a/apps/meteor/app/livechat/server/methods/changeLivechatStatus.ts b/apps/meteor/app/livechat/server/methods/changeLivechatStatus.ts index 8ccfcd5ec468..f45588cad6d3 100644 --- a/apps/meteor/app/livechat/server/methods/changeLivechatStatus.ts +++ b/apps/meteor/app/livechat/server/methods/changeLivechatStatus.ts @@ -1,13 +1,13 @@ import { ILivechatAgentStatus } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { Livechat as LivechatTS } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:changeLivechatStatus'(params?: { status?: ILivechatAgentStatus; agentId?: string }): unknown; diff --git a/apps/meteor/app/livechat/server/methods/closeRoom.ts b/apps/meteor/app/livechat/server/methods/closeRoom.ts index 5fdf9e7d504f..19c8b2709389 100644 --- a/apps/meteor/app/livechat/server/methods/closeRoom.ts +++ b/apps/meteor/app/livechat/server/methods/closeRoom.ts @@ -1,6 +1,6 @@ import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users, LivechatRooms, Subscriptions as SubscriptionRaw } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; @@ -35,7 +35,7 @@ type LivechatCloseRoomOptions = Omit }; }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:closeRoom'(roomId: string, comment?: string, options?: CloseRoomOptions): void; diff --git a/apps/meteor/app/livechat/server/methods/discardTranscript.ts b/apps/meteor/app/livechat/server/methods/discardTranscript.ts index d46c8ffea35f..3265aa9c54d2 100644 --- a/apps/meteor/app/livechat/server/methods/discardTranscript.ts +++ b/apps/meteor/app/livechat/server/methods/discardTranscript.ts @@ -1,12 +1,12 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatRooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:discardTranscript'(rid: string): boolean; diff --git a/apps/meteor/app/livechat/server/methods/getAgentData.ts b/apps/meteor/app/livechat/server/methods/getAgentData.ts index d32d24d7f7c1..5fe58560806e 100644 --- a/apps/meteor/app/livechat/server/methods/getAgentData.ts +++ b/apps/meteor/app/livechat/server/methods/getAgentData.ts @@ -1,13 +1,13 @@ import type { ILivechatAgent } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatVisitors, LivechatRooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { settings } from '../../../settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:getAgentData'(params: { diff --git a/apps/meteor/app/livechat/server/methods/getAgentOverviewData.ts b/apps/meteor/app/livechat/server/methods/getAgentOverviewData.ts index b5ea8dafe92c..819bac03c5b4 100644 --- a/apps/meteor/app/livechat/server/methods/getAgentOverviewData.ts +++ b/apps/meteor/app/livechat/server/methods/getAgentOverviewData.ts @@ -1,13 +1,13 @@ import type { ConversationData } from '@rocket.chat/core-services'; import { OmnichannelAnalytics } from '@rocket.chat/core-services'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:getAgentOverviewData'(options: { chartOptions: { name: string } }): ConversationData | void; diff --git a/apps/meteor/app/livechat/server/methods/getAnalyticsChartData.ts b/apps/meteor/app/livechat/server/methods/getAnalyticsChartData.ts index 85c8e033b8f5..2ff682c1c39c 100644 --- a/apps/meteor/app/livechat/server/methods/getAnalyticsChartData.ts +++ b/apps/meteor/app/livechat/server/methods/getAnalyticsChartData.ts @@ -1,12 +1,12 @@ import type { ChartDataResult } from '@rocket.chat/core-services'; import { OmnichannelAnalytics } from '@rocket.chat/core-services'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:getAnalyticsChartData'(options: { chartOptions: { name: string } }): ChartDataResult | void; diff --git a/apps/meteor/app/livechat/server/methods/getAnalyticsOverviewData.ts b/apps/meteor/app/livechat/server/methods/getAnalyticsOverviewData.ts index c9bb3d163457..9f56cfa57069 100644 --- a/apps/meteor/app/livechat/server/methods/getAnalyticsOverviewData.ts +++ b/apps/meteor/app/livechat/server/methods/getAnalyticsOverviewData.ts @@ -1,14 +1,14 @@ import type { AnalyticsOverviewDataResult } from '@rocket.chat/core-services'; import { OmnichannelAnalytics } from '@rocket.chat/core-services'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { settings } from '../../../settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:getAnalyticsOverviewData'(options: { analyticsOptions: { name: string } }): AnalyticsOverviewDataResult[] | void; diff --git a/apps/meteor/app/livechat/server/methods/getCustomFields.ts b/apps/meteor/app/livechat/server/methods/getCustomFields.ts index ec0ac35d6c21..36dca08f0859 100644 --- a/apps/meteor/app/livechat/server/methods/getCustomFields.ts +++ b/apps/meteor/app/livechat/server/methods/getCustomFields.ts @@ -1,11 +1,11 @@ import type { ILivechatCustomField } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatCustomField } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:getCustomFields'(): ILivechatCustomField[]; diff --git a/apps/meteor/app/livechat/server/methods/getDepartmentForwardRestrictions.ts b/apps/meteor/app/livechat/server/methods/getDepartmentForwardRestrictions.ts index b26d9706a8cd..2b891514d03e 100644 --- a/apps/meteor/app/livechat/server/methods/getDepartmentForwardRestrictions.ts +++ b/apps/meteor/app/livechat/server/methods/getDepartmentForwardRestrictions.ts @@ -1,10 +1,10 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../../lib/callbacks'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:getDepartmentForwardRestrictions'(departmentId: string): unknown; diff --git a/apps/meteor/app/livechat/server/methods/getFirstRoomMessage.ts b/apps/meteor/app/livechat/server/methods/getFirstRoomMessage.ts index 197898e8d2b2..d8accf7f84f5 100644 --- a/apps/meteor/app/livechat/server/methods/getFirstRoomMessage.ts +++ b/apps/meteor/app/livechat/server/methods/getFirstRoomMessage.ts @@ -1,12 +1,12 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatRooms, Messages } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:getFirstRoomMessage'(params: { rid: string }): unknown; diff --git a/apps/meteor/app/livechat/server/methods/getNextAgent.ts b/apps/meteor/app/livechat/server/methods/getNextAgent.ts index 53b8441cad2e..179f1f95dedf 100644 --- a/apps/meteor/app/livechat/server/methods/getNextAgent.ts +++ b/apps/meteor/app/livechat/server/methods/getNextAgent.ts @@ -1,6 +1,6 @@ import type { ILivechatAgent } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatRooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -9,7 +9,7 @@ import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarn import { settings } from '../../../settings/server'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:getNextAgent'(params: { diff --git a/apps/meteor/app/livechat/server/methods/getRoutingConfig.ts b/apps/meteor/app/livechat/server/methods/getRoutingConfig.ts index 364853a74511..02b2840f41cc 100644 --- a/apps/meteor/app/livechat/server/methods/getRoutingConfig.ts +++ b/apps/meteor/app/livechat/server/methods/getRoutingConfig.ts @@ -1,10 +1,10 @@ import type { OmichannelRoutingConfig } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { RoutingManager } from '../lib/RoutingManager'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:getRoutingConfig'(): OmichannelRoutingConfig | undefined; diff --git a/apps/meteor/app/livechat/server/methods/getTagsList.ts b/apps/meteor/app/livechat/server/methods/getTagsList.ts index e9e467d243c8..b3efe5d026a3 100644 --- a/apps/meteor/app/livechat/server/methods/getTagsList.ts +++ b/apps/meteor/app/livechat/server/methods/getTagsList.ts @@ -1,11 +1,11 @@ import type { ILivechatTag } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../../lib/callbacks'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:getTagsList'(): ILivechatTag[]; diff --git a/apps/meteor/app/livechat/server/methods/loadHistory.ts b/apps/meteor/app/livechat/server/methods/loadHistory.ts index 373ede1a3610..1004f9dd604d 100644 --- a/apps/meteor/app/livechat/server/methods/loadHistory.ts +++ b/apps/meteor/app/livechat/server/methods/loadHistory.ts @@ -1,13 +1,13 @@ import type { IMessage } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatVisitors, LivechatRooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check, Match } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { loadMessageHistory } from '../../../lib/server/functions/loadMessageHistory'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:loadHistory'(params: { token: string; rid: string; end?: Date; limit?: number; ls: Date }): diff --git a/apps/meteor/app/livechat/server/methods/loginByToken.ts b/apps/meteor/app/livechat/server/methods/loginByToken.ts index cae23e6d16f7..3b82413e038a 100644 --- a/apps/meteor/app/livechat/server/methods/loginByToken.ts +++ b/apps/meteor/app/livechat/server/methods/loginByToken.ts @@ -1,10 +1,10 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatVisitors } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:loginByToken'(token: string): { _id: string } | undefined; diff --git a/apps/meteor/app/livechat/server/methods/pageVisited.ts b/apps/meteor/app/livechat/server/methods/pageVisited.ts index c226a91de430..7c0864f27b74 100644 --- a/apps/meteor/app/livechat/server/methods/pageVisited.ts +++ b/apps/meteor/app/livechat/server/methods/pageVisited.ts @@ -1,10 +1,10 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:pageVisited'(token: string, room: string, pageInfo: { title: string; location: { href: string }; change: string }): void; diff --git a/apps/meteor/app/livechat/server/methods/registerGuest.ts b/apps/meteor/app/livechat/server/methods/registerGuest.ts index 4a531d0c89e5..c6a119d91591 100644 --- a/apps/meteor/app/livechat/server/methods/registerGuest.ts +++ b/apps/meteor/app/livechat/server/methods/registerGuest.ts @@ -1,13 +1,13 @@ import type { ILivechatVisitor, IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatVisitors, Messages, LivechatRooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../../lib/callbacks'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { Livechat as LivechatTyped } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:registerGuest'({ diff --git a/apps/meteor/app/livechat/server/methods/removeAgent.ts b/apps/meteor/app/livechat/server/methods/removeAgent.ts index 643ae696ada0..ebb57383784f 100644 --- a/apps/meteor/app/livechat/server/methods/removeAgent.ts +++ b/apps/meteor/app/livechat/server/methods/removeAgent.ts @@ -1,11 +1,11 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:removeAgent'(username: string): boolean; diff --git a/apps/meteor/app/livechat/server/methods/removeAllClosedRooms.ts b/apps/meteor/app/livechat/server/methods/removeAllClosedRooms.ts index 9be699ae05ed..ba3939bb8573 100644 --- a/apps/meteor/app/livechat/server/methods/removeAllClosedRooms.ts +++ b/apps/meteor/app/livechat/server/methods/removeAllClosedRooms.ts @@ -1,14 +1,14 @@ import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Logger } from '@rocket.chat/logger'; import { LivechatRooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../../lib/callbacks'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:removeAllClosedRooms'(departmentIds?: string[]): Promise; diff --git a/apps/meteor/app/livechat/server/methods/removeCustomField.ts b/apps/meteor/app/livechat/server/methods/removeCustomField.ts index 1d3e7c817738..ad02df582337 100644 --- a/apps/meteor/app/livechat/server/methods/removeCustomField.ts +++ b/apps/meteor/app/livechat/server/methods/removeCustomField.ts @@ -1,12 +1,12 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatCustomField } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import type { DeleteResult } from 'mongodb'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:removeCustomField'(_id: string): DeleteResult; diff --git a/apps/meteor/app/livechat/server/methods/removeDepartment.ts b/apps/meteor/app/livechat/server/methods/removeDepartment.ts index 3c46f3a424d6..6e4b11c836f6 100644 --- a/apps/meteor/app/livechat/server/methods/removeDepartment.ts +++ b/apps/meteor/app/livechat/server/methods/removeDepartment.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import type { DeleteResult } from 'mongodb'; @@ -7,7 +7,7 @@ import { hasPermissionAsync } from '../../../authorization/server/functions/hasP import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { DepartmentHelper } from '../lib/Departments'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:removeDepartment'(_id: string): DeleteResult; diff --git a/apps/meteor/app/livechat/server/methods/removeManager.ts b/apps/meteor/app/livechat/server/methods/removeManager.ts index 4c003ff922bc..85a5f3076c8c 100644 --- a/apps/meteor/app/livechat/server/methods/removeManager.ts +++ b/apps/meteor/app/livechat/server/methods/removeManager.ts @@ -1,11 +1,11 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:removeManager'(username: string): boolean; diff --git a/apps/meteor/app/livechat/server/methods/removeRoom.ts b/apps/meteor/app/livechat/server/methods/removeRoom.ts index db3fcf2c849f..751d51d4f019 100644 --- a/apps/meteor/app/livechat/server/methods/removeRoom.ts +++ b/apps/meteor/app/livechat/server/methods/removeRoom.ts @@ -1,12 +1,12 @@ import type { IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatRooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:removeRoom'(rid: IRoom['_id']): void; diff --git a/apps/meteor/app/livechat/server/methods/removeTrigger.ts b/apps/meteor/app/livechat/server/methods/removeTrigger.ts index 69f3a4a2d80c..41d79d725176 100644 --- a/apps/meteor/app/livechat/server/methods/removeTrigger.ts +++ b/apps/meteor/app/livechat/server/methods/removeTrigger.ts @@ -1,12 +1,12 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatTrigger } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:removeTrigger'(triggerId: string): boolean; diff --git a/apps/meteor/app/livechat/server/methods/requestTranscript.ts b/apps/meteor/app/livechat/server/methods/requestTranscript.ts index 5abf6a3b72e3..80cb3a9625fe 100644 --- a/apps/meteor/app/livechat/server/methods/requestTranscript.ts +++ b/apps/meteor/app/livechat/server/methods/requestTranscript.ts @@ -1,5 +1,5 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -7,7 +7,7 @@ import { hasPermissionAsync } from '../../../authorization/server/functions/hasP import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:requestTranscript'(rid: string, email: string, subject: string): Promise; diff --git a/apps/meteor/app/livechat/server/methods/returnAsInquiry.ts b/apps/meteor/app/livechat/server/methods/returnAsInquiry.ts index 38b58b9d2d42..bf76519a5afb 100644 --- a/apps/meteor/app/livechat/server/methods/returnAsInquiry.ts +++ b/apps/meteor/app/livechat/server/methods/returnAsInquiry.ts @@ -1,13 +1,13 @@ import { Omnichannel } from '@rocket.chat/core-services'; import type { ILivechatDepartment, IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatRooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:returnAsInquiry'(rid: IRoom['_id'], departmentID?: ILivechatDepartment['_id']): boolean; diff --git a/apps/meteor/app/livechat/server/methods/saveAgentInfo.ts b/apps/meteor/app/livechat/server/methods/saveAgentInfo.ts index 90d9815d4cf1..fe542b67156e 100644 --- a/apps/meteor/app/livechat/server/methods/saveAgentInfo.ts +++ b/apps/meteor/app/livechat/server/methods/saveAgentInfo.ts @@ -1,12 +1,12 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { hasRoleAsync } from '../../../authorization/server/functions/hasRole'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:saveAgentInfo'(_id: string, agentData: Record, agentDepartments: string[]): unknown; diff --git a/apps/meteor/app/livechat/server/methods/saveAppearance.ts b/apps/meteor/app/livechat/server/methods/saveAppearance.ts index cac5d34264d2..619dae147708 100644 --- a/apps/meteor/app/livechat/server/methods/saveAppearance.ts +++ b/apps/meteor/app/livechat/server/methods/saveAppearance.ts @@ -1,12 +1,12 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Settings } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { notifyOnSettingChangedById } from '../../../lib/server/lib/notifyListener'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:saveAppearance'(settings: { _id: string; value: any }[]): Promise; diff --git a/apps/meteor/app/livechat/server/methods/saveBusinessHour.ts b/apps/meteor/app/livechat/server/methods/saveBusinessHour.ts index 2e3e64365649..9bf32697fae9 100644 --- a/apps/meteor/app/livechat/server/methods/saveBusinessHour.ts +++ b/apps/meteor/app/livechat/server/methods/saveBusinessHour.ts @@ -1,10 +1,10 @@ import type { ILivechatBusinessHour } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { businessHourManager } from '../business-hour'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:saveBusinessHour'(businessHourData: ILivechatBusinessHour): void; diff --git a/apps/meteor/app/livechat/server/methods/saveCustomField.ts b/apps/meteor/app/livechat/server/methods/saveCustomField.ts index 8a0435560dd5..c83148ba8d29 100644 --- a/apps/meteor/app/livechat/server/methods/saveCustomField.ts +++ b/apps/meteor/app/livechat/server/methods/saveCustomField.ts @@ -1,12 +1,12 @@ import type { ILivechatCustomField } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatCustomField } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:saveCustomField'( diff --git a/apps/meteor/app/livechat/server/methods/saveDepartment.ts b/apps/meteor/app/livechat/server/methods/saveDepartment.ts index 971c2189f9a7..b4833523ab3f 100644 --- a/apps/meteor/app/livechat/server/methods/saveDepartment.ts +++ b/apps/meteor/app/livechat/server/methods/saveDepartment.ts @@ -1,11 +1,11 @@ import type { ILivechatDepartment } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:saveDepartment': ( diff --git a/apps/meteor/app/livechat/server/methods/saveDepartmentAgents.ts b/apps/meteor/app/livechat/server/methods/saveDepartmentAgents.ts index 73a471869926..42ee521713c0 100644 --- a/apps/meteor/app/livechat/server/methods/saveDepartmentAgents.ts +++ b/apps/meteor/app/livechat/server/methods/saveDepartmentAgents.ts @@ -1,12 +1,12 @@ import type { ILivechatDepartmentAgents } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:saveDepartmentAgents'( diff --git a/apps/meteor/app/livechat/server/methods/saveInfo.ts b/apps/meteor/app/livechat/server/methods/saveInfo.ts index a057706fdc23..bb22c127effa 100644 --- a/apps/meteor/app/livechat/server/methods/saveInfo.ts +++ b/apps/meteor/app/livechat/server/methods/saveInfo.ts @@ -1,6 +1,6 @@ import { isOmnichannelRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatRooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -9,7 +9,7 @@ import { hasPermissionAsync } from '../../../authorization/server/functions/hasP import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { Livechat as LivechatTyped } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:saveInfo'( diff --git a/apps/meteor/app/livechat/server/methods/saveIntegration.ts b/apps/meteor/app/livechat/server/methods/saveIntegration.ts index de7461d08e10..0a4d82cfbcc1 100644 --- a/apps/meteor/app/livechat/server/methods/saveIntegration.ts +++ b/apps/meteor/app/livechat/server/methods/saveIntegration.ts @@ -1,5 +1,5 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Settings } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { trim } from '../../../../lib/utils/stringUtils'; @@ -7,7 +7,7 @@ import { hasPermissionAsync } from '../../../authorization/server/functions/hasP import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { notifyOnSettingChangedById } from '../../../lib/server/lib/notifyListener'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:saveIntegration'(values: Record): void; diff --git a/apps/meteor/app/livechat/server/methods/saveSurveyFeedback.ts b/apps/meteor/app/livechat/server/methods/saveSurveyFeedback.ts index 48dea8175ea8..36fc3f775b9f 100644 --- a/apps/meteor/app/livechat/server/methods/saveSurveyFeedback.ts +++ b/apps/meteor/app/livechat/server/methods/saveSurveyFeedback.ts @@ -1,5 +1,5 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatRooms, LivechatVisitors } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import type { UpdateResult } from 'mongodb'; @@ -7,7 +7,7 @@ import _ from 'underscore'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:saveSurveyFeedback'( diff --git a/apps/meteor/app/livechat/server/methods/saveTrigger.ts b/apps/meteor/app/livechat/server/methods/saveTrigger.ts index 37f78d081203..850dead9a589 100644 --- a/apps/meteor/app/livechat/server/methods/saveTrigger.ts +++ b/apps/meteor/app/livechat/server/methods/saveTrigger.ts @@ -1,13 +1,13 @@ import type { ILivechatTrigger } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatTrigger } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:saveTrigger'(trigger: ILivechatTrigger): boolean; diff --git a/apps/meteor/app/livechat/server/methods/searchAgent.ts b/apps/meteor/app/livechat/server/methods/searchAgent.ts index 2a69679f2a07..932eb51e89d6 100644 --- a/apps/meteor/app/livechat/server/methods/searchAgent.ts +++ b/apps/meteor/app/livechat/server/methods/searchAgent.ts @@ -1,12 +1,12 @@ import type { IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:searchAgent'(username: string): { _id: string; username?: string } | undefined; diff --git a/apps/meteor/app/livechat/server/methods/sendFileLivechatMessage.ts b/apps/meteor/app/livechat/server/methods/sendFileLivechatMessage.ts index 15577abd76e3..0268207b2f6c 100644 --- a/apps/meteor/app/livechat/server/methods/sendFileLivechatMessage.ts +++ b/apps/meteor/app/livechat/server/methods/sendFileLivechatMessage.ts @@ -5,9 +5,9 @@ import type { VideoAttachmentProps, IUpload, } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatVisitors, LivechatRooms } from '@rocket.chat/models'; import { Random } from '@rocket.chat/random'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -21,7 +21,7 @@ interface ISendFileLivechatMessage { msgData?: { avatar?: string; emoji?: string; alias?: string; groupable?: boolean; msg?: string }; } -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { sendFileLivechatMessage( diff --git a/apps/meteor/app/livechat/server/methods/sendMessageLivechat.ts b/apps/meteor/app/livechat/server/methods/sendMessageLivechat.ts index ad16dea23e4f..6fac80397906 100644 --- a/apps/meteor/app/livechat/server/methods/sendMessageLivechat.ts +++ b/apps/meteor/app/livechat/server/methods/sendMessageLivechat.ts @@ -1,6 +1,6 @@ import { OmnichannelSourceType } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatVisitors } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -18,7 +18,7 @@ interface ISendMessageLivechat { agent?: ILivechatMessageAgent; } -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { sendMessageLivechat(message: ILivechatMessage, agent: ILivechatMessageAgent): boolean; diff --git a/apps/meteor/app/livechat/server/methods/sendOfflineMessage.ts b/apps/meteor/app/livechat/server/methods/sendOfflineMessage.ts index c3b5537f31be..b620aa434100 100644 --- a/apps/meteor/app/livechat/server/methods/sendOfflineMessage.ts +++ b/apps/meteor/app/livechat/server/methods/sendOfflineMessage.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { Meteor } from 'meteor/meteor'; @@ -6,7 +6,7 @@ import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:sendOfflineMessage'(data: { name: string; email: string; message: string }): Promise; diff --git a/apps/meteor/app/livechat/server/methods/sendTranscript.ts b/apps/meteor/app/livechat/server/methods/sendTranscript.ts index 366a73c8bb0a..4891f579926a 100644 --- a/apps/meteor/app/livechat/server/methods/sendTranscript.ts +++ b/apps/meteor/app/livechat/server/methods/sendTranscript.ts @@ -1,6 +1,6 @@ import { Omnichannel } from '@rocket.chat/core-services'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatRooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -8,7 +8,7 @@ import { hasPermissionAsync } from '../../../authorization/server/functions/hasP import { RateLimiter } from '../../../lib/server'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:sendTranscript'(token: string, rid: string, email: string, subject: string): boolean; diff --git a/apps/meteor/app/livechat/server/methods/setCustomField.ts b/apps/meteor/app/livechat/server/methods/setCustomField.ts index fb07c2b29a4e..6d3a2384cdd7 100644 --- a/apps/meteor/app/livechat/server/methods/setCustomField.ts +++ b/apps/meteor/app/livechat/server/methods/setCustomField.ts @@ -1,11 +1,11 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatVisitors, LivechatCustomField, LivechatRooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import type { UpdateResult, Document } from 'mongodb'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:setCustomField'(token: string, key: string, value: string, overwrite?: boolean): Promise; diff --git a/apps/meteor/app/livechat/server/methods/setDepartmentForVisitor.ts b/apps/meteor/app/livechat/server/methods/setDepartmentForVisitor.ts index a14933ed8d47..385f2d989015 100644 --- a/apps/meteor/app/livechat/server/methods/setDepartmentForVisitor.ts +++ b/apps/meteor/app/livechat/server/methods/setDepartmentForVisitor.ts @@ -1,5 +1,5 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatVisitors, Messages, LivechatRooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -7,7 +7,7 @@ import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarn import { normalizeTransferredByData } from '../lib/Helper'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:setDepartmentForVisitor'({ diff --git a/apps/meteor/app/livechat/server/methods/setUpConnection.ts b/apps/meteor/app/livechat/server/methods/setUpConnection.ts index 788b2384c4d3..21ce09acaa22 100644 --- a/apps/meteor/app/livechat/server/methods/setUpConnection.ts +++ b/apps/meteor/app/livechat/server/methods/setUpConnection.ts @@ -1,11 +1,11 @@ import { UserStatus } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:setUpConnection'(data: { token: string }): void; diff --git a/apps/meteor/app/livechat/server/methods/takeInquiry.ts b/apps/meteor/app/livechat/server/methods/takeInquiry.ts index 30a5dabb5717..733cbd995208 100644 --- a/apps/meteor/app/livechat/server/methods/takeInquiry.ts +++ b/apps/meteor/app/livechat/server/methods/takeInquiry.ts @@ -1,13 +1,13 @@ import { Omnichannel } from '@rocket.chat/core-services'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatInquiry, LivechatRooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { settings } from '../../../settings/server'; import { RoutingManager } from '../lib/RoutingManager'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:takeInquiry'( diff --git a/apps/meteor/app/livechat/server/methods/transfer.ts b/apps/meteor/app/livechat/server/methods/transfer.ts index 64a32c24638c..e0516fa27981 100644 --- a/apps/meteor/app/livechat/server/methods/transfer.ts +++ b/apps/meteor/app/livechat/server/methods/transfer.ts @@ -1,7 +1,7 @@ import { Omnichannel } from '@rocket.chat/core-services'; import type { IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatVisitors, LivechatRooms, Subscriptions, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -10,7 +10,7 @@ import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarn import { normalizeTransferredByData } from '../lib/Helper'; import { Livechat } from '../lib/LivechatTyped'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:transfer'(transferData: { diff --git a/apps/meteor/app/livechat/server/methods/webhookTest.ts b/apps/meteor/app/livechat/server/methods/webhookTest.ts index 12a4711d75b4..68800e1a0616 100644 --- a/apps/meteor/app/livechat/server/methods/webhookTest.ts +++ b/apps/meteor/app/livechat/server/methods/webhookTest.ts @@ -1,5 +1,5 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { SystemLogger } from '../../../../server/lib/logger/system'; @@ -14,7 +14,7 @@ const postCatchError = async function (url: string, options?: Record; diff --git a/apps/meteor/app/mail-messages/server/methods/sendMail.ts b/apps/meteor/app/mail-messages/server/methods/sendMail.ts index 158d271d5379..cc6469544df8 100644 --- a/apps/meteor/app/mail-messages/server/methods/sendMail.ts +++ b/apps/meteor/app/mail-messages/server/methods/sendMail.ts @@ -1,11 +1,11 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { Mailer } from '../lib/Mailer'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'Mailer.sendMail'(from: string, subject: string, body: string, dryrun?: boolean, query?: string): any; diff --git a/apps/meteor/app/mail-messages/server/methods/unsubscribe.ts b/apps/meteor/app/mail-messages/server/methods/unsubscribe.ts index 24243cc98c2d..e52677b5ee1a 100644 --- a/apps/meteor/app/mail-messages/server/methods/unsubscribe.ts +++ b/apps/meteor/app/mail-messages/server/methods/unsubscribe.ts @@ -1,11 +1,11 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { Mailer } from '../lib/Mailer'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'Mailer:unsubscribe'(_id: string, createdAt: string): Promise; diff --git a/apps/meteor/app/mentions/server/methods/getUserMentionsByChannel.ts b/apps/meteor/app/mentions/server/methods/getUserMentionsByChannel.ts index 948187d089ae..6d9a16539704 100644 --- a/apps/meteor/app/mentions/server/methods/getUserMentionsByChannel.ts +++ b/apps/meteor/app/mentions/server/methods/getUserMentionsByChannel.ts @@ -1,12 +1,12 @@ import type { IMessage } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, Users, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomAsync } from '../../../authorization/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getUserMentionsByChannel(params: { roomId: string; options: { limit: number; sort: { ts: -1 | 1 } } }): IMessage[]; diff --git a/apps/meteor/app/message-mark-as-unread/server/unreadMessages.ts b/apps/meteor/app/message-mark-as-unread/server/unreadMessages.ts index 2ba0224a0c70..6ef1f5567a20 100644 --- a/apps/meteor/app/message-mark-as-unread/server/unreadMessages.ts +++ b/apps/meteor/app/message-mark-as-unread/server/unreadMessages.ts @@ -1,11 +1,11 @@ import type { IMessage, IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, Subscriptions } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import logger from './logger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { unreadMessages(firstUnreadMessage?: IMessage, room?: IRoom['_id']): void; diff --git a/apps/meteor/app/message-pin/server/pinMessage.ts b/apps/meteor/app/message-pin/server/pinMessage.ts index b0eab3f929d6..b4a0b1532943 100644 --- a/apps/meteor/app/message-pin/server/pinMessage.ts +++ b/apps/meteor/app/message-pin/server/pinMessage.ts @@ -2,8 +2,8 @@ import { Apps, AppEvents } from '@rocket.chat/apps'; import { Message } from '@rocket.chat/core-services'; import { isQuoteAttachment, isRegisterUser } from '@rocket.chat/core-typings'; import type { IMessage, MessageAttachment, MessageQuoteAttachment } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, Rooms, Subscriptions, Users, ReadReceipts } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -36,7 +36,7 @@ const recursiveRemove = (msg: MessageAttachment, deep = 1) => { const shouldAdd = (attachments: MessageAttachment[], attachment: MessageQuoteAttachment) => !attachments.some((_attachment) => isQuoteAttachment(_attachment) && _attachment.message_link === attachment.message_link); -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { pinMessage(message: IMessage, pinnedAt?: Date): IMessage | null; diff --git a/apps/meteor/app/message-star/server/starMessage.ts b/apps/meteor/app/message-star/server/starMessage.ts index 4529efb63f6f..acd683a35965 100644 --- a/apps/meteor/app/message-star/server/starMessage.ts +++ b/apps/meteor/app/message-star/server/starMessage.ts @@ -1,7 +1,7 @@ import { Apps, AppEvents } from '@rocket.chat/apps'; import type { IMessage } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, Subscriptions, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { broadcastMessageFromData } from '../../../server/modules/watchers/lib/messages'; @@ -10,7 +10,7 @@ import { isTheLastMessage } from '../../lib/server/functions/isTheLastMessage'; import { notifyOnRoomChangedById } from '../../lib/server/lib/notifyListener'; import { settings } from '../../settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { starMessage(message: Omit & { starred: boolean }): boolean; diff --git a/apps/meteor/app/meteor-accounts-saml/server/methods/addSamlService.ts b/apps/meteor/app/meteor-accounts-saml/server/methods/addSamlService.ts index f952ce3b3fe3..0b6b5a6c8f6e 100644 --- a/apps/meteor/app/meteor-accounts-saml/server/methods/addSamlService.ts +++ b/apps/meteor/app/meteor-accounts-saml/server/methods/addSamlService.ts @@ -1,9 +1,9 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { addSamlService } from '../lib/settings'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { addSamlService(name: string): void; diff --git a/apps/meteor/app/meteor-accounts-saml/server/methods/samlLogout.ts b/apps/meteor/app/meteor-accounts-saml/server/methods/samlLogout.ts index 956426082d40..a7f9e87a93de 100644 --- a/apps/meteor/app/meteor-accounts-saml/server/methods/samlLogout.ts +++ b/apps/meteor/app/meteor-accounts-saml/server/methods/samlLogout.ts @@ -1,5 +1,5 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import type { IServiceProviderOptions } from '../definition/IServiceProviderOptions'; @@ -25,7 +25,7 @@ function getSamlServiceProviderOptions(provider: string): IServiceProviderOption return providers.filter(samlProvider)[0]; } -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { samlLogout(provider: string): string | undefined; diff --git a/apps/meteor/app/notifications/server/lib/Notifications.ts b/apps/meteor/app/notifications/server/lib/Notifications.ts index ed4985777414..3ddb611d76bd 100644 --- a/apps/meteor/app/notifications/server/lib/Notifications.ts +++ b/apps/meteor/app/notifications/server/lib/Notifications.ts @@ -1,5 +1,5 @@ import { api } from '@rocket.chat/core-services'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { DDPCommon } from 'meteor/ddp-common'; import { Meteor } from 'meteor/meteor'; diff --git a/apps/meteor/app/notifications/server/lib/Presence.ts b/apps/meteor/app/notifications/server/lib/Presence.ts index 9955b687701f..17f35a9d39ff 100644 --- a/apps/meteor/app/notifications/server/lib/Presence.ts +++ b/apps/meteor/app/notifications/server/lib/Presence.ts @@ -1,6 +1,6 @@ import type { IUser } from '@rocket.chat/core-typings'; +import type { StreamerEvents } from '@rocket.chat/ddp-client'; import { Emitter } from '@rocket.chat/emitter'; -import type { StreamerEvents } from '@rocket.chat/ui-contexts'; import type { IPublication, IStreamerConstructor, Connection, IStreamer } from 'meteor/rocketchat:streamer'; type UserPresenceStreamProps = { diff --git a/apps/meteor/app/oauth2-server-config/server/admin/methods/addOAuthApp.ts b/apps/meteor/app/oauth2-server-config/server/admin/methods/addOAuthApp.ts index 4556a5be7d9f..3f41b1b01bea 100644 --- a/apps/meteor/app/oauth2-server-config/server/admin/methods/addOAuthApp.ts +++ b/apps/meteor/app/oauth2-server-config/server/admin/methods/addOAuthApp.ts @@ -1,12 +1,12 @@ import type { IOAuthApps } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import type { OauthAppsAddParams } from '@rocket.chat/rest-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../../lib/server/lib/deprecationWarningLogger'; import { addOAuthApp } from '../functions/addOAuthApp'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { addOAuthApp(application: OauthAppsAddParams): IOAuthApps; diff --git a/apps/meteor/app/oauth2-server-config/server/admin/methods/deleteOAuthApp.ts b/apps/meteor/app/oauth2-server-config/server/admin/methods/deleteOAuthApp.ts index 0209f9d453b5..9c5cbf6fd9ae 100644 --- a/apps/meteor/app/oauth2-server-config/server/admin/methods/deleteOAuthApp.ts +++ b/apps/meteor/app/oauth2-server-config/server/admin/methods/deleteOAuthApp.ts @@ -1,11 +1,11 @@ import type { IOAuthApps } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { OAuthAccessTokens, OAuthApps, OAuthAuthCodes } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { deleteOAuthApp(applicationId: IOAuthApps['_id']): boolean; diff --git a/apps/meteor/app/oauth2-server-config/server/admin/methods/updateOAuthApp.ts b/apps/meteor/app/oauth2-server-config/server/admin/methods/updateOAuthApp.ts index 525d0fa2d124..f2daca1885c9 100644 --- a/apps/meteor/app/oauth2-server-config/server/admin/methods/updateOAuthApp.ts +++ b/apps/meteor/app/oauth2-server-config/server/admin/methods/updateOAuthApp.ts @@ -1,12 +1,12 @@ import type { IOAuthApps } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { OAuthApps, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; import { parseUriList } from '../functions/parseUriList'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { updateOAuthApp( diff --git a/apps/meteor/app/otr/server/methods/deleteOldOTRMessages.ts b/apps/meteor/app/otr/server/methods/deleteOldOTRMessages.ts index a994b19dd1a4..1b57c65b4bb7 100644 --- a/apps/meteor/app/otr/server/methods/deleteOldOTRMessages.ts +++ b/apps/meteor/app/otr/server/methods/deleteOldOTRMessages.ts @@ -1,9 +1,9 @@ import type { IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, Subscriptions, ReadReceipts } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { deleteOldOTRMessages(roomId: IRoom['_id']): Promise; diff --git a/apps/meteor/app/otr/server/methods/sendSystemMessages.ts b/apps/meteor/app/otr/server/methods/sendSystemMessages.ts index a2abf0938b9e..13abbd7511af 100644 --- a/apps/meteor/app/otr/server/methods/sendSystemMessages.ts +++ b/apps/meteor/app/otr/server/methods/sendSystemMessages.ts @@ -1,7 +1,7 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { sendSystemMessages(rid: string, user: string | undefined, id: string): void; diff --git a/apps/meteor/app/otr/server/methods/updateOTRAck.ts b/apps/meteor/app/otr/server/methods/updateOTRAck.ts index a5a502ddf1a2..4fbd182e9d27 100644 --- a/apps/meteor/app/otr/server/methods/updateOTRAck.ts +++ b/apps/meteor/app/otr/server/methods/updateOTRAck.ts @@ -1,9 +1,9 @@ import { api } from '@rocket.chat/core-services'; import type { IOTRMessage } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { updateOTRAck({ message, ack }: { message: IOTRMessage; ack: string }): void; diff --git a/apps/meteor/app/push-notifications/server/methods/saveNotificationSettings.ts b/apps/meteor/app/push-notifications/server/methods/saveNotificationSettings.ts index a4376c709275..a86ded6f24e5 100644 --- a/apps/meteor/app/push-notifications/server/methods/saveNotificationSettings.ts +++ b/apps/meteor/app/push-notifications/server/methods/saveNotificationSettings.ts @@ -1,6 +1,6 @@ import type { ISubscription } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -9,7 +9,7 @@ import { getUserNotificationPreference } from '../../../utils/server/getUserNoti const saveAudioNotificationValue = (subId: ISubscription['_id'], value: string) => value === 'default' ? Subscriptions.clearAudioNotificationValueById(subId) : Subscriptions.updateAudioNotificationValueById(subId, value); -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { saveNotificationSettings( diff --git a/apps/meteor/app/push/server/methods.ts b/apps/meteor/app/push/server/methods.ts index 364a16cbdb5e..1f1e261eccae 100644 --- a/apps/meteor/app/push/server/methods.ts +++ b/apps/meteor/app/push/server/methods.ts @@ -1,7 +1,7 @@ import type { IAppsTokens } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { AppsTokens } from '@rocket.chat/models'; import { Random } from '@rocket.chat/random'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Accounts } from 'meteor/accounts-base'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -9,7 +9,7 @@ import { Meteor } from 'meteor/meteor'; import { logger } from './logger'; import { _matchToken } from './push'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'raix:push-update'(options: { diff --git a/apps/meteor/app/reactions/client/methods/setReaction.ts b/apps/meteor/app/reactions/client/methods/setReaction.ts index a38e6c156790..ed15cda9ab8e 100644 --- a/apps/meteor/app/reactions/client/methods/setReaction.ts +++ b/apps/meteor/app/reactions/client/methods/setReaction.ts @@ -1,5 +1,5 @@ import type { IMessage, IRoom } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { roomCoordinator } from '../../../../client/lib/rooms/roomCoordinator'; diff --git a/apps/meteor/app/reactions/server/setReaction.ts b/apps/meteor/app/reactions/server/setReaction.ts index 896e5041bd61..5a25049331af 100644 --- a/apps/meteor/app/reactions/server/setReaction.ts +++ b/apps/meteor/app/reactions/server/setReaction.ts @@ -1,8 +1,8 @@ import { Apps, AppEvents } from '@rocket.chat/apps'; import { api } from '@rocket.chat/core-services'; import type { IMessage, IRoom, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, EmojiCustom, Rooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; @@ -140,7 +140,7 @@ export async function executeSetReaction(userId: string, reaction: string, messa return setReaction(room, user, message, reaction, shouldReact); } -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { setReaction(reaction: string, messageId: IMessage['_id'], shouldReact?: boolean): boolean | undefined; diff --git a/apps/meteor/app/search/server/methods.ts b/apps/meteor/app/search/server/methods.ts index 686b5b429e96..cdb3b4180f7a 100644 --- a/apps/meteor/app/search/server/methods.ts +++ b/apps/meteor/app/search/server/methods.ts @@ -1,12 +1,12 @@ import type { IMessageSearchProvider, IMessageSearchSuggestion, IRoom, IUser } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { SearchLogger } from './logger/logger'; import type { IRawSearchResult, ISearchResult } from './model/ISearchResult'; import { searchProviderService, validationService } from './service'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'rocketchatSearch.getProvider'(): IMessageSearchProvider | undefined; diff --git a/apps/meteor/app/slackbridge/server/removeChannelLinks.ts b/apps/meteor/app/slackbridge/server/removeChannelLinks.ts index 1a4e6f6a0096..2c89e71f9635 100644 --- a/apps/meteor/app/slackbridge/server/removeChannelLinks.ts +++ b/apps/meteor/app/slackbridge/server/removeChannelLinks.ts @@ -1,11 +1,11 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../authorization/server/functions/hasPermission'; import { settings } from '../../settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { removeSlackBridgeChannelLinks(): { message: string; params: unknown[] }; diff --git a/apps/meteor/app/statistics/server/methods/getStatistics.ts b/apps/meteor/app/statistics/server/methods/getStatistics.ts index c7eb79b5b985..a804ef83584e 100644 --- a/apps/meteor/app/statistics/server/methods/getStatistics.ts +++ b/apps/meteor/app/statistics/server/methods/getStatistics.ts @@ -1,10 +1,10 @@ import type { IStats } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { getLastStatistics } from '../functions/getLastStatistics'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getStatistics(refresh?: boolean): IStats; diff --git a/apps/meteor/app/threads/server/methods/followMessage.ts b/apps/meteor/app/threads/server/methods/followMessage.ts index 05650d0ad2ef..1790e0607a62 100644 --- a/apps/meteor/app/threads/server/methods/followMessage.ts +++ b/apps/meteor/app/threads/server/methods/followMessage.ts @@ -1,7 +1,7 @@ import { Apps, AppEvents } from '@rocket.chat/apps'; import type { IMessage } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -10,7 +10,7 @@ import { RateLimiter } from '../../../lib/server'; import { settings } from '../../../settings/server'; import { follow } from '../functions'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { followMessage(message: { mid: IMessage['_id'] }): false | undefined; diff --git a/apps/meteor/app/threads/server/methods/getThreadMessages.ts b/apps/meteor/app/threads/server/methods/getThreadMessages.ts index d6c2d65ff4d4..8ae31130df1b 100644 --- a/apps/meteor/app/threads/server/methods/getThreadMessages.ts +++ b/apps/meteor/app/threads/server/methods/getThreadMessages.ts @@ -1,6 +1,6 @@ import type { IMessage } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../../lib/callbacks'; @@ -8,7 +8,7 @@ import { canAccessRoomAsync } from '../../../authorization/server'; import { settings } from '../../../settings/server'; import { readThread } from '../functions'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getThreadMessages(params: { tmid: IMessage['_id']; limit?: number; skip?: number }): Promise; diff --git a/apps/meteor/app/threads/server/methods/getThreadsList.ts b/apps/meteor/app/threads/server/methods/getThreadsList.ts index 5a33dc16280b..c51449ff2d4d 100644 --- a/apps/meteor/app/threads/server/methods/getThreadsList.ts +++ b/apps/meteor/app/threads/server/methods/getThreadsList.ts @@ -1,6 +1,6 @@ import type { IMessage, IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomAsync } from '../../../authorization/server'; @@ -8,7 +8,7 @@ import { settings } from '../../../settings/server'; const MAX_LIMIT = 100; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getThreadsList(params: { rid: IRoom['_id']; limit?: number; skip?: number }): IMessage[]; diff --git a/apps/meteor/app/threads/server/methods/unfollowMessage.ts b/apps/meteor/app/threads/server/methods/unfollowMessage.ts index afc9206b038f..6371f40af6cb 100644 --- a/apps/meteor/app/threads/server/methods/unfollowMessage.ts +++ b/apps/meteor/app/threads/server/methods/unfollowMessage.ts @@ -1,7 +1,7 @@ import { Apps, AppEvents } from '@rocket.chat/apps'; import type { IMessage } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -10,7 +10,7 @@ import { RateLimiter } from '../../../lib/server'; import { settings } from '../../../settings/server'; import { unfollow } from '../functions'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { unfollowMessage(message: { mid: IMessage['_id'] }): false | undefined; diff --git a/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.ts b/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.ts index 545e1e73342d..602a0eddb8ce 100644 --- a/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.ts +++ b/apps/meteor/app/ui-cached-collection/client/models/CachedCollection.ts @@ -1,5 +1,5 @@ +import type { StreamNames } from '@rocket.chat/ddp-client'; import { Emitter } from '@rocket.chat/emitter'; -import type { StreamNames } from '@rocket.chat/ui-contexts'; import localforage from 'localforage'; import { Accounts } from 'meteor/accounts-base'; import { Meteor } from 'meteor/meteor'; diff --git a/apps/meteor/app/user-status/server/methods/deleteCustomUserStatus.ts b/apps/meteor/app/user-status/server/methods/deleteCustomUserStatus.ts index f58fa9551f4c..416bc6f678ed 100644 --- a/apps/meteor/app/user-status/server/methods/deleteCustomUserStatus.ts +++ b/apps/meteor/app/user-status/server/methods/deleteCustomUserStatus.ts @@ -1,11 +1,11 @@ import { api } from '@rocket.chat/core-services'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { CustomUserStatus } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { deleteCustomUserStatus(userStatusID: string): Promise; diff --git a/apps/meteor/app/user-status/server/methods/getUserStatusText.ts b/apps/meteor/app/user-status/server/methods/getUserStatusText.ts index 5aa80627d562..911a69854b95 100644 --- a/apps/meteor/app/user-status/server/methods/getUserStatusText.ts +++ b/apps/meteor/app/user-status/server/methods/getUserStatusText.ts @@ -1,9 +1,9 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { getStatusText } from '../../../lib/server/functions/getStatusText'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getUserStatusText(userId: string): Promise; diff --git a/apps/meteor/app/user-status/server/methods/insertOrUpdateUserStatus.ts b/apps/meteor/app/user-status/server/methods/insertOrUpdateUserStatus.ts index b6a98895bc2c..6e034f030679 100644 --- a/apps/meteor/app/user-status/server/methods/insertOrUpdateUserStatus.ts +++ b/apps/meteor/app/user-status/server/methods/insertOrUpdateUserStatus.ts @@ -1,14 +1,14 @@ import { api } from '@rocket.chat/core-services'; import type { ICustomUserStatus } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import type { InsertionModel } from '@rocket.chat/model-typings'; import { CustomUserStatus } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { trim } from '../../../../lib/utils/stringUtils'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { insertOrUpdateUserStatus(userStatusData: { diff --git a/apps/meteor/app/user-status/server/methods/listCustomUserStatus.ts b/apps/meteor/app/user-status/server/methods/listCustomUserStatus.ts index 3a962121d65c..d9a58f8b8c72 100644 --- a/apps/meteor/app/user-status/server/methods/listCustomUserStatus.ts +++ b/apps/meteor/app/user-status/server/methods/listCustomUserStatus.ts @@ -1,9 +1,9 @@ import type { ICustomUserStatus } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { CustomUserStatus } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { listCustomUserStatus(): ICustomUserStatus[]; diff --git a/apps/meteor/app/user-status/server/methods/setUserStatus.ts b/apps/meteor/app/user-status/server/methods/setUserStatus.ts index 32db93e722fb..0b40e7e37246 100644 --- a/apps/meteor/app/user-status/server/methods/setUserStatus.ts +++ b/apps/meteor/app/user-status/server/methods/setUserStatus.ts @@ -1,6 +1,6 @@ import { Presence } from '@rocket.chat/core-services'; import type { IUser } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -8,7 +8,7 @@ import { RateLimiter } from '../../../lib/server'; import { setStatusText } from '../../../lib/server/functions/setStatusText'; import { settings } from '../../../settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { setUserStatus(statusType: IUser['status'], statusText: IUser['statusText']): void; diff --git a/apps/meteor/app/utils/client/lib/SDKClient.ts b/apps/meteor/app/utils/client/lib/SDKClient.ts index 09748af414da..7d26adaf546b 100644 --- a/apps/meteor/app/utils/client/lib/SDKClient.ts +++ b/apps/meteor/app/utils/client/lib/SDKClient.ts @@ -1,7 +1,6 @@ import type { RestClientInterface } from '@rocket.chat/api-client'; -import type { SDK, ClientStream, StreamKeys, StreamNames, StreamerCallbackArgs } from '@rocket.chat/ddp-client'; +import type { SDK, ClientStream, StreamKeys, StreamNames, StreamerCallbackArgs, ServerMethods } from '@rocket.chat/ddp-client'; import { Emitter } from '@rocket.chat/emitter'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { DDPCommon } from 'meteor/ddp-common'; import { Meteor } from 'meteor/meteor'; diff --git a/apps/meteor/app/utils/lib/slashCommand.ts b/apps/meteor/app/utils/lib/slashCommand.ts index f4e2cc1b359a..47149807bbd8 100644 --- a/apps/meteor/app/utils/lib/slashCommand.ts +++ b/apps/meteor/app/utils/lib/slashCommand.ts @@ -126,7 +126,7 @@ export const slashCommands = { }, }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { slashCommand(params: { cmd: string; params: string; msg: IMessage; triggerId: string }): unknown; diff --git a/apps/meteor/app/utils/server/slashCommand.ts b/apps/meteor/app/utils/server/slashCommand.ts index 74f2c5716cc4..dc85fee9b671 100644 --- a/apps/meteor/app/utils/server/slashCommand.ts +++ b/apps/meteor/app/utils/server/slashCommand.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { slashCommands } from '../lib/slashCommand'; diff --git a/apps/meteor/app/version-check/server/methods/banner_dismiss.ts b/apps/meteor/app/version-check/server/methods/banner_dismiss.ts index 5ffebcfbbd5a..a3bf337626f9 100644 --- a/apps/meteor/app/version-check/server/methods/banner_dismiss.ts +++ b/apps/meteor/app/version-check/server/methods/banner_dismiss.ts @@ -1,10 +1,10 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { notifyOnUserChange } from '../../../lib/server/lib/notifyListener'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'banner/dismiss'({ id }: { id: string }): void; diff --git a/apps/meteor/app/webdav/server/methods/addWebdavAccount.ts b/apps/meteor/app/webdav/server/methods/addWebdavAccount.ts index e2c9a9ddc324..2c3973649091 100644 --- a/apps/meteor/app/webdav/server/methods/addWebdavAccount.ts +++ b/apps/meteor/app/webdav/server/methods/addWebdavAccount.ts @@ -1,14 +1,14 @@ import { api } from '@rocket.chat/core-services'; import type { IWebdavAccountPayload } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { WebdavAccounts } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { settings } from '../../../settings/server'; import { WebdavClientAdapter } from '../lib/webdavClientAdapter'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { addWebdavAccount(formData: IWebdavAccountPayload): boolean; diff --git a/apps/meteor/app/webdav/server/methods/getFileFromWebdav.ts b/apps/meteor/app/webdav/server/methods/getFileFromWebdav.ts index 346362935d87..38aeb0442c5c 100644 --- a/apps/meteor/app/webdav/server/methods/getFileFromWebdav.ts +++ b/apps/meteor/app/webdav/server/methods/getFileFromWebdav.ts @@ -1,15 +1,15 @@ import type { IWebdavAccount, IWebdavNode } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { WebdavAccounts } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { settings } from '../../../settings/server'; import { getWebdavCredentials } from '../lib/getWebdavCredentials'; import { WebdavClientAdapter } from '../lib/webdavClientAdapter'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention - export interface ServerMethods { + interface ServerMethods { getFileFromWebdav(accountId: IWebdavAccount['_id'], file: IWebdavNode): Promise<{ success: boolean; data: Uint8Array }>; } } diff --git a/apps/meteor/app/webdav/server/methods/getWebdavFileList.ts b/apps/meteor/app/webdav/server/methods/getWebdavFileList.ts index f4d944181928..66e924b719a2 100644 --- a/apps/meteor/app/webdav/server/methods/getWebdavFileList.ts +++ b/apps/meteor/app/webdav/server/methods/getWebdavFileList.ts @@ -1,13 +1,13 @@ import type { IWebdavAccount, IWebdavNode } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { WebdavAccounts } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { settings } from '../../../settings/server'; import { getWebdavCredentials } from '../lib/getWebdavCredentials'; import { WebdavClientAdapter } from '../lib/webdavClientAdapter'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getWebdavFileList(accountId: IWebdavAccount['_id'], path: string): { success: boolean; data: IWebdavNode[] }; diff --git a/apps/meteor/app/webdav/server/methods/getWebdavFilePreview.ts b/apps/meteor/app/webdav/server/methods/getWebdavFilePreview.ts index 1e01937a0e52..34077babf276 100644 --- a/apps/meteor/app/webdav/server/methods/getWebdavFilePreview.ts +++ b/apps/meteor/app/webdav/server/methods/getWebdavFilePreview.ts @@ -1,13 +1,13 @@ import type { IWebdavAccount } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { WebdavAccounts } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { createClient } from 'webdav'; import { settings } from '../../../settings/server'; import { getWebdavCredentials } from '../lib/getWebdavCredentials'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getWebdavFilePreview(accountId: IWebdavAccount['_id'], path: string): { success: true; data: ArrayBuffer } | undefined; diff --git a/apps/meteor/app/webdav/server/methods/removeWebdavAccount.ts b/apps/meteor/app/webdav/server/methods/removeWebdavAccount.ts index df6102297cc2..a68a14e29e40 100644 --- a/apps/meteor/app/webdav/server/methods/removeWebdavAccount.ts +++ b/apps/meteor/app/webdav/server/methods/removeWebdavAccount.ts @@ -1,14 +1,14 @@ import { api } from '@rocket.chat/core-services'; import type { IWebdavAccount } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { WebdavAccounts } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import type { DeleteResult } from 'mongodb'; import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { removeWebdavAccount(accountId: IWebdavAccount['_id']): DeleteResult; diff --git a/apps/meteor/app/webdav/server/methods/uploadFileToWebdav.ts b/apps/meteor/app/webdav/server/methods/uploadFileToWebdav.ts index 8a2e1badd27d..97bcf4632216 100644 --- a/apps/meteor/app/webdav/server/methods/uploadFileToWebdav.ts +++ b/apps/meteor/app/webdav/server/methods/uploadFileToWebdav.ts @@ -1,7 +1,8 @@ import { MeteorError } from '@rocket.chat/core-services'; import type { IWebdavAccount } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Logger } from '@rocket.chat/logger'; -import type { ServerMethods, TranslationKey } from '@rocket.chat/ui-contexts'; +import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { settings } from '../../../settings/server'; @@ -9,7 +10,7 @@ import { uploadFileToWebdav } from '../lib/uploadFileToWebdav'; const logger = new Logger('WebDAV_Upload'); -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { uploadFileToWebdav( diff --git a/apps/meteor/client/lib/utils/callWithErrorHandling.ts b/apps/meteor/client/lib/utils/callWithErrorHandling.ts index ebdb59a388e1..cd3c6c3748b5 100644 --- a/apps/meteor/client/lib/utils/callWithErrorHandling.ts +++ b/apps/meteor/client/lib/utils/callWithErrorHandling.ts @@ -1,4 +1,4 @@ -import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn } from '@rocket.chat/ui-contexts'; +import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn } from '@rocket.chat/ddp-client'; import { sdk } from '../../../app/utils/client/lib/SDKClient'; import { dispatchToastMessage } from '../toast'; diff --git a/apps/meteor/client/methods/hideRoom.ts b/apps/meteor/client/methods/hideRoom.ts index c7bb9317d71c..91cf2a3de04c 100644 --- a/apps/meteor/client/methods/hideRoom.ts +++ b/apps/meteor/client/methods/hideRoom.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { ChatSubscription } from '../../app/models/client'; diff --git a/apps/meteor/client/methods/openRoom.ts b/apps/meteor/client/methods/openRoom.ts index c449c154ec23..81a40989e696 100644 --- a/apps/meteor/client/methods/openRoom.ts +++ b/apps/meteor/client/methods/openRoom.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { ChatSubscription } from '../../app/models/client'; diff --git a/apps/meteor/client/methods/pinMessage.ts b/apps/meteor/client/methods/pinMessage.ts index 7b4247c71870..2fba64be2bf9 100644 --- a/apps/meteor/client/methods/pinMessage.ts +++ b/apps/meteor/client/methods/pinMessage.ts @@ -1,5 +1,5 @@ import type { IMessage } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { ChatMessage, ChatSubscription } from '../../app/models/client'; diff --git a/apps/meteor/client/methods/setUserActiveStatus.ts b/apps/meteor/client/methods/setUserActiveStatus.ts index 40370781129f..b6b9e0b778a7 100644 --- a/apps/meteor/client/methods/setUserActiveStatus.ts +++ b/apps/meteor/client/methods/setUserActiveStatus.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; Meteor.methods({ diff --git a/apps/meteor/client/methods/starMessage.ts b/apps/meteor/client/methods/starMessage.ts index d6d1a91aaca6..bfa74738e283 100644 --- a/apps/meteor/client/methods/starMessage.ts +++ b/apps/meteor/client/methods/starMessage.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { ChatMessage, ChatSubscription } from '../../app/models/client'; diff --git a/apps/meteor/client/methods/toggleFavorite.ts b/apps/meteor/client/methods/toggleFavorite.ts index 2df56e4731eb..5db56fa682f7 100644 --- a/apps/meteor/client/methods/toggleFavorite.ts +++ b/apps/meteor/client/methods/toggleFavorite.ts @@ -1,4 +1,4 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { ChatSubscription } from '../../app/models/client'; diff --git a/apps/meteor/client/methods/unpinMessage.ts b/apps/meteor/client/methods/unpinMessage.ts index 6c497d38ecc2..f05c07e5314d 100644 --- a/apps/meteor/client/methods/unpinMessage.ts +++ b/apps/meteor/client/methods/unpinMessage.ts @@ -1,5 +1,5 @@ import type { IMessage } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { ChatMessage, ChatSubscription } from '../../app/models/client'; diff --git a/apps/meteor/client/methods/updateMessage.ts b/apps/meteor/client/methods/updateMessage.ts index 719a036f870c..8efffbe73ee6 100644 --- a/apps/meteor/client/methods/updateMessage.ts +++ b/apps/meteor/client/methods/updateMessage.ts @@ -1,5 +1,5 @@ import type { IEditedMessage } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import moment from 'moment'; diff --git a/apps/meteor/client/providers/ServerProvider.tsx b/apps/meteor/client/providers/ServerProvider.tsx index 53ac92287f78..7bf442671f08 100644 --- a/apps/meteor/client/providers/ServerProvider.tsx +++ b/apps/meteor/client/providers/ServerProvider.tsx @@ -1,14 +1,14 @@ import type { Serialized } from '@rocket.chat/core-typings'; -import type { Method, PathFor, OperationParams, OperationResult, UrlParams, PathPattern } from '@rocket.chat/rest-typings'; import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn, StreamerCallbackArgs, - UploadResult, StreamNames, StreamKeys, -} from '@rocket.chat/ui-contexts'; +} from '@rocket.chat/ddp-client'; +import type { Method, PathFor, OperationParams, OperationResult, UrlParams, PathPattern } from '@rocket.chat/rest-typings'; +import type { UploadResult } from '@rocket.chat/ui-contexts'; import { ServerContext } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { compile } from 'path-to-regexp'; diff --git a/apps/meteor/client/stories/contexts/ServerContextMock.tsx b/apps/meteor/client/stories/contexts/ServerContextMock.tsx index 4a23d172ced2..2c9f835b35a5 100644 --- a/apps/meteor/client/stories/contexts/ServerContextMock.tsx +++ b/apps/meteor/client/stories/contexts/ServerContextMock.tsx @@ -1,6 +1,7 @@ import type { Serialized } from '@rocket.chat/core-typings'; +import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn } from '@rocket.chat/ddp-client'; import type { Method, OperationParams, OperationResult, PathFor, PathPattern } from '@rocket.chat/rest-typings'; -import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn, UploadResult } from '@rocket.chat/ui-contexts'; +import type { UploadResult } from '@rocket.chat/ui-contexts'; import { ServerContext } from '@rocket.chat/ui-contexts'; import { action } from '@storybook/addon-actions'; import type { ContextType, ReactElement, ReactNode } from 'react'; diff --git a/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.stories.tsx b/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.stories.tsx index 5c8a468eed80..d235d716d436 100644 --- a/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.stories.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.stories.tsx @@ -1,5 +1,6 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Field } from '@rocket.chat/fuselage'; -import type { ServerMethods, TranslationKey } from '@rocket.chat/ui-contexts'; +import type { TranslationKey } from '@rocket.chat/ui-contexts'; import type { ComponentMeta, ComponentStory } from '@storybook/react'; import React from 'react'; diff --git a/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.tsx index 86c76c86f502..2f94048e3406 100644 --- a/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.tsx @@ -1,5 +1,6 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Button, FieldRow, FieldHint } from '@rocket.chat/fuselage'; -import type { ServerMethods, TranslationKey } from '@rocket.chat/ui-contexts'; +import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useMethod, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React from 'react'; diff --git a/apps/meteor/definition/externals/meteor/meteor.d.ts b/apps/meteor/definition/externals/meteor/meteor.d.ts index 8aed1992c0cf..992595dc07bb 100644 --- a/apps/meteor/definition/externals/meteor/meteor.d.ts +++ b/apps/meteor/definition/externals/meteor/meteor.d.ts @@ -1,5 +1,5 @@ import 'meteor/meteor'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import type { IStreamerConstructor, IStreamer } from 'meteor/rocketchat:streamer'; type StringifyBuffers = { diff --git a/apps/meteor/ee/app/canned-responses/server/methods/removeCannedResponse.ts b/apps/meteor/ee/app/canned-responses/server/methods/removeCannedResponse.ts index 4185cf6356f5..dc0ab665063c 100644 --- a/apps/meteor/ee/app/canned-responses/server/methods/removeCannedResponse.ts +++ b/apps/meteor/ee/app/canned-responses/server/methods/removeCannedResponse.ts @@ -1,12 +1,12 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { CannedResponse } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission'; import notifications from '../../../../../app/notifications/server/lib/Notifications'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { removeCannedResponse(_id: string): Promise; diff --git a/apps/meteor/ee/app/canned-responses/server/methods/saveCannedResponse.ts b/apps/meteor/ee/app/canned-responses/server/methods/saveCannedResponse.ts index 592ddaaf01da..96012a4367f1 100644 --- a/apps/meteor/ee/app/canned-responses/server/methods/saveCannedResponse.ts +++ b/apps/meteor/ee/app/canned-responses/server/methods/saveCannedResponse.ts @@ -1,13 +1,13 @@ import type { IOmnichannelCannedResponse, ILivechatDepartment } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatDepartment, CannedResponse, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission'; import notifications from '../../../../../app/notifications/server/lib/Notifications'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { saveCannedResponse( diff --git a/apps/meteor/ee/app/license/server/methods.ts b/apps/meteor/ee/app/license/server/methods.ts index dbdfe7aea68c..3e0bcca67eb4 100644 --- a/apps/meteor/ee/app/license/server/methods.ts +++ b/apps/meteor/ee/app/license/server/methods.ts @@ -1,10 +1,10 @@ import { type ILicenseTag, type LicenseModule } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { License } from '@rocket.chat/license'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'license:hasLicense'(feature: string): boolean; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/methods/addMonitor.ts b/apps/meteor/ee/app/livechat-enterprise/server/methods/addMonitor.ts index c4ff577fb326..6e6e5a7423d1 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/methods/addMonitor.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/methods/addMonitor.ts @@ -1,11 +1,11 @@ import type { IUser } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission'; import { LivechatEnterprise } from '../lib/LivechatEnterprise'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:addMonitor'(username: string): boolean | IUser; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/methods/getUnitsFromUserRoles.ts b/apps/meteor/ee/app/livechat-enterprise/server/methods/getUnitsFromUserRoles.ts index 18ed1b1ea646..d32064fdd96c 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/methods/getUnitsFromUserRoles.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/methods/getUnitsFromUserRoles.ts @@ -1,5 +1,5 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatUnit, LivechatDepartmentAgents } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import mem from 'mem'; import { Meteor } from 'meteor/meteor'; @@ -32,7 +32,7 @@ export const getUnitsFromUser = async (user: string): Promise; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/methods/removeBusinessHour.ts b/apps/meteor/ee/app/livechat-enterprise/server/methods/removeBusinessHour.ts index d881fa5c1bcb..b71fd06d769f 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/methods/removeBusinessHour.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/methods/removeBusinessHour.ts @@ -1,10 +1,10 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission'; import { businessHourManager } from '../../../../../app/livechat/server/business-hour'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:removeBusinessHour'(id: string, type: string): void; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/methods/removeMonitor.ts b/apps/meteor/ee/app/livechat-enterprise/server/methods/removeMonitor.ts index 972c47f67c3c..12352a47d9cb 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/methods/removeMonitor.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/methods/removeMonitor.ts @@ -1,10 +1,10 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission'; import { LivechatEnterprise } from '../lib/LivechatEnterprise'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:removeMonitor'(username: string): boolean; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/methods/removeTag.ts b/apps/meteor/ee/app/livechat-enterprise/server/methods/removeTag.ts index 38af03202361..ca9bc93e97ee 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/methods/removeTag.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/methods/removeTag.ts @@ -1,10 +1,10 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission'; import { LivechatEnterprise } from '../lib/LivechatEnterprise'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:removeTag'(id: string): Promise; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/methods/removeUnit.ts b/apps/meteor/ee/app/livechat-enterprise/server/methods/removeUnit.ts index 5ff1fb7f7845..c4c193f4b105 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/methods/removeUnit.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/methods/removeUnit.ts @@ -1,10 +1,10 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission'; import { LivechatEnterprise } from '../lib/LivechatEnterprise'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:removeUnit'(id: string): boolean; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/methods/resumeOnHold.ts b/apps/meteor/ee/app/livechat-enterprise/server/methods/resumeOnHold.ts index d708f8941269..1831ddc98783 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/methods/resumeOnHold.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/methods/resumeOnHold.ts @@ -1,8 +1,8 @@ import { Message } from '@rocket.chat/core-services'; import type { ILivechatVisitor, IOmnichannelSystemMessage } from '@rocket.chat/core-typings'; import { isOmnichannelRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatVisitors, LivechatInquiry, LivechatRooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../../../../app/lib/server/lib/deprecationWarningLogger'; @@ -31,7 +31,7 @@ async function resolveOnHoldCommentInfo(options: { clientAction: boolean }, room return i18n.t('Omnichannel_on_hold_chat_automatically', { guest }); } -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:resumeOnHold'(roomId: string, options?: { clientAction: boolean }): void; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/methods/saveTag.ts b/apps/meteor/ee/app/livechat-enterprise/server/methods/saveTag.ts index 42d7c91da971..094c4a97285a 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/methods/saveTag.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/methods/saveTag.ts @@ -1,11 +1,11 @@ import type { ILivechatTag } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission'; import { LivechatEnterprise } from '../lib/LivechatEnterprise'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:saveTag'(id: string, tagData: any, tagDepartments: any): Promise; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/methods/saveUnit.ts b/apps/meteor/ee/app/livechat-enterprise/server/methods/saveUnit.ts index 426dfaf8f81c..d686315e65df 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/methods/saveUnit.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/methods/saveUnit.ts @@ -1,11 +1,11 @@ import type { IOmnichannelBusinessUnit } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission'; import { LivechatEnterprise } from '../lib/LivechatEnterprise'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'livechat:saveUnit'(_id: string, unitData: any, unitMonitors: any, unitDepartments: any): Omit; diff --git a/apps/meteor/ee/server/lib/audit/methods.ts b/apps/meteor/ee/server/lib/audit/methods.ts index add64414c6e8..a3d32f0635d8 100644 --- a/apps/meteor/ee/server/lib/audit/methods.ts +++ b/apps/meteor/ee/server/lib/audit/methods.ts @@ -1,7 +1,7 @@ import type { ILivechatAgent, ILivechatVisitor, IMessage, IRoom, IUser, IAuditLog } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { LivechatRooms, Messages, Rooms, Users, AuditLog } from '@rocket.chat/models'; import { escapeRegExp } from '@rocket.chat/string-helpers'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { Meteor } from 'meteor/meteor'; @@ -57,7 +57,7 @@ const getRoomInfoByAuditParams = async ({ } }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { auditGetAuditions: (params: { startDate: Date; endDate: Date }) => IAuditLog[]; diff --git a/apps/meteor/ee/server/methods/getReadReceipts.ts b/apps/meteor/ee/server/methods/getReadReceipts.ts index 78fe8a4d967e..04a6ed1dff35 100644 --- a/apps/meteor/ee/server/methods/getReadReceipts.ts +++ b/apps/meteor/ee/server/methods/getReadReceipts.ts @@ -1,14 +1,14 @@ import type { ReadReceipt as ReadReceiptType, IMessage } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { License } from '@rocket.chat/license'; import { Messages } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomIdAsync } from '../../../app/authorization/server/functions/canAccessRoom'; import { ReadReceipt } from '../lib/message-read-receipt/ReadReceipt'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getReadReceipts(options: { messageId: IMessage['_id'] }): ReadReceiptType[]; diff --git a/apps/meteor/imports/personal-access-tokens/server/api/methods/generateToken.ts b/apps/meteor/imports/personal-access-tokens/server/api/methods/generateToken.ts index a7dfc6ab46f6..7badb659774f 100644 --- a/apps/meteor/imports/personal-access-tokens/server/api/methods/generateToken.ts +++ b/apps/meteor/imports/personal-access-tokens/server/api/methods/generateToken.ts @@ -1,13 +1,13 @@ import { Meteor } from 'meteor/meteor'; import { Random } from '@rocket.chat/random'; import { Accounts } from 'meteor/accounts-base'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission'; import { twoFactorRequired } from '../../../../../app/2fa/server/twoFactorRequired'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'personalAccessTokens:generateToken'(params: { tokenName: string; bypassTwoFactor: boolean }): Promise; diff --git a/apps/meteor/imports/personal-access-tokens/server/api/methods/regenerateToken.ts b/apps/meteor/imports/personal-access-tokens/server/api/methods/regenerateToken.ts index 8fa323644283..14629ce4dd9d 100644 --- a/apps/meteor/imports/personal-access-tokens/server/api/methods/regenerateToken.ts +++ b/apps/meteor/imports/personal-access-tokens/server/api/methods/regenerateToken.ts @@ -1,11 +1,11 @@ import { Meteor } from 'meteor/meteor'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission'; import { twoFactorRequired } from '../../../../../app/2fa/server/twoFactorRequired'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'personalAccessTokens:regenerateToken'(params: { tokenName: string }): Promise; diff --git a/apps/meteor/imports/personal-access-tokens/server/api/methods/removeToken.ts b/apps/meteor/imports/personal-access-tokens/server/api/methods/removeToken.ts index 7da13fe48eeb..0f03e6087ee2 100644 --- a/apps/meteor/imports/personal-access-tokens/server/api/methods/removeToken.ts +++ b/apps/meteor/imports/personal-access-tokens/server/api/methods/removeToken.ts @@ -1,11 +1,11 @@ import { Meteor } from 'meteor/meteor'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; import { hasPermissionAsync } from '../../../../../app/authorization/server/functions/hasPermission'; import { twoFactorRequired } from '../../../../../app/2fa/server/twoFactorRequired'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'personalAccessTokens:removeToken'(params: { tokenName: string }): Promise; diff --git a/apps/meteor/server/lib/pushConfig.ts b/apps/meteor/server/lib/pushConfig.ts index 2cf944bef737..fb2f91c4b868 100644 --- a/apps/meteor/server/lib/pushConfig.ts +++ b/apps/meteor/server/lib/pushConfig.ts @@ -1,6 +1,6 @@ import type { IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { AppsTokens } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; @@ -30,7 +30,7 @@ export const executePushTest = async (userId: IUser['_id'], username: IUser['use return tokens; }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { push_test(): { message: string; params: number[] }; diff --git a/apps/meteor/server/methods/OEmbedCacheCleanup.ts b/apps/meteor/server/methods/OEmbedCacheCleanup.ts index 158964125502..80e83959d5b0 100644 --- a/apps/meteor/server/methods/OEmbedCacheCleanup.ts +++ b/apps/meteor/server/methods/OEmbedCacheCleanup.ts @@ -1,11 +1,11 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { OEmbedCache } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; import { settings } from '../../app/settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { OEmbedCacheCleanup(): { message: string }; diff --git a/apps/meteor/server/methods/addAllUserToRoom.ts b/apps/meteor/server/methods/addAllUserToRoom.ts index 0c4f1532371d..c07bdc48040a 100644 --- a/apps/meteor/server/methods/addAllUserToRoom.ts +++ b/apps/meteor/server/methods/addAllUserToRoom.ts @@ -1,7 +1,7 @@ import { Message } from '@rocket.chat/core-services'; import type { IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Rooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -11,7 +11,7 @@ import { getDefaultSubscriptionPref } from '../../app/utils/lib/getDefaultSubscr import { callbacks } from '../../lib/callbacks'; import { getSubscriptionAutotranslateDefaultConfig } from '../lib/getSubscriptionAutotranslateDefaultConfig'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { addAllUserToRoom(rid: IRoom['_id'], activeUsersOnly?: boolean): Promise; diff --git a/apps/meteor/server/methods/addRoomLeader.ts b/apps/meteor/server/methods/addRoomLeader.ts index d8c9d1a7351f..b8e09b44065a 100644 --- a/apps/meteor/server/methods/addRoomLeader.ts +++ b/apps/meteor/server/methods/addRoomLeader.ts @@ -1,14 +1,14 @@ import { api, Message, Team } from '@rocket.chat/core-services'; import type { IRoom, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; import { settings } from '../../app/settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { addRoomLeader(rid: IRoom['_id'], userId: IUser['_id']): boolean; diff --git a/apps/meteor/server/methods/addRoomModerator.ts b/apps/meteor/server/methods/addRoomModerator.ts index 357629a8155e..ef64ced09423 100644 --- a/apps/meteor/server/methods/addRoomModerator.ts +++ b/apps/meteor/server/methods/addRoomModerator.ts @@ -1,15 +1,15 @@ import { api, Message, Team } from '@rocket.chat/core-services'; import type { IRoom, IUser } from '@rocket.chat/core-typings'; import { isRoomFederated } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Rooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; import { settings } from '../../app/settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { addRoomModerator(rid: IRoom['_id'], userId: IUser['_id']): boolean; diff --git a/apps/meteor/server/methods/addRoomOwner.ts b/apps/meteor/server/methods/addRoomOwner.ts index 5ee7a9dd74d2..f64e6699a4cb 100644 --- a/apps/meteor/server/methods/addRoomOwner.ts +++ b/apps/meteor/server/methods/addRoomOwner.ts @@ -1,15 +1,15 @@ import { api, Message, Team } from '@rocket.chat/core-services'; import type { IRoom, IUser } from '@rocket.chat/core-typings'; import { isRoomFederated } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Rooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; import { settings } from '../../app/settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { addRoomOwner(rid: IRoom['_id'], userId: IUser['_id']): boolean; diff --git a/apps/meteor/server/methods/afterVerifyEmail.ts b/apps/meteor/server/methods/afterVerifyEmail.ts index c9c4819ed4f6..06bf389b0a03 100644 --- a/apps/meteor/server/methods/afterVerifyEmail.ts +++ b/apps/meteor/server/methods/afterVerifyEmail.ts @@ -1,11 +1,11 @@ import type { IRole } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Roles, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; const rolesToChangeTo: Map = new Map([['anonymous', ['user']]]); -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { afterVerifyEmail(): void; diff --git a/apps/meteor/server/methods/browseChannels.ts b/apps/meteor/server/methods/browseChannels.ts index 5516b83d184a..965accc83954 100644 --- a/apps/meteor/server/methods/browseChannels.ts +++ b/apps/meteor/server/methods/browseChannels.ts @@ -1,8 +1,8 @@ import { Team } from '@rocket.chat/core-services'; import type { IRoom, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms, Users, Subscriptions } from '@rocket.chat/models'; import { escapeRegExp } from '@rocket.chat/string-helpers'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import mem from 'mem'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { Meteor } from 'meteor/meteor'; @@ -308,7 +308,7 @@ const getUsers = async ( }; }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { browseChannels: (params: { diff --git a/apps/meteor/server/methods/canAccessRoom.ts b/apps/meteor/server/methods/canAccessRoom.ts index 945dd0e9a14f..eeff599a8585 100644 --- a/apps/meteor/server/methods/canAccessRoom.ts +++ b/apps/meteor/server/methods/canAccessRoom.ts @@ -1,13 +1,13 @@ import type { IRoom, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomAsync } from '../../app/authorization/server'; import { settings } from '../../app/settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { canAccessRoom(rid: IRoom['_id'], userId: IUser['_id'], extraData?: Record): (IRoom & { username?: string }) | boolean; diff --git a/apps/meteor/server/methods/channelsList.ts b/apps/meteor/server/methods/channelsList.ts index 4a2a154a191a..654c4aa070d6 100644 --- a/apps/meteor/server/methods/channelsList.ts +++ b/apps/meteor/server/methods/channelsList.ts @@ -1,6 +1,6 @@ import type { IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms, Subscriptions, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import type { FindOptions } from 'mongodb'; @@ -11,7 +11,7 @@ import { settings } from '../../app/settings/server'; import { getUserPreference } from '../../app/utils/server/lib/getUserPreference'; import { trim } from '../../lib/utils/stringUtils'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { channelsList(filter: string, channelType: string, limit?: number, sort?: string): { channels: IRoom[] }; diff --git a/apps/meteor/server/methods/createDirectMessage.ts b/apps/meteor/server/methods/createDirectMessage.ts index ccbfe8916cae..51847454fe61 100644 --- a/apps/meteor/server/methods/createDirectMessage.ts +++ b/apps/meteor/server/methods/createDirectMessage.ts @@ -1,7 +1,7 @@ import type { ICreateRoomParams } from '@rocket.chat/core-services'; import type { ICreatedRoom, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check, Match } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -119,7 +119,7 @@ export async function createDirectMessage( }; } -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { createDirectMessage(...usernames: Exclude[]): Omit; diff --git a/apps/meteor/server/methods/deleteFileMessage.ts b/apps/meteor/server/methods/deleteFileMessage.ts index 42b52c404301..7fbf8650bd2a 100644 --- a/apps/meteor/server/methods/deleteFileMessage.ts +++ b/apps/meteor/server/methods/deleteFileMessage.ts @@ -1,5 +1,5 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import type { DeleteResult } from 'mongodb'; @@ -7,7 +7,7 @@ import type { DeleteResult } from 'mongodb'; import { FileUpload } from '../../app/file-upload/server'; import { deleteMessageValidatingPermission } from '../../app/lib/server/functions/deleteMessage'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { deleteFileMessage(fileID: string): Promise; diff --git a/apps/meteor/server/methods/deleteUser.ts b/apps/meteor/server/methods/deleteUser.ts index e8b1f6eeed65..32dc4f8eb313 100644 --- a/apps/meteor/server/methods/deleteUser.ts +++ b/apps/meteor/server/methods/deleteUser.ts @@ -1,14 +1,14 @@ import { Apps, AppEvents } from '@rocket.chat/apps'; import type { IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; import { deleteUser } from '../../app/lib/server/functions/deleteUser'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { deleteUser(userId: IUser['_id'], confirmRelinquish?: boolean): boolean; diff --git a/apps/meteor/server/methods/eraseRoom.ts b/apps/meteor/server/methods/eraseRoom.ts index b9b4833ad67f..e11c0fe6dcfd 100644 --- a/apps/meteor/server/methods/eraseRoom.ts +++ b/apps/meteor/server/methods/eraseRoom.ts @@ -1,7 +1,7 @@ import { AppEvents, Apps } from '@rocket.chat/apps'; import { Message, Team } from '@rocket.chat/core-services'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -58,7 +58,7 @@ export async function eraseRoom(rid: string, uid: string): Promise { } } -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { eraseRoom(rid: string): Promise; diff --git a/apps/meteor/server/methods/getAvatarSuggestion.ts b/apps/meteor/server/methods/getAvatarSuggestion.ts index 5cf8cdd2e4b1..f00c1a6563d2 100644 --- a/apps/meteor/server/methods/getAvatarSuggestion.ts +++ b/apps/meteor/server/methods/getAvatarSuggestion.ts @@ -1,11 +1,11 @@ import type { IUser } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; import { getAvatarSuggestionForUser } from '../../app/lib/server/functions/getAvatarSuggestionForUser'; import { methodDeprecationLogger } from '../../app/lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getAvatarSuggestion(): Record< diff --git a/apps/meteor/server/methods/getPasswordPolicy.ts b/apps/meteor/server/methods/getPasswordPolicy.ts index cc35f1cfb514..483938716093 100644 --- a/apps/meteor/server/methods/getPasswordPolicy.ts +++ b/apps/meteor/server/methods/getPasswordPolicy.ts @@ -1,12 +1,13 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods, TranslationKey } from '@rocket.chat/ui-contexts'; +import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { passwordPolicy } from '../../app/lib/server'; import { methodDeprecationLogger } from '../../app/lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getPasswordPolicy(params: { token: string }): { diff --git a/apps/meteor/server/methods/getRoomById.ts b/apps/meteor/server/methods/getRoomById.ts index c14009a59451..ce21f9c9a043 100644 --- a/apps/meteor/server/methods/getRoomById.ts +++ b/apps/meteor/server/methods/getRoomById.ts @@ -1,13 +1,13 @@ import type { IRoom, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomAsync } from '../../app/authorization/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getRoomById(rid: IRoom['_id']): IRoom; diff --git a/apps/meteor/server/methods/getRoomIdByNameOrId.ts b/apps/meteor/server/methods/getRoomIdByNameOrId.ts index d660a43d3f6f..91dbf555fe79 100644 --- a/apps/meteor/server/methods/getRoomIdByNameOrId.ts +++ b/apps/meteor/server/methods/getRoomIdByNameOrId.ts @@ -1,12 +1,12 @@ // DEPRECATE +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomAsync } from '../../app/authorization/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getRoomIdByNameOrId(rid: string): string; diff --git a/apps/meteor/server/methods/getRoomNameById.ts b/apps/meteor/server/methods/getRoomNameById.ts index 3aec8ed249aa..ebe0ade89f44 100644 --- a/apps/meteor/server/methods/getRoomNameById.ts +++ b/apps/meteor/server/methods/getRoomNameById.ts @@ -1,12 +1,12 @@ import type { IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getRoomNameById(rid: IRoom['_id']): Promise; diff --git a/apps/meteor/server/methods/getSetupWizardParameters.ts b/apps/meteor/server/methods/getSetupWizardParameters.ts index 808c308611f3..e204b02514f9 100644 --- a/apps/meteor/server/methods/getSetupWizardParameters.ts +++ b/apps/meteor/server/methods/getSetupWizardParameters.ts @@ -1,11 +1,11 @@ import type { ISetting } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Settings } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { settings } from '../../app/settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getSetupWizardParameters(): Promise<{ diff --git a/apps/meteor/server/methods/getTotalChannels.ts b/apps/meteor/server/methods/getTotalChannels.ts index 45449f104e6b..f1492d85d458 100644 --- a/apps/meteor/server/methods/getTotalChannels.ts +++ b/apps/meteor/server/methods/getTotalChannels.ts @@ -1,8 +1,8 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getTotalChannels(): number; diff --git a/apps/meteor/server/methods/getUsersOfRoom.ts b/apps/meteor/server/methods/getUsersOfRoom.ts index dde359f8e490..d3d69ce93754 100644 --- a/apps/meteor/server/methods/getUsersOfRoom.ts +++ b/apps/meteor/server/methods/getUsersOfRoom.ts @@ -1,6 +1,6 @@ import type { IRoom, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -8,7 +8,7 @@ import { canAccessRoomAsync, roomAccessAttributes } from '../../app/authorizatio import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; import { findUsersOfRoom } from '../lib/findUsersOfRoom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { getUsersOfRoom( diff --git a/apps/meteor/server/methods/hideRoom.ts b/apps/meteor/server/methods/hideRoom.ts index 64397969cca0..a53a328d549a 100644 --- a/apps/meteor/server/methods/hideRoom.ts +++ b/apps/meteor/server/methods/hideRoom.ts @@ -1,9 +1,9 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { hideRoom(rid: string): Promise; diff --git a/apps/meteor/server/methods/ignoreUser.ts b/apps/meteor/server/methods/ignoreUser.ts index 980efbd31ba4..358fc3be3d8f 100644 --- a/apps/meteor/server/methods/ignoreUser.ts +++ b/apps/meteor/server/methods/ignoreUser.ts @@ -1,9 +1,9 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { ignoreUser(params: { rid: string; userId: string; ignore?: boolean }): boolean; diff --git a/apps/meteor/server/methods/loadHistory.ts b/apps/meteor/server/methods/loadHistory.ts index a2b44ffab519..44f4e8e98e7c 100644 --- a/apps/meteor/server/methods/loadHistory.ts +++ b/apps/meteor/server/methods/loadHistory.ts @@ -1,6 +1,6 @@ import type { IMessage, IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -9,7 +9,7 @@ import { hasPermissionAsync } from '../../app/authorization/server/functions/has import { loadMessageHistory } from '../../app/lib/server/functions/loadMessageHistory'; import { settings } from '../../app/settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { loadHistory( diff --git a/apps/meteor/server/methods/loadLocale.ts b/apps/meteor/server/methods/loadLocale.ts index 8cf011c18067..891f708037b9 100644 --- a/apps/meteor/server/methods/loadLocale.ts +++ b/apps/meteor/server/methods/loadLocale.ts @@ -1,10 +1,10 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { getMomentLocale } from '../lib/getMomentLocale'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { loadLocale(locale: string): string | undefined; diff --git a/apps/meteor/server/methods/loadMissedMessages.ts b/apps/meteor/server/methods/loadMissedMessages.ts index f2bdc1c4f0e0..7c0ac4609066 100644 --- a/apps/meteor/server/methods/loadMissedMessages.ts +++ b/apps/meteor/server/methods/loadMissedMessages.ts @@ -1,12 +1,12 @@ import type { IMessage, IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomIdAsync } from '../../app/authorization/server/functions/canAccessRoom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { loadMissedMessages(rid: IRoom['_id'], ts: Date): Promise; diff --git a/apps/meteor/server/methods/loadNextMessages.ts b/apps/meteor/server/methods/loadNextMessages.ts index a5ff7b6940c5..db3235a498cc 100644 --- a/apps/meteor/server/methods/loadNextMessages.ts +++ b/apps/meteor/server/methods/loadNextMessages.ts @@ -1,13 +1,13 @@ import type { IMessage, IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomIdAsync } from '../../app/authorization/server/functions/canAccessRoom'; import { normalizeMessagesForUser } from '../../app/utils/server/lib/normalizeMessagesForUser'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { loadNextMessages(rid: IRoom['_id'], end?: Date, limit?: number): Promise<{ messages: IMessage[] }>; diff --git a/apps/meteor/server/methods/loadSurroundingMessages.ts b/apps/meteor/server/methods/loadSurroundingMessages.ts index d4cd54dfc2a5..3ea0e1492a80 100644 --- a/apps/meteor/server/methods/loadSurroundingMessages.ts +++ b/apps/meteor/server/methods/loadSurroundingMessages.ts @@ -1,6 +1,6 @@ import type { IMessage } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import type { FindOptions } from 'mongodb'; @@ -8,7 +8,7 @@ import type { FindOptions } from 'mongodb'; import { canAccessRoomIdAsync } from '../../app/authorization/server/functions/canAccessRoom'; import { normalizeMessagesForUser } from '../../app/utils/server/lib/normalizeMessagesForUser'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { loadSurroundingMessages( diff --git a/apps/meteor/server/methods/logoutCleanUp.ts b/apps/meteor/server/methods/logoutCleanUp.ts index 359933faccbd..c4ac54020ef7 100644 --- a/apps/meteor/server/methods/logoutCleanUp.ts +++ b/apps/meteor/server/methods/logoutCleanUp.ts @@ -1,12 +1,12 @@ import { AppEvents, Apps } from '@rocket.chat/apps'; import type { IUser } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { afterLogoutCleanUpCallback } from '../../lib/callbacks/afterLogoutCleanUpCallback'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { logoutCleanUp(user: IUser): Promise; diff --git a/apps/meteor/server/methods/messageSearch.ts b/apps/meteor/server/methods/messageSearch.ts index 3ba7b59d2655..e49e3f21a67e 100644 --- a/apps/meteor/server/methods/messageSearch.ts +++ b/apps/meteor/server/methods/messageSearch.ts @@ -1,6 +1,6 @@ import type { ISubscription, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, Subscriptions } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -10,7 +10,7 @@ import { settings } from '../../app/settings/server'; import { readSecondaryPreferred } from '../database/readSecondaryPreferred'; import { parseMessageSearchQuery } from '../lib/parseMessageSearchQuery'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { messageSearch(text: string, rid?: string, limit?: number, offset?: number): IRawSearchResult | boolean; diff --git a/apps/meteor/server/methods/muteUserInRoom.ts b/apps/meteor/server/methods/muteUserInRoom.ts index 95a0331d9bee..07e9683806da 100644 --- a/apps/meteor/server/methods/muteUserInRoom.ts +++ b/apps/meteor/server/methods/muteUserInRoom.ts @@ -1,7 +1,7 @@ import { Message } from '@rocket.chat/core-services'; import type { IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms, Subscriptions, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -12,7 +12,7 @@ import { RoomMemberActions } from '../../definition/IRoomTypeConfig'; import { callbacks } from '../../lib/callbacks'; import { roomCoordinator } from '../lib/rooms/roomCoordinator'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { muteUserInRoom(data: { rid: IRoom['_id']; username: string }): boolean; diff --git a/apps/meteor/server/methods/openRoom.ts b/apps/meteor/server/methods/openRoom.ts index 3348104862b5..b2957768f237 100644 --- a/apps/meteor/server/methods/openRoom.ts +++ b/apps/meteor/server/methods/openRoom.ts @@ -1,10 +1,10 @@ import type { IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { openRoom(rid: IRoom['_id']): Promise; diff --git a/apps/meteor/server/methods/readMessages.ts b/apps/meteor/server/methods/readMessages.ts index ed1c9fd6441e..217ba948b093 100644 --- a/apps/meteor/server/methods/readMessages.ts +++ b/apps/meteor/server/methods/readMessages.ts @@ -1,13 +1,13 @@ import type { IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomAsync } from '../../app/authorization/server'; import { readMessages } from '../lib/readMessages'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { readMessages(rid: string, readThreads?: boolean): Promise; diff --git a/apps/meteor/server/methods/readThreads.ts b/apps/meteor/server/methods/readThreads.ts index 234d0181294c..8f3652b7012c 100644 --- a/apps/meteor/server/methods/readThreads.ts +++ b/apps/meteor/server/methods/readThreads.ts @@ -1,6 +1,6 @@ import type { IMessage } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages, Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -9,7 +9,7 @@ import { settings } from '../../app/settings/server'; import { readThread } from '../../app/threads/server/functions'; import { callbacks } from '../../lib/callbacks'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { readThreads(tmid: IMessage['_id']): void; diff --git a/apps/meteor/server/methods/registerUser.ts b/apps/meteor/server/methods/registerUser.ts index e67181f3b089..09e44c5e1b82 100644 --- a/apps/meteor/server/methods/registerUser.ts +++ b/apps/meteor/server/methods/registerUser.ts @@ -1,6 +1,6 @@ import type { IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Accounts } from 'meteor/accounts-base'; import { Match, check } from 'meteor/check'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; @@ -11,7 +11,7 @@ import { validateEmailDomain, passwordPolicy, RateLimiter } from '../../app/lib/ import { settings } from '../../app/settings/server'; import { trim } from '../../lib/utils/stringUtils'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { registerUser( diff --git a/apps/meteor/server/methods/removeRoomLeader.ts b/apps/meteor/server/methods/removeRoomLeader.ts index 40b217e2b793..754d68960a4a 100644 --- a/apps/meteor/server/methods/removeRoomLeader.ts +++ b/apps/meteor/server/methods/removeRoomLeader.ts @@ -1,14 +1,14 @@ import { api, Message, Team } from '@rocket.chat/core-services'; import type { IRoom, IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; import { settings } from '../../app/settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { removeRoomLeader(rid: IRoom['_id'], userId: IUser['_id']): boolean; diff --git a/apps/meteor/server/methods/removeRoomModerator.ts b/apps/meteor/server/methods/removeRoomModerator.ts index a0d24159e4c8..291cc294a5fa 100644 --- a/apps/meteor/server/methods/removeRoomModerator.ts +++ b/apps/meteor/server/methods/removeRoomModerator.ts @@ -1,15 +1,15 @@ import { api, Message, Team } from '@rocket.chat/core-services'; import type { IRoom, IUser } from '@rocket.chat/core-typings'; import { isRoomFederated } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Rooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; import { settings } from '../../app/settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { removeRoomModerator(rid: IRoom['_id'], userId: IUser['_id']): boolean; diff --git a/apps/meteor/server/methods/removeRoomOwner.ts b/apps/meteor/server/methods/removeRoomOwner.ts index 37311898177c..82ee2c37f9b8 100644 --- a/apps/meteor/server/methods/removeRoomOwner.ts +++ b/apps/meteor/server/methods/removeRoomOwner.ts @@ -1,7 +1,7 @@ import { api, Message, Team } from '@rocket.chat/core-services'; import { isRoomFederated } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Rooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -9,7 +9,7 @@ import { getUsersInRole } from '../../app/authorization/server'; import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; import { settings } from '../../app/settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { removeRoomOwner(rid: string, userId: string): boolean; diff --git a/apps/meteor/server/methods/removeUserFromRoom.ts b/apps/meteor/server/methods/removeUserFromRoom.ts index 6662ae8d22cf..2f0e703a3b66 100644 --- a/apps/meteor/server/methods/removeUserFromRoom.ts +++ b/apps/meteor/server/methods/removeUserFromRoom.ts @@ -1,8 +1,8 @@ import { Apps, AppEvents } from '@rocket.chat/apps'; import { AppsEngineException } from '@rocket.chat/apps-engine/definition/exceptions'; import { Message, Team } from '@rocket.chat/core-services'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Rooms, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -17,7 +17,7 @@ import { afterRemoveFromRoomCallback } from '../../lib/callbacks/afterRemoveFrom import { removeUserFromRolesAsync } from '../lib/roles/removeUserFromRoles'; import { roomCoordinator } from '../lib/rooms/roomCoordinator'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { removeUserFromRoom(data: { rid: string; username: string }): boolean; diff --git a/apps/meteor/server/methods/reportMessage.ts b/apps/meteor/server/methods/reportMessage.ts index 05ac5aaf7e7b..cc240a2fb291 100644 --- a/apps/meteor/server/methods/reportMessage.ts +++ b/apps/meteor/server/methods/reportMessage.ts @@ -1,14 +1,14 @@ import { Apps, AppEvents } from '@rocket.chat/apps'; import type { IMessage } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { ModerationReports, Rooms, Users, Messages } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomAsync } from '../../app/authorization/server/functions/canAccessRoom'; import { methodDeprecationLogger } from '../../app/lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { reportMessage(messageId: IMessage['_id'], description: string): Promise; diff --git a/apps/meteor/server/methods/requestDataDownload.ts b/apps/meteor/server/methods/requestDataDownload.ts index bedad2e0e316..80769aae6340 100644 --- a/apps/meteor/server/methods/requestDataDownload.ts +++ b/apps/meteor/server/methods/requestDataDownload.ts @@ -3,14 +3,14 @@ import { tmpdir } from 'os'; import path, { join } from 'path'; import type { IExportOperation } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { ExportOperations, UserDataFiles } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { settings } from '../../app/settings/server'; import * as dataExport from '../lib/dataExport'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { requestDataDownload(params: { fullExport?: boolean }): Promise<{ diff --git a/apps/meteor/server/methods/resetAvatar.ts b/apps/meteor/server/methods/resetAvatar.ts index 1ed59482840e..8df7beb72545 100644 --- a/apps/meteor/server/methods/resetAvatar.ts +++ b/apps/meteor/server/methods/resetAvatar.ts @@ -1,7 +1,7 @@ import { api } from '@rocket.chat/core-services'; import type { IUser } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { Meteor } from 'meteor/meteor'; @@ -9,7 +9,7 @@ import { hasPermissionAsync } from '../../app/authorization/server/functions/has import { FileUpload } from '../../app/file-upload/server'; import { settings } from '../../app/settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { resetAvatar(userId: IUser['_id']): void; diff --git a/apps/meteor/server/methods/roomNameExists.ts b/apps/meteor/server/methods/roomNameExists.ts index e99def10215e..f510391ddd8e 100644 --- a/apps/meteor/server/methods/roomNameExists.ts +++ b/apps/meteor/server/methods/roomNameExists.ts @@ -1,11 +1,11 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { methodDeprecationLogger } from '../../app/lib/server/lib/deprecationWarningLogger'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { roomNameExists(roomName: string): boolean; diff --git a/apps/meteor/server/methods/saveUserPreferences.ts b/apps/meteor/server/methods/saveUserPreferences.ts index dbc6bf835640..2cdca3250f50 100644 --- a/apps/meteor/server/methods/saveUserPreferences.ts +++ b/apps/meteor/server/methods/saveUserPreferences.ts @@ -1,6 +1,6 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Users } from '@rocket.chat/models'; import type { FontSize } from '@rocket.chat/rest-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import type { ThemePreference } from '@rocket.chat/ui-theming/src/types/themes'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -47,7 +47,7 @@ type UserPreferences = { mentionsWithSymbol?: boolean; }; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { saveUserPreferences(preferences: Partial): boolean; diff --git a/apps/meteor/server/methods/saveUserProfile.ts b/apps/meteor/server/methods/saveUserProfile.ts index c2ed41adaab9..beb72d9a2f63 100644 --- a/apps/meteor/server/methods/saveUserProfile.ts +++ b/apps/meteor/server/methods/saveUserProfile.ts @@ -1,7 +1,7 @@ import { Apps, AppEvents } from '@rocket.chat/apps'; import type { UserStatus } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Accounts } from 'meteor/accounts-base'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -165,7 +165,7 @@ const saveUserProfileWithTwoFactor = twoFactorRequired(saveUserProfile, { requireSecondFactor: true, }); -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { saveUserProfile( diff --git a/apps/meteor/server/methods/sendConfirmationEmail.ts b/apps/meteor/server/methods/sendConfirmationEmail.ts index 8c7d056532d3..b79d037c252f 100644 --- a/apps/meteor/server/methods/sendConfirmationEmail.ts +++ b/apps/meteor/server/methods/sendConfirmationEmail.ts @@ -1,5 +1,5 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Accounts } from 'meteor/accounts-base'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; diff --git a/apps/meteor/server/methods/sendForgotPasswordEmail.ts b/apps/meteor/server/methods/sendForgotPasswordEmail.ts index b77f6318a324..7b8082812dde 100644 --- a/apps/meteor/server/methods/sendForgotPasswordEmail.ts +++ b/apps/meteor/server/methods/sendForgotPasswordEmail.ts @@ -1,5 +1,5 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Accounts } from 'meteor/accounts-base'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -7,7 +7,7 @@ import { Meteor } from 'meteor/meteor'; import { settings } from '../../app/settings/server'; import { SystemLogger } from '../lib/logger/system'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { sendForgotPasswordEmail(to: string): boolean | undefined; diff --git a/apps/meteor/server/methods/setAvatarFromService.ts b/apps/meteor/server/methods/setAvatarFromService.ts index bec5018f9652..b59100e4a627 100644 --- a/apps/meteor/server/methods/setAvatarFromService.ts +++ b/apps/meteor/server/methods/setAvatarFromService.ts @@ -1,11 +1,11 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Match, check } from 'meteor/check'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { Meteor } from 'meteor/meteor'; import { setAvatarFromServiceWithValidation } from '../../app/lib/server/functions/setUserAvatar'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { setAvatarFromService(dataURI: Buffer | Blob, contentType?: string, service?: string, targetUserId?: string): void; diff --git a/apps/meteor/server/methods/setUserActiveStatus.ts b/apps/meteor/server/methods/setUserActiveStatus.ts index 4a35080543fb..a14616c30c04 100644 --- a/apps/meteor/server/methods/setUserActiveStatus.ts +++ b/apps/meteor/server/methods/setUserActiveStatus.ts @@ -1,11 +1,11 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; import { setUserActiveStatus } from '../../app/lib/server/functions/setUserActiveStatus'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { setUserActiveStatus(userId: string, active: boolean, confirmRelinquish?: boolean): boolean; diff --git a/apps/meteor/server/methods/setUserPassword.ts b/apps/meteor/server/methods/setUserPassword.ts index a395b372c467..e17fa09baf4c 100644 --- a/apps/meteor/server/methods/setUserPassword.ts +++ b/apps/meteor/server/methods/setUserPassword.ts @@ -1,5 +1,5 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Accounts } from 'meteor/accounts-base'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -8,7 +8,7 @@ import type { UpdateResult } from 'mongodb'; import { passwordPolicy } from '../../app/lib/server'; import { compareUserPassword } from '../lib/compareUserPassword'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { setUserPassword(password: string): UpdateResult; diff --git a/apps/meteor/server/methods/toggleFavorite.ts b/apps/meteor/server/methods/toggleFavorite.ts index 14a363a3304a..36555a4566db 100644 --- a/apps/meteor/server/methods/toggleFavorite.ts +++ b/apps/meteor/server/methods/toggleFavorite.ts @@ -1,10 +1,10 @@ import type { IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { toggleFavorite(rid: IRoom['_id'], f?: boolean): Promise; diff --git a/apps/meteor/server/methods/unmuteUserInRoom.ts b/apps/meteor/server/methods/unmuteUserInRoom.ts index 74abdc472e78..ffdb8466de3f 100644 --- a/apps/meteor/server/methods/unmuteUserInRoom.ts +++ b/apps/meteor/server/methods/unmuteUserInRoom.ts @@ -1,7 +1,7 @@ import { Message } from '@rocket.chat/core-services'; import type { IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms, Subscriptions, Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; @@ -12,7 +12,7 @@ import { RoomMemberActions } from '../../definition/IRoomTypeConfig'; import { callbacks } from '../../lib/callbacks'; import { roomCoordinator } from '../lib/rooms/roomCoordinator'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { unmuteUserInRoom(data: { rid: IRoom['_id']; username: string }): boolean; diff --git a/apps/meteor/server/methods/userPresence.ts b/apps/meteor/server/methods/userPresence.ts index aa5aefa297e8..21f3f795155e 100644 --- a/apps/meteor/server/methods/userPresence.ts +++ b/apps/meteor/server/methods/userPresence.ts @@ -1,9 +1,9 @@ import { Presence } from '@rocket.chat/core-services'; import { UserStatus } from '@rocket.chat/core-typings'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'UserPresence:setDefaultStatus'(status: UserStatus): boolean | undefined; diff --git a/apps/meteor/server/methods/userSetUtcOffset.ts b/apps/meteor/server/methods/userSetUtcOffset.ts index d06a8f4b76d3..819b9c1b92f1 100644 --- a/apps/meteor/server/methods/userSetUtcOffset.ts +++ b/apps/meteor/server/methods/userSetUtcOffset.ts @@ -1,10 +1,10 @@ +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Users } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { Meteor } from 'meteor/meteor'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { userSetUtcOffset(utcOffset: number): void; diff --git a/apps/meteor/server/modules/notifications/notifications.module.ts b/apps/meteor/server/modules/notifications/notifications.module.ts index 75a2935d5616..a0394591aadf 100644 --- a/apps/meteor/server/modules/notifications/notifications.module.ts +++ b/apps/meteor/server/modules/notifications/notifications.module.ts @@ -1,7 +1,7 @@ import { Authorization, VideoConf } from '@rocket.chat/core-services'; import type { ISubscription, IOmnichannelRoom, IUser } from '@rocket.chat/core-typings'; +import type { StreamerCallbackArgs, StreamKeys, StreamNames } from '@rocket.chat/ddp-client'; import { Rooms, Subscriptions, Users, Settings } from '@rocket.chat/models'; -import type { StreamerCallbackArgs, StreamKeys, StreamNames } from '@rocket.chat/ui-contexts'; import type { IStreamer, IStreamerConstructor, IPublication } from 'meteor/rocketchat:streamer'; import type { ImporterProgress } from '../../../app/importer/server/classes/ImporterProgress'; @@ -257,7 +257,7 @@ export class NotificationsModule { this.streamRoomUsers.allowRead('none'); this.streamRoomUsers.allowWrite(async function (eventName, ...args: any[]) { - const [roomId, e] = eventName.split('/') as typeof eventName extends `${infer K}/${infer E}` ? [K, E] : never; + const [roomId, e] = eventName.split('/'); if (!this.userId) { const room = await Rooms.findOneById(roomId, { projection: { 't': 1, 'servedBy._id': 1 }, diff --git a/apps/meteor/server/modules/streamer/streamer.module.ts b/apps/meteor/server/modules/streamer/streamer.module.ts index c669c7bc2a00..9fc8065db2e7 100644 --- a/apps/meteor/server/modules/streamer/streamer.module.ts +++ b/apps/meteor/server/modules/streamer/streamer.module.ts @@ -1,5 +1,5 @@ import { MeteorError } from '@rocket.chat/core-services'; -import type { StreamerEvents } from '@rocket.chat/ui-contexts'; +import type { StreamerEvents } from '@rocket.chat/ddp-client'; import { EventEmitter } from 'eventemitter3'; import type { IPublication, Rule, Connection, DDPSubscription, IStreamer, IRules, TransformMessage } from 'meteor/rocketchat:streamer'; diff --git a/apps/meteor/server/publications/messages.ts b/apps/meteor/server/publications/messages.ts index e08aa61a13a3..ebf813a637d0 100644 --- a/apps/meteor/server/publications/messages.ts +++ b/apps/meteor/server/publications/messages.ts @@ -1,13 +1,13 @@ import type { IMessage, IRoom } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Messages } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import type { FindOptions } from 'mongodb'; import { canAccessRoomIdAsync } from '../../app/authorization/server/functions/canAccessRoom'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'messages/get': ( diff --git a/apps/meteor/server/publications/room/index.ts b/apps/meteor/server/publications/room/index.ts index 84841d30ce53..f8ced449f8cb 100644 --- a/apps/meteor/server/publications/room/index.ts +++ b/apps/meteor/server/publications/room/index.ts @@ -1,6 +1,6 @@ import type { IOmnichannelRoom, IRoom, RoomType } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Rooms } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; @@ -13,7 +13,7 @@ import { roomCoordinator } from '../../lib/rooms/roomCoordinator'; type PublicRoomField = keyof typeof roomFields; type PublicRoom = Pick & Pick; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'rooms/get'(updatedAt?: Date): IRoom[] | { update: IRoom[]; remove: IRoom[] }; diff --git a/apps/meteor/server/publications/settings/index.ts b/apps/meteor/server/publications/settings/index.ts index 2cf699c8d82e..17c58a123c37 100644 --- a/apps/meteor/server/publications/settings/index.ts +++ b/apps/meteor/server/publications/settings/index.ts @@ -1,6 +1,6 @@ import type { ISetting, RocketChatRecordDeleted } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Settings } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import type { WithId } from 'mongodb'; @@ -8,7 +8,7 @@ import { getSettingPermissionId } from '../../../app/authorization/lib'; import { hasPermissionAsync, hasAtLeastOnePermissionAsync } from '../../../app/authorization/server/functions/hasPermission'; import { SettingsEvents } from '../../../app/settings/server'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'public-settings/get'( diff --git a/apps/meteor/server/publications/spotlight.ts b/apps/meteor/server/publications/spotlight.ts index a88a0eb74b65..b9275598c4c6 100644 --- a/apps/meteor/server/publications/spotlight.ts +++ b/apps/meteor/server/publications/spotlight.ts @@ -1,10 +1,10 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; import { Meteor } from 'meteor/meteor'; import { Spotlight } from '../lib/spotlight'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { spotlight( diff --git a/apps/meteor/server/publications/subscription/index.ts b/apps/meteor/server/publications/subscription/index.ts index 9bbe1f63afe3..b691b7daf9ee 100644 --- a/apps/meteor/server/publications/subscription/index.ts +++ b/apps/meteor/server/publications/subscription/index.ts @@ -1,11 +1,11 @@ import type { ISubscription } from '@rocket.chat/core-typings'; +import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions } from '@rocket.chat/models'; -import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { subscriptionFields } from '../../../lib/publishFields'; -declare module '@rocket.chat/ui-contexts' { +declare module '@rocket.chat/ddp-client' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'subscriptions/get'(updatedAt?: Date): ISubscription[] | { update: ISubscription[]; remove: { _id: string; _deletedAt: Date }[] }; diff --git a/ee/packages/ddp-client/src/types/methods.ts b/ee/packages/ddp-client/src/types/methods.ts index 711f5dd79343..f8a7052c3266 100644 --- a/ee/packages/ddp-client/src/types/methods.ts +++ b/ee/packages/ddp-client/src/types/methods.ts @@ -11,7 +11,3 @@ export type ServerMethodName = keyof ServerMethods; export type ServerMethodParameters = Parameters; export type ServerMethodReturn = Awaited>; - -export type ServerMethodFunction = ( - ...args: ServerMethodParameters -) => Promise>; diff --git a/packages/livechat/src/providers/ServerProvider.tsx b/packages/livechat/src/providers/ServerProvider.tsx index 79a0b2eb6f8f..203740a62e39 100644 --- a/packages/livechat/src/providers/ServerProvider.tsx +++ b/packages/livechat/src/providers/ServerProvider.tsx @@ -1,15 +1,15 @@ import type { Serialized } from '@rocket.chat/core-typings'; -import { Emitter } from '@rocket.chat/emitter'; -import type { Method, PathFor, OperationParams, OperationResult, UrlParams, PathPattern } from '@rocket.chat/rest-typings'; import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn, StreamerCallbackArgs, - UploadResult, StreamNames, StreamKeys, -} from '@rocket.chat/ui-contexts'; +} from '@rocket.chat/ddp-client'; +import { Emitter } from '@rocket.chat/emitter'; +import type { Method, PathFor, OperationParams, OperationResult, UrlParams, PathPattern } from '@rocket.chat/rest-typings'; +import type { UploadResult } from '@rocket.chat/ui-contexts'; import { ServerContext } from '@rocket.chat/ui-contexts'; import { compile } from 'path-to-regexp'; import { useMemo } from 'preact/hooks'; diff --git a/packages/mock-providers/package.json b/packages/mock-providers/package.json index 9adbce01c624..e5bd5d1a0b0a 100644 --- a/packages/mock-providers/package.json +++ b/packages/mock-providers/package.json @@ -8,6 +8,7 @@ "react-i18next": "~13.2.2" }, "devDependencies": { + "@rocket.chat/ddp-client": "workspace:~", "@rocket.chat/ui-contexts": "workspace:*", "@storybook/react": "~6.5.16", "@tanstack/react-query": "^4.16.1", diff --git a/packages/mock-providers/src/MockedAppRootBuilder.tsx b/packages/mock-providers/src/MockedAppRootBuilder.tsx index 26c6a82c5533..31eb125c0915 100644 --- a/packages/mock-providers/src/MockedAppRootBuilder.tsx +++ b/packages/mock-providers/src/MockedAppRootBuilder.tsx @@ -1,10 +1,8 @@ import { type ISetting, type Serialized, type SettingValue } from '@rocket.chat/core-typings'; +import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn } from '@rocket.chat/ddp-client'; import languages from '@rocket.chat/i18n/dist/languages'; import { type Method, type OperationParams, type OperationResult, type PathPattern, type UrlParams } from '@rocket.chat/rest-typings'; import { - type ServerMethodName, - type ServerMethodParameters, - type ServerMethodReturn, type TranslationKey, AuthorizationContext, ConnectionStatusContext, diff --git a/packages/mock-providers/src/MockedServerContext.tsx b/packages/mock-providers/src/MockedServerContext.tsx index 58b8ac592d27..1f30cd6f1c2f 100644 --- a/packages/mock-providers/src/MockedServerContext.tsx +++ b/packages/mock-providers/src/MockedServerContext.tsx @@ -1,6 +1,6 @@ import type { Serialized } from '@rocket.chat/core-typings'; +import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn } from '@rocket.chat/ddp-client'; import type { Method, OperationParams, OperationResult, PathPattern, UrlParams } from '@rocket.chat/rest-typings'; -import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn } from '@rocket.chat/ui-contexts'; import { ServerContext } from '@rocket.chat/ui-contexts'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import React from 'react'; diff --git a/packages/ui-contexts/src/hooks/useMethod.ts b/packages/ui-contexts/src/hooks/useMethod.ts index 491ed1e02819..a9f1513ed2f3 100644 --- a/packages/ui-contexts/src/hooks/useMethod.ts +++ b/packages/ui-contexts/src/hooks/useMethod.ts @@ -1,8 +1,12 @@ -import type { ServerMethodFunction, ServerMethodParameters, ServerMethods } from '@rocket.chat/ddp-client'; +import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn, ServerMethods } from '@rocket.chat/ddp-client'; import { useCallback, useContext } from 'react'; import { ServerContext } from '../ServerContext'; +type ServerMethodFunction = ( + ...args: ServerMethodParameters +) => Promise>; + /* @deprecated prefer the use of api endpoints (useEndpoint) */ export const useMethod = (methodName: MethodName): ServerMethodFunction => { const { callMethod } = useContext(ServerContext); diff --git a/packages/ui-contexts/src/index.ts b/packages/ui-contexts/src/index.ts index cb3b3e976990..e021eb840aa0 100644 --- a/packages/ui-contexts/src/index.ts +++ b/packages/ui-contexts/src/index.ts @@ -92,8 +92,6 @@ export { useSetOutputMediaDevice } from './hooks/useSetOutputMediaDevice'; export { useSetInputMediaDevice } from './hooks/useSetInputMediaDevice'; export { useAccountsCustomFields } from './hooks/useAccountsCustomFields'; -export { ServerMethods, ServerMethodName, ServerMethodParameters, ServerMethodReturn, ServerMethodFunction } from '@rocket.chat/ddp-client'; -export { StreamerEvents, StreamNames, StreamKeys, StreamerConfigs, StreamerConfig, StreamerCallbackArgs } from '@rocket.chat/ddp-client'; export { UploadResult } from './ServerContext'; export { TranslationKey, TranslationLanguage } from './TranslationContext'; export { Fields } from './UserContext'; diff --git a/yarn.lock b/yarn.lock index 8de2a76ed66c..106dff4d10c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9719,6 +9719,7 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/mock-providers@workspace:packages/mock-providers" dependencies: + "@rocket.chat/ddp-client": "workspace:~" "@rocket.chat/i18n": "workspace:~" "@rocket.chat/ui-contexts": "workspace:*" "@storybook/react": ~6.5.16 From 98bfe201167fadcabb7f951f45191061f45e0933 Mon Sep 17 00:00:00 2001 From: Tasso Date: Tue, 23 Jul 2024 19:00:56 -0300 Subject: [PATCH 3/4] Get rid of bad imports from `@rocket.chat/ui-theming` --- .../sidebar/footer/SidebarFooterDefault.tsx | 2 +- .../sidebarv2/footer/SidebarFooterDefault.tsx | 2 +- .../hooks/useAcessibilityPreferencesValues.ts | 2 +- .../root/MainLayout/MainLayoutStyleTags.tsx | 2 +- .../server/methods/saveUserPreferences.ts | 2 +- .../src/hooks/useCreateStyleContainer.ts | 20 ------------------- .../src/hooks/useLayoutVariables.ts | 7 ------- .../src/hooks/useSetLayoutSetting.ts | 5 ----- .../ui-theming/src/hooks/useThemeMode.ts | 2 +- ee/packages/ui-theming/src/index.ts | 1 + packages/core-typings/src/index.ts | 1 + .../core-typings/src}/themes.ts | 0 .../v1/users/UsersSetPreferenceParamsPOST.ts | 2 +- 13 files changed, 9 insertions(+), 39 deletions(-) delete mode 100644 ee/packages/ui-theming/src/hooks/useCreateStyleContainer.ts delete mode 100644 ee/packages/ui-theming/src/hooks/useLayoutVariables.ts delete mode 100644 ee/packages/ui-theming/src/hooks/useSetLayoutSetting.ts create mode 100644 ee/packages/ui-theming/src/index.ts rename {ee/packages/ui-theming/src/types => packages/core-typings/src}/themes.ts (100%) diff --git a/apps/meteor/client/sidebar/footer/SidebarFooterDefault.tsx b/apps/meteor/client/sidebar/footer/SidebarFooterDefault.tsx index fbf987fa78af..3d1c17dcebbe 100644 --- a/apps/meteor/client/sidebar/footer/SidebarFooterDefault.tsx +++ b/apps/meteor/client/sidebar/footer/SidebarFooterDefault.tsx @@ -1,7 +1,7 @@ import { css } from '@rocket.chat/css-in-js'; import { Box, SidebarDivider, Palette, SidebarFooter as Footer } from '@rocket.chat/fuselage'; import { useSetting } from '@rocket.chat/ui-contexts'; -import { useThemeMode } from '@rocket.chat/ui-theming/src/hooks/useThemeMode'; +import { useThemeMode } from '@rocket.chat/ui-theming'; import type { ReactElement } from 'react'; import React from 'react'; diff --git a/apps/meteor/client/sidebarv2/footer/SidebarFooterDefault.tsx b/apps/meteor/client/sidebarv2/footer/SidebarFooterDefault.tsx index fbf987fa78af..3d1c17dcebbe 100644 --- a/apps/meteor/client/sidebarv2/footer/SidebarFooterDefault.tsx +++ b/apps/meteor/client/sidebarv2/footer/SidebarFooterDefault.tsx @@ -1,7 +1,7 @@ import { css } from '@rocket.chat/css-in-js'; import { Box, SidebarDivider, Palette, SidebarFooter as Footer } from '@rocket.chat/fuselage'; import { useSetting } from '@rocket.chat/ui-contexts'; -import { useThemeMode } from '@rocket.chat/ui-theming/src/hooks/useThemeMode'; +import { useThemeMode } from '@rocket.chat/ui-theming'; import type { ReactElement } from 'react'; import React from 'react'; diff --git a/apps/meteor/client/views/account/accessibility/hooks/useAcessibilityPreferencesValues.ts b/apps/meteor/client/views/account/accessibility/hooks/useAcessibilityPreferencesValues.ts index 339cdcff7dd9..9620e4286eb5 100644 --- a/apps/meteor/client/views/account/accessibility/hooks/useAcessibilityPreferencesValues.ts +++ b/apps/meteor/client/views/account/accessibility/hooks/useAcessibilityPreferencesValues.ts @@ -1,6 +1,6 @@ +import type { ThemePreference } from '@rocket.chat/core-typings'; import type { FontSize } from '@rocket.chat/rest-typings'; import { useUserPreference } from '@rocket.chat/ui-contexts'; -import type { ThemePreference } from '@rocket.chat/ui-theming/src/types/themes'; export type AccessibilityPreferencesData = { themeAppearence?: ThemePreference; diff --git a/apps/meteor/client/views/root/MainLayout/MainLayoutStyleTags.tsx b/apps/meteor/client/views/root/MainLayout/MainLayoutStyleTags.tsx index 662ee415fa26..c46111c5bcc4 100644 --- a/apps/meteor/client/views/root/MainLayout/MainLayoutStyleTags.tsx +++ b/apps/meteor/client/views/root/MainLayout/MainLayoutStyleTags.tsx @@ -1,5 +1,5 @@ import { PaletteStyleTag } from '@rocket.chat/fuselage'; -import { useThemeMode } from '@rocket.chat/ui-theming/src/hooks/useThemeMode'; +import { useThemeMode } from '@rocket.chat/ui-theming'; import React from 'react'; import { codeBlock } from '../lib/codeBlockStyles'; diff --git a/apps/meteor/server/methods/saveUserPreferences.ts b/apps/meteor/server/methods/saveUserPreferences.ts index 2cdca3250f50..f19e653f7ccc 100644 --- a/apps/meteor/server/methods/saveUserPreferences.ts +++ b/apps/meteor/server/methods/saveUserPreferences.ts @@ -1,7 +1,7 @@ +import type { ThemePreference } from '@rocket.chat/core-typings'; import type { ServerMethods } from '@rocket.chat/ddp-client'; import { Subscriptions, Users } from '@rocket.chat/models'; import type { FontSize } from '@rocket.chat/rest-typings'; -import type { ThemePreference } from '@rocket.chat/ui-theming/src/types/themes'; import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; diff --git a/ee/packages/ui-theming/src/hooks/useCreateStyleContainer.ts b/ee/packages/ui-theming/src/hooks/useCreateStyleContainer.ts deleted file mode 100644 index aaa37df66ae6..000000000000 --- a/ee/packages/ui-theming/src/hooks/useCreateStyleContainer.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { useMemo } from 'react'; - -export const useCreateStyleContainer = (id: string) => { - return useMemo(() => { - const refElement = document.getElementById('rcx-styles') || document.head.lastChild; - - const el = document.getElementById(id); - - if (el) { - return el; - } - - const styleElement = document.createElement('style'); - styleElement.setAttribute('id', id); - - document.head.insertBefore(styleElement, refElement); - document.head.appendChild(document.createElement('style')); - return styleElement; - }, [id]); -}; diff --git a/ee/packages/ui-theming/src/hooks/useLayoutVariables.ts b/ee/packages/ui-theming/src/hooks/useLayoutVariables.ts deleted file mode 100644 index e0d8310c41e0..000000000000 --- a/ee/packages/ui-theming/src/hooks/useLayoutVariables.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { useSetting } from '@rocket.chat/ui-contexts'; - -export const useLayoutPalette = () => { - const setting = String(useSetting('Layout_Fuselage_Palette') || '{}'); - - return JSON.parse(setting); -}; diff --git a/ee/packages/ui-theming/src/hooks/useSetLayoutSetting.ts b/ee/packages/ui-theming/src/hooks/useSetLayoutSetting.ts deleted file mode 100644 index 1810273bbfe7..000000000000 --- a/ee/packages/ui-theming/src/hooks/useSetLayoutSetting.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { useEndpoint } from '@rocket.chat/ui-contexts'; - -export const useSetLayoutSetting = (): (({ value }: { value: string }) => void) => { - return useEndpoint('POST', '/v1/settings/:_id', { _id: 'Layout_Fuselage_Palette' }); -}; diff --git a/ee/packages/ui-theming/src/hooks/useThemeMode.ts b/ee/packages/ui-theming/src/hooks/useThemeMode.ts index 63cf01bf6eb2..ca60d7845d4a 100644 --- a/ee/packages/ui-theming/src/hooks/useThemeMode.ts +++ b/ee/packages/ui-theming/src/hooks/useThemeMode.ts @@ -1,6 +1,6 @@ +import type { ThemePreference as ThemeMode, Themes } from '@rocket.chat/core-typings'; import { useDarkMode } from '@rocket.chat/fuselage-hooks'; import { useEndpoint, useUserPreference } from '@rocket.chat/ui-contexts'; -import type { ThemePreference as ThemeMode, Themes } from '@rocket.chat/ui-theming/src/types/themes'; import { useCallback, useState } from 'react'; /** diff --git a/ee/packages/ui-theming/src/index.ts b/ee/packages/ui-theming/src/index.ts new file mode 100644 index 000000000000..a3c440cc2e49 --- /dev/null +++ b/ee/packages/ui-theming/src/index.ts @@ -0,0 +1 @@ +export * from './hooks/useThemeMode'; diff --git a/packages/core-typings/src/index.ts b/packages/core-typings/src/index.ts index 01bc90d2a6bc..c04ffa998d77 100644 --- a/packages/core-typings/src/index.ts +++ b/packages/core-typings/src/index.ts @@ -140,3 +140,4 @@ export * from './CustomFieldMetadata'; export * from './RoomRouteData'; export * as Cloud from './cloud'; +export * from './themes'; diff --git a/ee/packages/ui-theming/src/types/themes.ts b/packages/core-typings/src/themes.ts similarity index 100% rename from ee/packages/ui-theming/src/types/themes.ts rename to packages/core-typings/src/themes.ts diff --git a/packages/rest-typings/src/v1/users/UsersSetPreferenceParamsPOST.ts b/packages/rest-typings/src/v1/users/UsersSetPreferenceParamsPOST.ts index 1c89fdc04d5d..7ef41d363dea 100644 --- a/packages/rest-typings/src/v1/users/UsersSetPreferenceParamsPOST.ts +++ b/packages/rest-typings/src/v1/users/UsersSetPreferenceParamsPOST.ts @@ -1,4 +1,4 @@ -import type { ThemePreference } from '@rocket.chat/ui-theming/src/types/themes'; +import type { ThemePreference } from '@rocket.chat/core-typings'; import Ajv from 'ajv'; const ajv = new Ajv({ From 26ce896764b0c71a0dc3effb20356c1a55f40ff3 Mon Sep 17 00:00:00 2001 From: Tasso Date: Tue, 23 Jul 2024 20:23:47 -0300 Subject: [PATCH 4/4] FIx another batch of invalid imports --- apps/meteor/client/providers/RouterProvider.tsx | 4 ++-- packages/ui-contexts/src/hooks/useUserSubscriptions.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/meteor/client/providers/RouterProvider.tsx b/apps/meteor/client/providers/RouterProvider.tsx index d7fb25a1ed31..590c5f20da57 100644 --- a/apps/meteor/client/providers/RouterProvider.tsx +++ b/apps/meteor/client/providers/RouterProvider.tsx @@ -1,4 +1,5 @@ import type { RoomType, RoomRouteData } from '@rocket.chat/core-typings'; +import { RouterContext } from '@rocket.chat/ui-contexts'; import type { RouterContextValue, RouteName, @@ -7,9 +8,8 @@ import type { SearchParameters, To, RouteObject, + LocationSearch, } from '@rocket.chat/ui-contexts'; -import { RouterContext } from '@rocket.chat/ui-contexts'; -import type { LocationSearch } from '@rocket.chat/ui-contexts/src/RouterContext'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Tracker } from 'meteor/tracker'; import type { ReactNode } from 'react'; diff --git a/packages/ui-contexts/src/hooks/useUserSubscriptions.ts b/packages/ui-contexts/src/hooks/useUserSubscriptions.ts index e59a1e733a2f..ab5cdb9baacd 100644 --- a/packages/ui-contexts/src/hooks/useUserSubscriptions.ts +++ b/packages/ui-contexts/src/hooks/useUserSubscriptions.ts @@ -1,9 +1,9 @@ -import type { SubscriptionWithRoom } from '@rocket.chat/ui-contexts/src/types/SubscriptionWithRoom'; import { useContext, useMemo } from 'react'; import { useSyncExternalStore } from 'use-sync-external-store/shim'; import type { FindOptions, SubscriptionQuery } from '../UserContext'; import { UserContext } from '../UserContext'; +import type { SubscriptionWithRoom } from '../types/SubscriptionWithRoom'; export const useUserSubscriptions = (query: SubscriptionQuery, options?: FindOptions): SubscriptionWithRoom[] => { const { querySubscriptions } = useContext(UserContext);