From f27d384c4d7e9bd043199d8590822c932395d5eb Mon Sep 17 00:00:00 2001 From: dougfabris Date: Fri, 26 Jul 2024 18:45:58 -0300 Subject: [PATCH] chore: remove unused method and setting --- .../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 eb0742813c1ff..0000000000000 --- a/apps/meteor/app/livechat/client/externalFrame/generateNewKey.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; -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 5f05d53f1ccce..0000000000000 --- 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 bc00a95bcdcdb..c6884923db308 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 11463bcf00d48..0000000000000 --- a/apps/meteor/app/livechat/server/externalFrame/generateNewKey.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { ServerMethods } from '@rocket.chat/ui-contexts'; -import { Meteor } from 'meteor/meteor'; - -declare module '@rocket.chat/ui-contexts' { - // 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 5f05d53f1ccce..0000000000000 --- 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 fc96f2a921a96..465d94efce0ad 100644 --- a/apps/meteor/app/livechat/server/index.ts +++ b/apps/meteor/app/livechat/server/index.ts @@ -73,5 +73,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 ed1daa8ce2289..dd78831a5960d 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, - }, - }); }); });