Skip to content
Merged
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
2 changes: 1 addition & 1 deletion apps/meteor/app/api/server/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class RocketChatAPIRouter<
[x: string]: unknown;
} = NonNullable<unknown>,
> extends Router<TBasePath, TOperations, APIActionHandler> {
protected convertActionToHandler(action: APIActionHandler): (c: HonoContext) => Promise<ResponseSchema<TypedOptions>> {
protected override convertActionToHandler(action: APIActionHandler): (c: HonoContext) => Promise<ResponseSchema<TypedOptions>> {
return async (c: HonoContext): Promise<ResponseSchema<TypedOptions>> => {
const { req, res } = c;
const queryParams = this.parseQueryParams(req);
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/app/api/server/v1/integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ API.v1.addRoute(
return API.v1.success({ integration: await addOutgoingIntegration(this.userId, this.bodyParams as INewOutgoingIntegration) });
case 'webhook-incoming':
return API.v1.success({ integration: await addIncomingIntegration(this.userId, this.bodyParams as INewIncomingIntegration) });
default:
return API.v1.failure('Invalid integration type.');
}

return API.v1.failure('Invalid integration type.');
},
},
);
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/apple/server/AppleCustomOAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CustomOAuth } from '../../custom-oauth/server/custom_oauth_server';
import { handleIdentityToken } from '../lib/handleIdentityToken';

export class AppleCustomOAuth extends CustomOAuth {
async getIdentity(_accessToken: string, query: Record<string, any>): Promise<any> {
override async getIdentity(_accessToken: string, query: Record<string, any>): Promise<any> {
const { id_token: identityToken, user: userStr = '' } = query;

let usrObj = {} as any;
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/file-upload/server/config/GridFS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ExtractRange extends stream.Transform {
this.bytes_read = 0;
}

_transform(chunk: any, _enc: BufferEncoding, cb: TransformCallback) {
override _transform(chunk: any, _enc: BufferEncoding, cb: TransformCallback) {
if (this.bytes_read > this.stop) {
// done reading
this.end();
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/importer-csv/server/CsvImporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class CsvImporter extends Importer {
this.csvParser = parse;
}

async prepareUsingLocalFile(fullFilePath: string): Promise<ImporterProgress> {
override async prepareUsingLocalFile(fullFilePath: string): Promise<ImporterProgress> {
this.logger.debug('start preparing import operation');
await this.converter.clearImportData();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class ContactImporter extends Importer {
this.csvParser = parse;
}

async prepareUsingLocalFile(fullFilePath: string): Promise<ImporterProgress> {
override async prepareUsingLocalFile(fullFilePath: string): Promise<ImporterProgress> {
this.logger.debug('start preparing import operation');
await this.converter.clearImportData();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class PendingAvatarImporter extends Importer {
return fileCount;
}

async startImport(importSelection: IImporterShortSelection): Promise<ImporterProgress> {
override async startImport(importSelection: IImporterShortSelection): Promise<ImporterProgress> {
const pendingFileUserList = Users.findAllUsersWithPendingAvatar();
try {
for await (const user of pendingFileUserList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class PendingFileImporter extends Importer {
return fileCount;
}

async startImport(importSelection: IImporterShortSelection): Promise<ImporterProgress> {
override async startImport(importSelection: IImporterShortSelection): Promise<ImporterProgress> {
const downloadedFileIds: string[] = [];
const maxFileCount = 10;
const maxFileSize = 1024 * 1024 * 500;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class SlackUsersImporter extends Importer {
this.csvParser = parse;
}

async prepareUsingLocalFile(fullFilePath: string): Promise<ImporterProgress> {
override async prepareUsingLocalFile(fullFilePath: string): Promise<ImporterProgress> {
this.logger.debug('start preparing import operation');
await this.converter.clearImportData();

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/importer-slack/server/SlackImporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export class SlackImporter extends Importer {
return data.length;
}

async prepareUsingLocalFile(fullFilePath: string): Promise<ImporterProgress> {
override async prepareUsingLocalFile(fullFilePath: string): Promise<ImporterProgress> {
this.logger.debug('start preparing import operation');
await this.converter.clearImportData();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class ContactConverter extends RecordConverter<IImportContactRecord> {
return validateCustomFields(allowedCustomFields, customFields, { ignoreAdditionalFields: true });
}

protected async convertRecord(record: IImportContactRecord): Promise<boolean> {
protected override async convertRecord(record: IImportContactRecord): Promise<boolean> {
const { data } = record;

await createContact({
Expand All @@ -36,7 +36,7 @@ export class ContactConverter extends RecordConverter<IImportContactRecord> {
return LivechatVisitors.getNextVisitorUsername();
}

protected getDataType(): 'contact' {
protected override getDataType(): 'contact' {
return 'contact';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type IMessageReactions = Record<string, IMessageReaction>;
export class MessageConverter extends RecordConverter<IImportMessageRecord> {
private rids: string[] = [];

async convertData({ afterImportAllMessagesFn, ...callbacks }: MessageConversionCallbacks = {}): Promise<void> {
override async convertData({ afterImportAllMessagesFn, ...callbacks }: MessageConversionCallbacks = {}): Promise<void> {
this.rids = [];
await super.convertData(callbacks);

Expand Down Expand Up @@ -76,7 +76,7 @@ export class MessageConverter extends RecordConverter<IImportMessageRecord> {
}
}

protected async convertRecord(record: IImportMessageRecord): Promise<boolean> {
protected override async convertRecord(record: IImportMessageRecord): Promise<boolean> {
await this.insertMessage(record.data);
return true;
}
Expand Down Expand Up @@ -257,7 +257,7 @@ export class MessageConverter extends RecordConverter<IImportMessageRecord> {
}
}

protected getDataType(): 'message' {
protected override getDataType(): 'message' {
return 'message';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class RoomConverter extends RecordConverter<IImportChannelRecord> {
return this.convertData(callbacks);
}

protected async convertRecord(record: IImportChannelRecord): Promise<boolean> {
protected override async convertRecord(record: IImportChannelRecord): Promise<boolean> {
const { data } = record;

if (!data.name && data.t !== 'd') {
Expand Down Expand Up @@ -193,7 +193,7 @@ export class RoomConverter extends RecordConverter<IImportChannelRecord> {
throw new Error('importer-channel-invalid-creator');
}

protected getDataType(): 'channel' {
protected override getDataType(): 'channel' {
return 'channel';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class UserConverter extends RecordConverter<IImportUserRecord, UserConver

private updatedIds = new Set<IUser['_id']>();

protected async convertRecord(record: IImportUserRecord): Promise<boolean | undefined> {
protected override async convertRecord(record: IImportUserRecord): Promise<boolean | undefined> {
const { data, _id } = record;

data.importIds = data.importIds.filter((item) => item);
Expand All @@ -55,7 +55,7 @@ export class UserConverter extends RecordConverter<IImportUserRecord, UserConver
return !existingUser;
}

async convertData(userCallbacks: IConversionCallbacks = {}): Promise<void> {
override async convertData(userCallbacks: IConversionCallbacks = {}): Promise<void> {
this.insertedIds.clear();
this.updatedIds.clear();

Expand Down Expand Up @@ -424,7 +424,7 @@ export class UserConverter extends RecordConverter<IImportUserRecord, UserConver
.replace(/^\w/, (u) => u.toUpperCase());
}

protected getDataType(): 'user' {
protected override getDataType(): 'user' {
return 'user';
}
}
10 changes: 5 additions & 5 deletions apps/meteor/app/integrations/server/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ async function executeIntegrationRest(
});
return API.v1.success();
}
if (result && result.error) {
if (result?.error) {
return API.v1.failure(result.error);
}

Expand Down Expand Up @@ -312,7 +312,7 @@ function integrationInfoRest(): { statusCode: number; body: { success: boolean }
}

class WebHookAPI extends APIClass<'/hooks'> {
async authenticatedRoute(this: IntegrationThis): Promise<IUser | null> {
override async authenticatedRoute(this: IntegrationThis): Promise<IUser | null> {
const { integrationId, token } = this.urlParams;
const integration = await Integrations.findOneByIdAndToken<IIncomingIntegration>(integrationId, decodeURIComponent(token));

Expand All @@ -327,7 +327,7 @@ class WebHookAPI extends APIClass<'/hooks'> {
return Users.findOneById(this.request.integration.userId);
}

shouldAddRateLimitToRoute(options: { rateLimiterOptions?: RateLimiterOptions | boolean }): boolean {
override shouldAddRateLimitToRoute(options: { rateLimiterOptions?: RateLimiterOptions | boolean }): boolean {
const { rateLimiterOptions } = options;
return (
(typeof rateLimiterOptions === 'object' || rateLimiterOptions === undefined) &&
Expand All @@ -336,14 +336,14 @@ class WebHookAPI extends APIClass<'/hooks'> {
);
}

async shouldVerifyRateLimit(): Promise<boolean> {
override async shouldVerifyRateLimit(): Promise<boolean> {
return (
settings.get('API_Enable_Rate_Limiter') === true &&
(process.env.NODE_ENV !== 'development' || settings.get('API_Enable_Rate_Limiter_Dev') === true)
);
}

async enforceRateLimit(
override async enforceRateLimit(
objectForRateLimitMatch: RateLimiterOptionsToCheck,
request: Request,
response: Response,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { validators } from './roomAccessValidator.compatibility';
export class AuthorizationLivechat extends ServiceClassInternal implements IAuthorizationLivechat {
protected name = 'authorization-livechat';

protected internal = true;
protected override internal = true;

async canAccessRoom(room: IOmnichannelRoom, user?: Pick<IUser, '_id'>, extraData?: object): Promise<boolean> {
for await (const validator of validators) {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/notifications/server/lib/Presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class StreamPresence {
// eslint-disable-next-line @typescript-eslint/naming-convention
static getInstance(Streamer: IStreamerConstructor, name = 'user-presence'): IStreamer<'user-presence'> {
return new (class StreamPresence extends Streamer<'user-presence'> {
async _publish(
override async _publish(
publication: IPublication,
_eventName: string,
options: boolean | { useCollection?: boolean; args?: any } = false,
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/search/server/search.internalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { settings } from '../../settings/server';
class Search extends ServiceClassInternal {
protected name = 'search';

protected internal = true;
protected override internal = true;

constructor() {
super();
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/settings/server/CachedSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class CachedSettings
* @param _id - The setting id
* @returns {boolean}
*/
public has(_id: ISetting['_id']): boolean {
public override has(_id: ISetting['_id']): boolean {
if (!this.ready && warn) {
SystemLogger.warn(`Settings not initialized yet. getting: ${_id}`);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/utils/client/lib/RestApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { invokeTwoFactorModal } from '../../../../client/lib/2fa/process2faRetur
import { baseURI } from '../../../../client/lib/baseURI';

class RestApiClient extends RestClient {
getCredentials():
override getCredentials():
| {
'X-User-Id': string;
'X-Auth-Token': string;
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/cachedStores/RoomsCachedStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class RoomsCachedStore extends PrivateCachedStore<IRoom> {
);
}

protected deserializeFromCache(record: unknown) {
protected override deserializeFromCache(record: unknown) {
const deserialized = super.deserializeFromCache(record);

if (deserialized?.lastMessage?._updatedAt) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class SubscriptionsCachedStore extends PrivateCachedStore<SubscriptionWithRoom,
return this.handleRecordEvent('changed', record);
}

protected deserializeFromCache(record: unknown) {
protected override deserializeFromCache(record: unknown) {
const deserialized = super.deserializeFromCache(record);

if (deserialized?.lastMessage?._updatedAt) {
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/lib/lists/DiscussionsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class DiscussionsList extends MessageList<IDiscussionMessage> {
this.clear();
}

protected filter(message: IMessage): boolean {
protected override filter(message: IMessage): boolean {
const { rid } = this._options;

if (!isDiscussionMessageInRoom(message, rid)) {
Expand All @@ -46,7 +46,7 @@ export class DiscussionsList extends MessageList<IDiscussionMessage> {
return true;
}

protected compare(a: IMessage, b: IMessage): number {
protected override compare(a: IMessage, b: IMessage): number {
return (b.tlm ?? b.ts).getTime() - (a.tlm ?? a.ts).getTime();
}
}
2 changes: 1 addition & 1 deletion apps/meteor/client/lib/lists/FilesList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class FilesList extends RecordList<IUpload> {
this.clear();
}

protected filter(message: IUpload): boolean {
protected override filter(message: IUpload): boolean {
const { rid } = this._options;

if (!isFileMessageInRoom(message, rid)) {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/lib/lists/ImagesList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ImagesList extends RecordList<IUpload> {
this.clear();
}

protected filter(message: IUpload): boolean {
protected override filter(message: IUpload): boolean {
const { roomId } = this._options;

if (!isFileMessageInRoom(message, roomId)) {
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/lib/lists/MessageList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import type { IMessage } from '@rocket.chat/core-typings';
import { RecordList } from './RecordList';

export class MessageList<T extends IMessage = IMessage> extends RecordList<T> {
protected filter(message: T): boolean {
protected override filter(message: T): boolean {
return message._hidden !== true;
}

protected compare(a: T, b: T): number {
protected override compare(a: T, b: T): number {
return a.ts.getTime() - b.ts.getTime();
}
}
4 changes: 2 additions & 2 deletions apps/meteor/client/lib/lists/ThreadsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class ThreadsList extends MessageList<IThreadMainMessage> {
this.clear();
}

protected filter(message: IThreadMainMessage): boolean {
protected override filter(message: IThreadMainMessage): boolean {
const { rid } = this._options;

if (!isThreadMessageInRoom(message, rid)) {
Expand Down Expand Up @@ -77,7 +77,7 @@ export class ThreadsList extends MessageList<IThreadMainMessage> {
return true;
}

protected compare(a: IThreadMainMessage, b: IThreadMainMessage): number {
protected override compare(a: IThreadMainMessage, b: IThreadMainMessage): number {
return (b.tlm ?? b.ts).getTime() - (a.tlm ?? a.ts).getTime();
}
}
4 changes: 2 additions & 2 deletions apps/meteor/client/lib/rooms/roomCoordinator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class RoomCoordinatorClient extends RoomCoordinator {
}
}

protected validateRoomConfig(roomConfig: IRoomTypeClientConfig): void {
protected override validateRoomConfig(roomConfig: IRoomTypeClientConfig): void {
super.validateRoomConfig(roomConfig);

const { route, label } = roomConfig;
Expand All @@ -170,7 +170,7 @@ class RoomCoordinatorClient extends RoomCoordinator {
}
}

protected addRoomType(roomConfig: IRoomTypeClientConfig, directives: IRoomTypeClientDirectives): void {
protected override addRoomType(roomConfig: IRoomTypeClientConfig, directives: IRoomTypeClientDirectives): void {
super.addRoomType(roomConfig, directives);

if (roomConfig.route?.path && roomConfig.route.name && directives.extractOpenRoomParams) {
Expand Down
Loading
Loading