From 4f3b1c9322a9ca87198762b805cff7fc6e3af3db Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Sat, 5 Oct 2024 00:13:55 +0530 Subject: [PATCH 1/2] chore:! remove deprecated addOAuthApp method Signed-off-by: Abhinav Kumar --- .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 000000000000..fe62c337110f --- /dev/null +++ b/.changeset/hungry-icons-try.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': major +--- + +Removed 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 3f41b1b01bea..000000000000 --- 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 2dd48fe73a2c..be26bdb2facb 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'; From 53d90bc726a48a5dd4ec41345305089ef5392125 Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Tue, 8 Oct 2024 01:21:28 -0300 Subject: [PATCH 2/2] Update hungry-icons-try.md --- .changeset/hungry-icons-try.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/hungry-icons-try.md b/.changeset/hungry-icons-try.md index fe62c337110f..971873093a55 100644 --- a/.changeset/hungry-icons-try.md +++ b/.changeset/hungry-icons-try.md @@ -2,4 +2,4 @@ '@rocket.chat/meteor': major --- -Removed deprecated method `addOAuthApp`. Moving forward, use the endpoint `oauth-apps.create` instead. +Removes deprecated method `addOAuthApp`. Moving forward, use the endpoint `oauth-apps.create` instead.