Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/blue-pugs-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

Fixes integration saving error because of missing babel dependencies inside the docker container
2 changes: 1 addition & 1 deletion .github/actions/meteor-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ runs:
"meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-x64-musl" # Removes 58M
"meteor/babel-compiler/node_modules/@meteorjs/swc-core/.swc/node_modules/@swc/core-linux-arm64-musl" # Removes 44M
"meteor/babel-compiler/node_modules/typescript" # Removes 31M
"meteor/babel-compiler/node_modules/@babel" # Removes 14M
# "meteor/babel-compiler/node_modules/@babel" # Removes 14M
"@rocket.chat/i18n/src" # Removes 16M
"typescript" # Removes 19M
Expand Down
47 changes: 47 additions & 0 deletions apps/meteor/tests/end-to-end/api/incoming-integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,53 @@ describe('[Incoming Integrations]', () => {

await removeIntegration(withScript._id, 'incoming');
});

describe('With manage-own-incoming-integrations permission', () => {
let integrationId: string;

before(async () => {
await updatePermission('manage-own-incoming-integrations', ['admin']);
});

after(async () => {
if (integrationId) {
await removeIntegration(integrationId, 'incoming');
}
});

it('should return scriptCompiled and no scriptError', async () => {
const res = await request
.post(api('integrations.create'))
.set(credentials)
.send({
type: 'webhook-incoming',
name: 'Incoming test',
enabled: true,
alias: 'test',
username: 'rocket.cat',
scriptEnabled: true,
scriptEngine: 'isolated-vm',
channel: '#general',
script: `
class Script {
process_incoming_request({ request }) {
return {
content:{
text: request.content.text
}
};
}
}
`,
})
.expect(200);

expect(res.body.integration).to.have.property('scriptCompiled');
expect(res.body.integration).to.not.have.property('scriptError');

integrationId = res.body.integration._id;
});
});
});

describe('[/integrations.history]', () => {
Expand Down
Loading