Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
82765dd
refactor(core-typings): remove `_updatedAt` from `IInstanceStatus`
tassoevan Feb 3, 2026
018e772
refactor(core-typings): reset `_updatedAt` field on `ICustomSound`
tassoevan Feb 4, 2026
4d43b80
refactor(core-typings): reset `_updatedAt` field on `ICustomUserStatus`
tassoevan Feb 4, 2026
4aa2c53
refactor(core-typings): delete `IInquiry`
tassoevan Feb 4, 2026
e579073
refactor(core-typings): reset `_updatedAt` field on `ILivechatBusines…
tassoevan Feb 4, 2026
b34f559
refactor(core-typings): reset `_updatedAt` field on `ILivechatDepartm…
tassoevan Feb 4, 2026
8323d64
refactor: update `ICustomSoundsModel.setName` method to return the up…
tassoevan Feb 6, 2026
30105f1
refactor(core-typings): extend `ICronHistoryItem` to implement `IRock…
tassoevan Feb 6, 2026
6fc2214
refactor(core-typings): update `ISmarshHistory` to extend `IRocketCha…
tassoevan Feb 6, 2026
a91e28a
refactor(core-typings): extend `IEmailMessageHistory` to implement `I…
tassoevan Feb 6, 2026
e8a28d7
refactor(core-typings,model-typings,models): implement `ICredentialTo…
tassoevan Feb 6, 2026
12bf0cf
refactor(core-typings): change `FederationKey` to interface and exten…
tassoevan Feb 6, 2026
45d16ec
refactor(core-typings): extend `IOAuthAuthCode` to implement `IRocket…
tassoevan Feb 6, 2026
b12dfab
refactor(core-typings): extend `IOAuthRefreshToken` to implement `IRo…
tassoevan Feb 6, 2026
b0e38c7
refactor(core-typings): extend `IOAuthAccessToken` to implement `IRoc…
tassoevan Feb 7, 2026
568a29f
refactor(core-typings): update `IWorkspaceCredentials` to extend `IRo…
tassoevan Feb 7, 2026
f702b47
refactor(core-typings): update `IReadReceipt` to extend `IRocketChatR…
tassoevan Feb 7, 2026
9f56fe0
refactor(core-typings): update `IControl` to extend `IRocketChatRecord`
tassoevan Feb 7, 2026
c0b987e
refactor(core-typings): update `IPermission` to extend `IRocketChatRe…
tassoevan Feb 7, 2026
2d062af
refactor(core-typings): update `IServerEvent` to extend `IRocketChatR…
tassoevan Feb 7, 2026
e7f1e1a
refactor(core-typings,models): update `IOEmbedCache` to extend `IRock…
tassoevan Feb 7, 2026
22057ec
refactor(core-typings): add `_updatedAt` field to role objects and up…
tassoevan Feb 7, 2026
717769b
refactor(core-typings): update `ILivechatTag` to extend `IRocketChatR…
tassoevan Feb 8, 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
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,12 @@ Meteor.methods<ServerMethods>({
}

if (soundData.name !== soundData.previousName) {
await CustomSounds.setName(soundData._id, soundData.name);
void api.broadcast('notify.updateCustomSound', {
soundData: {
_id: soundData._id,
name: soundData.name,
extension: soundData.extension,
},
});
const updatedSound = await CustomSounds.setName(soundData._id, soundData.name);
if (updatedSound) {
void api.broadcast('notify.updateCustomSound', {
soundData: updatedSound,
});
}
}

return soundData._id;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { api } from '@rocket.chat/core-services';
import type { RequiredField } from '@rocket.chat/core-typings';
import type { ServerMethods } from '@rocket.chat/ddp-client';
import { CustomSounds } from '@rocket.chat/models';
import { Meteor } from 'meteor/meteor';

import type { ICustomSoundData } from './insertOrUpdateSound';
Expand Down Expand Up @@ -28,8 +29,13 @@ Meteor.methods<ServerMethods>({

return new Promise((resolve) => {
const ws = RocketChatFileCustomSoundsInstance.createWriteStream(`${soundData._id}.${soundData.extension}`, contentType);
ws.on('end', () => {
setTimeout(() => api.broadcast('notify.updateCustomSound', { soundData }), 500);
ws.on('end', async () => {
setTimeout(async () => {
const sound = await CustomSounds.findOneById(soundData._id);
if (sound) {
void api.broadcast('notify.updateCustomSound', { soundData: sound });
}
}, 500);
resolve();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { LivechatBusinessHourTypes } from '@rocket.chat/core-typings';
import moment from 'moment-timezone';
import { ObjectId } from 'mongodb';

export const createDefaultBusinessHourRow = (): ILivechatBusinessHour => {
export const createDefaultBusinessHourRow = (): Omit<ILivechatBusinessHour, '_updatedAt'> => {
const days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
const closedDays = ['Saturday', 'Sunday'];
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ILivechatBusinessHour } from '@rocket.chat/core-typings';
import moment from 'moment';

export const filterBusinessHoursThatMustBeOpened = async (
businessHours: ILivechatBusinessHour[],
businessHours: Omit<ILivechatBusinessHour, '_updatedAt'>[],
): Promise<Pick<ILivechatBusinessHour, '_id' | 'type'>[]> => {
const currentTime = moment(moment().format('dddd:HH:mm:ss'), 'dddd:HH:mm:ss');

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/lib/userStatuses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class UserStatuses implements Iterable<UserStatusDescriptor> {
this.store.set(customUserStatus.id, customUserStatus);
}

public createFromCustom(customUserStatus: ICustomUserStatus): UserStatusDescriptor {
public createFromCustom(customUserStatus: Omit<ICustomUserStatus, '_updatedAt'>): UserStatusDescriptor {
if (!this.isValidType(customUserStatus.statusType)) {
throw new Error('Invalid user status type');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const CustomSoundProvider = ({ children }: CustomSoundProviderProps) => {
const { notificationsSoundVolume, voipRingerVolume } = useUserSoundPreferences();

const { data: list } = useQuery({
queryFn: async () => {
queryFn: async (): Promise<Omit<ICustomSound, '_updatedAt'>[]> => {
const customSoundsList = await sdk.call('listCustomSounds');
if (!customSoundsList.length) {
return defaultSounds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const soundTranslationKeys: Record<string, string> = {
'ringtone': 'Sound_Ringtone',
};

export const defaultSounds: ICustomSound[] = [
export const defaultSounds: Omit<ICustomSound, '_updatedAt'>[] = [
{ _id: 'chime', name: 'Sound_Chime', extension: 'mp3', src: getAssetUrl('sounds/chime.mp3') },
{ _id: 'door', name: 'Sound_Door', extension: 'mp3', src: getAssetUrl('sounds/door.mp3') },
{ _id: 'beep', name: 'Sound_Beep', extension: 'mp3', src: getAssetUrl('sounds/beep.mp3') },
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/startup/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Meteor.startup(() => {
onLoggedIn(async () => {
const { roles } = await sdk.rest.get('/v1/roles.list');
// if a role is checked before this collection is populated, it will return undefined
Roles.state.replaceAll(roles);
Roles.state.replaceAll(roles.map((role) => ({ ...role, _updatedAt: new Date(role._updatedAt) })));
});

type ClientAction = 'inserted' | 'updated' | 'removed' | 'changed';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ const roles: IRole[] = [
protected: true,
scope: 'Users',
_id: 'owner',
_updatedAt: new Date(),
},
{
description: 'Administrator',
name: 'admin',
protected: true,
scope: 'Users',
_id: 'admin',
_updatedAt: new Date(),
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,55 +24,63 @@ const roles: IRole[] = [
protected: true,
scope: 'Users',
_id: 'owner',
_updatedAt: new Date(),
},
{
description: 'Administrator',
name: 'admin',
protected: true,
scope: 'Users',
_id: 'admin',
_updatedAt: new Date(),
},
{
description: 'Leader',
name: 'leader',
protected: false,
scope: 'Subscriptions',
_id: 'leader',
_updatedAt: new Date(),
},
{
description: 'Moderator',
name: 'moderator',
protected: false,
scope: 'Subscriptions',
_id: 'moderator',
_updatedAt: new Date(),
},
{
description: 'User',
name: 'user',
protected: true,
scope: 'Users',
_id: 'user',
_updatedAt: new Date(),
},
{
description: 'Guest',
name: 'guest',
protected: true,
scope: 'Users',
_id: 'guest',
_updatedAt: new Date(),
},
{
description: 'Bot',
name: 'bot',
protected: true,
scope: 'Users',
_id: 'bot',
_updatedAt: new Date(),
},
{
description: 'App',
name: 'app',
protected: true,
scope: 'Users',
_id: 'app',
_updatedAt: new Date(),
},
];

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/admin/users/AdminUserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type AdminUserFormProps = {
onReload: () => void;
context: string;
refetchUserFormData?: () => void;
roleData: { roles: IRole[] } | undefined;
roleData: { roles: Serialized<IRole>[] } | undefined;
roleError: Error | null;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IRole, IUser } from '@rocket.chat/core-typings';
import type { IRole, IUser, Serialized } from '@rocket.chat/core-typings';
import { Box, Callout } from '@rocket.chat/fuselage';
import { useEffectEvent } from '@rocket.chat/fuselage-hooks';
import type { ReactElement } from 'react';
Expand All @@ -12,7 +12,7 @@ type AdminUserFormWithDataProps = {
uid: IUser['_id'];
onReload: () => void;
context: string;
roleData: { roles: IRole[] } | undefined;
roleData: { roles: Serialized<IRole>[] } | undefined;
roleError: Error | null;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { useShowVoipExtension } from '../useShowVoipExtension';

type UsersTableProps = {
tab: AdminUsersTab;
roleData: { roles: IRole[] } | undefined;
roleData: { roles: Serialized<IRole>[] } | undefined;
users: Serialized<DefaultUserInfo>[];
total: number;
isLoading: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IRole } from '@rocket.chat/core-typings';
import type { IRole, Serialized } from '@rocket.chat/core-typings';
import { Box, Icon, Margins, TextInput } from '@rocket.chat/fuselage';
import { useBreakpoints } from '@rocket.chat/fuselage-hooks';
import type { OptionProp } from '@rocket.chat/ui-client';
Expand All @@ -11,7 +11,7 @@ import type { UsersFilters } from '../AdminUsersPage';

type UsersTableFiltersProps = {
setUsersFilters: Dispatch<SetStateAction<UsersFilters>>;
roleData: { roles: IRole[] } | undefined;
roleData: { roles: Serialized<IRole>[] } | undefined;
};

const UsersTableFilters = ({ roleData, setUsersFilters }: UsersTableFiltersProps) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Default.args = {
connected: true,
},
instanceRecord: {
_updatedAt: new Date(),
_createdAt: new Date(),
_id: 'instance-id',
name: 'instance-name',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ const InstancesModal = ({ instances = [], onClose }: InstancesModalProps) => {
>
{formatDateAndTime(instanceRecord?._createdAt)}
</DescriptionListEntry>
<DescriptionListEntry
label={
<>
{t('Instance_Record')} &gt; {t('Updated_at')}
</>
}
>
{formatDateAndTime(instanceRecord?._updatedAt)}
</DescriptionListEntry>
</DescriptionList>
</AccordionItem>
))}
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/omnichannel/tags/TagEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type TagEditPayload = {
};

type TagEditProps = {
tagData?: ILivechatTag;
tagData?: Serialized<ILivechatTag>;
currentDepartments?: Serialized<ILivechatDepartment>[];
onClose: () => void;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import type { ILivechatTag } from '@rocket.chat/core-typings';
import type { ILivechatTag, Serialized } from '@rocket.chat/core-typings';
import { Callout } from '@rocket.chat/fuselage';
import { ContextualbarSkeletonBody } from '@rocket.chat/ui-client';
import { useTranslation, useEndpoint } from '@rocket.chat/ui-contexts';
import { useEndpoint } from '@rocket.chat/ui-contexts';
import { useQuery } from '@tanstack/react-query';
import { useTranslation } from 'react-i18next';

import TagEdit from './TagEdit';

const TagEditWithDepartmentData = ({ tagData, onClose }: { tagData: ILivechatTag; onClose: () => void }) => {
const t = useTranslation();
const TagEditWithDepartmentData = ({ tagData, onClose }: { tagData: Serialized<ILivechatTag>; onClose: () => void }) => {
const { t } = useTranslation();

const getDepartmentsById = useEndpoint('GET', '/v1/livechat/department.listByIds');
const { data, isPending, isError } = useQuery({
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/ee/server/lib/roles/insertRole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type InsertRoleOptions = {
broadcastUpdate?: boolean;
};

export const insertRoleAsync = async (roleData: Omit<IRole, '_id'>, options: InsertRoleOptions = {}): Promise<IRole> => {
export const insertRoleAsync = async (roleData: Omit<IRole, '_id' | '_updatedAt'>, options: InsertRoleOptions = {}): Promise<IRole> => {
const { name, scope, description, mandatory2fa } = roleData;

if (await Roles.findOneByName(name)) {
Expand Down
6 changes: 5 additions & 1 deletion apps/meteor/ee/server/lib/roles/updateRole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ type UpdateRoleOptions = {
broadcastUpdate?: boolean;
};

export const updateRole = async (roleId: IRole['_id'], roleData: Omit<IRole, '_id'>, options: UpdateRoleOptions = {}): Promise<IRole> => {
export const updateRole = async (
roleId: IRole['_id'],
roleData: Omit<IRole, '_id' | '_updatedAt'>,
options: UpdateRoleOptions = {},
): Promise<IRole> => {
const role = await Roles.findOneById(roleId);

if (!role) {
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/ee/server/models/raw/LivechatTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class LivechatTagRaw extends BaseRaw<ILivechatTag> implements ILivechatTa
description,
numDepartments: departments.length,
departments,
_updatedAt: new Date(), // TODO: this will be reassigned by the model
};

if (_id) {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/tests/data/livechat/department.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export const archiveDepartment = async (departmentId: string): Promise<void> =>
.expect(200);
};

export const disableDepartment = async (department: ILivechatDepartment): Promise<void> => {
export const disableDepartment = async (department: Omit<ILivechatDepartment, '_updatedAt'>): Promise<void> => {
department.enabled = false;
delete department._updatedAt;
const updatedDepartment = await updateDepartment(department._id, department);
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/tests/mocks/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ export function createFakeTag(overrides?: Partial<Serialized<ILivechatTag>>): Se
description: 'description',
numDepartments: 0,
departments: [],
_updatedAt: new Date().toISOString(),
...overrides,
};
}
Expand Down
3 changes: 1 addition & 2 deletions packages/core-services/src/events/Events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { ISetting as AppsSetting } from '@rocket.chat/apps-engine/definitio
import type {
IEmailInbox,
IEmoji,
IInquiry,
IInstanceStatus,
IIntegration,
IIntegrationHistory,
Expand Down Expand Up @@ -72,7 +71,7 @@ export type EventSignatures = {
'license.sync'(): void;
'license.actions'(actions: Record<Partial<LicenseLimitKind>, boolean>): void;

'livechat-inquiry-queue-observer'(data: { action: string; inquiry: IInquiry }): void;
'livechat-inquiry-queue-observer'(data: { action: string; inquiry: ILivechatInquiryRecord }): void;
'message'(data: { action: string; message: IMessage }): void;
'meteor.clientVersionUpdated'(data: AutoUpdateRecord): void;
'notify.desktop'(uid: string, data: INotificationDesktop): void;
Expand Down
4 changes: 2 additions & 2 deletions packages/core-typings/src/ICredentialToken.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface ICredentialToken {
_id: string;
import type { IRocketChatRecord } from './IRocketChatRecord';

export interface ICredentialToken extends IRocketChatRecord {
userInfo: {
username?: string;
attributes?: any;
Expand Down
5 changes: 3 additions & 2 deletions packages/core-typings/src/ICronHistoryItem.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface ICronHistoryItem {
_id: string;
import type { IRocketChatRecord } from './IRocketChatRecord';

export interface ICronHistoryItem extends IRocketChatRecord {
name: string;
intendedAt: Date;
startedAt: Date;
Expand Down
6 changes: 3 additions & 3 deletions packages/core-typings/src/ICustomSound.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export interface ICustomSound {
_id: string;
import type { IRocketChatRecord } from './IRocketChatRecord';

export interface ICustomSound extends IRocketChatRecord {
name: string;
extension: string;
src?: string;
random?: unknown;
_updatedAt?: Date;
}
5 changes: 2 additions & 3 deletions packages/core-typings/src/ICustomUserStatus.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { IRocketChatRecord } from './IRocketChatRecord';
import type { IUserStatus } from './IUserStatus';

export interface ICustomUserStatus extends IUserStatus {
_updatedAt?: Date;
}
export interface ICustomUserStatus extends IUserStatus, IRocketChatRecord {}
5 changes: 3 additions & 2 deletions packages/core-typings/src/IEmailMessageHistory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface IEmailMessageHistory {
_id: string;
import type { IRocketChatRecord } from './IRocketChatRecord';

export interface IEmailMessageHistory extends IRocketChatRecord {
email: string;
createdAt?: Date;
}
Loading
Loading