Skip to content

Commit 7e1f8ff

Browse files
d-gubertclaude
andcommitted
refactor(apps): remove AppManager dependency from deno-runtime Room class
room.ts previously imported `AppManager` from the server layer (`@rocket.chat/apps-engine/server/AppManager.ts`) solely to type the private [PrivateManager] symbol field that backs the deprecated `usernames` getter. This created a cross-boundary import from the Deno subprocess into the Node.js host. Replace with a minimal inline `IRoomManager` interface that exposes only the one method actually called: getBridges().getInternalBridge().doGetUsernamesOfRoomById() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 64502db commit 7e1f8ff

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

  • packages/apps/deno-runtime/lib

packages/apps/deno-runtime/lib/room.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms/IRoom.ts';
22
import type { RoomType } from '@rocket.chat/apps-engine/definition/rooms/RoomType.ts';
33
import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser.ts';
4-
import type { AppManager } from '@rocket.chat/apps-engine/server/AppManager.ts';
4+
5+
/** Minimal interface covering the only AppManager capability used by Room */
6+
interface IRoomManager {
7+
getBridges(): {
8+
getInternalBridge(): {
9+
doGetUsernamesOfRoomById(id: string | undefined): Promise<Array<string>>;
10+
};
11+
};
12+
}
513

614
const PrivateManager = Symbol('RoomPrivateManager');
715

@@ -36,7 +44,7 @@ export class Room {
3644

3745
private _USERNAMES: Promise<Array<string>> | undefined;
3846

39-
private [PrivateManager]: AppManager | undefined;
47+
private [PrivateManager]: IRoomManager | undefined;
4048

4149
/**
4250
* @deprecated
@@ -51,7 +59,7 @@ export class Room {
5159

5260
public set usernames(usernames) {}
5361

54-
public constructor(room: IRoom, manager: AppManager) {
62+
public constructor(room: IRoom, manager: IRoomManager) {
5563
Object.assign(this, room);
5664

5765
Object.defineProperty(this, PrivateManager, {

0 commit comments

Comments
 (0)