Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
40e4dd0
test: migrate Mocha test to Jest
tassoevan Jan 26, 2026
946fc5b
refactor: convert legacy markdown lib to TypeScript
tassoevan Jan 27, 2026
61a6a2a
refactor: convert `apps/meteor/app/authentication/server/startup/inde…
tassoevan Jan 27, 2026
8e33213
refactor: convert `apps/meteor/app/2fa/server/MethodInvocationOverrid…
tassoevan Jan 27, 2026
ca5b211
refactor: convert `apps/meteor/app/apps/server/bridges/bridges.js` to…
tassoevan Jan 28, 2026
ca2ed38
refactor: convert `apps/meteor/app/apps/server/converters/departments…
tassoevan Jan 28, 2026
a6ab57d
refactor: convert `apps/meteor/app/apps/server/converters/messages.js…
tassoevan Jan 28, 2026
c4a4b34
refactor: convert `apps/meteor/app/apps/server/converters/rooms.js` t…
tassoevan Jan 28, 2026
8023f1f
refactor: convert `apps/meteor/app/apps/server/converters/settings.js…
tassoevan Jan 28, 2026
3462cb5
refactor: convert `apps/meteor/app/apps/server/converters/uploads.js`…
tassoevan Jan 28, 2026
3a5d813
refactor: convert `apps/meteor/app/apps/server/converters/users.js` t…
tassoevan Jan 28, 2026
27b523d
refactor: convert `apps/meteor/app/apps/server/converters/visitors.js…
tassoevan Jan 28, 2026
5b121cc
refactor: convert `apps/meteor/app/custom-oauth/server/transform_help…
tassoevan Jan 28, 2026
9d5aca1
refactor: convert `apps/meteor/app/custom-oauth/server/custom_oauth_s…
tassoevan Jan 28, 2026
c045692
refactor: convert `apps/meteor/app/custom-sounds/server/startup/custo…
tassoevan Jan 28, 2026
0272f68
refactor: convert `apps/meteor/app/emoji-custom/server/startup/emoji-…
tassoevan Jan 28, 2026
e6a8bb9
refactor: convert `apps/meteor/app/google-oauth/server/index.js` to T…
tassoevan Jan 28, 2026
d5a327d
refactor: convert `apps/meteor/app/importer/server/startup/setImports…
tassoevan Jan 28, 2026
8319885
refactor: convert `apps/meteor/app/importer/server/startup/store.js` …
tassoevan Jan 28, 2026
fed847c
refactor: convert `apps/meteor/app/irc/server/irc-bridge/localHandler…
tassoevan Jan 28, 2026
6c8ea5a
refactor: convert `apps/meteor/app/irc/server/irc-bridge/localHandler…
tassoevan Jan 29, 2026
c62baa4
refactor: convert `apps/meteor/app/irc/server/irc-bridge/localHandler…
tassoevan Jan 29, 2026
09193b9
refactor: convert `apps/meteor/app/irc/server/irc-bridge/localHandler…
tassoevan Jan 29, 2026
d582ee7
refactor: convert `apps/meteor/app/irc/server/irc-bridge/localHandler…
tassoevan Jan 29, 2026
ec7cfae
refactor: convert `apps/meteor/app/irc/server/irc-bridge/localHandler…
tassoevan Jan 29, 2026
7215e0a
refactor: convert `apps/meteor/app/irc/server/irc-bridge/localHandler…
tassoevan Jan 29, 2026
fbfca2c
refactor: convert `apps/meteor/app/irc/server/irc-bridge/peerHandlers…
tassoevan Jan 29, 2026
1fd7d9a
refactor: convert `apps/meteor/app/irc/server/irc-bridge/peerHandlers…
tassoevan Jan 29, 2026
100bbcb
refactor: convert `apps/meteor/app/irc/server/irc-bridge/peerHandlers…
tassoevan Jan 29, 2026
cf0071d
refactor: convert `apps/meteor/app/irc/server/irc-bridge/peerHandlers…
tassoevan Jan 29, 2026
30b56c5
refactor: convert `apps/meteor/app/irc/server/irc-bridge/peerHandlers…
tassoevan Jan 29, 2026
bcc2c0f
refactor: convert `apps/meteor/app/irc/server/irc-bridge/peerHandlers…
tassoevan Jan 29, 2026
f199eeb
refactor: convert `apps/meteor/app/irc/server/irc-bridge/index.js` to…
tassoevan Jan 29, 2026
5d16693
refactor: convert `apps/meteor/app/irc/server/servers/RFC2813/codes.j…
tassoevan Jan 29, 2026
fccd339
refactor: convert `apps/meteor/app/irc/server/servers/RFC2813/peerCom…
tassoevan Jan 29, 2026
0437256
refactor: convert `apps/meteor/app/irc/server/servers/RFC2813/localCo…
tassoevan Jan 29, 2026
b9175d0
refactor: convert `apps/meteor/app/irc/server/servers/RFC2813/parseMe…
tassoevan Jan 29, 2026
2615fda
refactor: convert `apps/meteor/app/irc/server/servers/RFC2813/index.j…
tassoevan Jan 29, 2026
a98b3c2
refactor: normalize types on `apps/meteor/app/irc/server/servers/RFC2…
tassoevan Jan 29, 2026
e2ff723
refactor: convert `apps/meteor/app/lib/server/startup/rateLimiter.js`…
tassoevan Jan 29, 2026
4ff848d
refactor: convert `apps/meteor/app/lib/server/startup/robots.js` to T…
tassoevan Jan 29, 2026
f5042da
refactor: convert `apps/meteor/app/lib/server/lib/validateEmailDomain…
tassoevan Jan 29, 2026
6d09657
refactor: convert `apps/meteor/app/lib/server/lib/debug.js` to TypeSc…
tassoevan Jan 29, 2026
684efa8
refactor: convert `apps/meteor/app/lib/server/lib/interceptDirectRepl…
tassoevan Jan 29, 2026
c6163ba
refactor: convert `apps/meteor/app/lib/server/lib/RateLimiter.js` to …
tassoevan Jan 29, 2026
6214cce
refactor: convert `apps/meteor/app/lib/server/functions/validateCusto…
tassoevan Jan 29, 2026
7e4341c
refactor: convert `apps/meteor/app/metrics/server/lib/statsTracker.js…
tassoevan Jan 29, 2026
ee43968
refactor: convert `apps/meteor/app/statistics/server/lib/UAParserCust…
tassoevan Jan 29, 2026
e612b97
refactor: convert `apps/meteor/app/token-login/server/login_token_ser…
tassoevan Jan 29, 2026
688e399
refactor: convert `apps/meteor/app/lib/server/functions/notifications…
tassoevan Jan 29, 2026
ca611e9
refactor: convert `apps/meteor/app/lib/server/functions/notifications…
tassoevan Jan 29, 2026
dbede31
refactor: convert `apps/meteor/app/lib/server/oauth/proxy.js` to Type…
tassoevan Jan 29, 2026
1bf828f
refactor: convert `apps/meteor/app/lib/server/oauth/oauth.js` to Type…
tassoevan Jan 29, 2026
fe9dfc7
refactor: convert `apps/meteor/app/lib/server/oauth/{facebook,google,…
tassoevan Jan 29, 2026
f16ca1e
refactor: convert `apps/meteor/ee/app/api-enterprise/server/lib/canne…
tassoevan Jan 30, 2026
e18caf5
refactor: convert `apps/meteor/ee/server/apps/orchestrator.js` to Typ…
tassoevan Jan 30, 2026
87b9c52
refactor: convert `apps/meteor/ee/lib/misc/determineFileType.js` to T…
tassoevan Jan 30, 2026
02c2df4
refactor: convert `apps/meteor/server/configuration/accounts_meld.js`…
tassoevan Jan 30, 2026
cbf329f
refactor: convert `apps/meteor/server/lib/spotlight.js` to TypeScript
tassoevan Jan 30, 2026
7a0edbc
refactor: migrate unit test `apps/meteor/tests/unit/app/statistics/se…
tassoevan Jan 30, 2026
ab35a1a
refactor: convert `apps/meteor/app/statistics/server/functions/sendUs…
tassoevan Jan 31, 2026
adc611e
refactor: migrate unit test `apps/meteor/tests/unit/app/custom-oauth/…
tassoevan Jan 31, 2026
4084ab4
refactor: migrate unit test `apps/meteor/tests/unit/app/highlight-wor…
tassoevan Jan 31, 2026
caeb8d0
refactor: migrate unit test `apps/meteor/tests/unit/app/mentions/serv…
tassoevan Jan 31, 2026
84e6ae1
refactor: migrate unit test `apps/meteor/tests/unit/app/mentions/clie…
tassoevan Jan 31, 2026
8113673
refactor: migrate unit test `apps/meteor/tests/unit/app/utils/lib/get…
tassoevan Jan 31, 2026
38fdc2d
refactor: migrate some mock modules to TypeScript
tassoevan Feb 1, 2026
6c351da
refactor: migrate unit test `apps/meteor/tests/unit/app/apps/server/m…
tassoevan Feb 1, 2026
d6021ee
refactor: migrate unit test `apps/meteor/tests/unit/app/apps/server/r…
tassoevan Feb 1, 2026
e072b04
refactor: delete useless unit test
tassoevan Feb 1, 2026
f802b79
refactor: migrate `apps/meteor/.storybook/mocks/meteor.js` to TypeScript
tassoevan Feb 1, 2026
036393f
refactor: review over `apps/meteor/app/apps/server/converters/visitor…
tassoevan Feb 2, 2026
5e22af2
refactor: review over `apps/meteor/app/lib/server/oauth/facebook.ts`
tassoevan Feb 2, 2026
801ee67
refactor: review over `apps/meteor/app/apps/server/converters/departm…
tassoevan Feb 2, 2026
fc79851
refactor: review over `apps/meteor/app/lib/server/functions/validateC…
tassoevan Feb 2, 2026
4835d67
refactor: review over `apps/meteor/app/lib/server/oauth/google.ts`
tassoevan Feb 2, 2026
cfc2351
refactor: review over `apps/meteor/app/custom-oauth/server/transform_…
tassoevan Feb 2, 2026
050681c
refactor: review over `apps/meteor/ee/lib/misc/determineFileType.ts`
tassoevan Feb 2, 2026
0f419ee
refactor: review over `apps/meteor/server/configuration/accounts_meld…
tassoevan Feb 2, 2026
e246502
refactor: review over `apps/meteor/app/lib/server/oauth/google.ts`
tassoevan Feb 2, 2026
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
7 changes: 5 additions & 2 deletions apps/meteor/.mocharc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = {
'ee/tests/**/*.tests.ts',
'ee/tests/**/*.spec.ts',
'tests/unit/app/**/*.spec.ts',
'tests/unit/app/**/*.tests.js',
'tests/unit/app/**/*.tests.ts',
'tests/unit/lib/**/*.tests.ts',
'server/routes/avatar/**/*.spec.ts',
Expand All @@ -28,9 +27,13 @@ module.exports = {
'tests/unit/server/**/*.spec.ts',
'app/api/server/lib/**/*.spec.ts',
'app/file-upload/server/**/*.spec.ts',
'app/statistics/server/**/*.spec.ts',
'app/livechat/server/lib/**/*.spec.ts',
'app/push/server/**/*.spec.ts',
'app/utils/server/**/*.spec.ts',
'!app/custom-oauth/server/**/*.spec.ts',
'!app/highlight-words/client/**/*.spec.ts',
'!app/mentions/server/**/*.spec.ts',
'!app/mentions/lib/**/*.spec.ts',
'!app/utils/lib/**/*.spec.ts',
],
};
4 changes: 2 additions & 2 deletions apps/meteor/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { StorybookConfig } from '@storybook/react-webpack5';
import webpack from 'webpack';

export default {
stories: ['../client/**/*.stories.{js,tsx}', '../app/**/*.stories.{js,tsx}', '../ee/app/**/*.stories.{js,tsx}'],
stories: ['../client/**/*.stories.{js,tsx}'],

addons: [
getAbsolutePath('@storybook/addon-essentials'),
Expand Down Expand Up @@ -44,7 +44,7 @@ export default {
});

config.plugins?.push(
new webpack.NormalModuleReplacementPlugin(/^meteor/, require.resolve('./mocks/meteor.js')),
new webpack.NormalModuleReplacementPlugin(/^meteor/, require.resolve('./mocks/meteor.ts')),
new webpack.NormalModuleReplacementPlugin(/(app)\/*.*\/(server)\/*/, require.resolve('./mocks/empty.ts')),
);

Expand Down
95 changes: 0 additions & 95 deletions apps/meteor/.storybook/mocks/meteor.js

This file was deleted.

95 changes: 95 additions & 0 deletions apps/meteor/.storybook/mocks/meteor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
export const Meteor = {
Device: {
isDesktop: () => false,
},
isClient: true,
isServer: false,
_localStorage: window.localStorage,
absoluteUrl: Object.assign(() => undefined, {
defaultOptions: {},
}),
userId: () => undefined,
Streamer: () => ({
on: () => undefined,
removeListener: () => undefined,
}),
StreamerCentral: {
on: () => undefined,
removeListener: () => undefined,
},
startup: () => undefined,
methods: () => undefined,
call: () => undefined,
connection: {
_stream: {
on: () => undefined,
},
},
users: {},
};

export const Tracker = {
autorun: () => ({
stop: () => undefined,
}),
nonreactive: (fn: () => void) => fn(),
Dependency: () => undefined,
};

export const Accounts = {
onLogin: () => undefined,
onLogout: () => undefined,
};

export const Mongo = {
Collection: () => ({
find: () => ({
observe: () => undefined,
fetch: () => [],
}),
}),
};

export const ReactiveVar = <T>(val: T) => {
let currentVal = val;
return {
get: () => currentVal,
set: (val: T) => {
currentVal = val;
},
};
};

export const ReactiveDict = () => ({
get: () => undefined,
set: () => undefined,
all: () => undefined,
});

export const Template = Object.assign(
() => ({
onCreated: () => undefined,
onRendered: () => undefined,
onDestroyed: () => undefined,
helpers: () => undefined,
events: () => undefined,
}),
{
registerHelper: () => undefined,
__checkName: () => undefined,
},
);

export const check = () => undefined;

export const FlowRouter = {
route: () => undefined,
group: () => ({
route: () => undefined,
}),
};

export const Session = {
get: () => undefined,
set: () => undefined,
};
17 changes: 0 additions & 17 deletions apps/meteor/app/2fa/server/MethodInvocationOverride.js

This file was deleted.

26 changes: 26 additions & 0 deletions apps/meteor/app/2fa/server/MethodInvocationOverride.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { DDP } from 'meteor/ddp';
import { DDPCommon } from 'meteor/ddp-common';

class MethodInvocation extends DDPCommon.MethodInvocation {
twoFactorChecked?: boolean;

constructor(options: {
connection: {
id: string;
close: () => void;
clientAddress: string;
httpHeaders: Record<string, any>;
};
isSimulation?: boolean;
userId?: string;
}) {
super(options);
const currentInvocation = DDP._CurrentInvocation.get();

if (currentInvocation) {
this.twoFactorChecked = (currentInvocation as MethodInvocation).twoFactorChecked;
}
}
}

DDPCommon.MethodInvocation = MethodInvocation;
1 change: 1 addition & 0 deletions apps/meteor/app/2fa/server/code/PasswordCheckFallback.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { IUser } from '@rocket.chat/core-typings';
import { Accounts } from 'meteor/accounts-base';
import type { Meteor } from 'meteor/meteor';

import type { ICodeCheck, IProcessInvalidCodeResult } from './ICodeCheck';
import { settings } from '../../../settings/server';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/api/server/ApiClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ export class APIClass<TBasePath extends string = '', TOperations extends Record<
});

try {
const auth = await DDP._CurrentInvocation.withValue(invocation as any, async () => Meteor.callAsync('login', args));
const auth = await DDP._CurrentInvocation.withValue(invocation, async () => Meteor.callAsync('login', args));
const user = await Users.findOne(
{
_id: auth.id,
Expand Down
Loading
Loading