From bcd54b75fd3b9810c5ee56c5e627ff0a445ca78c Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Thu, 27 Apr 2023 11:34:35 -0600 Subject: [PATCH] refactor: Remove imports based on isomorphic logic - 3 (#29071) --- .../meteor/app/emoji-emojione/client/index.ts | 2 +- apps/meteor/app/emoji-emojione/client/lib.ts | 49 +++++++++++++++++ .../lib/{emojiPicker.js => emojiPicker.ts} | 0 .../app/emoji-emojione/lib/emojioneRender.js | 9 --- .../app/emoji-emojione/lib/emojioneRender.ts | 9 +++ .../app/emoji-emojione/lib/rocketchat.js | 55 +++++-------------- .../meteor/app/emoji-emojione/server/index.ts | 2 +- apps/meteor/app/emoji-emojione/server/lib.ts | 47 ++++++++++++++++ apps/meteor/app/emoji/client/emojiParser.js | 2 +- apps/meteor/app/emoji/client/emojiPicker.js | 2 +- apps/meteor/app/emoji/client/index.ts | 2 +- .../{lib/rocketchat.js => client/lib.ts} | 15 +++-- .../app/emoji/client/lib/EmojiPicker.js | 2 +- apps/meteor/app/emoji/index.js | 8 --- apps/meteor/app/emoji/lib/rocketchat.ts | 31 +++++++++++ apps/meteor/app/emoji/server/index.ts | 2 +- apps/meteor/app/emoji/server/lib.ts | 28 ++++++++++ apps/meteor/app/models/index.ts | 5 -- apps/meteor/app/utils/index.js | 10 ---- apps/meteor/client/lib/utils/renderEmoji.ts | 2 +- apps/meteor/client/main.ts | 2 +- apps/meteor/lib/oauthRedirectUriClient.ts | 20 +++++++ ...directUri.ts => oauthRedirectUriServer.ts} | 17 +----- apps/meteor/server/main.ts | 2 +- apps/meteor/server/models/raw/BaseRaw.ts | 2 +- .../lib => server/models/raw}/setUpdatedAt.ts | 0 26 files changed, 221 insertions(+), 104 deletions(-) create mode 100644 apps/meteor/app/emoji-emojione/client/lib.ts rename apps/meteor/app/emoji-emojione/lib/{emojiPicker.js => emojiPicker.ts} (100%) delete mode 100644 apps/meteor/app/emoji-emojione/lib/emojioneRender.js create mode 100644 apps/meteor/app/emoji-emojione/lib/emojioneRender.ts create mode 100644 apps/meteor/app/emoji-emojione/server/lib.ts rename apps/meteor/app/emoji/{lib/rocketchat.js => client/lib.ts} (68%) delete mode 100644 apps/meteor/app/emoji/index.js create mode 100644 apps/meteor/app/emoji/lib/rocketchat.ts create mode 100644 apps/meteor/app/emoji/server/lib.ts delete mode 100644 apps/meteor/app/models/index.ts delete mode 100644 apps/meteor/app/utils/index.js create mode 100644 apps/meteor/lib/oauthRedirectUriClient.ts rename apps/meteor/lib/{oauthRedirectUri.ts => oauthRedirectUriServer.ts} (71%) rename apps/meteor/{app/models/server/lib => server/models/raw}/setUpdatedAt.ts (100%) diff --git a/apps/meteor/app/emoji-emojione/client/index.ts b/apps/meteor/app/emoji-emojione/client/index.ts index 3bf47e3c8c5a..431fd4fbd05c 100644 --- a/apps/meteor/app/emoji-emojione/client/index.ts +++ b/apps/meteor/app/emoji-emojione/client/index.ts @@ -1,2 +1,2 @@ -import '../lib/rocketchat'; +import './lib'; import './emojione-sprites.css'; diff --git a/apps/meteor/app/emoji-emojione/client/lib.ts b/apps/meteor/app/emoji-emojione/client/lib.ts new file mode 100644 index 000000000000..fad97298adf3 --- /dev/null +++ b/apps/meteor/app/emoji-emojione/client/lib.ts @@ -0,0 +1,49 @@ +import { Meteor } from 'meteor/meteor'; + +import { emoji } from '../../emoji/client'; +import { getEmojiConfig, isSetNotNull } from '../lib/rocketchat'; +import { getUserPreference } from '../../utils/client'; + +const config = getEmojiConfig(); + +emoji.packages.emojione = config.emojione as any; +if (emoji.packages.emojione) { + emoji.packages.emojione.sprites = config.sprites; + emoji.packages.emojione.emojisByCategory = config.emojisByCategory; + emoji.packages.emojione.emojiCategories = config.emojiCategories; + emoji.packages.emojione.toneList = config.toneList; + + emoji.packages.emojione.render = config.render; + emoji.packages.emojione.renderPicker = config.renderPicker; + + // RocketChat.emoji.list is the collection of emojis from all emoji packages + for (const key in config.emojione.emojioneList) { + if (config.emojione.emojioneList.hasOwnProperty(key)) { + const currentEmoji = config.emojione.emojioneList[key]; + // @ts-expect-error - emojione types + currentEmoji.emojiPackage = 'emojione'; + emoji.list[key] = currentEmoji; + + // @ts-expect-error - emojione types + if (currentEmoji.shortnames) { + // @ts-expect-error - emojione types + currentEmoji.shortnames.forEach((shortname: string) => { + emoji.list[shortname] = currentEmoji; + }); + } + } + } + + // Additional settings -- ascii emojis + Meteor.startup(function () { + Tracker.autorun(async function () { + if ((await isSetNotNull(() => emoji.packages.emojione)) && emoji.packages.emojione) { + if (await isSetNotNull(() => getUserPreference(Meteor.userId() as string, 'convertAsciiEmoji'))) { + emoji.packages.emojione.ascii = await getUserPreference(Meteor.userId() as string, 'convertAsciiEmoji'); + } else { + emoji.packages.emojione.ascii = true; + } + } + }); + }); +} diff --git a/apps/meteor/app/emoji-emojione/lib/emojiPicker.js b/apps/meteor/app/emoji-emojione/lib/emojiPicker.ts similarity index 100% rename from apps/meteor/app/emoji-emojione/lib/emojiPicker.js rename to apps/meteor/app/emoji-emojione/lib/emojiPicker.ts diff --git a/apps/meteor/app/emoji-emojione/lib/emojioneRender.js b/apps/meteor/app/emoji-emojione/lib/emojioneRender.js deleted file mode 100644 index b5ada6236414..000000000000 --- a/apps/meteor/app/emoji-emojione/lib/emojioneRender.js +++ /dev/null @@ -1,9 +0,0 @@ -import emojione from 'emojione'; - -export function emojioneRender(message) { - return emojione.toImage(message); -} - -export function emojioneRenderFromShort(message) { - return emojione.shortnameToImage(message); -} diff --git a/apps/meteor/app/emoji-emojione/lib/emojioneRender.ts b/apps/meteor/app/emoji-emojione/lib/emojioneRender.ts new file mode 100644 index 000000000000..2ed772ce644c --- /dev/null +++ b/apps/meteor/app/emoji-emojione/lib/emojioneRender.ts @@ -0,0 +1,9 @@ +import emojione from 'emojione'; + +export function emojioneRender(message: string): string { + return emojione.toImage(message); +} + +export function emojioneRenderFromShort(message: string): string { + return emojione.shortnameToImage(message); +} diff --git a/apps/meteor/app/emoji-emojione/lib/rocketchat.js b/apps/meteor/app/emoji-emojione/lib/rocketchat.js index 08179c09e5ea..7e415b99efe8 100644 --- a/apps/meteor/app/emoji-emojione/lib/rocketchat.js +++ b/apps/meteor/app/emoji-emojione/lib/rocketchat.js @@ -1,12 +1,8 @@ import emojione from 'emojione'; -import { Meteor } from 'meteor/meteor'; -import { Tracker } from 'meteor/tracker'; import mem from 'mem'; import { emojioneRender, emojioneRenderFromShort } from './emojioneRender'; import { emojisByCategory, emojiCategories, toneList } from './emojiPicker'; -import { emoji } from '../../emoji'; -import { getUserPreference } from '../../utils'; // TODO remove fix below when issue is solved: https://github.com/joypixels/emojione/issues/617 @@ -260,50 +256,25 @@ emojione.emojioneList[':asterisk_symbol:'] = { }; })(emojione); -emoji.packages.emojione = emojione; -emoji.packages.emojione.sprites = true; -emoji.packages.emojione.emojisByCategory = emojisByCategory; -emoji.packages.emojione.emojiCategories = emojiCategories; -emoji.packages.emojione.toneList = toneList; - -emoji.packages.emojione.render = emojioneRender; -emoji.packages.emojione.renderPicker = emojioneRenderFromShort; +export function getEmojiConfig() { + return { + emojione, + emojisByCategory, + emojiCategories, + toneList, + render: emojioneRender, + renderPicker: emojioneRenderFromShort, + sprites: true, + }; +} // http://stackoverflow.com/a/26990347 function isSet() from Gajus -function isSetNotNull(fn) { +export async function isSetNotNull(fn) { let value; try { - value = fn(); + value = await fn(); } catch (e) { value = null; } return value !== null && value !== undefined; } - -// RocketChat.emoji.list is the collection of emojis from all emoji packages -for (const key in emojione.emojioneList) { - if (emojione.emojioneList.hasOwnProperty(key)) { - const currentEmoji = emojione.emojioneList[key]; - currentEmoji.emojiPackage = 'emojione'; - emoji.list[key] = currentEmoji; - - if (currentEmoji.shortnames) { - currentEmoji.shortnames.forEach((shortname) => { - emoji.list[shortname] = currentEmoji; - }); - } - } -} - -// Additional settings -- ascii emojis -Meteor.startup(function () { - Tracker.autorun(function () { - if (isSetNotNull(() => emoji.packages.emojione)) { - if (isSetNotNull(() => getUserPreference(Meteor.userId(), 'convertAsciiEmoji'))) { - emoji.packages.emojione.ascii = getUserPreference(Meteor.userId(), 'convertAsciiEmoji'); - } else { - emoji.packages.emojione.ascii = true; - } - } - }); -}); diff --git a/apps/meteor/app/emoji-emojione/server/index.ts b/apps/meteor/app/emoji-emojione/server/index.ts index c8e0898cfc01..723d879892f7 100644 --- a/apps/meteor/app/emoji-emojione/server/index.ts +++ b/apps/meteor/app/emoji-emojione/server/index.ts @@ -1,2 +1,2 @@ -import '../lib/rocketchat'; +import './lib'; import './callbacks'; diff --git a/apps/meteor/app/emoji-emojione/server/lib.ts b/apps/meteor/app/emoji-emojione/server/lib.ts new file mode 100644 index 000000000000..0f3cde12d25f --- /dev/null +++ b/apps/meteor/app/emoji-emojione/server/lib.ts @@ -0,0 +1,47 @@ +import { Meteor } from 'meteor/meteor'; + +import { emoji } from '../../emoji/server'; +import { getEmojiConfig, isSetNotNull } from '../lib/rocketchat'; +import { getUserPreference } from '../../utils/server'; + +const config = getEmojiConfig(); + +emoji.packages.emojione = config.emojione as any; +if (emoji.packages.emojione) { + emoji.packages.emojione.sprites = config.sprites; + emoji.packages.emojione.emojisByCategory = config.emojisByCategory; + emoji.packages.emojione.emojiCategories = config.emojiCategories; + emoji.packages.emojione.toneList = config.toneList; + + emoji.packages.emojione.render = config.render; + emoji.packages.emojione.renderPicker = config.renderPicker; + + // RocketChat.emoji.list is the collection of emojis from all emoji packages + for (const key in config.emojione.emojioneList) { + if (config.emojione.emojioneList.hasOwnProperty(key)) { + const currentEmoji = config.emojione.emojioneList[key]; + // @ts-expect-error - emojione types + currentEmoji.emojiPackage = 'emojione'; + emoji.list[key] = currentEmoji; + + // @ts-expect-error - emojione types + if (currentEmoji.shortnames) { + // @ts-expect-error - emojione types + currentEmoji.shortnames.forEach((shortname: string) => { + emoji.list[shortname] = currentEmoji; + }); + } + } + } + + // Additional settings -- ascii emojis + Meteor.startup(async function () { + if ((await isSetNotNull(() => emoji.packages.emojione)) && emoji.packages.emojione) { + if (await isSetNotNull(() => getUserPreference(Meteor.userId() as string, 'convertAsciiEmoji'))) { + emoji.packages.emojione.ascii = await getUserPreference(Meteor.userId() as string, 'convertAsciiEmoji'); + } else { + emoji.packages.emojione.ascii = true; + } + } + }); +} diff --git a/apps/meteor/app/emoji/client/emojiParser.js b/apps/meteor/app/emoji/client/emojiParser.js index 5595da639209..7b887bb0575f 100644 --- a/apps/meteor/app/emoji/client/emojiParser.js +++ b/apps/meteor/app/emoji/client/emojiParser.js @@ -1,5 +1,5 @@ import { isIE11 } from '../../../client/lib/utils/isIE11'; -import { emoji } from '../lib/rocketchat'; +import { emoji } from './lib'; /* * emojiParser is a function that will replace emojis diff --git a/apps/meteor/app/emoji/client/emojiPicker.js b/apps/meteor/app/emoji/client/emojiPicker.js index 7e9b436d99b8..5ca957de8f92 100644 --- a/apps/meteor/app/emoji/client/emojiPicker.js +++ b/apps/meteor/app/emoji/client/emojiPicker.js @@ -7,7 +7,7 @@ import $ from 'jquery'; import { t } from '../../utils/client'; import { EmojiPicker } from './lib/EmojiPicker'; -import { emoji } from '../lib/rocketchat'; +import { emoji } from './lib'; import { withThrottling } from '../../../lib/utils/highOrderFunctions'; import { baseURI } from '../../../client/lib/baseURI'; import './emojiPicker.html'; diff --git a/apps/meteor/app/emoji/client/index.ts b/apps/meteor/app/emoji/client/index.ts index 300398ed738e..a8bc15a376e6 100644 --- a/apps/meteor/app/emoji/client/index.ts +++ b/apps/meteor/app/emoji/client/index.ts @@ -1,2 +1,2 @@ export { EmojiPicker } from './lib/EmojiPicker'; -export { emoji } from '../lib/rocketchat'; +export { emoji } from './lib'; diff --git a/apps/meteor/app/emoji/lib/rocketchat.js b/apps/meteor/app/emoji/client/lib.ts similarity index 68% rename from apps/meteor/app/emoji/lib/rocketchat.js rename to apps/meteor/app/emoji/client/lib.ts index 8a38eadc3912..667d5b773049 100644 --- a/apps/meteor/app/emoji/lib/rocketchat.js +++ b/apps/meteor/app/emoji/client/lib.ts @@ -1,15 +1,16 @@ import { emojioneRender } from '../../emoji-emojione/lib/emojioneRender'; +import type { EmojiPackage } from '../lib/rocketchat'; -let EmojiPicker; -const removeFromRecent = (emoji) => { +let EmojiPicker: any; +const removeFromRecent = (emoji: string) => { if (!EmojiPicker) { // since this function will be only called client side, the import needs to happen here - ({ EmojiPicker } = require('../client/lib/EmojiPicker')); + ({ EmojiPicker } = require('./lib/EmojiPicker')); } EmojiPicker.removeFromRecent(emoji.replace(/(^:|:$)/g, '')); }; -export const emoji = { +export const emoji: EmojiPackage = { packages: { base: { emojiCategories: [{ key: 'recent', i18n: 'Frequently_Used' }], @@ -25,7 +26,11 @@ export const emoji = { return; } const correctPackage = emoji.list[emojiToRender].emojiPackage; - return emoji.packages[correctPackage].renderPicker(emojiToRender); + if (!correctPackage) { + return; + } + + return emoji.packages[correctPackage]?.renderPicker(emojiToRender); }, }, }, diff --git a/apps/meteor/app/emoji/client/lib/EmojiPicker.js b/apps/meteor/app/emoji/client/lib/EmojiPicker.js index b4c59225f532..dab1a204ce44 100644 --- a/apps/meteor/app/emoji/client/lib/EmojiPicker.js +++ b/apps/meteor/app/emoji/client/lib/EmojiPicker.js @@ -4,7 +4,7 @@ import { Template } from 'meteor/templating'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; -import { emoji } from '../../lib/rocketchat'; +import { emoji } from '../lib'; import { updateRecentEmoji } from '../emojiPicker'; import { withDebouncing } from '../../../../lib/utils/highOrderFunctions'; diff --git a/apps/meteor/app/emoji/index.js b/apps/meteor/app/emoji/index.js deleted file mode 100644 index 1f3257e45429..000000000000 --- a/apps/meteor/app/emoji/index.js +++ /dev/null @@ -1,8 +0,0 @@ -import { Meteor } from 'meteor/meteor'; - -if (Meteor.isClient) { - module.exports = require('./client/index.ts'); -} -if (Meteor.isServer) { - module.exports = require('./server/index.ts'); -} diff --git a/apps/meteor/app/emoji/lib/rocketchat.ts b/apps/meteor/app/emoji/lib/rocketchat.ts new file mode 100644 index 000000000000..cb16e2ed3362 --- /dev/null +++ b/apps/meteor/app/emoji/lib/rocketchat.ts @@ -0,0 +1,31 @@ +export type EmojiPackage = { + packages: { + base: { + emojiCategories: Array<{ key: string; i18n: string }>; + categoryIndex: number; + emojisByCategory: Record; + toneList: Record; + render: (message: string) => string; + renderPicker: (emojiToRender: string) => void; + ascii?: boolean; + }; + emojione?: { + sprites: boolean; + emojisByCategory: Record; + emojiCategories: Array<{ key: string; i18n: string }>; + toneList: Record; + render: (message: string) => string; + renderPicker: (emojiToRender: string) => void; + ascii?: boolean; + }; + }; + list: Record< + string, + { emojiPackage?: keyof NonNullable } & { + unicode: string[]; + fname: string; + uc: string; + isCanonical: boolean; + } + >; +}; diff --git a/apps/meteor/app/emoji/server/index.ts b/apps/meteor/app/emoji/server/index.ts index 4bb73e75c17d..525aac958906 100644 --- a/apps/meteor/app/emoji/server/index.ts +++ b/apps/meteor/app/emoji/server/index.ts @@ -1 +1 @@ -export { emoji } from '../lib/rocketchat'; +export { emoji } from './lib'; diff --git a/apps/meteor/app/emoji/server/lib.ts b/apps/meteor/app/emoji/server/lib.ts new file mode 100644 index 000000000000..cbc4406e91cd --- /dev/null +++ b/apps/meteor/app/emoji/server/lib.ts @@ -0,0 +1,28 @@ +import type { EmojiPackage } from '../lib/rocketchat'; + +export const emoji: EmojiPackage = { + packages: { + base: { + emojiCategories: [{ key: 'recent', i18n: 'Frequently_Used' }], + categoryIndex: 0, + emojisByCategory: { + recent: [], + }, + toneList: {}, + render: (message: string) => message, + renderPicker(emojiToRender) { + if (!emoji.list[emojiToRender]) { + return; + } + const correctPackage = emoji.list[emojiToRender].emojiPackage; + if (!correctPackage) { + return; + } + + return emoji.packages[correctPackage]?.renderPicker(emojiToRender); + }, + }, + }, + /** @type {Record} */ + list: {}, +}; diff --git a/apps/meteor/app/models/index.ts b/apps/meteor/app/models/index.ts deleted file mode 100644 index fc1928079266..000000000000 --- a/apps/meteor/app/models/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Meteor } from 'meteor/meteor'; - -if (Meteor.isClient) { - module.exports = require('./client/index'); -} diff --git a/apps/meteor/app/utils/index.js b/apps/meteor/app/utils/index.js deleted file mode 100644 index 784d2e0f7989..000000000000 --- a/apps/meteor/app/utils/index.js +++ /dev/null @@ -1,10 +0,0 @@ -import { Meteor } from 'meteor/meteor'; - -// HACK: this barrel export is needed in JS to make the desktop app work - -if (Meteor.isClient) { - module.exports = require('./client/index.ts'); -} -if (Meteor.isServer) { - module.exports = require('./server/index.ts'); -} diff --git a/apps/meteor/client/lib/utils/renderEmoji.ts b/apps/meteor/client/lib/utils/renderEmoji.ts index 76c8e4c352c1..5c7acaf88dc6 100644 --- a/apps/meteor/client/lib/utils/renderEmoji.ts +++ b/apps/meteor/client/lib/utils/renderEmoji.ts @@ -1,4 +1,4 @@ -import { emoji } from '../../../app/emoji/lib/rocketchat'; +import { emoji } from '../../../app/emoji/client/lib'; const emojiList = emoji.list as Record; const emojiPackages = emoji.packages as Record; diff --git a/apps/meteor/client/main.ts b/apps/meteor/client/main.ts index 2911c7c70af2..2d7652cb79af 100644 --- a/apps/meteor/client/main.ts +++ b/apps/meteor/client/main.ts @@ -2,7 +2,7 @@ import '../ee/definition'; import '../ee/client/ecdh'; import './polyfills'; -import '../lib/oauthRedirectUri'; +import '../lib/oauthRedirectUriClient'; import './lib/meteorCallWrapper'; import './importPackages'; diff --git a/apps/meteor/lib/oauthRedirectUriClient.ts b/apps/meteor/lib/oauthRedirectUriClient.ts new file mode 100644 index 000000000000..cb5581210432 --- /dev/null +++ b/apps/meteor/lib/oauthRedirectUriClient.ts @@ -0,0 +1,20 @@ +import { OAuth } from 'meteor/oauth'; + +const { _redirectUri } = OAuth; + +OAuth._redirectUri = (serviceName: string, config: any, params: unknown, absoluteUrlOptions: unknown): string => { + const ret = _redirectUri(serviceName, config, params, absoluteUrlOptions); + + // DEPRECATED: Remove in v5.0.0 + // Meteor 2.3 removed ?close from redirect uri so we need to add it back to not break old oauth clients + // https://github.com/meteor/meteor/commit/b5b7306bedc3e8eb241e64efb1e281925aa75dd3#diff-59244f4e0176cb1beed2e287924e97dc7ae2c0cc51494ce121a85d8937d116a5L11 + if (!config?.loginStyle && !ret.includes('close')) { + console.warn( + `Automatically added ?close to 'redirect_uri' for ${serviceName}, this behavior will be removed in v5.0.0.\n` + + "Please update your OAuth config to accept both with and without ?close as the 'redirect_uri'.", + ); + return `${ret + (ret.includes('?') ? '&' : '?')}close`; + } + + return ret; +}; diff --git a/apps/meteor/lib/oauthRedirectUri.ts b/apps/meteor/lib/oauthRedirectUriServer.ts similarity index 71% rename from apps/meteor/lib/oauthRedirectUri.ts rename to apps/meteor/lib/oauthRedirectUriServer.ts index 6174f773129a..ce89f00ef2a2 100644 --- a/apps/meteor/lib/oauthRedirectUri.ts +++ b/apps/meteor/lib/oauthRedirectUriServer.ts @@ -1,19 +1,8 @@ -import { Meteor } from 'meteor/meteor'; import { OAuth } from 'meteor/oauth'; -const { _redirectUri } = OAuth; - -const warn = ((): ((message: unknown) => void) => { - if (Meteor.isServer) { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const { SystemLogger } = require('../server/lib/logger/system'); - return (message: unknown): void => { - SystemLogger.warn(message); - }; - } +import { SystemLogger } from '../server/lib/logger/system'; - return console.warn; -})(); +const { _redirectUri } = OAuth; OAuth._redirectUri = (serviceName: string, config: any, params: unknown, absoluteUrlOptions: unknown): string => { const ret = _redirectUri(serviceName, config, params, absoluteUrlOptions); @@ -22,7 +11,7 @@ OAuth._redirectUri = (serviceName: string, config: any, params: unknown, absolut // Meteor 2.3 removed ?close from redirect uri so we need to add it back to not break old oauth clients // https://github.com/meteor/meteor/commit/b5b7306bedc3e8eb241e64efb1e281925aa75dd3#diff-59244f4e0176cb1beed2e287924e97dc7ae2c0cc51494ce121a85d8937d116a5L11 if (!config?.loginStyle && !ret.includes('close')) { - warn( + SystemLogger.warn( `Automatically added ?close to 'redirect_uri' for ${serviceName}, this behavior will be removed in v5.0.0.\n` + "Please update your OAuth config to accept both with and without ?close as the 'redirect_uri'.", ); diff --git a/apps/meteor/server/main.ts b/apps/meteor/server/main.ts index 8bf06426228a..b233d0238b79 100644 --- a/apps/meteor/server/main.ts +++ b/apps/meteor/server/main.ts @@ -3,7 +3,7 @@ import './settings/index'; import '../ee/server/models/startup'; import './services/startup'; import '../app/settings/server'; -import '../lib/oauthRedirectUri'; +import '../lib/oauthRedirectUriServer'; import './overrides/http'; import './lib/logger/startup'; import './importPackages'; diff --git a/apps/meteor/server/models/raw/BaseRaw.ts b/apps/meteor/server/models/raw/BaseRaw.ts index fdbcd406139b..3382510df576 100644 --- a/apps/meteor/server/models/raw/BaseRaw.ts +++ b/apps/meteor/server/models/raw/BaseRaw.ts @@ -27,7 +27,7 @@ import type { RocketChatRecordDeleted } from '@rocket.chat/core-typings'; import type { IBaseModel, DefaultFields, ResultFields, FindPaginated, InsertionModel } from '@rocket.chat/model-typings'; import { getCollectionName } from '@rocket.chat/models'; -import { setUpdatedAt } from '../../../app/models/server/lib/setUpdatedAt'; +import { setUpdatedAt } from './setUpdatedAt'; const warnFields = process.env.NODE_ENV !== 'production' || process.env.SHOW_WARNINGS === 'true' diff --git a/apps/meteor/app/models/server/lib/setUpdatedAt.ts b/apps/meteor/server/models/raw/setUpdatedAt.ts similarity index 100% rename from apps/meteor/app/models/server/lib/setUpdatedAt.ts rename to apps/meteor/server/models/raw/setUpdatedAt.ts