From 38d0556ac36b1a82d78ad79e0210d6ae9f0a69fd Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Mon, 26 Jan 2026 14:48:58 +0000 Subject: [PATCH] expose more functions --- .../src/collaboration/collaboration.gateway.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/server/src/collaboration/collaboration.gateway.ts b/apps/server/src/collaboration/collaboration.gateway.ts index 676594b9..453681ae 100644 --- a/apps/server/src/collaboration/collaboration.gateway.ts +++ b/apps/server/src/collaboration/collaboration.gateway.ts @@ -144,6 +144,24 @@ export class CollaborationGateway { return this.redisSync?.handleEvent(eventName, documentName, payload); } + openDirectConnection(documentName: string, context?: any) { + return this.hocuspocus.openDirectConnection(documentName, context); + } + + /* + *Can be used before calling openDirectConnection directly + */ + async lockDocument(documentName: string) { + return this.redisSync.lockDocument(documentName); + } + + /* + *Releases a document lock and stops the interval that maintains it. + */ + async releaseLock(documentName: string) { + return this.redisSync.releaseLock(documentName); + } + async destroy(collabWsAdapter: CollabWsAdapter): Promise { // eslint-disable-next-line no-async-promise-executor await new Promise(async (resolve) => {