diff --git a/.changeset/nervous-melons-cough.md b/.changeset/nervous-melons-cough.md new file mode 100644 index 0000000000000..870cdfacdff37 --- /dev/null +++ b/.changeset/nervous-melons-cough.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Removes the deprecated meteor method: `livechat:addMonitor` diff --git a/apps/meteor/ee/app/livechat-enterprise/server/index.ts b/apps/meteor/ee/app/livechat-enterprise/server/index.ts index 477279dc1da9a..1324ed7009ec1 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/index.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/index.ts @@ -2,7 +2,6 @@ import { License } from '@rocket.chat/license'; import { patchOmniCore } from '@rocket.chat/omni-core-ee'; import { Meteor } from 'meteor/meteor'; -import './methods/addMonitor'; import './methods/removeBusinessHour'; import './hooks/afterTakeInquiry'; import './hooks/beforeNewInquiry'; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/methods/addMonitor.ts b/apps/meteor/ee/app/livechat-enterprise/server/methods/addMonitor.ts deleted file mode 100644 index 1cdd298a205d0..0000000000000 --- a/apps/meteor/ee/app/livechat-enterprise/server/methods/addMonitor.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type { IUser } from '@rocket.chat/core-typings'; -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 { methodDeprecationLogger } from '../../../../../app/lib/server/lib/deprecationWarningLogger'; -import { LivechatEnterprise } from '../lib/LivechatEnterprise'; - -declare module '@rocket.chat/ddp-client' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface ServerMethods { - 'livechat:addMonitor'(username: string): boolean | Pick; - } -} - -Meteor.methods({ - async 'livechat:addMonitor'(username) { - methodDeprecationLogger.method('livechat:addMonitor', '8.0.0', '/v1/livechat/monitors'); - const uid = Meteor.userId(); - if (!uid || !(await hasPermissionAsync(uid, 'manage-livechat-monitors'))) { - throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'livechat:addMonitor' }); - } - - check(username, String); - return LivechatEnterprise.addMonitor(username); - }, -});