Skip to content

Commit

Permalink
Regression: Fix incorrect imports of the Apps-Engine (#17695)
Browse files Browse the repository at this point in the history
* Fix incorrect imports of the Apps-Engine

* Update Apps-Engine dependency modifier
  • Loading branch information
d-gubert authored May 19, 2020
1 parent bbb3133 commit d33d114
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
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

0 comments on commit d33d114

Please sign in to comment.