From 92139cd93c987beb21097188e7cb068d8cfde78b Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Thu, 10 Oct 2024 01:25:15 +0530 Subject: [PATCH] chore!: remove deprecated addOAuthApp method (#33465) --- .changeset/hungry-icons-try.md | 5 ++++ .../server/admin/methods/addOAuthApp.ts | 24 ------------------- .../app/oauth2-server-config/server/index.ts | 1 - 3 files changed, 5 insertions(+), 25 deletions(-) create mode 100644 .changeset/hungry-icons-try.md delete mode 100644 apps/meteor/app/oauth2-server-config/server/admin/methods/addOAuthApp.ts diff --git a/.changeset/hungry-icons-try.md b/.changeset/hungry-icons-try.md new file mode 100644 index 0000000000000..971873093a552 --- /dev/null +++ b/.changeset/hungry-icons-try.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': major +--- + +Removes deprecated method `addOAuthApp`. Moving forward, use the endpoint `oauth-apps.create` instead. 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 deleted file mode 100644 index 3f41b1b01bea4..0000000000000 --- a/apps/meteor/app/oauth2-server-config/server/admin/methods/addOAuthApp.ts +++ /dev/null @@ -1,24 +0,0 @@ -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 { Meteor } from 'meteor/meteor'; - -import { methodDeprecationLogger } from '../../../../lib/server/lib/deprecationWarningLogger'; -import { addOAuthApp } from '../functions/addOAuthApp'; - -declare module '@rocket.chat/ddp-client' { - // eslint-disable-next-line @typescript-eslint/naming-convention - interface ServerMethods { - addOAuthApp(application: OauthAppsAddParams): IOAuthApps; - } -} - -Meteor.methods({ - async addOAuthApp(application) { - methodDeprecationLogger.warn( - 'addOAuthApp is deprecated and will be removed in future versions of Rocket.Chat. Use the REST endpoint /v1/oauth-apps.create instead.', - ); - - return addOAuthApp(application, this.userId ?? undefined); - }, -}); diff --git a/apps/meteor/app/oauth2-server-config/server/index.ts b/apps/meteor/app/oauth2-server-config/server/index.ts index 2dd48fe73a2c1..be26bdb2facb1 100644 --- a/apps/meteor/app/oauth2-server-config/server/index.ts +++ b/apps/meteor/app/oauth2-server-config/server/index.ts @@ -1,6 +1,5 @@ import './oauth/oauth2-server'; import './oauth/default-services'; import './admin/functions/addOAuthApp'; -import './admin/methods/addOAuthApp'; import './admin/methods/updateOAuthApp'; import './admin/methods/deleteOAuthApp';