Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/meteor/app/bot-helpers/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { removeUserFromRoomMethod } from '../../../server/methods/removeUserFrom
import { hasRoleAsync } from '../../authorization/server/functions/hasRole';
import { addUserToRole } from '../../authorization/server/methods/addUserToRole';
import { removeUserFromRole } from '../../authorization/server/methods/removeUserFromRole';
import { methodDeprecationLogger } from '../../lib/server/lib/deprecationWarningLogger';
import { addUsersToRoomMethod } from '../../lib/server/methods/addUsersToRoom';
import { settings } from '../../settings/server';

Expand Down Expand Up @@ -204,7 +205,11 @@ declare module '@rocket.chat/ddp-client' {
}

Meteor.methods<ServerMethods>({
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async botRequest(...args) {
methodDeprecationLogger.method('botRequest', '9.0.0', []);
const userID = Meteor.userId();
if (userID && (await hasRoleAsync(userID, 'bot'))) {
return botHelpers.request(...args, userID);
Expand Down
21 changes: 20 additions & 1 deletion apps/meteor/app/cloud/server/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Meteor.methods<ServerMethods>({
* Prefer using cloud.registrationStatus rest api.
*/
async 'cloud:checkRegisterStatus'() {
methodDeprecationLogger.method('cloud:checkRegisterStatus', '9.0.0', '/v1/cloud.registrationStatus');
const uid = Meteor.userId();

if (!uid) {
Expand Down Expand Up @@ -75,7 +74,11 @@ Meteor.methods<ServerMethods>({

return Buffer.from(JSON.stringify(await buildWorkspaceRegistrationData(undefined))).toString('base64');
},
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async 'cloud:registerWorkspace'() {
methodDeprecationLogger.method('cloud:registerWorkspace', '9.0.0', []);
const uid = Meteor.userId();

if (!uid) {
Expand Down Expand Up @@ -137,7 +140,11 @@ Meteor.methods<ServerMethods>({
return connectWorkspace(token);
},
// Currently unused but will link local account to Rocket.Chat Cloud account.
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async 'cloud:getOAuthAuthorizationUrl'() {
methodDeprecationLogger.method('cloud:getOAuthAuthorizationUrl', '9.0.0', []);
const uid = Meteor.userId();
if (!uid) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', {
Expand All @@ -153,7 +160,11 @@ Meteor.methods<ServerMethods>({

return getOAuthAuthorizationUrl();
},
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async 'cloud:finishOAuthAuthorization'(code, state) {
methodDeprecationLogger.method('cloud:finishOAuthAuthorization', '9.0.0', []);
check(code, String);
check(state, String);

Expand All @@ -173,7 +184,11 @@ Meteor.methods<ServerMethods>({

return finishOAuthAuthorization(code, state);
},
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async 'cloud:checkUserLoggedIn'() {
methodDeprecationLogger.method('cloud:checkUserLoggedIn', '9.0.0', []);
const uid = Meteor.userId();
if (!uid) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', {
Expand All @@ -189,7 +204,11 @@ Meteor.methods<ServerMethods>({

return checkUserHasCloudLogin(uid);
},
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async 'cloud:logout'() {
methodDeprecationLogger.method('cloud:logout', '9.0.0', []);
const uid = Meteor.userId();
if (!uid) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', {
Expand Down
9 changes: 9 additions & 0 deletions apps/meteor/app/crowd/server/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Meteor } from 'meteor/meteor';
import { CROWD } from './crowd';
import { logger } from './logger';
import { hasPermissionAsync } from '../../authorization/server/functions/hasPermission';
import { methodDeprecationLogger } from '../../lib/server/lib/deprecationWarningLogger';
import { settings } from '../../settings/server';

declare module '@rocket.chat/ddp-client' {
Expand All @@ -16,7 +17,11 @@ declare module '@rocket.chat/ddp-client' {
}

Meteor.methods<ServerMethods>({
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async crowd_test_connection() {
methodDeprecationLogger.method('crowd_test_connection', '9.0.0', []);
const user = await Meteor.userAsync();
if (!user) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', {
Expand Down Expand Up @@ -50,7 +55,11 @@ Meteor.methods<ServerMethods>({
throw new Meteor.Error('Invalid connection details', '', { method: 'crowd_test_connection' });
}
},
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async crowd_sync_users() {
methodDeprecationLogger.method('crowd_sync_users', '9.0.0', []);
const user = await Meteor.userAsync();
if (settings.get('CROWD_Enable') !== true) {
throw new Meteor.Error('crowd_disabled');
Expand Down
5 changes: 5 additions & 0 deletions apps/meteor/app/file-upload/server/methods/getS3FileUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Meteor } from 'meteor/meteor';

import { UploadFS } from '../../../../server/ufs';
import { canAccessRoomAsync } from '../../../authorization/server';
import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
import { settings } from '../../../settings/server';

declare module '@rocket.chat/ddp-client' {
Expand All @@ -15,7 +16,11 @@ declare module '@rocket.chat/ddp-client' {
}

Meteor.methods<ServerMethods>({
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async getS3FileUrl(fileId) {
methodDeprecationLogger.method('getS3FileUrl', '9.0.0', []);
check(fileId, String);
const uid = Meteor.userId();
if (settings.get<boolean>('FileUpload_ProtectFiles') && !uid) {
Expand Down
6 changes: 6 additions & 0 deletions apps/meteor/app/iframe-login/server/iframe_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { check } from 'meteor/check';
import { Meteor } from 'meteor/meteor';
import { OAuth } from 'meteor/oauth';

import { methodDeprecationLogger } from '../../lib/server/lib/deprecationWarningLogger';

Accounts.registerLoginHandler('iframe', async (result) => {
if (!result.iframe) {
return;
Expand All @@ -31,7 +33,11 @@ declare module '@rocket.chat/ddp-client' {
}

Meteor.methods<ServerMethods>({
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
'OAuth.retrieveCredential'(credentialToken, credentialSecret) {
methodDeprecationLogger.method('OAuth.retrieveCredential', '9.0.0', []);
return OAuth.retrieveCredential(credentialToken, credentialSecret);
},
});
5 changes: 5 additions & 0 deletions apps/meteor/app/irc/server/methods/resetIrcConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Meteor } from 'meteor/meteor';

import { updateAuditedByUser } from '../../../../server/settings/lib/auditedSettingUpdates';
import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission';
import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
import { notifyOnSettingChangedById } from '../../../lib/server/lib/notifyListener';
import { settings } from '../../../settings/server';
import Bridge from '../irc-bridge';
Expand All @@ -16,7 +17,11 @@ declare module '@rocket.chat/ddp-client' {
}

Meteor.methods<ServerMethods>({
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async resetIrcConnection() {
methodDeprecationLogger.method('resetIrcConnection', '9.0.0', []);
const ircEnabled = Boolean(settings.get('IRC_Enabled'));
const uid = Meteor.userId();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import type { ServerMethods } from '@rocket.chat/ddp-client';
import { License } from '@rocket.chat/license';
import { Meteor } from 'meteor/meteor';

import { methodDeprecationLogger } from '../lib/deprecationWarningLogger';

declare module '@rocket.chat/ddp-client' {
// eslint-disable-next-line @typescript-eslint/naming-convention
interface ServerMethods {
Expand All @@ -11,7 +13,11 @@ declare module '@rocket.chat/ddp-client' {
}

Meteor.methods<ServerMethods>({
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async checkFederationConfiguration() {
methodDeprecationLogger.method('checkFederationConfiguration', '9.0.0', []);
const uid = Meteor.userId();

if (!uid) {
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/app/lib/server/methods/getRoomJoinCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { check } from 'meteor/check';
import { Meteor } from 'meteor/meteor';

import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission';
import { methodDeprecationLogger } from '../lib/deprecationWarningLogger';

declare module '@rocket.chat/ddp-client' {
// eslint-disable-next-line @typescript-eslint/naming-convention
Expand All @@ -15,6 +16,7 @@ declare module '@rocket.chat/ddp-client' {
/* @deprecated */
Meteor.methods<ServerMethods>({
async getRoomJoinCode(rid) {
methodDeprecationLogger.method('getRoomJoinCode', '9.0.0', []);
check(rid, String);

const userId = Meteor.userId();
Expand Down
5 changes: 5 additions & 0 deletions apps/meteor/app/lib/server/methods/joinDefaultChannels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Match, check } from 'meteor/check';
import { Meteor } from 'meteor/meteor';

import { addUserToDefaultChannels } from '../functions/addUserToDefaultChannels';
import { methodDeprecationLogger } from '../lib/deprecationWarningLogger';

declare module '@rocket.chat/ddp-client' {
// eslint-disable-next-line @typescript-eslint/naming-convention
Expand All @@ -13,7 +14,11 @@ declare module '@rocket.chat/ddp-client' {
}

Meteor.methods<ServerMethods>({
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async joinDefaultChannels(silenced) {
methodDeprecationLogger.method('joinDefaultChannels', '9.0.0', []);
check(silenced, Match.Optional(Boolean));
const user = await Meteor.userAsync();

Expand Down
5 changes: 5 additions & 0 deletions apps/meteor/app/lib/server/methods/restartServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { ServerMethods } from '@rocket.chat/ddp-client';
import { Meteor } from 'meteor/meteor';

import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission';
import { methodDeprecationLogger } from '../lib/deprecationWarningLogger';

declare module '@rocket.chat/ddp-client' {
// eslint-disable-next-line @typescript-eslint/naming-convention
Expand All @@ -14,7 +15,11 @@ declare module '@rocket.chat/ddp-client' {
}

Meteor.methods<ServerMethods>({
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async restart_server() {
methodDeprecationLogger.method('restart_server', '9.0.0', []);
const uid = Meteor.userId();

if (!uid) {
Expand Down
5 changes: 5 additions & 0 deletions apps/meteor/app/lib/server/methods/sendSMTPTestEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Meteor } from 'meteor/meteor';

import * as Mailer from '../../../mailer/server/api';
import { settings } from '../../../settings/server';
import { methodDeprecationLogger } from '../lib/deprecationWarningLogger';

declare module '@rocket.chat/ddp-client' {
// eslint-disable-next-line @typescript-eslint/naming-convention
Expand All @@ -16,7 +17,11 @@ declare module '@rocket.chat/ddp-client' {
}

Meteor.methods<ServerMethods>({
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async sendSMTPTestEmail() {
methodDeprecationLogger.method('sendSMTPTestEmail', '9.0.0', []);
if (!Meteor.userId()) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', {
method: 'sendSMTPTestEmail',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ServerMethods } from '@rocket.chat/ddp-client';
import { Meteor } from 'meteor/meteor';

import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
import { addSamlService } from '../lib/settings';

declare module '@rocket.chat/ddp-client' {
Expand All @@ -11,7 +12,11 @@ declare module '@rocket.chat/ddp-client' {
}

Meteor.methods<ServerMethods>({
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
addSamlService(name) {
methodDeprecationLogger.method('addSamlService', '9.0.0', []);
addSamlService(name);
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ export const saveNotificationSettingsMethod = async (
};

Meteor.methods<ServerMethods>({
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async saveNotificationSettings(roomId, field, value) {
methodDeprecationLogger.method('saveNotificationSettings', '9.0.0', '/v1/rooms.saveNotification');
const userId = Meteor.userId();
if (!userId) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', {
Expand All @@ -147,7 +149,11 @@ Meteor.methods<ServerMethods>({
return saveNotificationSettingsMethod(userId, roomId, field, value);
},

/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async saveAudioNotificationValue(rid, value) {
methodDeprecationLogger.method('saveAudioNotificationValue', '9.0.0', []);
const userId = Meteor.userId();
if (!userId) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', {
Expand Down
5 changes: 5 additions & 0 deletions apps/meteor/app/search/server/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Meteor } from 'meteor/meteor';
import { SearchLogger } from './logger/logger';
import type { IRawSearchResult, ISearchResult } from './model/ISearchResult';
import { searchProviderService, validationService } from './service';
import { methodDeprecationLogger } from '../../lib/server/lib/deprecationWarningLogger';

declare module '@rocket.chat/ddp-client' {
// eslint-disable-next-line @typescript-eslint/naming-convention
Expand Down Expand Up @@ -71,7 +72,11 @@ Meteor.methods<ServerMethods>({
}).then((result) => validationService.validateSearchResult(result));
},

/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async 'rocketchatSearch.suggest'(text, context, payload) {
methodDeprecationLogger.method('rocketchatSearch.suggest', '9.0.0', []);
payload ??= undefined; // TODO is this cleanup necessary?

if (!searchProviderService.activeProvider) {
Expand Down
5 changes: 5 additions & 0 deletions apps/meteor/app/slackbridge/server/removeChannelLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Rooms } from '@rocket.chat/models';
import { Meteor } from 'meteor/meteor';

import { hasPermissionAsync } from '../../authorization/server/functions/hasPermission';
import { methodDeprecationLogger } from '../../lib/server/lib/deprecationWarningLogger';
import { settings } from '../../settings/server';

declare module '@rocket.chat/ddp-client' {
Expand All @@ -13,7 +14,11 @@ declare module '@rocket.chat/ddp-client' {
}

Meteor.methods<ServerMethods>({
/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async removeSlackBridgeChannelLinks() {
methodDeprecationLogger.method('removeSlackBridgeChannelLinks', '9.0.0', []);
const user = await Meteor.userAsync();
if (!user) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', {
Expand Down
5 changes: 5 additions & 0 deletions apps/meteor/app/webdav/server/methods/addWebdavAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { WebdavAccounts } from '@rocket.chat/models';
import { Match, check } from 'meteor/check';
import { Meteor } from 'meteor/meteor';

import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger';
import { settings } from '../../../settings/server';
import { WebdavClientAdapter } from '../lib/webdavClientAdapter';

Expand Down Expand Up @@ -141,7 +142,11 @@ Meteor.methods<ServerMethods>({
return true;
},

/**
* @deprecated Scheduled for removal in 9.0.0. No caller found in this repository — kept for external DDP clients only.
*/
async addWebdavAccountByToken(data) {
methodDeprecationLogger.method('addWebdavAccountByToken', '9.0.0', []);
const userId = Meteor.userId();

if (!userId) {
Expand Down
Loading
Loading