From 9632cb7ec5bac537f9aaa1bc2db20d2f017f25c5 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 19 Aug 2019 10:29:02 -0300 Subject: [PATCH] [BREAK] Remove REST endpoint `/api/v1/info` (#15197) --- app/api/server/v1/misc.js | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/app/api/server/v1/misc.js b/app/api/server/v1/misc.js index 8aa8f7b973b5..68f75e302244 100644 --- a/app/api/server/v1/misc.js +++ b/app/api/server/v1/misc.js @@ -3,45 +3,12 @@ import { check } from 'meteor/check'; import { TAPi18n } from 'meteor/rocketchat:tap-i18n'; import s from 'underscore.string'; -import { hasRole } from '../../../authorization'; -import { Info } from '../../../utils'; -import { Users } from '../../../models'; -import { settings } from '../../../settings'; +import { Users } from '../../../models/server'; +import { settings } from '../../../settings/server'; import { API } from '../api'; import { getDefaultUserFields } from '../../../utils/server/functions/getDefaultUserFields'; import { getURL } from '../../../utils/lib/getURL'; - -// DEPRECATED -// Will be removed after v1.12.0 -API.v1.addRoute('info', { authRequired: false }, { - get() { - const warningMessage = 'The endpoint "/v1/info" is deprecated and will be removed after version v1.12.0'; - console.warn(warningMessage); - const user = this.getLoggedInUser(); - - if (user && hasRole(user._id, 'admin')) { - return API.v1.success(this.deprecationWarning({ - endpoint: 'info', - versionWillBeRemoved: '1.12.0', - response: { - info: Info, - }, - })); - } - - return API.v1.success(this.deprecationWarning({ - endpoint: 'info', - versionWillBeRemoved: '1.12.0', - response: { - info: { - version: Info.version, - }, - }, - })); - }, -}); - API.v1.addRoute('me', { authRequired: true }, { get() { return API.v1.success(this.getUserInfo(Users.findOneById(this.userId, { fields: getDefaultUserFields() })));