Skip to content

Commit 8d90708

Browse files
authored
fix: remove apps-engine dependency on internal package (#36007)
1 parent 6d334f2 commit 8d90708

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

.changeset/stale-walls-move.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@rocket.chat/apps-engine': patch
3+
'@rocket.chat/meteor': patch
4+
---
5+
6+
Fixes the Apps-Engine package installation, removing the dependency on an internal package

apps/meteor/ee/server/apps/storage/AppRealStorage.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { IAppStorageItem } from '@rocket.chat/apps-engine/server/storage';
22
import { AppMetadataStorage } from '@rocket.chat/apps-engine/server/storage';
33
import type { Apps } from '@rocket.chat/models';
4+
import { removeEmpty } from '@rocket.chat/tools';
45
import type { UpdateFilter } from 'mongodb';
56

67
export class AppRealStorage extends AppMetadataStorage {
@@ -18,10 +19,11 @@ export class AppRealStorage extends AppMetadataStorage {
1819
throw new Error('App already exists.');
1920
}
2021

21-
const id = (await this.db.insertOne(item)).insertedId as unknown as string;
22-
item._id = id;
22+
const nonEmptyItem = removeEmpty(item);
23+
const id = (await this.db.insertOne(nonEmptyItem)).insertedId as unknown as string;
24+
nonEmptyItem._id = id;
2325

24-
return item;
26+
return nonEmptyItem;
2527
}
2628

2729
public async retrieveOne(id: string): Promise<IAppStorageItem> {

packages/apps-engine/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
},
9494
"dependencies": {
9595
"@msgpack/msgpack": "3.0.0-beta2",
96-
"@rocket.chat/tools": "workspace:^",
9796
"adm-zip": "^0.5.16",
9897
"debug": "^4.3.7",
9998
"esbuild": "^0.25.0",

packages/apps-engine/src/server/AppManager.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { Buffer } from 'buffer';
22

3-
import { removeEmpty } from '@rocket.chat/tools';
4-
53
import type { IGetAppsFilter } from './IGetAppsFilter';
64
import { ProxiedApp } from './ProxiedApp';
75
import type { PersistenceBridge, UserBridge } from './bridges';
@@ -609,7 +607,7 @@ export class AppManager {
609607
}
610608

611609
descriptor.signature = await this.getSignatureManager().signApp(descriptor);
612-
const created = await this.appMetadataStorage.create(removeEmpty(descriptor));
610+
const created = await this.appMetadataStorage.create(descriptor);
613611

614612
if (!created) {
615613
aff.setStorageError('Failed to create the App, the storage did not return it.');

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7999,7 +7999,6 @@ __metadata:
79997999
dependencies:
80008000
"@msgpack/msgpack": "npm:3.0.0-beta2"
80018001
"@rocket.chat/eslint-config": "workspace:~"
8002-
"@rocket.chat/tools": "workspace:^"
80038002
"@rocket.chat/ui-kit": "workspace:~"
80048003
"@types/adm-zip": "npm:^0.5.6"
80058004
"@types/debug": "npm:^4.1.12"

0 commit comments

Comments
 (0)