-
Notifications
You must be signed in to change notification settings - Fork 13k
feat(apps-engine): adds executeLivechatRoomCreatePrevent event #35486
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
Merged
sampaiodiego
merged 23 commits into
RocketChat:develop
from
alfredodelfabro:feat/pre-room-create-prevent-livechat
Mar 20, 2025
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
73dfc92
feat(apps-engine): adds executeLivechatRoomCreatePrevent event
alfredodelfabro 1a77c8d
Merge remote-tracking branch 'upstream/develop' into feat/pre-room-cr…
alfredodelfabro 22055a1
fix: add LivechatRoom info to executePreLivechatRoomCreatePrevent
alfredodelfabro a8c0f0b
fix: simplifies hook logic
alfredodelfabro 992cf13
fix: keeps default error message when returning a boolean from apps
alfredodelfabro 757f45f
refactor: removes boolean return from apps engine hook
alfredodelfabro 0cadb99
Merge branch 'develop' into feat/pre-room-create-prevent-livechat
alfredodelfabro d1d9463
chore: added just for CI debug
alfredodelfabro 6388d8e
Merge branch 'develop' into feat/pre-room-create-prevent-livechat
alfredodelfabro 570947f
fix: lint
alfredodelfabro ef2df38
Merge branch 'develop' into feat/pre-room-create-prevent-livechat
alfredodelfabro 312b03b
fix: install test app before runs testapi
alfredodelfabro 6a6d6d1
Merge branch 'develop' into feat/pre-room-create-prevent-livechat
alfredodelfabro b04a625
fix: lint
alfredodelfabro c9000c4
Merge branch 'develop' into feat/pre-room-create-prevent-livechat
alfredodelfabro ea1100e
test: install app for API tests
sampaiodiego cac913b
Update packages/apps-engine/src/definition/livechat/IPreLivechatRoomC…
d-gubert 58d51bc
chore: adds changeset
alfredodelfabro c16b0c5
Merge branch 'develop' into feat/pre-room-create-prevent-livechat
d-gubert 3ebbddb
test: check if app is enabled
sampaiodiego c3b0197
test: unify APP_URL constant
sampaiodiego e734fa3
test: run test only on EE
sampaiodiego 4302d5d
Merge remote-tracking branch 'origin/develop' into feat/pre-room-crea…
sampaiodiego File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@rocket.chat/apps-engine': minor | ||
| '@rocket.chat/apps': minor | ||
| '@rocket.chat/meteor': minor | ||
| --- | ||
|
|
||
| Adds the executeLivechatRoomCreatePrevent hook to the Rocket.Chat Apps-Engine to prevent the creation of live chat rooms. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/apps-engine/src/definition/livechat/IPreLivechatRoomCreatePrevent.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { IRead, IHttp, IPersistence } from "../accessors"; | ||
| import { AppMethod } from "../metadata"; | ||
| import { ILivechatRoom } from "./ILivechatRoom"; | ||
|
|
||
| /** | ||
| * Handler called before a livechat room is created. | ||
| * | ||
| * To prevent the room from being created, the app should throw an `AppsEngineException` | ||
| */ | ||
| export interface IPreLivechatRoomCreatePrevent { | ||
| /** | ||
| * Method called *before* a livechat room is created. | ||
| * | ||
| * @param livechatRoom The livechat room which is about to be created | ||
| * @param read An accessor to the environment | ||
| * @param http An accessor to the outside world | ||
| * @param persis An accessor to the App's persistence | ||
| * @param modify An accessor to the modifier | ||
| */ | ||
| [AppMethod.EXECUTE_PRE_LIVECHAT_ROOM_CREATE_PREVENT]( | ||
| room: ILivechatRoom, | ||
| read: IRead, | ||
| http: IHttp, | ||
| persis: IPersistence | ||
| ): Promise<void>; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.