Skip to content

Commit

Permalink
CR suggestions: Move type out of core package
Browse files Browse the repository at this point in the history
  • Loading branch information
murtaza98 committed May 24, 2022
1 parent c61d590 commit 3d3d470
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { IRoomClosingInfo, IOmniRoomClosingMessage } from '@rocket.chat/core-typings';
import { IRoomClosingInfo } from '@rocket.chat/core-typings';

import { IOmniRoomClosingMessage } from '../../../../../server/services/omnichannel-voip/internalTypes';
import { OmnichannelVoipService } from '../../../../../server/services/omnichannel-voip/service';
import { overwriteClassOnLicense } from '../../../license/server';

Expand Down
4 changes: 4 additions & 0 deletions apps/meteor/server/services/omnichannel-voip/internalTypes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { IMessage } from '@rocket.chat/core-typings';

export type FindVoipRoomsParams = {
agents?: string[];
open?: boolean;
Expand All @@ -13,3 +15,5 @@ export type FindVoipRoomsParams = {
offset?: number;
};
};

export type IOmniRoomClosingMessage = Pick<IMessage, 't' | 'groupable'> & Partial<Pick<IMessage, 'msg'>>;
3 changes: 1 addition & 2 deletions apps/meteor/server/services/omnichannel-voip/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type {
IRoomCreationResponse,
IUser,
ILivechatAgent,
IOmniRoomClosingMessage,
} from '@rocket.chat/core-typings';
import {
ILivechatVisitor,
Expand All @@ -28,7 +27,7 @@ import { UsersRaw } from '../../../app/models/server/raw/Users';
import { VoipRoomsRaw } from '../../../app/models/server/raw/VoipRooms';
import { PbxEventsRaw } from '../../../app/models/server/raw/PbxEvents';
import { sendMessage } from '../../../app/lib/server/functions/sendMessage';
import { FindVoipRoomsParams } from './internalTypes';
import { FindVoipRoomsParams, IOmniRoomClosingMessage } from './internalTypes';
import { api } from '../../sdk/api';
import { calculateOnHoldTimeForRoom } from './helper';

Expand Down
2 changes: 0 additions & 2 deletions packages/core-typings/src/IMessage/IMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,5 +252,3 @@ export type IMessageInbox = IMessage & {

export const isIMessageInbox = (message: IMessage): message is IMessageInbox => 'email' in message;
export const isVoipMessage = (message: IMessage): message is IVoipMessage => 'voipData' in message;

export type IOmniRoomClosingMessage = Pick<IMessage, 't' | 'groupable'> & Partial<Pick<IMessage, 'msg'>>;

0 comments on commit 3d3d470

Please sign in to comment.