Skip to content

Commit

Permalink
fix: update type of message bridge's create method (RocketChat#30321)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dnouv committed Sep 8, 2023
1 parent ee3815f commit 9f6efb1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-bees-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': minor
---

New helper for Apps to notify users via a Direct Message
4 changes: 2 additions & 2 deletions apps/meteor/app/apps/server/bridges/messages.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IMessage } from '@rocket.chat/apps-engine/definition/messages';
import type { IMessage, IDirectMessage } from '@rocket.chat/apps-engine/definition/messages';
import type { IRoom } from '@rocket.chat/apps-engine/definition/rooms';
import type { IUser } from '@rocket.chat/apps-engine/definition/users';
import type { ITypingDescriptor } from '@rocket.chat/apps-engine/server/bridges/MessageBridge';
Expand All @@ -17,7 +17,7 @@ export class AppMessageBridge extends MessageBridge {
super();
}

protected async create(message: IMessage, appId: string): Promise<string> {
protected async create(message: IMessage | IDirectMessage, appId: string): Promise<string> {
this.orch.debugLog(`The App ${appId} is creating a new message.`);

const convertedMessage = await this.orch.getConverters()?.get('messages').convertAppMessage(message);
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
"@rocket.chat/account-utils": "workspace:^",
"@rocket.chat/agenda": "workspace:^",
"@rocket.chat/api-client": "workspace:^",
"@rocket.chat/apps-engine": "1.41.0-alpha.312",
"@rocket.chat/apps-engine": "1.41.0-alpha.325",
"@rocket.chat/base64": "workspace:^",
"@rocket.chat/cas-validate": "workspace:^",
"@rocket.chat/core-services": "workspace:^",
Expand Down Expand Up @@ -469,4 +469,4 @@
"installConfig": {
"hoistingLimits": "workspaces"
}
}
}
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7774,21 +7774,21 @@ __metadata:
languageName: node
linkType: hard

"@rocket.chat/apps-engine@npm:1.41.0-alpha.312":
version: 1.41.0-alpha.312
resolution: "@rocket.chat/apps-engine@npm:1.41.0-alpha.312"
"@rocket.chat/apps-engine@npm:1.41.0-alpha.325":
version: 1.41.0-alpha.325
resolution: "@rocket.chat/apps-engine@npm:1.41.0-alpha.325"
dependencies:
adm-zip: ^0.5.9
cryptiles: ^4.1.3
jose: ^4.11.1
lodash.clonedeep: ^4.5.0
semver: ^5.7.1
stack-trace: 0.0.10
uuid: ^3.4.0
uuid: ~8.3.2
vm2: ^3.9.19
peerDependencies:
"@rocket.chat/ui-kit": "*"
checksum: 003853d3c4d4374ab984474026e4ae657daf4591fe4c375b914aa57c27f576af0fcba66e70c539e056b5d80a1ef655775f6f3a07bf81a36ab6fd438ce464e70f
checksum: 3159b69d1174166bfe1fea13ac51e81bc39ddcabad3a8dcd20e4614d33592b7f93ae45625578d7545c149f52f90e9c30dee92a1bbd3f5830f7bcdc13d19fcef4
languageName: node
linkType: hard

Expand Down Expand Up @@ -8520,7 +8520,7 @@ __metadata:
"@rocket.chat/account-utils": "workspace:^"
"@rocket.chat/agenda": "workspace:^"
"@rocket.chat/api-client": "workspace:^"
"@rocket.chat/apps-engine": 1.41.0-alpha.312
"@rocket.chat/apps-engine": 1.41.0-alpha.325
"@rocket.chat/base64": "workspace:^"
"@rocket.chat/cas-validate": "workspace:^"
"@rocket.chat/core-services": "workspace:^"
Expand Down Expand Up @@ -38612,7 +38612,7 @@ __metadata:
languageName: node
linkType: hard

"uuid@npm:^8.0.0, uuid@npm:^8.3.1, uuid@npm:^8.3.2":
"uuid@npm:^8.0.0, uuid@npm:^8.3.1, uuid@npm:^8.3.2, uuid@npm:~8.3.2":
version: 8.3.2
resolution: "uuid@npm:8.3.2"
bin:
Expand Down

0 comments on commit 9f6efb1

Please sign in to comment.