From b4bc19e9c8c547624333b421b62bf33c6fb045d2 Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Thu, 15 Aug 2024 16:51:25 -0300 Subject: [PATCH] chore!: Remove unused `omnichannelExternalFrameGenerateKey` (#32921) --- .../client/externalFrame/generateNewKey.ts | 12 ------------ .../app/livechat/client/externalFrame/index.ts | 1 - apps/meteor/app/livechat/client/index.ts | 1 - .../server/externalFrame/generateNewKey.ts | 18 ------------------ .../app/livechat/server/externalFrame/index.ts | 1 - apps/meteor/app/livechat/server/index.ts | 1 - apps/meteor/server/settings/omnichannel.ts | 9 --------- 7 files changed, 43 deletions(-) delete mode 100644 apps/meteor/app/livechat/client/externalFrame/generateNewKey.ts delete mode 100644 apps/meteor/app/livechat/client/externalFrame/index.ts delete mode 100644 apps/meteor/app/livechat/server/externalFrame/generateNewKey.ts delete mode 100644 apps/meteor/app/livechat/server/externalFrame/index.ts diff --git a/apps/meteor/app/livechat/client/externalFrame/generateNewKey.ts b/apps/meteor/app/livechat/client/externalFrame/generateNewKey.ts deleted file mode 100644 index 54c6ba4d75f1..000000000000 --- a/apps/meteor/app/livechat/client/externalFrame/generateNewKey.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { ServerMethods } from '@rocket.chat/ddp-client'; -import { Meteor } from 'meteor/meteor'; - -import { sdk } from '../../../utils/client/lib/SDKClient'; -import { generateKey } from './crypto'; - -Meteor.methods({ - async omnichannelExternalFrameGenerateKey() { - const key = await generateKey(); - await sdk.call('saveSetting', 'Omnichannel_External_Frame_Encryption_JWK', key); - }, -}); diff --git a/apps/meteor/app/livechat/client/externalFrame/index.ts b/apps/meteor/app/livechat/client/externalFrame/index.ts deleted file mode 100644 index 5f05d53f1ccc..000000000000 --- a/apps/meteor/app/livechat/client/externalFrame/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './generateNewKey'; diff --git a/apps/meteor/app/livechat/client/index.ts b/apps/meteor/app/livechat/client/index.ts index bc00a95bcdcd..c6884923db30 100644 --- a/apps/meteor/app/livechat/client/index.ts +++ b/apps/meteor/app/livechat/client/index.ts @@ -2,4 +2,3 @@ import '../lib/messageTypes'; import './voip'; import './ui'; import './stylesheets/livechat.css'; -import './externalFrame'; diff --git a/apps/meteor/app/livechat/server/externalFrame/generateNewKey.ts b/apps/meteor/app/livechat/server/externalFrame/generateNewKey.ts deleted file mode 100644 index a8f145f47d39..000000000000 --- a/apps/meteor/app/livechat/server/externalFrame/generateNewKey.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { ServerMethods } from '@rocket.chat/ddp-client'; -import { Meteor } from 'meteor/meteor'; - -declare module '@rocket.chat/ddp-client' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface ServerMethods { - omnichannelExternalFrameGenerateKey(): unknown; - } -} - -Meteor.methods({ - // eslint-disable-next-line @typescript-eslint/no-empty-function - omnichannelExternalFrameGenerateKey() { - return { - message: 'Generating_key', - }; - }, // only to prevent error when calling the client method -}); diff --git a/apps/meteor/app/livechat/server/externalFrame/index.ts b/apps/meteor/app/livechat/server/externalFrame/index.ts deleted file mode 100644 index 5f05d53f1ccc..000000000000 --- a/apps/meteor/app/livechat/server/externalFrame/index.ts +++ /dev/null @@ -1 +0,0 @@ -import './generateNewKey'; diff --git a/apps/meteor/app/livechat/server/index.ts b/apps/meteor/app/livechat/server/index.ts index 9a1f40238df5..357d444ac474 100644 --- a/apps/meteor/app/livechat/server/index.ts +++ b/apps/meteor/app/livechat/server/index.ts @@ -74,5 +74,4 @@ import './lib/stream/agentStatus'; import './sendMessageBySMS'; import './api'; import './api/rest'; -import './externalFrame'; import './methods/saveBusinessHour'; diff --git a/apps/meteor/server/settings/omnichannel.ts b/apps/meteor/server/settings/omnichannel.ts index ed1daa8ce228..dd78831a5960 100644 --- a/apps/meteor/server/settings/omnichannel.ts +++ b/apps/meteor/server/settings/omnichannel.ts @@ -845,14 +845,5 @@ await settingsRegistry.addGroup('SMS', async function () { value: true, }, }); - - await this.add('Omnichannel_External_Frame_GenerateKey', 'omnichannelExternalFrameGenerateKey', { - type: 'action', - actionText: 'Generate_new_key', - enableQuery: { - _id: 'Omnichannel_External_Frame_Enabled', - value: true, - }, - }); }); });