diff --git a/.changeset/blue-pugs-greet.md b/.changeset/blue-pugs-greet.md new file mode 100644 index 0000000000000..e350e872d866f --- /dev/null +++ b/.changeset/blue-pugs-greet.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixes integration saving error because of missing babel dependencies inside the docker container diff --git a/.github/actions/meteor-build/action.yml b/.github/actions/meteor-build/action.yml index 13fe7da5b302a..9466a172cebf7 100644 --- a/.github/actions/meteor-build/action.yml +++ b/.github/actions/meteor-build/action.yml @@ -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 diff --git a/apps/meteor/tests/end-to-end/api/incoming-integrations.ts b/apps/meteor/tests/end-to-end/api/incoming-integrations.ts index bdc1691f79869..3bad5551f3cc1 100644 --- a/apps/meteor/tests/end-to-end/api/incoming-integrations.ts +++ b/apps/meteor/tests/end-to-end/api/incoming-integrations.ts @@ -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]', () => {