Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Fix incorrect imports of the Apps-Engine #17695

Merged
merged 2 commits into from
May 19, 2020
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
7 changes: 3 additions & 4 deletions app/livechat/server/lib/Helper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { AppInterface } from '@rocket.chat/apps-engine/server/compiler';
import { Meteor } from 'meteor/meteor';
import { Match, check } from 'meteor/check';
import { MongoInternals } from 'meteor/mongo';
Expand All @@ -8,7 +7,7 @@ import { Livechat } from './Livechat';
import { RoutingManager } from './RoutingManager';
import { callbacks } from '../../../callbacks/server';
import { settings } from '../../../settings';
import { Apps } from '../../../apps/server';
import { Apps, AppEvents } from '../../../apps/server';

export const createLivechatRoom = (rid, name, guest, roomInfo = {}, extraData = {}) => {
check(rid, String);
Expand Down Expand Up @@ -45,7 +44,7 @@ export const createLivechatRoom = (rid, name, guest, roomInfo = {}, extraData =

const roomId = Rooms.insert(room);

Apps.getBridges().getListenerBridge().livechatEvent(AppInterface.IPostLivechatRoomStarted, room);
Apps.getBridges().getListenerBridge().livechatEvent(AppEvents.IPostLivechatRoomStarted, room);
callbacks.run('livechat.newRoom', room);
return roomId;
};
Expand Down Expand Up @@ -167,7 +166,7 @@ export const removeAgentFromSubscription = (rid, { _id, username }) => {
Subscriptions.removeByRoomIdAndUserId(rid, _id);
Messages.createUserLeaveWithRoomIdAndUser(rid, { _id, username });

Apps.getBridges().getListenerBridge().livechatEvent(AppInterface.IPostLivechatAgentUnassigned, { room, user });
Apps.getBridges().getListenerBridge().livechatEvent(AppEvents.IPostLivechatAgentUnassigned, { room, user });
};

export const parseAgentCustomFields = (customFields) => {
Expand Down
9 changes: 4 additions & 5 deletions app/livechat/server/lib/Livechat.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import dns from 'dns';

import { AppInterface } from '@rocket.chat/apps-engine/server/compiler';
import { Meteor } from 'meteor/meteor';
import { Match, check } from 'meteor/check';
import { Random } from 'meteor/random';
Expand Down Expand Up @@ -38,7 +37,7 @@ import { updateMessage } from '../../../lib/server/functions/updateMessage';
import { deleteMessage } from '../../../lib/server/functions/deleteMessage';
import { FileUpload } from '../../../file-upload/server';
import { normalizeTransferredByData, parseAgentCustomFields } from './Helper';
import { Apps } from '../../../apps/server';
import { Apps, AppEvents } from '../../../apps/server';

export const Livechat = {
Analytics,
Expand Down Expand Up @@ -372,11 +371,11 @@ export const Livechat = {

Meteor.defer(() => {
/**
* @deprecated the `AppInterface.ILivechatRoomClosedHandler` event will be removed
* @deprecated the `AppEvents.ILivechatRoomClosedHandler` event will be removed
* in the next major version of the Apps-Engine
*/
Apps.getBridges().getListenerBridge().livechatEvent(AppInterface.ILivechatRoomClosedHandler, room);
Apps.getBridges().getListenerBridge().livechatEvent(AppInterface.IPostLivechatRoomClosed, room);
Apps.getBridges().getListenerBridge().livechatEvent(AppEvents.ILivechatRoomClosedHandler, room);
Apps.getBridges().getListenerBridge().livechatEvent(AppEvents.IPostLivechatRoomClosed, room);
callbacks.run('livechat.closeRoom', room);
});

Expand Down
5 changes: 2 additions & 3 deletions app/livechat/server/lib/RoutingManager.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { AppInterface } from '@rocket.chat/apps-engine/server/compiler';
import { Meteor } from 'meteor/meteor';
import { Match, check } from 'meteor/check';

Expand All @@ -12,7 +11,7 @@ import { createLivechatSubscription,
} from './Helper';
import { callbacks } from '../../../callbacks/server';
import { LivechatRooms, Rooms, Messages, Users, LivechatInquiry } from '../../../models/server';
import { Apps } from '../../../apps/server';
import { Apps, AppEvents } from '../../../apps/server';

export const RoutingManager = {
methodName: null,
Expand Down Expand Up @@ -81,7 +80,7 @@ export const RoutingManager = {
Messages.createCommandWithRoomIdAndUser('connected', rid, user);
dispatchAgentDelegated(rid, agent.agentId);

Apps.getBridges().getListenerBridge().livechatEvent(AppInterface.IPostLivechatAgentAssigned, { room, user });
Apps.getBridges().getListenerBridge().livechatEvent(AppEvents.IPostLivechatAgentAssigned, { room, user });
return inquiry;
},

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"@nivo/heatmap": "^0.61.0",
"@nivo/line": "^0.61.1",
"@nivo/pie": "^0.61.1",
"@rocket.chat/apps-engine": "^1.15.0-alpha.3394",
"@rocket.chat/apps-engine": "1.15.0-alpha.3394",
"@rocket.chat/fuselage": "^0.6.3-dev.45",
"@rocket.chat/fuselage-hooks": "^0.6.3-dev.35",
"@rocket.chat/fuselage-polyfills": "^0.6.3-dev.45",
Expand Down