From 811a951d29ab023b04839026ae0613f2fddb3615 Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Tue, 6 Sep 2022 12:24:01 -0300 Subject: [PATCH 01/12] Support channelId and channelName params in channels.convertToTeam endpoint --- apps/meteor/app/api/server/v1/channels.ts | 4 ++-- .../src/v1/channels/ChannelsConvertToTeamProps.ts | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/meteor/app/api/server/v1/channels.ts b/apps/meteor/app/api/server/v1/channels.ts index 9816a262d10e2..79d68ea836996 100644 --- a/apps/meteor/app/api/server/v1/channels.ts +++ b/apps/meteor/app/api/server/v1/channels.ts @@ -471,8 +471,8 @@ API.v1.addRoute( const room = findChannelByIdOrName({ params: { - roomId: channelId, - roomName: channelName, + ...(channelId && { roomId: channelId }), + ...(channelName && { roomName: channelName }), }, userId: this.userId, }); diff --git a/packages/rest-typings/src/v1/channels/ChannelsConvertToTeamProps.ts b/packages/rest-typings/src/v1/channels/ChannelsConvertToTeamProps.ts index 8be16da6c6b41..a825549403859 100644 --- a/packages/rest-typings/src/v1/channels/ChannelsConvertToTeamProps.ts +++ b/packages/rest-typings/src/v1/channels/ChannelsConvertToTeamProps.ts @@ -22,6 +22,15 @@ const channelsConvertToTeamPropsSchema = { required: ['channelName'], additionalProperties: false, }, + { + type: 'object', + properties: { + channelId: { type: 'string' }, + channelName: { type: 'string' }, + }, + required: ['channelId', 'channelName'], + additionalProperties: false, + }, ], }; From 1d13bd49896bf6089e80fdfac7b8436cd60883db Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Mon, 12 Sep 2022 12:31:03 -0300 Subject: [PATCH 02/12] Add tests --- .../tests/end-to-end/api/02-channels.js | 4259 +++++++++-------- 1 file changed, 2157 insertions(+), 2102 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/02-channels.js b/apps/meteor/tests/end-to-end/api/02-channels.js index d6e3ef53afc4f..cc00fad8bcebb 100644 --- a/apps/meteor/tests/end-to-end/api/02-channels.js +++ b/apps/meteor/tests/end-to-end/api/02-channels.js @@ -1,2102 +1,2157 @@ -import { expect } from 'chai'; - -import { getCredentials, api, request, credentials, apiPublicChannelName, channel, reservedWords } from '../../data/api-data.js'; -import { adminUsername, password } from '../../data/user.js'; -import { createUser, login } from '../../data/users.helper'; -import { updatePermission, updateSetting } from '../../data/permissions.helper'; -import { createRoom } from '../../data/rooms.helper'; -import { createVisitor } from '../../data/livechat/rooms'; -import { createIntegration, removeIntegration } from '../../data/integration.helper'; - -function getRoomInfo(roomId) { - return new Promise((resolve /* , reject*/) => { - request - .get(api('channels.info')) - .set(credentials) - .query({ - roomId, - }) - .end((err, req) => { - resolve(req.body); - }); - }); -} - -describe('[Channels]', function () { - this.retries(0); - - before((done) => getCredentials(done)); - - before('Creating channel', (done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: apiPublicChannelName, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', 0); - channel._id = res.body.channel._id; - }) - .end(done); - }); - - describe('[/channels.info]', () => { - let testChannel = {}; - let channelMessage = {}; - it('creating new channel...', (done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: apiPublicChannelName, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - testChannel = res.body.channel; - }) - .end(done); - }); - it('should return channel basic structure', (done) => { - request - .get(api('channels.info')) - .set(credentials) - .query({ - roomId: testChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', 0); - }) - .end(done); - }); - it('sending a message...', (done) => { - request - .post(api('chat.sendMessage')) - .set(credentials) - .send({ - message: { - text: 'Sample message', - rid: testChannel._id, - }, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - channelMessage = res.body.message; - }) - .end(done); - }); - it('REACTing with last message', (done) => { - request - .post(api('chat.react')) - .set(credentials) - .send({ - emoji: ':squid:', - messageId: channelMessage._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - it('STARring last message', (done) => { - request - .post(api('chat.starMessage')) - .set(credentials) - .send({ - messageId: channelMessage._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - it('PINning last message', (done) => { - request - .post(api('chat.pinMessage')) - .set(credentials) - .send({ - messageId: channelMessage._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - it('should return channel structure with "lastMessage" object including pin, reaction and star(should be an array) infos', (done) => { - request - .get(api('channels.info')) - .set(credentials) - .query({ - roomId: testChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('channel').and.to.be.an('object'); - const { channel } = res.body; - expect(channel).to.have.property('lastMessage').and.to.be.an('object'); - expect(channel.lastMessage).to.have.property('reactions').and.to.be.an('object'); - expect(channel.lastMessage).to.have.property('pinned').and.to.be.a('boolean'); - expect(channel.lastMessage).to.have.property('pinnedAt').and.to.be.a('string'); - expect(channel.lastMessage).to.have.property('pinnedBy').and.to.be.an('object'); - expect(channel.lastMessage).to.have.property('starred').and.to.be.an('array'); - }) - .end(done); - }); - it('should return all channels messages where the last message of array should have the "star" array with USERS star ONLY', (done) => { - request - .get(api('channels.messages')) - .set(credentials) - .query({ - roomId: testChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('messages').and.to.be.an('array'); - const { messages } = res.body; - const lastMessage = messages.filter((message) => message._id === channelMessage._id)[0]; - expect(lastMessage).to.have.property('starred').and.to.be.an('array'); - expect(lastMessage.starred[0]._id).to.be.equal(adminUsername); - }) - .end(done); - }); - it('should return all channels messages where the last message of array should have the "star" array with USERS star ONLY even requested with count and offset params', (done) => { - request - .get(api('channels.messages')) - .set(credentials) - .query({ - roomId: testChannel._id, - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('messages').and.to.be.an('array'); - const { messages } = res.body; - const lastMessage = messages.filter((message) => message._id === channelMessage._id)[0]; - expect(lastMessage).to.have.property('starred').and.to.be.an('array'); - expect(lastMessage.starred[0]._id).to.be.equal(adminUsername); - }) - .end(done); - }); - }); - - describe('[/channels.online]', () => { - const createUserAndChannel = async () => { - const testUser = await createUser(); - const testUserCredentials = await login(testUser.username, password); - - await request.post(api('users.setStatus')).set(testUserCredentials).send({ - message: '', - status: 'online', - }); - - const roomName = `group-test-${Date.now()}`; - - const roomResponse = await createRoom({ - name: roomName, - type: 'c', - members: [testUser.username], - }); - - return { - testUser, - testUserCredentials, - room: roomResponse.body.channel, - }; - }; - - it('should return an error if no query', () => - request - .get(api('channels.online')) - .set(credentials) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('error', 'Invalid query'); - })); - - it('should return an error if passing an empty query', () => - request - .get(api('channels.online')) - .set(credentials) - .query('query={}') - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('error', 'Invalid query'); - })); - - it('should return an array with online members', async () => { - const { testUser, testUserCredentials, room } = await createUserAndChannel(); - - return request - .get(api('channels.online')) - .set(testUserCredentials) - .query(`query={"_id": "${room._id}"}`) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('online'); - - const expected = { - _id: testUser._id, - username: testUser.username, - }; - expect(res.body.online).to.deep.include(expected); - }); - }); - - it('should return an empty array if requesting user is not in channel', async () => { - const outsider = await createUser(); - const outsiderCredentials = await login(outsider.username, password); - - const { testUser, room } = await createUserAndChannel(); - - return request - .get(api('channels.online')) - .set(outsiderCredentials) - .query(`query={"_id": "${room._id}"}`) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('online'); - - const expected = { - _id: testUser._id, - username: testUser.username, - }; - expect(res.body.online).to.deep.include(expected); - }); - }); - }); - - describe('[/channels.files]', () => { - before(() => updateSetting('VoIP_Enabled', true)); - const createVoipRoom = async () => { - const testUser = await createUser({ roles: ['user', 'livechat-agent'] }); - const testUserCredentials = await login(testUser.username, password); - const visitor = await createVisitor(); - const roomResponse = await createRoom({ - token: visitor.token, - type: 'v', - agentId: testUser._id, - credentials: testUserCredentials, - }); - return roomResponse.body.room; - }; - it('should fail if invalid channel', (done) => { - request - .get(api('channels.files')) - .set(credentials) - .query({ - roomId: 'invalid', - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('errorType', 'error-room-not-found'); - }) - .end(done); - }); - - it('should fail for room type v', async () => { - const { _id } = await createVoipRoom(); - request - .get(api('channels.files')) - .set(credentials) - .query({ - roomId: _id, - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('errorType', 'error-room-not-found'); - }); - }); - - it('should succeed when searching by roomId', (done) => { - request - .get(api('channels.files')) - .set(credentials) - .query({ - roomId: 'GENERAL', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('files').and.to.be.an('array'); - }) - .end(done); - }); - - it('should succeed when searching by roomId even requested with count and offset params', (done) => { - request - .get(api('channels.files')) - .set(credentials) - .query({ - roomId: 'GENERAL', - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('files').and.to.be.an('array'); - }) - .end(done); - }); - - it('should succeed when searching by roomName', (done) => { - request - .get(api('channels.files')) - .set(credentials) - .query({ - roomName: 'general', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('files').and.to.be.an('array'); - }) - .end(done); - }); - - it('should succeed when searching by roomName even requested with count and offset params', (done) => { - request - .get(api('channels.files')) - .set(credentials) - .query({ - roomName: 'general', - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('files').and.to.be.an('array'); - }) - .end(done); - }); - }); - - describe('[/channels.join]', () => { - let testChannelNoCode; - let testChannelWithCode; - let testUser; - let testUserCredentials; - before('Create test user', (done) => { - const username = `user.test.${Date.now()}`; - const email = `${username}@rocket.chat`; - request - .post(api('users.create')) - .set(credentials) - .send({ email, name: username, username, password }) - .end((err, res) => { - testUser = res.body.user; - done(); - }); - }); - before('Login as test user', (done) => { - request - .post(api('login')) - .send({ - user: testUser.username, - password, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - testUserCredentials = {}; - testUserCredentials['X-Auth-Token'] = res.body.data.authToken; - testUserCredentials['X-User-Id'] = res.body.data.userId; - }) - .end(done); - }); - before('Create no code channel', (done) => { - request - .post(api('channels.create')) - .set(testUserCredentials) - .send({ - name: `${apiPublicChannelName}-nojoincode`, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - testChannelNoCode = res.body.channel; - }) - .end(done); - }); - before('Create code channel', (done) => { - request - .post(api('channels.create')) - .set(testUserCredentials) - .send({ - name: `${apiPublicChannelName}-withjoincode`, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - testChannelWithCode = res.body.channel; - }) - .end(done); - }); - before('Set code for channel', (done) => { - request - .post(api('channels.setJoinCode')) - .set(testUserCredentials) - .send({ - roomId: testChannelWithCode._id, - joinCode: '123', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('should fail if invalid channel', (done) => { - request - .post(api('channels.join')) - .set(credentials) - .send({ - roomId: 'invalid', - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('errorType', 'error-room-not-found'); - }) - .end(done); - }); - - it('should succeed when joining code-free channel without join code', (done) => { - request - .post(api('channels.join')) - .set(credentials) - .send({ - roomId: testChannelNoCode._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id', testChannelNoCode._id); - }) - .end(done); - }); - - it('should fail when joining code-needed channel without join code and no join-without-join-code permission', (done) => { - updatePermission('join-without-join-code', []).then(() => { - request - .post(api('channels.join')) - .set(credentials) - .send({ - roomId: testChannelWithCode._id, - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.nested.property('errorType', 'error-code-invalid'); - }) - .end(done); - }); - }); - - it('should succeed when joining code-needed channel without join code and with join-without-join-code permission', (done) => { - updatePermission('join-without-join-code', ['admin']).then(() => { - request - .post(api('channels.join')) - .set(credentials) - .send({ - roomId: testChannelWithCode._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id', testChannelWithCode._id); - }) - .end(done); - }); - }); - - it('leave channel', (done) => { - request - .post(api('channels.leave')) - .set(credentials) - .send({ - roomId: testChannelWithCode._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('should succeed when joining code-needed channel with join code', (done) => { - request - .post(api('channels.join')) - .set(credentials) - .send({ - roomId: testChannelWithCode._id, - joinCode: '123', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id', testChannelWithCode._id); - }) - .end(done); - }); - }); - - it('/channels.invite', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.invite')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - - it('/channels.addModerator', (done) => { - request - .post(api('channels.addModerator')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.removeModerator', (done) => { - request - .post(api('channels.removeModerator')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.addOwner', (done) => { - request - .post(api('channels.addOwner')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.removeOwner', (done) => { - request - .post(api('channels.removeOwner')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.kick', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.kick')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - - it('/channels.invite', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.invite')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - - it('/channels.addOwner', (done) => { - request - .post(api('channels.addOwner')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - describe('/channels.setDescription', () => { - it('should set the description of the channel with a string', (done) => { - request - .post(api('channels.setDescription')) - .set(credentials) - .send({ - roomId: channel._id, - description: 'this is a description for a channel for api tests', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('description', 'this is a description for a channel for api tests'); - }) - .end(done); - }); - it('should set the description of the channel with an empty string(remove the description)', (done) => { - request - .post(api('channels.setDescription')) - .set(credentials) - .send({ - roomId: channel._id, - description: '', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('description', ''); - }) - .end(done); - }); - }); - - describe('/channels.setTopic', () => { - it('should set the topic of the channel with a string', (done) => { - request - .post(api('channels.setTopic')) - .set(credentials) - .send({ - roomId: channel._id, - topic: 'this is a topic of a channel for api tests', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('topic', 'this is a topic of a channel for api tests'); - }) - .end(done); - }); - it('should set the topic of the channel with an empty string(remove the topic)', (done) => { - request - .post(api('channels.setTopic')) - .set(credentials) - .send({ - roomId: channel._id, - topic: '', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('topic', ''); - }) - .end(done); - }); - }); - - describe('/channels.setAnnouncement', () => { - it('should set the announcement of the channel with a string', (done) => { - request - .post(api('channels.setAnnouncement')) - .set(credentials) - .send({ - roomId: channel._id, - announcement: 'this is an announcement of a channel for api tests', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('announcement', 'this is an announcement of a channel for api tests'); - }) - .end(done); - }); - it('should set the announcement of the channel with an empty string(remove the announcement)', (done) => { - request - .post(api('channels.setAnnouncement')) - .set(credentials) - .send({ - roomId: channel._id, - announcement: '', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('announcement', ''); - }) - .end(done); - }); - }); - - describe('/channels.setPurpose', () => { - it('should set the purpose of the channel with a string', (done) => { - request - .post(api('channels.setPurpose')) - .set(credentials) - .send({ - roomId: channel._id, - purpose: 'this is a purpose of a channel for api tests', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('purpose', 'this is a purpose of a channel for api tests'); - }) - .end(done); - }); - it('should set the announcement of channel with an empty string(remove the purpose)', (done) => { - request - .post(api('channels.setPurpose')) - .set(credentials) - .send({ - roomId: channel._id, - purpose: '', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('purpose', ''); - }) - .end(done); - }); - }); - - describe('/channels.history', () => { - it('should return an array of members by channel', (done) => { - request - .get(api('channels.history')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('messages'); - }) - .end(done); - }); - - it('should return an array of members by channel even requested with count and offset params', (done) => { - request - .get(api('channels.history')) - .set(credentials) - .query({ - roomId: channel._id, - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('messages'); - }) - .end(done); - }); - }); - - it('/channels.archive', (done) => { - request - .post(api('channels.archive')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.unarchive', (done) => { - request - .post(api('channels.unarchive')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.close', (done) => { - request - .post(api('channels.close')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.close', (done) => { - request - .post(api('channels.close')) - .set(credentials) - .send({ - roomName: apiPublicChannelName, - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('error', `The channel, ${apiPublicChannelName}, is already closed to the sender`); - }) - .end(done); - }); - - it('/channels.open', (done) => { - request - .post(api('channels.open')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.list', (done) => { - request - .get(api('channels.list')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - }) - .end(done); - }); - - it('/channels.list.joined', (done) => { - request - .get(api('channels.list.joined')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - }) - .end(done); - }); - it('/channels.counters', (done) => { - request - .get(api('channels.counters')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('joined', true); - expect(res.body).to.have.property('members'); - expect(res.body).to.have.property('unreads'); - expect(res.body).to.have.property('unreadsFrom'); - expect(res.body).to.have.property('msgs'); - expect(res.body).to.have.property('latest'); - expect(res.body).to.have.property('userMentions'); - }) - .end(done); - }); - - describe('/channels.members', () => { - it('should return an array of members by channel', (done) => { - request - .get(api('channels.members')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('members').and.to.be.an('array'); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - expect(res.body).to.have.property('offset'); - }) - .end(done); - }); - - it('should return an array of members by channel even requested with count and offset params', (done) => { - request - .get(api('channels.members')) - .set(credentials) - .query({ - roomId: channel._id, - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('members').and.to.be.an('array'); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - expect(res.body).to.have.property('offset'); - }) - .end(done); - }); - - it('should return an filtered array of members by channel', (done) => { - request - .get(api('channels.members')) - .set(credentials) - .query({ - roomId: channel._id, - filter: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('members').and.to.be.an('array'); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('count', 1); - expect(res.body).to.have.property('total'); - expect(res.body).to.have.property('offset'); - }) - .end(done); - }); - }); - - it('/channels.rename', async () => { - const roomInfo = await getRoomInfo(channel._id); - - function failRenameChannel(name) { - it(`should not rename a channel to the reserved name ${name}`, (done) => { - request - .post(api('channels.rename')) - .set(credentials) - .send({ - roomId: channel._id, - name, - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('error', `${name} is already in use :( [error-field-unavailable]`); - }) - .end(done); - }); - } - - reservedWords.forEach((name) => { - failRenameChannel(name); - }); - - return request - .post(api('channels.rename')) - .set(credentials) - .send({ - roomId: channel._id, - name: `EDITED${apiPublicChannelName}`, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - - describe('/channels.getIntegrations', () => { - let integrationCreatedByAnUser; - let userCredentials; - let createdChannel; - before((done) => { - createRoom({ name: `test-integration-channel-${Date.now()}`, type: 'c' }).end((err, res) => { - createdChannel = res.body.channel; - createUser().then((createdUser) => { - const user = createdUser; - login(user.username, password).then((credentials) => { - userCredentials = credentials; - updatePermission('manage-incoming-integrations', ['user']).then(() => { - updatePermission('manage-own-incoming-integrations', ['user']).then(() => { - createIntegration( - { - type: 'webhook-incoming', - name: 'Incoming test', - enabled: true, - alias: 'test', - username: 'rocket.cat', - scriptEnabled: false, - channel: `#${createdChannel.name}`, - }, - userCredentials, - ).then((integration) => { - integrationCreatedByAnUser = integration; - done(); - }); - }); - }); - }); - }); - }); - }); - - after((done) => { - removeIntegration(integrationCreatedByAnUser._id, 'incoming').then(done); - }); - - it('should return the list of integrations of created channel and it should contain the integration created by user when the admin DOES have the permission', (done) => { - updatePermission('manage-incoming-integrations', ['admin']).then(() => { - request - .get(api('channels.getIntegrations')) - .set(credentials) - .query({ - roomId: createdChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - const integrationCreated = res.body.integrations.find( - (createdIntegration) => createdIntegration._id === integrationCreatedByAnUser._id, - ); - expect(integrationCreated).to.be.an('object'); - expect(integrationCreated._id).to.be.equal(integrationCreatedByAnUser._id); - expect(res.body).to.have.property('offset'); - expect(res.body).to.have.property('total'); - }) - .end(done); - }); - }); - - it('should return the list of integrations created by the user only', (done) => { - updatePermission('manage-own-incoming-integrations', ['admin']).then(() => { - updatePermission('manage-incoming-integrations', []).then(() => { - request - .get(api('channels.getIntegrations')) - .set(credentials) - .query({ - roomId: createdChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - const integrationCreated = res.body.integrations.find( - (createdIntegration) => createdIntegration._id === integrationCreatedByAnUser._id, - ); - expect(integrationCreated).to.be.equal(undefined); - expect(res.body).to.have.property('offset'); - expect(res.body).to.have.property('total'); - }) - .end(done); - }); - }); - }); - - it('should return unauthorized error when the user does not have any integrations permissions', (done) => { - updatePermission('manage-incoming-integrations', []).then(() => { - updatePermission('manage-own-incoming-integrations', []).then(() => { - updatePermission('manage-outgoing-integrations', []).then(() => { - updatePermission('manage-own-outgoing-integrations', []).then(() => { - request - .get(api('channels.getIntegrations')) - .set(credentials) - .query({ - roomId: createdChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(403) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('error', 'unauthorized'); - }) - .end(done); - }); - }); - }); - }); - }); - }); - - it('/channels.addAll', (done) => { - request - .post(api('channels.addAll')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'c'); - }) - .end(done); - }); - - it('/channels.addLeader', (done) => { - request - .post(api('channels.addLeader')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) - .end(done); - }); - it('/channels.removeLeader', (done) => { - request - .post(api('channels.removeLeader')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - describe('/channels.setCustomFields:', () => { - let cfchannel; - it('create channel with customFields', (done) => { - const customFields = { field0: 'value0' }; - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: `channel.cf.${Date.now()}`, - customFields, - }) - .end((err, res) => { - cfchannel = res.body.channel; - done(); - }); - }); - it('get customFields using channels.info', (done) => { - request - .get(api('channels.info')) - .set(credentials) - .query({ - roomId: cfchannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel.customFields.field0', 'value0'); - }) - .end(done); - }); - it('change customFields', async () => { - const customFields = { field9: 'value9' }; - return request - .post(api('channels.setCustomFields')) - .set(credentials) - .send({ - roomId: cfchannel._id, - customFields, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', cfchannel.name); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.customFields.field9', 'value9'); - expect(res.body).to.have.not.nested.property('channel.customFields.field0', 'value0'); - }); - }); - it('get customFields using channels.info', (done) => { - request - .get(api('channels.info')) - .set(credentials) - .query({ - roomId: cfchannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel.customFields.field9', 'value9'); - }) - .end(done); - }); - it('delete channels with customFields', (done) => { - request - .post(api('channels.delete')) - .set(credentials) - .send({ - roomName: cfchannel.name, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - it('create channel without customFields', (done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: `channel.cf.${Date.now()}`, - }) - .end((err, res) => { - cfchannel = res.body.channel; - done(); - }); - }); - it('set customFields with one nested field', async () => { - const customFields = { field1: 'value1' }; - return request - .post(api('channels.setCustomFields')) - .set(credentials) - .send({ - roomId: cfchannel._id, - customFields, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', cfchannel.name); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.customFields.field1', 'value1'); - }); - }); - it('set customFields with multiple nested fields', async () => { - const customFields = { field2: 'value2', field3: 'value3', field4: 'value4' }; - - return request - .post(api('channels.setCustomFields')) - .set(credentials) - .send({ - roomName: cfchannel.name, - customFields, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', cfchannel.name); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.customFields.field2', 'value2'); - expect(res.body).to.have.nested.property('channel.customFields.field3', 'value3'); - expect(res.body).to.have.nested.property('channel.customFields.field4', 'value4'); - expect(res.body).to.have.not.nested.property('channel.customFields.field1', 'value1'); - }); - }); - it('set customFields to empty object', (done) => { - const customFields = {}; - - request - .post(api('channels.setCustomFields')) - .set(credentials) - .send({ - roomName: cfchannel.name, - customFields, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', cfchannel.name); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.not.nested.property('channel.customFields.field2', 'value2'); - expect(res.body).to.have.not.nested.property('channel.customFields.field3', 'value3'); - expect(res.body).to.have.not.nested.property('channel.customFields.field4', 'value4'); - }) - .end(done); - }); - it('set customFields as a string -> should return 400', (done) => { - const customFields = ''; - - request - .post(api('channels.setCustomFields')) - .set(credentials) - .send({ - roomName: cfchannel.name, - customFields, - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - }) - .end(done); - }); - it('delete channel with empty customFields', (done) => { - request - .post(api('channels.delete')) - .set(credentials) - .send({ - roomName: cfchannel.name, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - }); - - it('/channels.setJoinCode', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.setJoinCode')) - .set(credentials) - .send({ - roomId: channel._id, - joinCode: '123', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs); - }); - }); - - it('/channels.setReadOnly', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.setReadOnly')) - .set(credentials) - .send({ - roomId: channel._id, - readOnly: true, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - - it('/channels.setDefault', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.setDefault')) - .set(credentials) - .send({ - roomId: channel._id, - default: true, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs); - }); - }); - - it('/channels.leave', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.leave')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - - describe('/channels.setType', () => { - it('should change the type public channel to private', async () => { - const roomInfo = await getRoomInfo(channel._id); - - request - .post(api('channels.setType')) - .set(credentials) - .send({ - roomId: channel._id, - type: 'p', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'p'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - }); - - describe('/channels.delete:', () => { - let testChannel; - it('/channels.create', (done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: `channel.test.${Date.now()}`, - }) - .end((err, res) => { - testChannel = res.body.channel; - done(); - }); - }); - it('/channels.delete', (done) => { - request - .post(api('channels.delete')) - .set(credentials) - .send({ - roomName: testChannel.name, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - it('/channels.info', (done) => { - request - .get(api('channels.info')) - .set(credentials) - .query({ - roomId: testChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('errorType', 'error-room-not-found'); - }) - .end(done); - }); - }); - - describe('/channels.getAllUserMentionsByChannel', () => { - it('should return an array of mentions by channel', (done) => { - request - .get(api('channels.getAllUserMentionsByChannel')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('mentions').and.to.be.an('array'); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('offset'); - expect(res.body).to.have.property('total'); - }) - .end(done); - }); - it('should return an array of mentions by channel even requested with count and offset params', (done) => { - request - .get(api('channels.getAllUserMentionsByChannel')) - .set(credentials) - .query({ - roomId: channel._id, - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('mentions').and.to.be.an('array'); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('offset'); - expect(res.body).to.have.property('total'); - }) - .end(done); - }); - }); - - describe('/channels.roles', () => { - let testChannel; - it('/channels.create', (done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: `channel.roles.test.${Date.now()}`, - }) - .end((err, res) => { - testChannel = res.body.channel; - done(); - }); - }); - it('/channels.invite', (done) => { - request - .post(api('channels.invite')) - .set(credentials) - .send({ - roomId: testChannel._id, - userId: 'rocket.cat', - }) - .end(done); - }); - it('/channels.addModerator', (done) => { - request - .post(api('channels.addModerator')) - .set(credentials) - .send({ - roomId: testChannel._id, - userId: 'rocket.cat', - }) - .end(done); - }); - it('/channels.addLeader', (done) => { - request - .post(api('channels.addLeader')) - .set(credentials) - .send({ - roomId: testChannel._id, - userId: 'rocket.cat', - }) - .end(done); - }); - it('should return an array of role <-> user relationships in a channel', (done) => { - request - .get(api('channels.roles')) - .set(credentials) - .query({ - roomId: testChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - expect(res.body).to.have.a.property('roles').that.is.an('array').that.has.lengthOf(2); - - expect(res.body.roles[0]).to.have.a.property('_id').that.is.a('string'); - expect(res.body.roles[0]).to.have.a.property('rid').that.is.equal(testChannel._id); - expect(res.body.roles[0]).to.have.a.property('roles').that.is.an('array').that.includes('moderator', 'leader'); - expect(res.body.roles[0]).to.have.a.property('u').that.is.an('object'); - expect(res.body.roles[0].u).to.have.a.property('_id').that.is.a('string'); - expect(res.body.roles[0].u).to.have.a.property('username').that.is.a('string'); - - expect(res.body.roles[1]).to.have.a.property('_id').that.is.a('string'); - expect(res.body.roles[1]).to.have.a.property('rid').that.is.equal(testChannel._id); - expect(res.body.roles[1]).to.have.a.property('roles').that.is.an('array').that.includes('owner'); - expect(res.body.roles[1]).to.have.a.property('u').that.is.an('object'); - expect(res.body.roles[1].u).to.have.a.property('_id').that.is.a('string'); - expect(res.body.roles[1].u).to.have.a.property('username').that.is.a('string'); - }) - .end(done); - }); - }); - - describe('/channels.moderators', () => { - let testChannel; - it('/channels.create', (done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: `channel.roles.test.${Date.now()}`, - }) - .end((err, res) => { - testChannel = res.body.channel; - done(); - }); - }); - it('/channels.invite', (done) => { - request - .post(api('channels.invite')) - .set(credentials) - .send({ - roomId: testChannel._id, - userId: 'rocket.cat', - }) - .end(done); - }); - it('/channels.addModerator', (done) => { - request - .post(api('channels.addModerator')) - .set(credentials) - .send({ - roomId: testChannel._id, - userId: 'rocket.cat', - }) - .end(done); - }); - it('should return an array of moderators with rocket.cat as a moderator', (done) => { - request - .get(api('channels.moderators')) - .set(credentials) - .query({ - roomId: testChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - expect(res.body).to.have.a.property('moderators').that.is.an('array').that.has.lengthOf(1); - expect(res.body.moderators[0].username).to.be.equal('rocket.cat'); - }) - .end(done); - }); - }); - describe('/channels.anonymousread', () => { - after(() => updateSetting('Accounts_AllowAnonymousRead', false)); - it('should return an error when the setting "Accounts_AllowAnonymousRead" is disabled', (done) => { - updateSetting('Accounts_AllowAnonymousRead', false).then(() => { - request - .get(api('channels.anonymousread')) - .query({ - roomId: 'GENERAL', - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.a.property('success', false); - expect(res.body).to.have.a.property('error'); - expect(res.body).to.have.a.property('errorType'); - expect(res.body.errorType).to.be.equal('error-not-allowed'); - expect(res.body.error).to.be.equal('Enable "Allow Anonymous Read" [error-not-allowed]'); - }) - .end(done); - }); - }); - it('should return the messages list when the setting "Accounts_AllowAnonymousRead" is enabled', (done) => { - updateSetting('Accounts_AllowAnonymousRead', true).then(() => { - request - .get(api('channels.anonymousread')) - .query({ - roomId: 'GENERAL', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - expect(res.body).to.have.a.property('messages').that.is.an('array'); - }) - .end(done); - }); - }); - it('should return the messages list when the setting "Accounts_AllowAnonymousRead" is enabled even requested with count and offset params', (done) => { - updateSetting('Accounts_AllowAnonymousRead', true).then(() => { - request - .get(api('channels.anonymousread')) - .query({ - roomId: 'GENERAL', - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - expect(res.body).to.have.a.property('messages').that.is.an('array'); - }) - .end(done); - }); - }); - }); - - describe('/channels.convertToTeam', () => { - before((done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ name: `channel-${Date.now()}` }) - .then((response) => { - this.newChannel = response.body.channel; - }) - .then(() => done()); - }); - - it('should fail to convert channel if lacking edit-room permission', (done) => { - updatePermission('create-team', []).then(() => { - updatePermission('edit-room', ['admin']).then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(403) - .expect((res) => { - expect(res.body).to.have.a.property('success', false); - }) - .end(done); - }); - }); - }); - - it('should fail to convert channel if lacking create-team permission', (done) => { - updatePermission('create-team', ['admin']).then(() => { - updatePermission('edit-room', []).then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(403) - .expect((res) => { - expect(res.body).to.have.a.property('success', false); - }) - .end(done); - }); - }); - }); - - it('should successfully convert a channel to a team', (done) => { - updatePermission('create-team', ['admin']).then(() => { - updatePermission('edit-room', ['admin']).then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) - .end(done); - }); - }); - }); - - it('should fail to convert channel without the required parameters', (done) => { - request.post(api('channels.convertToTeam')).set(credentials).send({}).expect(400).end(done); - }); - - it("should fail to convert channel if it's already taken", (done) => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(400) - .expect((res) => { - expect(res.body).to.have.a.property('success', false); - }) - .end(done); - }); - }); - - describe.skip('/channels.setAutojoin', () => { - // let testTeam; - let testChannel; - // let testUser1; - // let testUser2; - before(async () => { - const teamCreateRes = await request - .post(api('teams.create')) - .set(credentials) - .send({ name: `team-${Date.now()}` }); - - const { team } = teamCreateRes.body; - - const user1 = await createUser(); - const user2 = await createUser(); - - const channelCreateRes = await request - .post(api('channels.create')) - .set(credentials) - .send({ - name: `team-channel-${Date.now()}`, - extraData: { - teamId: team._id, - }, - }); - - const { channel } = channelCreateRes.body; - - // testTeam = team; - testChannel = channel; - // testUser1 = user1; - // testUser2 = user2; - - await request - .post(api('teams.addMembers')) - .set(credentials) - .send({ - name: team.name, - members: [{ userId: user1._id }, { userId: user2._id }], - }); - }); - - it('should add all existing team members', async () => { - const resAutojoin = await request - .post(api('channels.setAutojoin')) - .set(credentials) - .send({ roomName: testChannel.name, autojoin: true }) - .expect(200); - expect(resAutojoin.body).to.have.a.property('success', true); - - const channelInfoResponse = await request.get(api('channels.info')).set(credentials).query({ roomId: testChannel._id }); - const { channel } = channelInfoResponse.body; - - return expect(channel.usersCount).to.be.equals(3); - }); - }); - - context("Setting: 'Use Real Name': true", () => { - before(async () => { - await updateSetting('UI_Use_Real_Name', true); - - await request - .post(api('channels.join')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id', channel._id); - }); - - await request - .post(api('chat.sendMessage')) - .set(credentials) - .send({ - message: { - text: 'Sample message', - rid: channel._id, - }, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }); - }); - after(async () => { - await updateSetting('UI_Use_Real_Name', false); - - await request - .post(api('channels.leave')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id', channel._id); - }); - }); - - it('/channels.list', (done) => { - request - .get(api('channels.list')) - .set(credentials) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - expect(res.body).to.have.property('channels').and.to.be.an('array'); - - const retChannel = res.body.channels.find(({ _id }) => _id === channel._id); - - expect(retChannel).to.have.nested.property('lastMessage.u.name', 'RocketChat Internal Admin Test'); - }) - .end(done); - }); - - it('/channels.list.joined', (done) => { - request - .get(api('channels.list.joined')) - .set(credentials) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - expect(res.body).to.have.property('channels').and.to.be.an('array'); - - const retChannel = res.body.channels.find(({ _id }) => _id === channel._id); - - expect(retChannel).to.have.nested.property('lastMessage.u.name', 'RocketChat Internal Admin Test'); - }) - .end(done); - }); - }); -}); +import { expect } from 'chai'; + +import { getCredentials, api, request, credentials, apiPublicChannelName, channel, reservedWords } from '../../data/api-data.js'; +import { adminUsername, password } from '../../data/user.js'; +import { createUser, login } from '../../data/users.helper'; +import { updatePermission, updateSetting } from '../../data/permissions.helper'; +import { createRoom } from '../../data/rooms.helper'; +import { createVisitor } from '../../data/livechat/rooms'; +import { createIntegration, removeIntegration } from '../../data/integration.helper'; + +function getRoomInfo(roomId) { + return new Promise((resolve /* , reject*/) => { + request + .get(api('channels.info')) + .set(credentials) + .query({ + roomId, + }) + .end((err, req) => { + resolve(req.body); + }); + }); +} + +describe('[Channels]', function () { + this.retries(0); + + before((done) => getCredentials(done)); + + before('Creating channel', (done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: apiPublicChannelName, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', 0); + channel._id = res.body.channel._id; + }) + .end(done); + }); + + describe('[/channels.info]', () => { + let testChannel = {}; + let channelMessage = {}; + it('creating new channel...', (done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: apiPublicChannelName, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + testChannel = res.body.channel; + }) + .end(done); + }); + it('should return channel basic structure', (done) => { + request + .get(api('channels.info')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', 0); + }) + .end(done); + }); + it('sending a message...', (done) => { + request + .post(api('chat.sendMessage')) + .set(credentials) + .send({ + message: { + text: 'Sample message', + rid: testChannel._id, + }, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + channelMessage = res.body.message; + }) + .end(done); + }); + it('REACTing with last message', (done) => { + request + .post(api('chat.react')) + .set(credentials) + .send({ + emoji: ':squid:', + messageId: channelMessage._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + it('STARring last message', (done) => { + request + .post(api('chat.starMessage')) + .set(credentials) + .send({ + messageId: channelMessage._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + it('PINning last message', (done) => { + request + .post(api('chat.pinMessage')) + .set(credentials) + .send({ + messageId: channelMessage._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + it('should return channel structure with "lastMessage" object including pin, reaction and star(should be an array) infos', (done) => { + request + .get(api('channels.info')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('channel').and.to.be.an('object'); + const { channel } = res.body; + expect(channel).to.have.property('lastMessage').and.to.be.an('object'); + expect(channel.lastMessage).to.have.property('reactions').and.to.be.an('object'); + expect(channel.lastMessage).to.have.property('pinned').and.to.be.a('boolean'); + expect(channel.lastMessage).to.have.property('pinnedAt').and.to.be.a('string'); + expect(channel.lastMessage).to.have.property('pinnedBy').and.to.be.an('object'); + expect(channel.lastMessage).to.have.property('starred').and.to.be.an('array'); + }) + .end(done); + }); + it('should return all channels messages where the last message of array should have the "star" array with USERS star ONLY', (done) => { + request + .get(api('channels.messages')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages').and.to.be.an('array'); + const { messages } = res.body; + const lastMessage = messages.filter((message) => message._id === channelMessage._id)[0]; + expect(lastMessage).to.have.property('starred').and.to.be.an('array'); + expect(lastMessage.starred[0]._id).to.be.equal(adminUsername); + }) + .end(done); + }); + it('should return all channels messages where the last message of array should have the "star" array with USERS star ONLY even requested with count and offset params', (done) => { + request + .get(api('channels.messages')) + .set(credentials) + .query({ + roomId: testChannel._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages').and.to.be.an('array'); + const { messages } = res.body; + const lastMessage = messages.filter((message) => message._id === channelMessage._id)[0]; + expect(lastMessage).to.have.property('starred').and.to.be.an('array'); + expect(lastMessage.starred[0]._id).to.be.equal(adminUsername); + }) + .end(done); + }); + }); + + describe('[/channels.online]', () => { + const createUserAndChannel = async () => { + const testUser = await createUser(); + const testUserCredentials = await login(testUser.username, password); + + await request.post(api('users.setStatus')).set(testUserCredentials).send({ + message: '', + status: 'online', + }); + + const roomName = `group-test-${Date.now()}`; + + const roomResponse = await createRoom({ + name: roomName, + type: 'c', + members: [testUser.username], + }); + + return { + testUser, + testUserCredentials, + room: roomResponse.body.channel, + }; + }; + + it('should return an error if no query', () => + request + .get(api('channels.online')) + .set(credentials) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error', 'Invalid query'); + })); + + it('should return an error if passing an empty query', () => + request + .get(api('channels.online')) + .set(credentials) + .query('query={}') + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error', 'Invalid query'); + })); + + it('should return an array with online members', async () => { + const { testUser, testUserCredentials, room } = await createUserAndChannel(); + + return request + .get(api('channels.online')) + .set(testUserCredentials) + .query(`query={"_id": "${room._id}"}`) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('online'); + + const expected = { + _id: testUser._id, + username: testUser.username, + }; + expect(res.body.online).to.deep.include(expected); + }); + }); + + it('should return an empty array if requesting user is not in channel', async () => { + const outsider = await createUser(); + const outsiderCredentials = await login(outsider.username, password); + + const { testUser, room } = await createUserAndChannel(); + + return request + .get(api('channels.online')) + .set(outsiderCredentials) + .query(`query={"_id": "${room._id}"}`) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('online'); + + const expected = { + _id: testUser._id, + username: testUser.username, + }; + expect(res.body.online).to.deep.include(expected); + }); + }); + }); + + describe('[/channels.files]', () => { + before(() => updateSetting('VoIP_Enabled', true)); + const createVoipRoom = async () => { + const testUser = await createUser({ roles: ['user', 'livechat-agent'] }); + const testUserCredentials = await login(testUser.username, password); + const visitor = await createVisitor(); + const roomResponse = await createRoom({ + token: visitor.token, + type: 'v', + agentId: testUser._id, + credentials: testUserCredentials, + }); + return roomResponse.body.room; + }; + it('should fail if invalid channel', (done) => { + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomId: 'invalid', + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('errorType', 'error-room-not-found'); + }) + .end(done); + }); + + it('should fail for room type v', async () => { + const { _id } = await createVoipRoom(); + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomId: _id, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('errorType', 'error-room-not-found'); + }); + }); + + it('should succeed when searching by roomId', (done) => { + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomId: 'GENERAL', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('files').and.to.be.an('array'); + }) + .end(done); + }); + + it('should succeed when searching by roomId even requested with count and offset params', (done) => { + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomId: 'GENERAL', + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('files').and.to.be.an('array'); + }) + .end(done); + }); + + it('should succeed when searching by roomName', (done) => { + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomName: 'general', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('files').and.to.be.an('array'); + }) + .end(done); + }); + + it('should succeed when searching by roomName even requested with count and offset params', (done) => { + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomName: 'general', + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('files').and.to.be.an('array'); + }) + .end(done); + }); + }); + + describe('[/channels.join]', () => { + let testChannelNoCode; + let testChannelWithCode; + let testUser; + let testUserCredentials; + before('Create test user', (done) => { + const username = `user.test.${Date.now()}`; + const email = `${username}@rocket.chat`; + request + .post(api('users.create')) + .set(credentials) + .send({ email, name: username, username, password }) + .end((err, res) => { + testUser = res.body.user; + done(); + }); + }); + before('Login as test user', (done) => { + request + .post(api('login')) + .send({ + user: testUser.username, + password, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + testUserCredentials = {}; + testUserCredentials['X-Auth-Token'] = res.body.data.authToken; + testUserCredentials['X-User-Id'] = res.body.data.userId; + }) + .end(done); + }); + before('Create no code channel', (done) => { + request + .post(api('channels.create')) + .set(testUserCredentials) + .send({ + name: `${apiPublicChannelName}-nojoincode`, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + testChannelNoCode = res.body.channel; + }) + .end(done); + }); + before('Create code channel', (done) => { + request + .post(api('channels.create')) + .set(testUserCredentials) + .send({ + name: `${apiPublicChannelName}-withjoincode`, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + testChannelWithCode = res.body.channel; + }) + .end(done); + }); + before('Set code for channel', (done) => { + request + .post(api('channels.setJoinCode')) + .set(testUserCredentials) + .send({ + roomId: testChannelWithCode._id, + joinCode: '123', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('should fail if invalid channel', (done) => { + request + .post(api('channels.join')) + .set(credentials) + .send({ + roomId: 'invalid', + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('errorType', 'error-room-not-found'); + }) + .end(done); + }); + + it('should succeed when joining code-free channel without join code', (done) => { + request + .post(api('channels.join')) + .set(credentials) + .send({ + roomId: testChannelNoCode._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id', testChannelNoCode._id); + }) + .end(done); + }); + + it('should fail when joining code-needed channel without join code and no join-without-join-code permission', (done) => { + updatePermission('join-without-join-code', []).then(() => { + request + .post(api('channels.join')) + .set(credentials) + .send({ + roomId: testChannelWithCode._id, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.nested.property('errorType', 'error-code-invalid'); + }) + .end(done); + }); + }); + + it('should succeed when joining code-needed channel without join code and with join-without-join-code permission', (done) => { + updatePermission('join-without-join-code', ['admin']).then(() => { + request + .post(api('channels.join')) + .set(credentials) + .send({ + roomId: testChannelWithCode._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id', testChannelWithCode._id); + }) + .end(done); + }); + }); + + it('leave channel', (done) => { + request + .post(api('channels.leave')) + .set(credentials) + .send({ + roomId: testChannelWithCode._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('should succeed when joining code-needed channel with join code', (done) => { + request + .post(api('channels.join')) + .set(credentials) + .send({ + roomId: testChannelWithCode._id, + joinCode: '123', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id', testChannelWithCode._id); + }) + .end(done); + }); + }); + + it('/channels.invite', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.invite')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + + it('/channels.addModerator', (done) => { + request + .post(api('channels.addModerator')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.removeModerator', (done) => { + request + .post(api('channels.removeModerator')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.addOwner', (done) => { + request + .post(api('channels.addOwner')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.removeOwner', (done) => { + request + .post(api('channels.removeOwner')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.kick', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.kick')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + + it('/channels.invite', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.invite')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + + it('/channels.addOwner', (done) => { + request + .post(api('channels.addOwner')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + describe('/channels.setDescription', () => { + it('should set the description of the channel with a string', (done) => { + request + .post(api('channels.setDescription')) + .set(credentials) + .send({ + roomId: channel._id, + description: 'this is a description for a channel for api tests', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('description', 'this is a description for a channel for api tests'); + }) + .end(done); + }); + it('should set the description of the channel with an empty string(remove the description)', (done) => { + request + .post(api('channels.setDescription')) + .set(credentials) + .send({ + roomId: channel._id, + description: '', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('description', ''); + }) + .end(done); + }); + }); + + describe('/channels.setTopic', () => { + it('should set the topic of the channel with a string', (done) => { + request + .post(api('channels.setTopic')) + .set(credentials) + .send({ + roomId: channel._id, + topic: 'this is a topic of a channel for api tests', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('topic', 'this is a topic of a channel for api tests'); + }) + .end(done); + }); + it('should set the topic of the channel with an empty string(remove the topic)', (done) => { + request + .post(api('channels.setTopic')) + .set(credentials) + .send({ + roomId: channel._id, + topic: '', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('topic', ''); + }) + .end(done); + }); + }); + + describe('/channels.setAnnouncement', () => { + it('should set the announcement of the channel with a string', (done) => { + request + .post(api('channels.setAnnouncement')) + .set(credentials) + .send({ + roomId: channel._id, + announcement: 'this is an announcement of a channel for api tests', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('announcement', 'this is an announcement of a channel for api tests'); + }) + .end(done); + }); + it('should set the announcement of the channel with an empty string(remove the announcement)', (done) => { + request + .post(api('channels.setAnnouncement')) + .set(credentials) + .send({ + roomId: channel._id, + announcement: '', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('announcement', ''); + }) + .end(done); + }); + }); + + describe('/channels.setPurpose', () => { + it('should set the purpose of the channel with a string', (done) => { + request + .post(api('channels.setPurpose')) + .set(credentials) + .send({ + roomId: channel._id, + purpose: 'this is a purpose of a channel for api tests', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('purpose', 'this is a purpose of a channel for api tests'); + }) + .end(done); + }); + it('should set the announcement of channel with an empty string(remove the purpose)', (done) => { + request + .post(api('channels.setPurpose')) + .set(credentials) + .send({ + roomId: channel._id, + purpose: '', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('purpose', ''); + }) + .end(done); + }); + }); + + describe('/channels.history', () => { + it('should return an array of members by channel', (done) => { + request + .get(api('channels.history')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages'); + }) + .end(done); + }); + + it('should return an array of members by channel even requested with count and offset params', (done) => { + request + .get(api('channels.history')) + .set(credentials) + .query({ + roomId: channel._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages'); + }) + .end(done); + }); + }); + + it('/channels.archive', (done) => { + request + .post(api('channels.archive')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.unarchive', (done) => { + request + .post(api('channels.unarchive')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.close', (done) => { + request + .post(api('channels.close')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.close', (done) => { + request + .post(api('channels.close')) + .set(credentials) + .send({ + roomName: apiPublicChannelName, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error', `The channel, ${apiPublicChannelName}, is already closed to the sender`); + }) + .end(done); + }); + + it('/channels.open', (done) => { + request + .post(api('channels.open')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.list', (done) => { + request + .get(api('channels.list')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + + it('/channels.list.joined', (done) => { + request + .get(api('channels.list.joined')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + it('/channels.counters', (done) => { + request + .get(api('channels.counters')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('joined', true); + expect(res.body).to.have.property('members'); + expect(res.body).to.have.property('unreads'); + expect(res.body).to.have.property('unreadsFrom'); + expect(res.body).to.have.property('msgs'); + expect(res.body).to.have.property('latest'); + expect(res.body).to.have.property('userMentions'); + }) + .end(done); + }); + + describe('/channels.members', () => { + it('should return an array of members by channel', (done) => { + request + .get(api('channels.members')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('members').and.to.be.an('array'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + }) + .end(done); + }); + + it('should return an array of members by channel even requested with count and offset params', (done) => { + request + .get(api('channels.members')) + .set(credentials) + .query({ + roomId: channel._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('members').and.to.be.an('array'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + }) + .end(done); + }); + + it('should return an filtered array of members by channel', (done) => { + request + .get(api('channels.members')) + .set(credentials) + .query({ + roomId: channel._id, + filter: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('members').and.to.be.an('array'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('count', 1); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + }) + .end(done); + }); + }); + + it('/channels.rename', async () => { + const roomInfo = await getRoomInfo(channel._id); + + function failRenameChannel(name) { + it(`should not rename a channel to the reserved name ${name}`, (done) => { + request + .post(api('channels.rename')) + .set(credentials) + .send({ + roomId: channel._id, + name, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error', `${name} is already in use :( [error-field-unavailable]`); + }) + .end(done); + }); + } + + reservedWords.forEach((name) => { + failRenameChannel(name); + }); + + return request + .post(api('channels.rename')) + .set(credentials) + .send({ + roomId: channel._id, + name: `EDITED${apiPublicChannelName}`, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + + describe('/channels.getIntegrations', () => { + let integrationCreatedByAnUser; + let userCredentials; + let createdChannel; + before((done) => { + createRoom({ name: `test-integration-channel-${Date.now()}`, type: 'c' }).end((err, res) => { + createdChannel = res.body.channel; + createUser().then((createdUser) => { + const user = createdUser; + login(user.username, password).then((credentials) => { + userCredentials = credentials; + updatePermission('manage-incoming-integrations', ['user']).then(() => { + updatePermission('manage-own-incoming-integrations', ['user']).then(() => { + createIntegration( + { + type: 'webhook-incoming', + name: 'Incoming test', + enabled: true, + alias: 'test', + username: 'rocket.cat', + scriptEnabled: false, + channel: `#${createdChannel.name}`, + }, + userCredentials, + ).then((integration) => { + integrationCreatedByAnUser = integration; + done(); + }); + }); + }); + }); + }); + }); + }); + + after((done) => { + removeIntegration(integrationCreatedByAnUser._id, 'incoming').then(done); + }); + + it('should return the list of integrations of created channel and it should contain the integration created by user when the admin DOES have the permission', (done) => { + updatePermission('manage-incoming-integrations', ['admin']).then(() => { + request + .get(api('channels.getIntegrations')) + .set(credentials) + .query({ + roomId: createdChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + const integrationCreated = res.body.integrations.find( + (createdIntegration) => createdIntegration._id === integrationCreatedByAnUser._id, + ); + expect(integrationCreated).to.be.an('object'); + expect(integrationCreated._id).to.be.equal(integrationCreatedByAnUser._id); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + }); + + it('should return the list of integrations created by the user only', (done) => { + updatePermission('manage-own-incoming-integrations', ['admin']).then(() => { + updatePermission('manage-incoming-integrations', []).then(() => { + request + .get(api('channels.getIntegrations')) + .set(credentials) + .query({ + roomId: createdChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + const integrationCreated = res.body.integrations.find( + (createdIntegration) => createdIntegration._id === integrationCreatedByAnUser._id, + ); + expect(integrationCreated).to.be.equal(undefined); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + }); + }); + + it('should return unauthorized error when the user does not have any integrations permissions', (done) => { + updatePermission('manage-incoming-integrations', []).then(() => { + updatePermission('manage-own-incoming-integrations', []).then(() => { + updatePermission('manage-outgoing-integrations', []).then(() => { + updatePermission('manage-own-outgoing-integrations', []).then(() => { + request + .get(api('channels.getIntegrations')) + .set(credentials) + .query({ + roomId: createdChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(403) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error', 'unauthorized'); + }) + .end(done); + }); + }); + }); + }); + }); + }); + + it('/channels.addAll', (done) => { + request + .post(api('channels.addAll')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'c'); + }) + .end(done); + }); + + it('/channels.addLeader', (done) => { + request + .post(api('channels.addLeader')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .end(done); + }); + it('/channels.removeLeader', (done) => { + request + .post(api('channels.removeLeader')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + describe('/channels.setCustomFields:', () => { + let cfchannel; + it('create channel with customFields', (done) => { + const customFields = { field0: 'value0' }; + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: `channel.cf.${Date.now()}`, + customFields, + }) + .end((err, res) => { + cfchannel = res.body.channel; + done(); + }); + }); + it('get customFields using channels.info', (done) => { + request + .get(api('channels.info')) + .set(credentials) + .query({ + roomId: cfchannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel.customFields.field0', 'value0'); + }) + .end(done); + }); + it('change customFields', async () => { + const customFields = { field9: 'value9' }; + return request + .post(api('channels.setCustomFields')) + .set(credentials) + .send({ + roomId: cfchannel._id, + customFields, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', cfchannel.name); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.customFields.field9', 'value9'); + expect(res.body).to.have.not.nested.property('channel.customFields.field0', 'value0'); + }); + }); + it('get customFields using channels.info', (done) => { + request + .get(api('channels.info')) + .set(credentials) + .query({ + roomId: cfchannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel.customFields.field9', 'value9'); + }) + .end(done); + }); + it('delete channels with customFields', (done) => { + request + .post(api('channels.delete')) + .set(credentials) + .send({ + roomName: cfchannel.name, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + it('create channel without customFields', (done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: `channel.cf.${Date.now()}`, + }) + .end((err, res) => { + cfchannel = res.body.channel; + done(); + }); + }); + it('set customFields with one nested field', async () => { + const customFields = { field1: 'value1' }; + return request + .post(api('channels.setCustomFields')) + .set(credentials) + .send({ + roomId: cfchannel._id, + customFields, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', cfchannel.name); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.customFields.field1', 'value1'); + }); + }); + it('set customFields with multiple nested fields', async () => { + const customFields = { field2: 'value2', field3: 'value3', field4: 'value4' }; + + return request + .post(api('channels.setCustomFields')) + .set(credentials) + .send({ + roomName: cfchannel.name, + customFields, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', cfchannel.name); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.customFields.field2', 'value2'); + expect(res.body).to.have.nested.property('channel.customFields.field3', 'value3'); + expect(res.body).to.have.nested.property('channel.customFields.field4', 'value4'); + expect(res.body).to.have.not.nested.property('channel.customFields.field1', 'value1'); + }); + }); + it('set customFields to empty object', (done) => { + const customFields = {}; + + request + .post(api('channels.setCustomFields')) + .set(credentials) + .send({ + roomName: cfchannel.name, + customFields, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', cfchannel.name); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.not.nested.property('channel.customFields.field2', 'value2'); + expect(res.body).to.have.not.nested.property('channel.customFields.field3', 'value3'); + expect(res.body).to.have.not.nested.property('channel.customFields.field4', 'value4'); + }) + .end(done); + }); + it('set customFields as a string -> should return 400', (done) => { + const customFields = ''; + + request + .post(api('channels.setCustomFields')) + .set(credentials) + .send({ + roomName: cfchannel.name, + customFields, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + }) + .end(done); + }); + it('delete channel with empty customFields', (done) => { + request + .post(api('channels.delete')) + .set(credentials) + .send({ + roomName: cfchannel.name, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + }); + + it('/channels.setJoinCode', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.setJoinCode')) + .set(credentials) + .send({ + roomId: channel._id, + joinCode: '123', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs); + }); + }); + + it('/channels.setReadOnly', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.setReadOnly')) + .set(credentials) + .send({ + roomId: channel._id, + readOnly: true, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + + it('/channels.setDefault', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.setDefault')) + .set(credentials) + .send({ + roomId: channel._id, + default: true, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs); + }); + }); + + it('/channels.leave', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.leave')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + + describe('/channels.setType', () => { + it('should change the type public channel to private', async () => { + const roomInfo = await getRoomInfo(channel._id); + + request + .post(api('channels.setType')) + .set(credentials) + .send({ + roomId: channel._id, + type: 'p', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'p'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + }); + + describe('/channels.delete:', () => { + let testChannel; + it('/channels.create', (done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: `channel.test.${Date.now()}`, + }) + .end((err, res) => { + testChannel = res.body.channel; + done(); + }); + }); + it('/channels.delete', (done) => { + request + .post(api('channels.delete')) + .set(credentials) + .send({ + roomName: testChannel.name, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + it('/channels.info', (done) => { + request + .get(api('channels.info')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('errorType', 'error-room-not-found'); + }) + .end(done); + }); + }); + + describe('/channels.getAllUserMentionsByChannel', () => { + it('should return an array of mentions by channel', (done) => { + request + .get(api('channels.getAllUserMentionsByChannel')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('mentions').and.to.be.an('array'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + it('should return an array of mentions by channel even requested with count and offset params', (done) => { + request + .get(api('channels.getAllUserMentionsByChannel')) + .set(credentials) + .query({ + roomId: channel._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('mentions').and.to.be.an('array'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + }); + + describe('/channels.roles', () => { + let testChannel; + it('/channels.create', (done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: `channel.roles.test.${Date.now()}`, + }) + .end((err, res) => { + testChannel = res.body.channel; + done(); + }); + }); + it('/channels.invite', (done) => { + request + .post(api('channels.invite')) + .set(credentials) + .send({ + roomId: testChannel._id, + userId: 'rocket.cat', + }) + .end(done); + }); + it('/channels.addModerator', (done) => { + request + .post(api('channels.addModerator')) + .set(credentials) + .send({ + roomId: testChannel._id, + userId: 'rocket.cat', + }) + .end(done); + }); + it('/channels.addLeader', (done) => { + request + .post(api('channels.addLeader')) + .set(credentials) + .send({ + roomId: testChannel._id, + userId: 'rocket.cat', + }) + .end(done); + }); + it('should return an array of role <-> user relationships in a channel', (done) => { + request + .get(api('channels.roles')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + expect(res.body).to.have.a.property('roles').that.is.an('array').that.has.lengthOf(2); + + expect(res.body.roles[0]).to.have.a.property('_id').that.is.a('string'); + expect(res.body.roles[0]).to.have.a.property('rid').that.is.equal(testChannel._id); + expect(res.body.roles[0]).to.have.a.property('roles').that.is.an('array').that.includes('moderator', 'leader'); + expect(res.body.roles[0]).to.have.a.property('u').that.is.an('object'); + expect(res.body.roles[0].u).to.have.a.property('_id').that.is.a('string'); + expect(res.body.roles[0].u).to.have.a.property('username').that.is.a('string'); + + expect(res.body.roles[1]).to.have.a.property('_id').that.is.a('string'); + expect(res.body.roles[1]).to.have.a.property('rid').that.is.equal(testChannel._id); + expect(res.body.roles[1]).to.have.a.property('roles').that.is.an('array').that.includes('owner'); + expect(res.body.roles[1]).to.have.a.property('u').that.is.an('object'); + expect(res.body.roles[1].u).to.have.a.property('_id').that.is.a('string'); + expect(res.body.roles[1].u).to.have.a.property('username').that.is.a('string'); + }) + .end(done); + }); + }); + + describe('/channels.moderators', () => { + let testChannel; + it('/channels.create', (done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: `channel.roles.test.${Date.now()}`, + }) + .end((err, res) => { + testChannel = res.body.channel; + done(); + }); + }); + it('/channels.invite', (done) => { + request + .post(api('channels.invite')) + .set(credentials) + .send({ + roomId: testChannel._id, + userId: 'rocket.cat', + }) + .end(done); + }); + it('/channels.addModerator', (done) => { + request + .post(api('channels.addModerator')) + .set(credentials) + .send({ + roomId: testChannel._id, + userId: 'rocket.cat', + }) + .end(done); + }); + it('should return an array of moderators with rocket.cat as a moderator', (done) => { + request + .get(api('channels.moderators')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + expect(res.body).to.have.a.property('moderators').that.is.an('array').that.has.lengthOf(1); + expect(res.body.moderators[0].username).to.be.equal('rocket.cat'); + }) + .end(done); + }); + }); + describe('/channels.anonymousread', () => { + after(() => updateSetting('Accounts_AllowAnonymousRead', false)); + it('should return an error when the setting "Accounts_AllowAnonymousRead" is disabled', (done) => { + updateSetting('Accounts_AllowAnonymousRead', false).then(() => { + request + .get(api('channels.anonymousread')) + .query({ + roomId: 'GENERAL', + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.a.property('success', false); + expect(res.body).to.have.a.property('error'); + expect(res.body).to.have.a.property('errorType'); + expect(res.body.errorType).to.be.equal('error-not-allowed'); + expect(res.body.error).to.be.equal('Enable "Allow Anonymous Read" [error-not-allowed]'); + }) + .end(done); + }); + }); + it('should return the messages list when the setting "Accounts_AllowAnonymousRead" is enabled', (done) => { + updateSetting('Accounts_AllowAnonymousRead', true).then(() => { + request + .get(api('channels.anonymousread')) + .query({ + roomId: 'GENERAL', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + expect(res.body).to.have.a.property('messages').that.is.an('array'); + }) + .end(done); + }); + }); + it('should return the messages list when the setting "Accounts_AllowAnonymousRead" is enabled even requested with count and offset params', (done) => { + updateSetting('Accounts_AllowAnonymousRead', true).then(() => { + request + .get(api('channels.anonymousread')) + .query({ + roomId: 'GENERAL', + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + expect(res.body).to.have.a.property('messages').that.is.an('array'); + }) + .end(done); + }); + }); + }); + + describe('/channels.convertToTeam', () => { + before((done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ name: `channel-${Date.now()}` }) + .then((response) => { + this.newChannel = response.body.channel; + }) + .then(() => done()); + }); + + it('should fail to convert channel if lacking edit-room permission', (done) => { + updatePermission('create-team', []).then(() => { + updatePermission('edit-room', ['admin']).then(() => { + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(403) + .expect((res) => { + expect(res.body).to.have.a.property('success', false); + }) + .end(done); + }); + }); + }); + + it('should fail to convert channel if lacking create-team permission', (done) => { + updatePermission('create-team', ['admin']).then(() => { + updatePermission('edit-room', []).then(() => { + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(403) + .expect((res) => { + expect(res.body).to.have.a.property('success', false); + }) + .end(done); + }); + }); + }); + + it(`should successfully convert a channel to a team when the channel's id is sent as parameter`, (done) => { + updatePermission('create-team', ['admin']).then(() => { + updatePermission('edit-room', ['admin']).then(() => { + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .end(done); + }); + }); + }); + + it(`should successfully convert a channel to a team when the channel's name is sent as parameter`, (done) => { + updatePermission('create-team', ['admin']).then(() => { + updatePermission('edit-room', ['admin']).then(() => { + request + .post(api('teams.convertToChannel')) + .set(credentials) + .send({ teamName: this.newChannel.name }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .then(() => { + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelName: this.newChannel.name }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .end(done); + }); + }); + }); + }); + + it(`should successfully convert a channel to a team when the channel's name and id are sent as parameter`, (done) => { + updatePermission('create-team', ['admin']).then(() => { + updatePermission('edit-room', ['admin']).then(() => { + request + .post(api('teams.convertToChannel')) + .set(credentials) + .send({ teamName: this.newChannel.name }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .then(() => { + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ + channelName: this.newChannel.name, + channelId: this.newChannel._id, + }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .end(done); + }); + }); + }); + }); + + it('should fail to convert channel without the required parameters', (done) => { + request.post(api('channels.convertToTeam')).set(credentials).send({}).expect(400).end(done); + }); + + it("should fail to convert channel if it's already taken", (done) => { + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(400) + .expect((res) => { + expect(res.body).to.have.a.property('success', false); + }) + .end(done); + }); + }); + + describe.skip('/channels.setAutojoin', () => { + // let testTeam; + let testChannel; + // let testUser1; + // let testUser2; + before(async () => { + const teamCreateRes = await request + .post(api('teams.create')) + .set(credentials) + .send({ name: `team-${Date.now()}` }); + + const { team } = teamCreateRes.body; + + const user1 = await createUser(); + const user2 = await createUser(); + + const channelCreateRes = await request + .post(api('channels.create')) + .set(credentials) + .send({ + name: `team-channel-${Date.now()}`, + extraData: { + teamId: team._id, + }, + }); + + const { channel } = channelCreateRes.body; + + // testTeam = team; + testChannel = channel; + // testUser1 = user1; + // testUser2 = user2; + + await request + .post(api('teams.addMembers')) + .set(credentials) + .send({ + name: team.name, + members: [{ userId: user1._id }, { userId: user2._id }], + }); + }); + + it('should add all existing team members', async () => { + const resAutojoin = await request + .post(api('channels.setAutojoin')) + .set(credentials) + .send({ roomName: testChannel.name, autojoin: true }) + .expect(200); + expect(resAutojoin.body).to.have.a.property('success', true); + + const channelInfoResponse = await request.get(api('channels.info')).set(credentials).query({ roomId: testChannel._id }); + const { channel } = channelInfoResponse.body; + + return expect(channel.usersCount).to.be.equals(3); + }); + }); + + context("Setting: 'Use Real Name': true", () => { + before(async () => { + await updateSetting('UI_Use_Real_Name', true); + + await request + .post(api('channels.join')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id', channel._id); + }); + + await request + .post(api('chat.sendMessage')) + .set(credentials) + .send({ + message: { + text: 'Sample message', + rid: channel._id, + }, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }); + }); + after(async () => { + await updateSetting('UI_Use_Real_Name', false); + + await request + .post(api('channels.leave')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id', channel._id); + }); + }); + + it('/channels.list', (done) => { + request + .get(api('channels.list')) + .set(credentials) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('channels').and.to.be.an('array'); + + const retChannel = res.body.channels.find(({ _id }) => _id === channel._id); + + expect(retChannel).to.have.nested.property('lastMessage.u.name', 'RocketChat Internal Admin Test'); + }) + .end(done); + }); + + it('/channels.list.joined', (done) => { + request + .get(api('channels.list.joined')) + .set(credentials) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('channels').and.to.be.an('array'); + + const retChannel = res.body.channels.find(({ _id }) => _id === channel._id); + + expect(retChannel).to.have.nested.property('lastMessage.u.name', 'RocketChat Internal Admin Test'); + }) + .end(done); + }); + }); +}); From 105444f88822434e108372c2d71fa6577fc6e1f0 Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Mon, 12 Sep 2022 13:01:36 -0300 Subject: [PATCH 03/12] Fix tests --- .../tests/end-to-end/api/02-channels.js | 4314 ++++++++--------- 1 file changed, 2157 insertions(+), 2157 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/02-channels.js b/apps/meteor/tests/end-to-end/api/02-channels.js index cc00fad8bcebb..5f29a69fc1e63 100644 --- a/apps/meteor/tests/end-to-end/api/02-channels.js +++ b/apps/meteor/tests/end-to-end/api/02-channels.js @@ -1,2157 +1,2157 @@ -import { expect } from 'chai'; - -import { getCredentials, api, request, credentials, apiPublicChannelName, channel, reservedWords } from '../../data/api-data.js'; -import { adminUsername, password } from '../../data/user.js'; -import { createUser, login } from '../../data/users.helper'; -import { updatePermission, updateSetting } from '../../data/permissions.helper'; -import { createRoom } from '../../data/rooms.helper'; -import { createVisitor } from '../../data/livechat/rooms'; -import { createIntegration, removeIntegration } from '../../data/integration.helper'; - -function getRoomInfo(roomId) { - return new Promise((resolve /* , reject*/) => { - request - .get(api('channels.info')) - .set(credentials) - .query({ - roomId, - }) - .end((err, req) => { - resolve(req.body); - }); - }); -} - -describe('[Channels]', function () { - this.retries(0); - - before((done) => getCredentials(done)); - - before('Creating channel', (done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: apiPublicChannelName, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', 0); - channel._id = res.body.channel._id; - }) - .end(done); - }); - - describe('[/channels.info]', () => { - let testChannel = {}; - let channelMessage = {}; - it('creating new channel...', (done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: apiPublicChannelName, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - testChannel = res.body.channel; - }) - .end(done); - }); - it('should return channel basic structure', (done) => { - request - .get(api('channels.info')) - .set(credentials) - .query({ - roomId: testChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', 0); - }) - .end(done); - }); - it('sending a message...', (done) => { - request - .post(api('chat.sendMessage')) - .set(credentials) - .send({ - message: { - text: 'Sample message', - rid: testChannel._id, - }, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - channelMessage = res.body.message; - }) - .end(done); - }); - it('REACTing with last message', (done) => { - request - .post(api('chat.react')) - .set(credentials) - .send({ - emoji: ':squid:', - messageId: channelMessage._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - it('STARring last message', (done) => { - request - .post(api('chat.starMessage')) - .set(credentials) - .send({ - messageId: channelMessage._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - it('PINning last message', (done) => { - request - .post(api('chat.pinMessage')) - .set(credentials) - .send({ - messageId: channelMessage._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - it('should return channel structure with "lastMessage" object including pin, reaction and star(should be an array) infos', (done) => { - request - .get(api('channels.info')) - .set(credentials) - .query({ - roomId: testChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('channel').and.to.be.an('object'); - const { channel } = res.body; - expect(channel).to.have.property('lastMessage').and.to.be.an('object'); - expect(channel.lastMessage).to.have.property('reactions').and.to.be.an('object'); - expect(channel.lastMessage).to.have.property('pinned').and.to.be.a('boolean'); - expect(channel.lastMessage).to.have.property('pinnedAt').and.to.be.a('string'); - expect(channel.lastMessage).to.have.property('pinnedBy').and.to.be.an('object'); - expect(channel.lastMessage).to.have.property('starred').and.to.be.an('array'); - }) - .end(done); - }); - it('should return all channels messages where the last message of array should have the "star" array with USERS star ONLY', (done) => { - request - .get(api('channels.messages')) - .set(credentials) - .query({ - roomId: testChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('messages').and.to.be.an('array'); - const { messages } = res.body; - const lastMessage = messages.filter((message) => message._id === channelMessage._id)[0]; - expect(lastMessage).to.have.property('starred').and.to.be.an('array'); - expect(lastMessage.starred[0]._id).to.be.equal(adminUsername); - }) - .end(done); - }); - it('should return all channels messages where the last message of array should have the "star" array with USERS star ONLY even requested with count and offset params', (done) => { - request - .get(api('channels.messages')) - .set(credentials) - .query({ - roomId: testChannel._id, - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('messages').and.to.be.an('array'); - const { messages } = res.body; - const lastMessage = messages.filter((message) => message._id === channelMessage._id)[0]; - expect(lastMessage).to.have.property('starred').and.to.be.an('array'); - expect(lastMessage.starred[0]._id).to.be.equal(adminUsername); - }) - .end(done); - }); - }); - - describe('[/channels.online]', () => { - const createUserAndChannel = async () => { - const testUser = await createUser(); - const testUserCredentials = await login(testUser.username, password); - - await request.post(api('users.setStatus')).set(testUserCredentials).send({ - message: '', - status: 'online', - }); - - const roomName = `group-test-${Date.now()}`; - - const roomResponse = await createRoom({ - name: roomName, - type: 'c', - members: [testUser.username], - }); - - return { - testUser, - testUserCredentials, - room: roomResponse.body.channel, - }; - }; - - it('should return an error if no query', () => - request - .get(api('channels.online')) - .set(credentials) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('error', 'Invalid query'); - })); - - it('should return an error if passing an empty query', () => - request - .get(api('channels.online')) - .set(credentials) - .query('query={}') - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('error', 'Invalid query'); - })); - - it('should return an array with online members', async () => { - const { testUser, testUserCredentials, room } = await createUserAndChannel(); - - return request - .get(api('channels.online')) - .set(testUserCredentials) - .query(`query={"_id": "${room._id}"}`) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('online'); - - const expected = { - _id: testUser._id, - username: testUser.username, - }; - expect(res.body.online).to.deep.include(expected); - }); - }); - - it('should return an empty array if requesting user is not in channel', async () => { - const outsider = await createUser(); - const outsiderCredentials = await login(outsider.username, password); - - const { testUser, room } = await createUserAndChannel(); - - return request - .get(api('channels.online')) - .set(outsiderCredentials) - .query(`query={"_id": "${room._id}"}`) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('online'); - - const expected = { - _id: testUser._id, - username: testUser.username, - }; - expect(res.body.online).to.deep.include(expected); - }); - }); - }); - - describe('[/channels.files]', () => { - before(() => updateSetting('VoIP_Enabled', true)); - const createVoipRoom = async () => { - const testUser = await createUser({ roles: ['user', 'livechat-agent'] }); - const testUserCredentials = await login(testUser.username, password); - const visitor = await createVisitor(); - const roomResponse = await createRoom({ - token: visitor.token, - type: 'v', - agentId: testUser._id, - credentials: testUserCredentials, - }); - return roomResponse.body.room; - }; - it('should fail if invalid channel', (done) => { - request - .get(api('channels.files')) - .set(credentials) - .query({ - roomId: 'invalid', - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('errorType', 'error-room-not-found'); - }) - .end(done); - }); - - it('should fail for room type v', async () => { - const { _id } = await createVoipRoom(); - request - .get(api('channels.files')) - .set(credentials) - .query({ - roomId: _id, - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('errorType', 'error-room-not-found'); - }); - }); - - it('should succeed when searching by roomId', (done) => { - request - .get(api('channels.files')) - .set(credentials) - .query({ - roomId: 'GENERAL', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('files').and.to.be.an('array'); - }) - .end(done); - }); - - it('should succeed when searching by roomId even requested with count and offset params', (done) => { - request - .get(api('channels.files')) - .set(credentials) - .query({ - roomId: 'GENERAL', - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('files').and.to.be.an('array'); - }) - .end(done); - }); - - it('should succeed when searching by roomName', (done) => { - request - .get(api('channels.files')) - .set(credentials) - .query({ - roomName: 'general', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('files').and.to.be.an('array'); - }) - .end(done); - }); - - it('should succeed when searching by roomName even requested with count and offset params', (done) => { - request - .get(api('channels.files')) - .set(credentials) - .query({ - roomName: 'general', - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('files').and.to.be.an('array'); - }) - .end(done); - }); - }); - - describe('[/channels.join]', () => { - let testChannelNoCode; - let testChannelWithCode; - let testUser; - let testUserCredentials; - before('Create test user', (done) => { - const username = `user.test.${Date.now()}`; - const email = `${username}@rocket.chat`; - request - .post(api('users.create')) - .set(credentials) - .send({ email, name: username, username, password }) - .end((err, res) => { - testUser = res.body.user; - done(); - }); - }); - before('Login as test user', (done) => { - request - .post(api('login')) - .send({ - user: testUser.username, - password, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - testUserCredentials = {}; - testUserCredentials['X-Auth-Token'] = res.body.data.authToken; - testUserCredentials['X-User-Id'] = res.body.data.userId; - }) - .end(done); - }); - before('Create no code channel', (done) => { - request - .post(api('channels.create')) - .set(testUserCredentials) - .send({ - name: `${apiPublicChannelName}-nojoincode`, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - testChannelNoCode = res.body.channel; - }) - .end(done); - }); - before('Create code channel', (done) => { - request - .post(api('channels.create')) - .set(testUserCredentials) - .send({ - name: `${apiPublicChannelName}-withjoincode`, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - testChannelWithCode = res.body.channel; - }) - .end(done); - }); - before('Set code for channel', (done) => { - request - .post(api('channels.setJoinCode')) - .set(testUserCredentials) - .send({ - roomId: testChannelWithCode._id, - joinCode: '123', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('should fail if invalid channel', (done) => { - request - .post(api('channels.join')) - .set(credentials) - .send({ - roomId: 'invalid', - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('errorType', 'error-room-not-found'); - }) - .end(done); - }); - - it('should succeed when joining code-free channel without join code', (done) => { - request - .post(api('channels.join')) - .set(credentials) - .send({ - roomId: testChannelNoCode._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id', testChannelNoCode._id); - }) - .end(done); - }); - - it('should fail when joining code-needed channel without join code and no join-without-join-code permission', (done) => { - updatePermission('join-without-join-code', []).then(() => { - request - .post(api('channels.join')) - .set(credentials) - .send({ - roomId: testChannelWithCode._id, - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.nested.property('errorType', 'error-code-invalid'); - }) - .end(done); - }); - }); - - it('should succeed when joining code-needed channel without join code and with join-without-join-code permission', (done) => { - updatePermission('join-without-join-code', ['admin']).then(() => { - request - .post(api('channels.join')) - .set(credentials) - .send({ - roomId: testChannelWithCode._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id', testChannelWithCode._id); - }) - .end(done); - }); - }); - - it('leave channel', (done) => { - request - .post(api('channels.leave')) - .set(credentials) - .send({ - roomId: testChannelWithCode._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('should succeed when joining code-needed channel with join code', (done) => { - request - .post(api('channels.join')) - .set(credentials) - .send({ - roomId: testChannelWithCode._id, - joinCode: '123', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id', testChannelWithCode._id); - }) - .end(done); - }); - }); - - it('/channels.invite', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.invite')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - - it('/channels.addModerator', (done) => { - request - .post(api('channels.addModerator')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.removeModerator', (done) => { - request - .post(api('channels.removeModerator')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.addOwner', (done) => { - request - .post(api('channels.addOwner')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.removeOwner', (done) => { - request - .post(api('channels.removeOwner')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.kick', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.kick')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - - it('/channels.invite', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.invite')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - - it('/channels.addOwner', (done) => { - request - .post(api('channels.addOwner')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - describe('/channels.setDescription', () => { - it('should set the description of the channel with a string', (done) => { - request - .post(api('channels.setDescription')) - .set(credentials) - .send({ - roomId: channel._id, - description: 'this is a description for a channel for api tests', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('description', 'this is a description for a channel for api tests'); - }) - .end(done); - }); - it('should set the description of the channel with an empty string(remove the description)', (done) => { - request - .post(api('channels.setDescription')) - .set(credentials) - .send({ - roomId: channel._id, - description: '', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('description', ''); - }) - .end(done); - }); - }); - - describe('/channels.setTopic', () => { - it('should set the topic of the channel with a string', (done) => { - request - .post(api('channels.setTopic')) - .set(credentials) - .send({ - roomId: channel._id, - topic: 'this is a topic of a channel for api tests', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('topic', 'this is a topic of a channel for api tests'); - }) - .end(done); - }); - it('should set the topic of the channel with an empty string(remove the topic)', (done) => { - request - .post(api('channels.setTopic')) - .set(credentials) - .send({ - roomId: channel._id, - topic: '', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('topic', ''); - }) - .end(done); - }); - }); - - describe('/channels.setAnnouncement', () => { - it('should set the announcement of the channel with a string', (done) => { - request - .post(api('channels.setAnnouncement')) - .set(credentials) - .send({ - roomId: channel._id, - announcement: 'this is an announcement of a channel for api tests', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('announcement', 'this is an announcement of a channel for api tests'); - }) - .end(done); - }); - it('should set the announcement of the channel with an empty string(remove the announcement)', (done) => { - request - .post(api('channels.setAnnouncement')) - .set(credentials) - .send({ - roomId: channel._id, - announcement: '', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('announcement', ''); - }) - .end(done); - }); - }); - - describe('/channels.setPurpose', () => { - it('should set the purpose of the channel with a string', (done) => { - request - .post(api('channels.setPurpose')) - .set(credentials) - .send({ - roomId: channel._id, - purpose: 'this is a purpose of a channel for api tests', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('purpose', 'this is a purpose of a channel for api tests'); - }) - .end(done); - }); - it('should set the announcement of channel with an empty string(remove the purpose)', (done) => { - request - .post(api('channels.setPurpose')) - .set(credentials) - .send({ - roomId: channel._id, - purpose: '', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('purpose', ''); - }) - .end(done); - }); - }); - - describe('/channels.history', () => { - it('should return an array of members by channel', (done) => { - request - .get(api('channels.history')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('messages'); - }) - .end(done); - }); - - it('should return an array of members by channel even requested with count and offset params', (done) => { - request - .get(api('channels.history')) - .set(credentials) - .query({ - roomId: channel._id, - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('messages'); - }) - .end(done); - }); - }); - - it('/channels.archive', (done) => { - request - .post(api('channels.archive')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.unarchive', (done) => { - request - .post(api('channels.unarchive')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.close', (done) => { - request - .post(api('channels.close')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.close', (done) => { - request - .post(api('channels.close')) - .set(credentials) - .send({ - roomName: apiPublicChannelName, - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('error', `The channel, ${apiPublicChannelName}, is already closed to the sender`); - }) - .end(done); - }); - - it('/channels.open', (done) => { - request - .post(api('channels.open')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - it('/channels.list', (done) => { - request - .get(api('channels.list')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - }) - .end(done); - }); - - it('/channels.list.joined', (done) => { - request - .get(api('channels.list.joined')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - }) - .end(done); - }); - it('/channels.counters', (done) => { - request - .get(api('channels.counters')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('joined', true); - expect(res.body).to.have.property('members'); - expect(res.body).to.have.property('unreads'); - expect(res.body).to.have.property('unreadsFrom'); - expect(res.body).to.have.property('msgs'); - expect(res.body).to.have.property('latest'); - expect(res.body).to.have.property('userMentions'); - }) - .end(done); - }); - - describe('/channels.members', () => { - it('should return an array of members by channel', (done) => { - request - .get(api('channels.members')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('members').and.to.be.an('array'); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - expect(res.body).to.have.property('offset'); - }) - .end(done); - }); - - it('should return an array of members by channel even requested with count and offset params', (done) => { - request - .get(api('channels.members')) - .set(credentials) - .query({ - roomId: channel._id, - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('members').and.to.be.an('array'); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - expect(res.body).to.have.property('offset'); - }) - .end(done); - }); - - it('should return an filtered array of members by channel', (done) => { - request - .get(api('channels.members')) - .set(credentials) - .query({ - roomId: channel._id, - filter: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('members').and.to.be.an('array'); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('count', 1); - expect(res.body).to.have.property('total'); - expect(res.body).to.have.property('offset'); - }) - .end(done); - }); - }); - - it('/channels.rename', async () => { - const roomInfo = await getRoomInfo(channel._id); - - function failRenameChannel(name) { - it(`should not rename a channel to the reserved name ${name}`, (done) => { - request - .post(api('channels.rename')) - .set(credentials) - .send({ - roomId: channel._id, - name, - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('error', `${name} is already in use :( [error-field-unavailable]`); - }) - .end(done); - }); - } - - reservedWords.forEach((name) => { - failRenameChannel(name); - }); - - return request - .post(api('channels.rename')) - .set(credentials) - .send({ - roomId: channel._id, - name: `EDITED${apiPublicChannelName}`, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - - describe('/channels.getIntegrations', () => { - let integrationCreatedByAnUser; - let userCredentials; - let createdChannel; - before((done) => { - createRoom({ name: `test-integration-channel-${Date.now()}`, type: 'c' }).end((err, res) => { - createdChannel = res.body.channel; - createUser().then((createdUser) => { - const user = createdUser; - login(user.username, password).then((credentials) => { - userCredentials = credentials; - updatePermission('manage-incoming-integrations', ['user']).then(() => { - updatePermission('manage-own-incoming-integrations', ['user']).then(() => { - createIntegration( - { - type: 'webhook-incoming', - name: 'Incoming test', - enabled: true, - alias: 'test', - username: 'rocket.cat', - scriptEnabled: false, - channel: `#${createdChannel.name}`, - }, - userCredentials, - ).then((integration) => { - integrationCreatedByAnUser = integration; - done(); - }); - }); - }); - }); - }); - }); - }); - - after((done) => { - removeIntegration(integrationCreatedByAnUser._id, 'incoming').then(done); - }); - - it('should return the list of integrations of created channel and it should contain the integration created by user when the admin DOES have the permission', (done) => { - updatePermission('manage-incoming-integrations', ['admin']).then(() => { - request - .get(api('channels.getIntegrations')) - .set(credentials) - .query({ - roomId: createdChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - const integrationCreated = res.body.integrations.find( - (createdIntegration) => createdIntegration._id === integrationCreatedByAnUser._id, - ); - expect(integrationCreated).to.be.an('object'); - expect(integrationCreated._id).to.be.equal(integrationCreatedByAnUser._id); - expect(res.body).to.have.property('offset'); - expect(res.body).to.have.property('total'); - }) - .end(done); - }); - }); - - it('should return the list of integrations created by the user only', (done) => { - updatePermission('manage-own-incoming-integrations', ['admin']).then(() => { - updatePermission('manage-incoming-integrations', []).then(() => { - request - .get(api('channels.getIntegrations')) - .set(credentials) - .query({ - roomId: createdChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - const integrationCreated = res.body.integrations.find( - (createdIntegration) => createdIntegration._id === integrationCreatedByAnUser._id, - ); - expect(integrationCreated).to.be.equal(undefined); - expect(res.body).to.have.property('offset'); - expect(res.body).to.have.property('total'); - }) - .end(done); - }); - }); - }); - - it('should return unauthorized error when the user does not have any integrations permissions', (done) => { - updatePermission('manage-incoming-integrations', []).then(() => { - updatePermission('manage-own-incoming-integrations', []).then(() => { - updatePermission('manage-outgoing-integrations', []).then(() => { - updatePermission('manage-own-outgoing-integrations', []).then(() => { - request - .get(api('channels.getIntegrations')) - .set(credentials) - .query({ - roomId: createdChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(403) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('error', 'unauthorized'); - }) - .end(done); - }); - }); - }); - }); - }); - }); - - it('/channels.addAll', (done) => { - request - .post(api('channels.addAll')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'c'); - }) - .end(done); - }); - - it('/channels.addLeader', (done) => { - request - .post(api('channels.addLeader')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) - .end(done); - }); - it('/channels.removeLeader', (done) => { - request - .post(api('channels.removeLeader')) - .set(credentials) - .send({ - roomId: channel._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - - describe('/channels.setCustomFields:', () => { - let cfchannel; - it('create channel with customFields', (done) => { - const customFields = { field0: 'value0' }; - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: `channel.cf.${Date.now()}`, - customFields, - }) - .end((err, res) => { - cfchannel = res.body.channel; - done(); - }); - }); - it('get customFields using channels.info', (done) => { - request - .get(api('channels.info')) - .set(credentials) - .query({ - roomId: cfchannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel.customFields.field0', 'value0'); - }) - .end(done); - }); - it('change customFields', async () => { - const customFields = { field9: 'value9' }; - return request - .post(api('channels.setCustomFields')) - .set(credentials) - .send({ - roomId: cfchannel._id, - customFields, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', cfchannel.name); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.customFields.field9', 'value9'); - expect(res.body).to.have.not.nested.property('channel.customFields.field0', 'value0'); - }); - }); - it('get customFields using channels.info', (done) => { - request - .get(api('channels.info')) - .set(credentials) - .query({ - roomId: cfchannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel.customFields.field9', 'value9'); - }) - .end(done); - }); - it('delete channels with customFields', (done) => { - request - .post(api('channels.delete')) - .set(credentials) - .send({ - roomName: cfchannel.name, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - it('create channel without customFields', (done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: `channel.cf.${Date.now()}`, - }) - .end((err, res) => { - cfchannel = res.body.channel; - done(); - }); - }); - it('set customFields with one nested field', async () => { - const customFields = { field1: 'value1' }; - return request - .post(api('channels.setCustomFields')) - .set(credentials) - .send({ - roomId: cfchannel._id, - customFields, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', cfchannel.name); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.customFields.field1', 'value1'); - }); - }); - it('set customFields with multiple nested fields', async () => { - const customFields = { field2: 'value2', field3: 'value3', field4: 'value4' }; - - return request - .post(api('channels.setCustomFields')) - .set(credentials) - .send({ - roomName: cfchannel.name, - customFields, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', cfchannel.name); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.customFields.field2', 'value2'); - expect(res.body).to.have.nested.property('channel.customFields.field3', 'value3'); - expect(res.body).to.have.nested.property('channel.customFields.field4', 'value4'); - expect(res.body).to.have.not.nested.property('channel.customFields.field1', 'value1'); - }); - }); - it('set customFields to empty object', (done) => { - const customFields = {}; - - request - .post(api('channels.setCustomFields')) - .set(credentials) - .send({ - roomName: cfchannel.name, - customFields, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', cfchannel.name); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.not.nested.property('channel.customFields.field2', 'value2'); - expect(res.body).to.have.not.nested.property('channel.customFields.field3', 'value3'); - expect(res.body).to.have.not.nested.property('channel.customFields.field4', 'value4'); - }) - .end(done); - }); - it('set customFields as a string -> should return 400', (done) => { - const customFields = ''; - - request - .post(api('channels.setCustomFields')) - .set(credentials) - .send({ - roomName: cfchannel.name, - customFields, - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - }) - .end(done); - }); - it('delete channel with empty customFields', (done) => { - request - .post(api('channels.delete')) - .set(credentials) - .send({ - roomName: cfchannel.name, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - }); - - it('/channels.setJoinCode', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.setJoinCode')) - .set(credentials) - .send({ - roomId: channel._id, - joinCode: '123', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs); - }); - }); - - it('/channels.setReadOnly', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.setReadOnly')) - .set(credentials) - .send({ - roomId: channel._id, - readOnly: true, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - - it('/channels.setDefault', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.setDefault')) - .set(credentials) - .send({ - roomId: channel._id, - default: true, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs); - }); - }); - - it('/channels.leave', async () => { - const roomInfo = await getRoomInfo(channel._id); - - return request - .post(api('channels.leave')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'c'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - - describe('/channels.setType', () => { - it('should change the type public channel to private', async () => { - const roomInfo = await getRoomInfo(channel._id); - - request - .post(api('channels.setType')) - .set(credentials) - .send({ - roomId: channel._id, - type: 'p', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id'); - expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); - expect(res.body).to.have.nested.property('channel.t', 'p'); - expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); - }); - }); - }); - - describe('/channels.delete:', () => { - let testChannel; - it('/channels.create', (done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: `channel.test.${Date.now()}`, - }) - .end((err, res) => { - testChannel = res.body.channel; - done(); - }); - }); - it('/channels.delete', (done) => { - request - .post(api('channels.delete')) - .set(credentials) - .send({ - roomName: testChannel.name, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); - it('/channels.info', (done) => { - request - .get(api('channels.info')) - .set(credentials) - .query({ - roomId: testChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('errorType', 'error-room-not-found'); - }) - .end(done); - }); - }); - - describe('/channels.getAllUserMentionsByChannel', () => { - it('should return an array of mentions by channel', (done) => { - request - .get(api('channels.getAllUserMentionsByChannel')) - .set(credentials) - .query({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('mentions').and.to.be.an('array'); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('offset'); - expect(res.body).to.have.property('total'); - }) - .end(done); - }); - it('should return an array of mentions by channel even requested with count and offset params', (done) => { - request - .get(api('channels.getAllUserMentionsByChannel')) - .set(credentials) - .query({ - roomId: channel._id, - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('mentions').and.to.be.an('array'); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('offset'); - expect(res.body).to.have.property('total'); - }) - .end(done); - }); - }); - - describe('/channels.roles', () => { - let testChannel; - it('/channels.create', (done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: `channel.roles.test.${Date.now()}`, - }) - .end((err, res) => { - testChannel = res.body.channel; - done(); - }); - }); - it('/channels.invite', (done) => { - request - .post(api('channels.invite')) - .set(credentials) - .send({ - roomId: testChannel._id, - userId: 'rocket.cat', - }) - .end(done); - }); - it('/channels.addModerator', (done) => { - request - .post(api('channels.addModerator')) - .set(credentials) - .send({ - roomId: testChannel._id, - userId: 'rocket.cat', - }) - .end(done); - }); - it('/channels.addLeader', (done) => { - request - .post(api('channels.addLeader')) - .set(credentials) - .send({ - roomId: testChannel._id, - userId: 'rocket.cat', - }) - .end(done); - }); - it('should return an array of role <-> user relationships in a channel', (done) => { - request - .get(api('channels.roles')) - .set(credentials) - .query({ - roomId: testChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - expect(res.body).to.have.a.property('roles').that.is.an('array').that.has.lengthOf(2); - - expect(res.body.roles[0]).to.have.a.property('_id').that.is.a('string'); - expect(res.body.roles[0]).to.have.a.property('rid').that.is.equal(testChannel._id); - expect(res.body.roles[0]).to.have.a.property('roles').that.is.an('array').that.includes('moderator', 'leader'); - expect(res.body.roles[0]).to.have.a.property('u').that.is.an('object'); - expect(res.body.roles[0].u).to.have.a.property('_id').that.is.a('string'); - expect(res.body.roles[0].u).to.have.a.property('username').that.is.a('string'); - - expect(res.body.roles[1]).to.have.a.property('_id').that.is.a('string'); - expect(res.body.roles[1]).to.have.a.property('rid').that.is.equal(testChannel._id); - expect(res.body.roles[1]).to.have.a.property('roles').that.is.an('array').that.includes('owner'); - expect(res.body.roles[1]).to.have.a.property('u').that.is.an('object'); - expect(res.body.roles[1].u).to.have.a.property('_id').that.is.a('string'); - expect(res.body.roles[1].u).to.have.a.property('username').that.is.a('string'); - }) - .end(done); - }); - }); - - describe('/channels.moderators', () => { - let testChannel; - it('/channels.create', (done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ - name: `channel.roles.test.${Date.now()}`, - }) - .end((err, res) => { - testChannel = res.body.channel; - done(); - }); - }); - it('/channels.invite', (done) => { - request - .post(api('channels.invite')) - .set(credentials) - .send({ - roomId: testChannel._id, - userId: 'rocket.cat', - }) - .end(done); - }); - it('/channels.addModerator', (done) => { - request - .post(api('channels.addModerator')) - .set(credentials) - .send({ - roomId: testChannel._id, - userId: 'rocket.cat', - }) - .end(done); - }); - it('should return an array of moderators with rocket.cat as a moderator', (done) => { - request - .get(api('channels.moderators')) - .set(credentials) - .query({ - roomId: testChannel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - expect(res.body).to.have.a.property('moderators').that.is.an('array').that.has.lengthOf(1); - expect(res.body.moderators[0].username).to.be.equal('rocket.cat'); - }) - .end(done); - }); - }); - describe('/channels.anonymousread', () => { - after(() => updateSetting('Accounts_AllowAnonymousRead', false)); - it('should return an error when the setting "Accounts_AllowAnonymousRead" is disabled', (done) => { - updateSetting('Accounts_AllowAnonymousRead', false).then(() => { - request - .get(api('channels.anonymousread')) - .query({ - roomId: 'GENERAL', - }) - .expect('Content-Type', 'application/json') - .expect(400) - .expect((res) => { - expect(res.body).to.have.a.property('success', false); - expect(res.body).to.have.a.property('error'); - expect(res.body).to.have.a.property('errorType'); - expect(res.body.errorType).to.be.equal('error-not-allowed'); - expect(res.body.error).to.be.equal('Enable "Allow Anonymous Read" [error-not-allowed]'); - }) - .end(done); - }); - }); - it('should return the messages list when the setting "Accounts_AllowAnonymousRead" is enabled', (done) => { - updateSetting('Accounts_AllowAnonymousRead', true).then(() => { - request - .get(api('channels.anonymousread')) - .query({ - roomId: 'GENERAL', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - expect(res.body).to.have.a.property('messages').that.is.an('array'); - }) - .end(done); - }); - }); - it('should return the messages list when the setting "Accounts_AllowAnonymousRead" is enabled even requested with count and offset params', (done) => { - updateSetting('Accounts_AllowAnonymousRead', true).then(() => { - request - .get(api('channels.anonymousread')) - .query({ - roomId: 'GENERAL', - count: 5, - offset: 0, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - expect(res.body).to.have.a.property('messages').that.is.an('array'); - }) - .end(done); - }); - }); - }); - - describe('/channels.convertToTeam', () => { - before((done) => { - request - .post(api('channels.create')) - .set(credentials) - .send({ name: `channel-${Date.now()}` }) - .then((response) => { - this.newChannel = response.body.channel; - }) - .then(() => done()); - }); - - it('should fail to convert channel if lacking edit-room permission', (done) => { - updatePermission('create-team', []).then(() => { - updatePermission('edit-room', ['admin']).then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(403) - .expect((res) => { - expect(res.body).to.have.a.property('success', false); - }) - .end(done); - }); - }); - }); - - it('should fail to convert channel if lacking create-team permission', (done) => { - updatePermission('create-team', ['admin']).then(() => { - updatePermission('edit-room', []).then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(403) - .expect((res) => { - expect(res.body).to.have.a.property('success', false); - }) - .end(done); - }); - }); - }); - - it(`should successfully convert a channel to a team when the channel's id is sent as parameter`, (done) => { - updatePermission('create-team', ['admin']).then(() => { - updatePermission('edit-room', ['admin']).then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) - .end(done); - }); - }); - }); - - it(`should successfully convert a channel to a team when the channel's name is sent as parameter`, (done) => { - updatePermission('create-team', ['admin']).then(() => { - updatePermission('edit-room', ['admin']).then(() => { - request - .post(api('teams.convertToChannel')) - .set(credentials) - .send({ teamName: this.newChannel.name }) - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) - .then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelName: this.newChannel.name }) - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) - .end(done); - }); - }); - }); - }); - - it(`should successfully convert a channel to a team when the channel's name and id are sent as parameter`, (done) => { - updatePermission('create-team', ['admin']).then(() => { - updatePermission('edit-room', ['admin']).then(() => { - request - .post(api('teams.convertToChannel')) - .set(credentials) - .send({ teamName: this.newChannel.name }) - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) - .then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ - channelName: this.newChannel.name, - channelId: this.newChannel._id, - }) - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) - .end(done); - }); - }); - }); - }); - - it('should fail to convert channel without the required parameters', (done) => { - request.post(api('channels.convertToTeam')).set(credentials).send({}).expect(400).end(done); - }); - - it("should fail to convert channel if it's already taken", (done) => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(400) - .expect((res) => { - expect(res.body).to.have.a.property('success', false); - }) - .end(done); - }); - }); - - describe.skip('/channels.setAutojoin', () => { - // let testTeam; - let testChannel; - // let testUser1; - // let testUser2; - before(async () => { - const teamCreateRes = await request - .post(api('teams.create')) - .set(credentials) - .send({ name: `team-${Date.now()}` }); - - const { team } = teamCreateRes.body; - - const user1 = await createUser(); - const user2 = await createUser(); - - const channelCreateRes = await request - .post(api('channels.create')) - .set(credentials) - .send({ - name: `team-channel-${Date.now()}`, - extraData: { - teamId: team._id, - }, - }); - - const { channel } = channelCreateRes.body; - - // testTeam = team; - testChannel = channel; - // testUser1 = user1; - // testUser2 = user2; - - await request - .post(api('teams.addMembers')) - .set(credentials) - .send({ - name: team.name, - members: [{ userId: user1._id }, { userId: user2._id }], - }); - }); - - it('should add all existing team members', async () => { - const resAutojoin = await request - .post(api('channels.setAutojoin')) - .set(credentials) - .send({ roomName: testChannel.name, autojoin: true }) - .expect(200); - expect(resAutojoin.body).to.have.a.property('success', true); - - const channelInfoResponse = await request.get(api('channels.info')).set(credentials).query({ roomId: testChannel._id }); - const { channel } = channelInfoResponse.body; - - return expect(channel.usersCount).to.be.equals(3); - }); - }); - - context("Setting: 'Use Real Name': true", () => { - before(async () => { - await updateSetting('UI_Use_Real_Name', true); - - await request - .post(api('channels.join')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id', channel._id); - }); - - await request - .post(api('chat.sendMessage')) - .set(credentials) - .send({ - message: { - text: 'Sample message', - rid: channel._id, - }, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }); - }); - after(async () => { - await updateSetting('UI_Use_Real_Name', false); - - await request - .post(api('channels.leave')) - .set(credentials) - .send({ - roomId: channel._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('channel._id', channel._id); - }); - }); - - it('/channels.list', (done) => { - request - .get(api('channels.list')) - .set(credentials) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - expect(res.body).to.have.property('channels').and.to.be.an('array'); - - const retChannel = res.body.channels.find(({ _id }) => _id === channel._id); - - expect(retChannel).to.have.nested.property('lastMessage.u.name', 'RocketChat Internal Admin Test'); - }) - .end(done); - }); - - it('/channels.list.joined', (done) => { - request - .get(api('channels.list.joined')) - .set(credentials) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('count'); - expect(res.body).to.have.property('total'); - expect(res.body).to.have.property('channels').and.to.be.an('array'); - - const retChannel = res.body.channels.find(({ _id }) => _id === channel._id); - - expect(retChannel).to.have.nested.property('lastMessage.u.name', 'RocketChat Internal Admin Test'); - }) - .end(done); - }); - }); -}); +import { expect } from 'chai'; + +import { getCredentials, api, request, credentials, apiPublicChannelName, channel, reservedWords } from '../../data/api-data.js'; +import { adminUsername, password } from '../../data/user.js'; +import { createUser, login } from '../../data/users.helper'; +import { updatePermission, updateSetting } from '../../data/permissions.helper'; +import { createRoom } from '../../data/rooms.helper'; +import { createVisitor } from '../../data/livechat/rooms'; +import { createIntegration, removeIntegration } from '../../data/integration.helper'; + +function getRoomInfo(roomId) { + return new Promise((resolve /* , reject*/) => { + request + .get(api('channels.info')) + .set(credentials) + .query({ + roomId, + }) + .end((err, req) => { + resolve(req.body); + }); + }); +} + +describe('[Channels]', function () { + this.retries(0); + + before((done) => getCredentials(done)); + + before('Creating channel', (done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: apiPublicChannelName, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', 0); + channel._id = res.body.channel._id; + }) + .end(done); + }); + + describe('[/channels.info]', () => { + let testChannel = {}; + let channelMessage = {}; + it('creating new channel...', (done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: apiPublicChannelName, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + testChannel = res.body.channel; + }) + .end(done); + }); + it('should return channel basic structure', (done) => { + request + .get(api('channels.info')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', 0); + }) + .end(done); + }); + it('sending a message...', (done) => { + request + .post(api('chat.sendMessage')) + .set(credentials) + .send({ + message: { + text: 'Sample message', + rid: testChannel._id, + }, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + channelMessage = res.body.message; + }) + .end(done); + }); + it('REACTing with last message', (done) => { + request + .post(api('chat.react')) + .set(credentials) + .send({ + emoji: ':squid:', + messageId: channelMessage._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + it('STARring last message', (done) => { + request + .post(api('chat.starMessage')) + .set(credentials) + .send({ + messageId: channelMessage._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + it('PINning last message', (done) => { + request + .post(api('chat.pinMessage')) + .set(credentials) + .send({ + messageId: channelMessage._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + it('should return channel structure with "lastMessage" object including pin, reaction and star(should be an array) infos', (done) => { + request + .get(api('channels.info')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('channel').and.to.be.an('object'); + const { channel } = res.body; + expect(channel).to.have.property('lastMessage').and.to.be.an('object'); + expect(channel.lastMessage).to.have.property('reactions').and.to.be.an('object'); + expect(channel.lastMessage).to.have.property('pinned').and.to.be.a('boolean'); + expect(channel.lastMessage).to.have.property('pinnedAt').and.to.be.a('string'); + expect(channel.lastMessage).to.have.property('pinnedBy').and.to.be.an('object'); + expect(channel.lastMessage).to.have.property('starred').and.to.be.an('array'); + }) + .end(done); + }); + it('should return all channels messages where the last message of array should have the "star" array with USERS star ONLY', (done) => { + request + .get(api('channels.messages')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages').and.to.be.an('array'); + const { messages } = res.body; + const lastMessage = messages.filter((message) => message._id === channelMessage._id)[0]; + expect(lastMessage).to.have.property('starred').and.to.be.an('array'); + expect(lastMessage.starred[0]._id).to.be.equal(adminUsername); + }) + .end(done); + }); + it('should return all channels messages where the last message of array should have the "star" array with USERS star ONLY even requested with count and offset params', (done) => { + request + .get(api('channels.messages')) + .set(credentials) + .query({ + roomId: testChannel._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages').and.to.be.an('array'); + const { messages } = res.body; + const lastMessage = messages.filter((message) => message._id === channelMessage._id)[0]; + expect(lastMessage).to.have.property('starred').and.to.be.an('array'); + expect(lastMessage.starred[0]._id).to.be.equal(adminUsername); + }) + .end(done); + }); + }); + + describe('[/channels.online]', () => { + const createUserAndChannel = async () => { + const testUser = await createUser(); + const testUserCredentials = await login(testUser.username, password); + + await request.post(api('users.setStatus')).set(testUserCredentials).send({ + message: '', + status: 'online', + }); + + const roomName = `group-test-${Date.now()}`; + + const roomResponse = await createRoom({ + name: roomName, + type: 'c', + members: [testUser.username], + }); + + return { + testUser, + testUserCredentials, + room: roomResponse.body.channel, + }; + }; + + it('should return an error if no query', () => + request + .get(api('channels.online')) + .set(credentials) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error', 'Invalid query'); + })); + + it('should return an error if passing an empty query', () => + request + .get(api('channels.online')) + .set(credentials) + .query('query={}') + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error', 'Invalid query'); + })); + + it('should return an array with online members', async () => { + const { testUser, testUserCredentials, room } = await createUserAndChannel(); + + return request + .get(api('channels.online')) + .set(testUserCredentials) + .query(`query={"_id": "${room._id}"}`) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('online'); + + const expected = { + _id: testUser._id, + username: testUser.username, + }; + expect(res.body.online).to.deep.include(expected); + }); + }); + + it('should return an empty array if requesting user is not in channel', async () => { + const outsider = await createUser(); + const outsiderCredentials = await login(outsider.username, password); + + const { testUser, room } = await createUserAndChannel(); + + return request + .get(api('channels.online')) + .set(outsiderCredentials) + .query(`query={"_id": "${room._id}"}`) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('online'); + + const expected = { + _id: testUser._id, + username: testUser.username, + }; + expect(res.body.online).to.deep.include(expected); + }); + }); + }); + + describe('[/channels.files]', () => { + before(() => updateSetting('VoIP_Enabled', true)); + const createVoipRoom = async () => { + const testUser = await createUser({ roles: ['user', 'livechat-agent'] }); + const testUserCredentials = await login(testUser.username, password); + const visitor = await createVisitor(); + const roomResponse = await createRoom({ + token: visitor.token, + type: 'v', + agentId: testUser._id, + credentials: testUserCredentials, + }); + return roomResponse.body.room; + }; + it('should fail if invalid channel', (done) => { + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomId: 'invalid', + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('errorType', 'error-room-not-found'); + }) + .end(done); + }); + + it('should fail for room type v', async () => { + const { _id } = await createVoipRoom(); + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomId: _id, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('errorType', 'error-room-not-found'); + }); + }); + + it('should succeed when searching by roomId', (done) => { + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomId: 'GENERAL', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('files').and.to.be.an('array'); + }) + .end(done); + }); + + it('should succeed when searching by roomId even requested with count and offset params', (done) => { + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomId: 'GENERAL', + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('files').and.to.be.an('array'); + }) + .end(done); + }); + + it('should succeed when searching by roomName', (done) => { + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomName: 'general', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('files').and.to.be.an('array'); + }) + .end(done); + }); + + it('should succeed when searching by roomName even requested with count and offset params', (done) => { + request + .get(api('channels.files')) + .set(credentials) + .query({ + roomName: 'general', + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('files').and.to.be.an('array'); + }) + .end(done); + }); + }); + + describe('[/channels.join]', () => { + let testChannelNoCode; + let testChannelWithCode; + let testUser; + let testUserCredentials; + before('Create test user', (done) => { + const username = `user.test.${Date.now()}`; + const email = `${username}@rocket.chat`; + request + .post(api('users.create')) + .set(credentials) + .send({ email, name: username, username, password }) + .end((err, res) => { + testUser = res.body.user; + done(); + }); + }); + before('Login as test user', (done) => { + request + .post(api('login')) + .send({ + user: testUser.username, + password, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + testUserCredentials = {}; + testUserCredentials['X-Auth-Token'] = res.body.data.authToken; + testUserCredentials['X-User-Id'] = res.body.data.userId; + }) + .end(done); + }); + before('Create no code channel', (done) => { + request + .post(api('channels.create')) + .set(testUserCredentials) + .send({ + name: `${apiPublicChannelName}-nojoincode`, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + testChannelNoCode = res.body.channel; + }) + .end(done); + }); + before('Create code channel', (done) => { + request + .post(api('channels.create')) + .set(testUserCredentials) + .send({ + name: `${apiPublicChannelName}-withjoincode`, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + testChannelWithCode = res.body.channel; + }) + .end(done); + }); + before('Set code for channel', (done) => { + request + .post(api('channels.setJoinCode')) + .set(testUserCredentials) + .send({ + roomId: testChannelWithCode._id, + joinCode: '123', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('should fail if invalid channel', (done) => { + request + .post(api('channels.join')) + .set(credentials) + .send({ + roomId: 'invalid', + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('errorType', 'error-room-not-found'); + }) + .end(done); + }); + + it('should succeed when joining code-free channel without join code', (done) => { + request + .post(api('channels.join')) + .set(credentials) + .send({ + roomId: testChannelNoCode._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id', testChannelNoCode._id); + }) + .end(done); + }); + + it('should fail when joining code-needed channel without join code and no join-without-join-code permission', (done) => { + updatePermission('join-without-join-code', []).then(() => { + request + .post(api('channels.join')) + .set(credentials) + .send({ + roomId: testChannelWithCode._id, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.nested.property('errorType', 'error-code-invalid'); + }) + .end(done); + }); + }); + + it('should succeed when joining code-needed channel without join code and with join-without-join-code permission', (done) => { + updatePermission('join-without-join-code', ['admin']).then(() => { + request + .post(api('channels.join')) + .set(credentials) + .send({ + roomId: testChannelWithCode._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id', testChannelWithCode._id); + }) + .end(done); + }); + }); + + it('leave channel', (done) => { + request + .post(api('channels.leave')) + .set(credentials) + .send({ + roomId: testChannelWithCode._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('should succeed when joining code-needed channel with join code', (done) => { + request + .post(api('channels.join')) + .set(credentials) + .send({ + roomId: testChannelWithCode._id, + joinCode: '123', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id', testChannelWithCode._id); + }) + .end(done); + }); + }); + + it('/channels.invite', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.invite')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + + it('/channels.addModerator', (done) => { + request + .post(api('channels.addModerator')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.removeModerator', (done) => { + request + .post(api('channels.removeModerator')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.addOwner', (done) => { + request + .post(api('channels.addOwner')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.removeOwner', (done) => { + request + .post(api('channels.removeOwner')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.kick', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.kick')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + + it('/channels.invite', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.invite')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', apiPublicChannelName); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + + it('/channels.addOwner', (done) => { + request + .post(api('channels.addOwner')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + describe('/channels.setDescription', () => { + it('should set the description of the channel with a string', (done) => { + request + .post(api('channels.setDescription')) + .set(credentials) + .send({ + roomId: channel._id, + description: 'this is a description for a channel for api tests', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('description', 'this is a description for a channel for api tests'); + }) + .end(done); + }); + it('should set the description of the channel with an empty string(remove the description)', (done) => { + request + .post(api('channels.setDescription')) + .set(credentials) + .send({ + roomId: channel._id, + description: '', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('description', ''); + }) + .end(done); + }); + }); + + describe('/channels.setTopic', () => { + it('should set the topic of the channel with a string', (done) => { + request + .post(api('channels.setTopic')) + .set(credentials) + .send({ + roomId: channel._id, + topic: 'this is a topic of a channel for api tests', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('topic', 'this is a topic of a channel for api tests'); + }) + .end(done); + }); + it('should set the topic of the channel with an empty string(remove the topic)', (done) => { + request + .post(api('channels.setTopic')) + .set(credentials) + .send({ + roomId: channel._id, + topic: '', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('topic', ''); + }) + .end(done); + }); + }); + + describe('/channels.setAnnouncement', () => { + it('should set the announcement of the channel with a string', (done) => { + request + .post(api('channels.setAnnouncement')) + .set(credentials) + .send({ + roomId: channel._id, + announcement: 'this is an announcement of a channel for api tests', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('announcement', 'this is an announcement of a channel for api tests'); + }) + .end(done); + }); + it('should set the announcement of the channel with an empty string(remove the announcement)', (done) => { + request + .post(api('channels.setAnnouncement')) + .set(credentials) + .send({ + roomId: channel._id, + announcement: '', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('announcement', ''); + }) + .end(done); + }); + }); + + describe('/channels.setPurpose', () => { + it('should set the purpose of the channel with a string', (done) => { + request + .post(api('channels.setPurpose')) + .set(credentials) + .send({ + roomId: channel._id, + purpose: 'this is a purpose of a channel for api tests', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('purpose', 'this is a purpose of a channel for api tests'); + }) + .end(done); + }); + it('should set the announcement of channel with an empty string(remove the purpose)', (done) => { + request + .post(api('channels.setPurpose')) + .set(credentials) + .send({ + roomId: channel._id, + purpose: '', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('purpose', ''); + }) + .end(done); + }); + }); + + describe('/channels.history', () => { + it('should return an array of members by channel', (done) => { + request + .get(api('channels.history')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages'); + }) + .end(done); + }); + + it('should return an array of members by channel even requested with count and offset params', (done) => { + request + .get(api('channels.history')) + .set(credentials) + .query({ + roomId: channel._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('messages'); + }) + .end(done); + }); + }); + + it('/channels.archive', (done) => { + request + .post(api('channels.archive')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.unarchive', (done) => { + request + .post(api('channels.unarchive')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.close', (done) => { + request + .post(api('channels.close')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.close', (done) => { + request + .post(api('channels.close')) + .set(credentials) + .send({ + roomName: apiPublicChannelName, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error', `The channel, ${apiPublicChannelName}, is already closed to the sender`); + }) + .end(done); + }); + + it('/channels.open', (done) => { + request + .post(api('channels.open')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + it('/channels.list', (done) => { + request + .get(api('channels.list')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + + it('/channels.list.joined', (done) => { + request + .get(api('channels.list.joined')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + it('/channels.counters', (done) => { + request + .get(api('channels.counters')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('joined', true); + expect(res.body).to.have.property('members'); + expect(res.body).to.have.property('unreads'); + expect(res.body).to.have.property('unreadsFrom'); + expect(res.body).to.have.property('msgs'); + expect(res.body).to.have.property('latest'); + expect(res.body).to.have.property('userMentions'); + }) + .end(done); + }); + + describe('/channels.members', () => { + it('should return an array of members by channel', (done) => { + request + .get(api('channels.members')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('members').and.to.be.an('array'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + }) + .end(done); + }); + + it('should return an array of members by channel even requested with count and offset params', (done) => { + request + .get(api('channels.members')) + .set(credentials) + .query({ + roomId: channel._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('members').and.to.be.an('array'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + }) + .end(done); + }); + + it('should return an filtered array of members by channel', (done) => { + request + .get(api('channels.members')) + .set(credentials) + .query({ + roomId: channel._id, + filter: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('members').and.to.be.an('array'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('count', 1); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('offset'); + }) + .end(done); + }); + }); + + it('/channels.rename', async () => { + const roomInfo = await getRoomInfo(channel._id); + + function failRenameChannel(name) { + it(`should not rename a channel to the reserved name ${name}`, (done) => { + request + .post(api('channels.rename')) + .set(credentials) + .send({ + roomId: channel._id, + name, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error', `${name} is already in use :( [error-field-unavailable]`); + }) + .end(done); + }); + } + + reservedWords.forEach((name) => { + failRenameChannel(name); + }); + + return request + .post(api('channels.rename')) + .set(credentials) + .send({ + roomId: channel._id, + name: `EDITED${apiPublicChannelName}`, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + + describe('/channels.getIntegrations', () => { + let integrationCreatedByAnUser; + let userCredentials; + let createdChannel; + before((done) => { + createRoom({ name: `test-integration-channel-${Date.now()}`, type: 'c' }).end((err, res) => { + createdChannel = res.body.channel; + createUser().then((createdUser) => { + const user = createdUser; + login(user.username, password).then((credentials) => { + userCredentials = credentials; + updatePermission('manage-incoming-integrations', ['user']).then(() => { + updatePermission('manage-own-incoming-integrations', ['user']).then(() => { + createIntegration( + { + type: 'webhook-incoming', + name: 'Incoming test', + enabled: true, + alias: 'test', + username: 'rocket.cat', + scriptEnabled: false, + channel: `#${createdChannel.name}`, + }, + userCredentials, + ).then((integration) => { + integrationCreatedByAnUser = integration; + done(); + }); + }); + }); + }); + }); + }); + }); + + after((done) => { + removeIntegration(integrationCreatedByAnUser._id, 'incoming').then(done); + }); + + it('should return the list of integrations of created channel and it should contain the integration created by user when the admin DOES have the permission', (done) => { + updatePermission('manage-incoming-integrations', ['admin']).then(() => { + request + .get(api('channels.getIntegrations')) + .set(credentials) + .query({ + roomId: createdChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + const integrationCreated = res.body.integrations.find( + (createdIntegration) => createdIntegration._id === integrationCreatedByAnUser._id, + ); + expect(integrationCreated).to.be.an('object'); + expect(integrationCreated._id).to.be.equal(integrationCreatedByAnUser._id); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + }); + + it('should return the list of integrations created by the user only', (done) => { + updatePermission('manage-own-incoming-integrations', ['admin']).then(() => { + updatePermission('manage-incoming-integrations', []).then(() => { + request + .get(api('channels.getIntegrations')) + .set(credentials) + .query({ + roomId: createdChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + const integrationCreated = res.body.integrations.find( + (createdIntegration) => createdIntegration._id === integrationCreatedByAnUser._id, + ); + expect(integrationCreated).to.be.equal(undefined); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + }); + }); + + it('should return unauthorized error when the user does not have any integrations permissions', (done) => { + updatePermission('manage-incoming-integrations', []).then(() => { + updatePermission('manage-own-incoming-integrations', []).then(() => { + updatePermission('manage-outgoing-integrations', []).then(() => { + updatePermission('manage-own-outgoing-integrations', []).then(() => { + request + .get(api('channels.getIntegrations')) + .set(credentials) + .query({ + roomId: createdChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(403) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error', 'unauthorized'); + }) + .end(done); + }); + }); + }); + }); + }); + }); + + it('/channels.addAll', (done) => { + request + .post(api('channels.addAll')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'c'); + }) + .end(done); + }); + + it('/channels.addLeader', (done) => { + request + .post(api('channels.addLeader')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .end(done); + }); + it('/channels.removeLeader', (done) => { + request + .post(api('channels.removeLeader')) + .set(credentials) + .send({ + roomId: channel._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + + describe('/channels.setCustomFields:', () => { + let cfchannel; + it('create channel with customFields', (done) => { + const customFields = { field0: 'value0' }; + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: `channel.cf.${Date.now()}`, + customFields, + }) + .end((err, res) => { + cfchannel = res.body.channel; + done(); + }); + }); + it('get customFields using channels.info', (done) => { + request + .get(api('channels.info')) + .set(credentials) + .query({ + roomId: cfchannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel.customFields.field0', 'value0'); + }) + .end(done); + }); + it('change customFields', async () => { + const customFields = { field9: 'value9' }; + return request + .post(api('channels.setCustomFields')) + .set(credentials) + .send({ + roomId: cfchannel._id, + customFields, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', cfchannel.name); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.customFields.field9', 'value9'); + expect(res.body).to.have.not.nested.property('channel.customFields.field0', 'value0'); + }); + }); + it('get customFields using channels.info', (done) => { + request + .get(api('channels.info')) + .set(credentials) + .query({ + roomId: cfchannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel.customFields.field9', 'value9'); + }) + .end(done); + }); + it('delete channels with customFields', (done) => { + request + .post(api('channels.delete')) + .set(credentials) + .send({ + roomName: cfchannel.name, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + it('create channel without customFields', (done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: `channel.cf.${Date.now()}`, + }) + .end((err, res) => { + cfchannel = res.body.channel; + done(); + }); + }); + it('set customFields with one nested field', async () => { + const customFields = { field1: 'value1' }; + return request + .post(api('channels.setCustomFields')) + .set(credentials) + .send({ + roomId: cfchannel._id, + customFields, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', cfchannel.name); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.customFields.field1', 'value1'); + }); + }); + it('set customFields with multiple nested fields', async () => { + const customFields = { field2: 'value2', field3: 'value3', field4: 'value4' }; + + return request + .post(api('channels.setCustomFields')) + .set(credentials) + .send({ + roomName: cfchannel.name, + customFields, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', cfchannel.name); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.customFields.field2', 'value2'); + expect(res.body).to.have.nested.property('channel.customFields.field3', 'value3'); + expect(res.body).to.have.nested.property('channel.customFields.field4', 'value4'); + expect(res.body).to.have.not.nested.property('channel.customFields.field1', 'value1'); + }); + }); + it('set customFields to empty object', (done) => { + const customFields = {}; + + request + .post(api('channels.setCustomFields')) + .set(credentials) + .send({ + roomName: cfchannel.name, + customFields, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', cfchannel.name); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.not.nested.property('channel.customFields.field2', 'value2'); + expect(res.body).to.have.not.nested.property('channel.customFields.field3', 'value3'); + expect(res.body).to.have.not.nested.property('channel.customFields.field4', 'value4'); + }) + .end(done); + }); + it('set customFields as a string -> should return 400', (done) => { + const customFields = ''; + + request + .post(api('channels.setCustomFields')) + .set(credentials) + .send({ + roomName: cfchannel.name, + customFields, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + }) + .end(done); + }); + it('delete channel with empty customFields', (done) => { + request + .post(api('channels.delete')) + .set(credentials) + .send({ + roomName: cfchannel.name, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + }); + + it('/channels.setJoinCode', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.setJoinCode')) + .set(credentials) + .send({ + roomId: channel._id, + joinCode: '123', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs); + }); + }); + + it('/channels.setReadOnly', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.setReadOnly')) + .set(credentials) + .send({ + roomId: channel._id, + readOnly: true, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + + it('/channels.setDefault', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.setDefault')) + .set(credentials) + .send({ + roomId: channel._id, + default: true, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs); + }); + }); + + it('/channels.leave', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.leave')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'c'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + + describe('/channels.setType', () => { + it('should change the type public channel to private', async () => { + const roomInfo = await getRoomInfo(channel._id); + + request + .post(api('channels.setType')) + .set(credentials) + .send({ + roomId: channel._id, + type: 'p', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id'); + expect(res.body).to.have.nested.property('channel.name', `EDITED${apiPublicChannelName}`); + expect(res.body).to.have.nested.property('channel.t', 'p'); + expect(res.body).to.have.nested.property('channel.msgs', roomInfo.channel.msgs + 1); + }); + }); + }); + + describe('/channels.delete:', () => { + let testChannel; + it('/channels.create', (done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: `channel.test.${Date.now()}`, + }) + .end((err, res) => { + testChannel = res.body.channel; + done(); + }); + }); + it('/channels.delete', (done) => { + request + .post(api('channels.delete')) + .set(credentials) + .send({ + roomName: testChannel.name, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); + it('/channels.info', (done) => { + request + .get(api('channels.info')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('errorType', 'error-room-not-found'); + }) + .end(done); + }); + }); + + describe('/channels.getAllUserMentionsByChannel', () => { + it('should return an array of mentions by channel', (done) => { + request + .get(api('channels.getAllUserMentionsByChannel')) + .set(credentials) + .query({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('mentions').and.to.be.an('array'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + it('should return an array of mentions by channel even requested with count and offset params', (done) => { + request + .get(api('channels.getAllUserMentionsByChannel')) + .set(credentials) + .query({ + roomId: channel._id, + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('mentions').and.to.be.an('array'); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('offset'); + expect(res.body).to.have.property('total'); + }) + .end(done); + }); + }); + + describe('/channels.roles', () => { + let testChannel; + it('/channels.create', (done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: `channel.roles.test.${Date.now()}`, + }) + .end((err, res) => { + testChannel = res.body.channel; + done(); + }); + }); + it('/channels.invite', (done) => { + request + .post(api('channels.invite')) + .set(credentials) + .send({ + roomId: testChannel._id, + userId: 'rocket.cat', + }) + .end(done); + }); + it('/channels.addModerator', (done) => { + request + .post(api('channels.addModerator')) + .set(credentials) + .send({ + roomId: testChannel._id, + userId: 'rocket.cat', + }) + .end(done); + }); + it('/channels.addLeader', (done) => { + request + .post(api('channels.addLeader')) + .set(credentials) + .send({ + roomId: testChannel._id, + userId: 'rocket.cat', + }) + .end(done); + }); + it('should return an array of role <-> user relationships in a channel', (done) => { + request + .get(api('channels.roles')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + expect(res.body).to.have.a.property('roles').that.is.an('array').that.has.lengthOf(2); + + expect(res.body.roles[0]).to.have.a.property('_id').that.is.a('string'); + expect(res.body.roles[0]).to.have.a.property('rid').that.is.equal(testChannel._id); + expect(res.body.roles[0]).to.have.a.property('roles').that.is.an('array').that.includes('moderator', 'leader'); + expect(res.body.roles[0]).to.have.a.property('u').that.is.an('object'); + expect(res.body.roles[0].u).to.have.a.property('_id').that.is.a('string'); + expect(res.body.roles[0].u).to.have.a.property('username').that.is.a('string'); + + expect(res.body.roles[1]).to.have.a.property('_id').that.is.a('string'); + expect(res.body.roles[1]).to.have.a.property('rid').that.is.equal(testChannel._id); + expect(res.body.roles[1]).to.have.a.property('roles').that.is.an('array').that.includes('owner'); + expect(res.body.roles[1]).to.have.a.property('u').that.is.an('object'); + expect(res.body.roles[1].u).to.have.a.property('_id').that.is.a('string'); + expect(res.body.roles[1].u).to.have.a.property('username').that.is.a('string'); + }) + .end(done); + }); + }); + + describe('/channels.moderators', () => { + let testChannel; + it('/channels.create', (done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ + name: `channel.roles.test.${Date.now()}`, + }) + .end((err, res) => { + testChannel = res.body.channel; + done(); + }); + }); + it('/channels.invite', (done) => { + request + .post(api('channels.invite')) + .set(credentials) + .send({ + roomId: testChannel._id, + userId: 'rocket.cat', + }) + .end(done); + }); + it('/channels.addModerator', (done) => { + request + .post(api('channels.addModerator')) + .set(credentials) + .send({ + roomId: testChannel._id, + userId: 'rocket.cat', + }) + .end(done); + }); + it('should return an array of moderators with rocket.cat as a moderator', (done) => { + request + .get(api('channels.moderators')) + .set(credentials) + .query({ + roomId: testChannel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + expect(res.body).to.have.a.property('moderators').that.is.an('array').that.has.lengthOf(1); + expect(res.body.moderators[0].username).to.be.equal('rocket.cat'); + }) + .end(done); + }); + }); + describe('/channels.anonymousread', () => { + after(() => updateSetting('Accounts_AllowAnonymousRead', false)); + it('should return an error when the setting "Accounts_AllowAnonymousRead" is disabled', (done) => { + updateSetting('Accounts_AllowAnonymousRead', false).then(() => { + request + .get(api('channels.anonymousread')) + .query({ + roomId: 'GENERAL', + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.a.property('success', false); + expect(res.body).to.have.a.property('error'); + expect(res.body).to.have.a.property('errorType'); + expect(res.body.errorType).to.be.equal('error-not-allowed'); + expect(res.body.error).to.be.equal('Enable "Allow Anonymous Read" [error-not-allowed]'); + }) + .end(done); + }); + }); + it('should return the messages list when the setting "Accounts_AllowAnonymousRead" is enabled', (done) => { + updateSetting('Accounts_AllowAnonymousRead', true).then(() => { + request + .get(api('channels.anonymousread')) + .query({ + roomId: 'GENERAL', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + expect(res.body).to.have.a.property('messages').that.is.an('array'); + }) + .end(done); + }); + }); + it('should return the messages list when the setting "Accounts_AllowAnonymousRead" is enabled even requested with count and offset params', (done) => { + updateSetting('Accounts_AllowAnonymousRead', true).then(() => { + request + .get(api('channels.anonymousread')) + .query({ + roomId: 'GENERAL', + count: 5, + offset: 0, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + expect(res.body).to.have.a.property('messages').that.is.an('array'); + }) + .end(done); + }); + }); + }); + + describe('/channels.convertToTeam', () => { + before((done) => { + request + .post(api('channels.create')) + .set(credentials) + .send({ name: `channel-${Date.now()}` }) + .then((response) => { + this.newChannel = response.body.channel; + }) + .then(() => done()); + }); + + it('should fail to convert channel if lacking edit-room permission', (done) => { + updatePermission('create-team', []).then(() => { + updatePermission('edit-room', ['admin']).then(() => { + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(403) + .expect((res) => { + expect(res.body).to.have.a.property('success', false); + }) + .end(done); + }); + }); + }); + + it('should fail to convert channel if lacking create-team permission', (done) => { + updatePermission('create-team', ['admin']).then(() => { + updatePermission('edit-room', []).then(() => { + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(403) + .expect((res) => { + expect(res.body).to.have.a.property('success', false); + }) + .end(done); + }); + }); + }); + + it(`should successfully convert a channel to a team when the channel's id is sent as parameter`, (done) => { + updatePermission('create-team', ['admin']).then(() => { + updatePermission('edit-room', ['admin']).then(() => { + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .end(done); + }); + }); + }); + + it(`should successfully convert a channel to a team when the channel's name is sent as parameter`, (done) => { + updatePermission('create-team', ['admin']).then(() => { + updatePermission('edit-room', ['admin']).then(() => { + request + .post(api('teams.convertToChannel')) + .set(credentials) + .send({ teamName: this.newChannel.name }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .then(() => { + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelName: this.newChannel.name }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .end(done); + }); + }); + }); + }); + + it(`should successfully convert a channel to a team when the channel's name and id are sent as parameter`, (done) => { + updatePermission('create-team', ['admin']).then(() => { + updatePermission('edit-room', ['admin']).then(() => { + request + .post(api('teams.convertToChannel')) + .set(credentials) + .send({ teamName: this.newChannel.name }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .then(() => { + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ + channelName: this.newChannel.name, + channelId: this.newChannel._id, + }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .end(done); + }); + }); + }); + }); + + it('should fail to convert channel without the required parameters', (done) => { + request.post(api('channels.convertToTeam')).set(credentials).send({}).expect(400).end(done); + }); + + it("should fail to convert channel if it's already taken", (done) => { + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(400) + .expect((res) => { + expect(res.body).to.have.a.property('success', false); + }) + .end(done); + }); + }); + + describe.skip('/channels.setAutojoin', () => { + // let testTeam; + let testChannel; + // let testUser1; + // let testUser2; + before(async () => { + const teamCreateRes = await request + .post(api('teams.create')) + .set(credentials) + .send({ name: `team-${Date.now()}` }); + + const { team } = teamCreateRes.body; + + const user1 = await createUser(); + const user2 = await createUser(); + + const channelCreateRes = await request + .post(api('channels.create')) + .set(credentials) + .send({ + name: `team-channel-${Date.now()}`, + extraData: { + teamId: team._id, + }, + }); + + const { channel } = channelCreateRes.body; + + // testTeam = team; + testChannel = channel; + // testUser1 = user1; + // testUser2 = user2; + + await request + .post(api('teams.addMembers')) + .set(credentials) + .send({ + name: team.name, + members: [{ userId: user1._id }, { userId: user2._id }], + }); + }); + + it('should add all existing team members', async () => { + const resAutojoin = await request + .post(api('channels.setAutojoin')) + .set(credentials) + .send({ roomName: testChannel.name, autojoin: true }) + .expect(200); + expect(resAutojoin.body).to.have.a.property('success', true); + + const channelInfoResponse = await request.get(api('channels.info')).set(credentials).query({ roomId: testChannel._id }); + const { channel } = channelInfoResponse.body; + + return expect(channel.usersCount).to.be.equals(3); + }); + }); + + context("Setting: 'Use Real Name': true", () => { + before(async () => { + await updateSetting('UI_Use_Real_Name', true); + + await request + .post(api('channels.join')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id', channel._id); + }); + + await request + .post(api('chat.sendMessage')) + .set(credentials) + .send({ + message: { + text: 'Sample message', + rid: channel._id, + }, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }); + }); + after(async () => { + await updateSetting('UI_Use_Real_Name', false); + + await request + .post(api('channels.leave')) + .set(credentials) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('channel._id', channel._id); + }); + }); + + it('/channels.list', (done) => { + request + .get(api('channels.list')) + .set(credentials) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('channels').and.to.be.an('array'); + + const retChannel = res.body.channels.find(({ _id }) => _id === channel._id); + + expect(retChannel).to.have.nested.property('lastMessage.u.name', 'RocketChat Internal Admin Test'); + }) + .end(done); + }); + + it('/channels.list.joined', (done) => { + request + .get(api('channels.list.joined')) + .set(credentials) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('count'); + expect(res.body).to.have.property('total'); + expect(res.body).to.have.property('channels').and.to.be.an('array'); + + const retChannel = res.body.channels.find(({ _id }) => _id === channel._id); + + expect(retChannel).to.have.nested.property('lastMessage.u.name', 'RocketChat Internal Admin Test'); + }) + .end(done); + }); + }); +}); From 0bf369be66abd73d3a3c688da51fac6afe4a8bfd Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Tue, 13 Sep 2022 10:19:45 -0300 Subject: [PATCH 04/12] Fix findChannelByIdOrName params type --- apps/meteor/app/api/server/v1/channels.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/apps/meteor/app/api/server/v1/channels.ts b/apps/meteor/app/api/server/v1/channels.ts index 79d68ea836996..75393ae4629e6 100644 --- a/apps/meteor/app/api/server/v1/channels.ts +++ b/apps/meteor/app/api/server/v1/channels.ts @@ -32,13 +32,7 @@ function findChannelByIdOrName({ checkedArchived = true, userId, }: { - params: - | { - roomId: string; - } - | { - roomName: string; - }; + params: { roomId?: string; roomName?: string }; userId?: string; checkedArchived?: boolean; }): IRoom { From d7df939bb231af17ef4b128db8979c562379968b Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Thu, 15 Sep 2022 20:30:47 -0300 Subject: [PATCH 05/12] Do not allow channel's name and id both to be sent as parameters --- apps/meteor/app/api/server/v1/channels.ts | 15 +++++++++++---- apps/meteor/tests/end-to-end/api/02-channels.js | 7 ++++--- .../src/v1/channels/ChannelsConvertToTeamProps.ts | 9 --------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/apps/meteor/app/api/server/v1/channels.ts b/apps/meteor/app/api/server/v1/channels.ts index 75393ae4629e6..8e7e6d777c2c1 100644 --- a/apps/meteor/app/api/server/v1/channels.ts +++ b/apps/meteor/app/api/server/v1/channels.ts @@ -32,13 +32,20 @@ function findChannelByIdOrName({ checkedArchived = true, userId, }: { - params: { roomId?: string; roomName?: string }; + params: + | { + roomId: string; + } + | { + roomName: string; + }; userId?: string; checkedArchived?: boolean; }): IRoom { const fields = { ...API.v1.defaultFieldsToExclude }; - const room: IRoom = 'roomId' in params ? Rooms.findOneById(params.roomId, { fields }) : Rooms.findOneByName(params.roomName, { fields }); + const room: IRoom = + 'roomId' in params && params.roomId ? Rooms.findOneById(params.roomId, { fields }) : Rooms.findOneByName(params.roomName, { fields }); if (!room || (room.t !== 'c' && room.t !== 'l')) { throw new Meteor.Error('error-room-not-found', 'The required "roomId" or "roomName" param provided does not match any channel'); @@ -465,8 +472,8 @@ API.v1.addRoute( const room = findChannelByIdOrName({ params: { - ...(channelId && { roomId: channelId }), - ...(channelName && { roomName: channelName }), + roomId: channelId, + roomName: channelName, }, userId: this.userId, }); diff --git a/apps/meteor/tests/end-to-end/api/02-channels.js b/apps/meteor/tests/end-to-end/api/02-channels.js index 5f29a69fc1e63..eda83c3409801 100644 --- a/apps/meteor/tests/end-to-end/api/02-channels.js +++ b/apps/meteor/tests/end-to-end/api/02-channels.js @@ -1964,7 +1964,7 @@ describe('[Channels]', function () { }); }); - it(`should successfully convert a channel to a team when the channel's name and id are sent as parameter`, (done) => { + it(`should return an error when the channel's name and id are sent as parameter`, (done) => { updatePermission('create-team', ['admin']).then(() => { updatePermission('edit-room', ['admin']).then(() => { request @@ -1983,9 +1983,10 @@ describe('[Channels]', function () { channelName: this.newChannel.name, channelId: this.newChannel._id, }) - .expect(200) + .expect(400) .expect((res) => { - expect(res.body).to.have.a.property('success', true); + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error').include(`must match exactly one schema in oneOf`); }) .end(done); }); diff --git a/packages/rest-typings/src/v1/channels/ChannelsConvertToTeamProps.ts b/packages/rest-typings/src/v1/channels/ChannelsConvertToTeamProps.ts index a825549403859..8be16da6c6b41 100644 --- a/packages/rest-typings/src/v1/channels/ChannelsConvertToTeamProps.ts +++ b/packages/rest-typings/src/v1/channels/ChannelsConvertToTeamProps.ts @@ -22,15 +22,6 @@ const channelsConvertToTeamPropsSchema = { required: ['channelName'], additionalProperties: false, }, - { - type: 'object', - properties: { - channelId: { type: 'string' }, - channelName: { type: 'string' }, - }, - required: ['channelId', 'channelName'], - additionalProperties: false, - }, ], }; From 35605b46212f8263e41d477ef400fabd067efc47 Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Fri, 16 Sep 2022 16:58:44 -0300 Subject: [PATCH 06/12] Fix typing issue in findChannelByIdOrName call --- apps/meteor/app/api/server/v1/channels.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/meteor/app/api/server/v1/channels.ts b/apps/meteor/app/api/server/v1/channels.ts index 8e7e6d777c2c1..8fe5e472a939f 100644 --- a/apps/meteor/app/api/server/v1/channels.ts +++ b/apps/meteor/app/api/server/v1/channels.ts @@ -44,8 +44,7 @@ function findChannelByIdOrName({ }): IRoom { const fields = { ...API.v1.defaultFieldsToExclude }; - const room: IRoom = - 'roomId' in params && params.roomId ? Rooms.findOneById(params.roomId, { fields }) : Rooms.findOneByName(params.roomName, { fields }); + const room: IRoom = 'roomId' in params ? Rooms.findOneById(params.roomId, { fields }) : Rooms.findOneByName(params.roomName, { fields }); if (!room || (room.t !== 'c' && room.t !== 'l')) { throw new Meteor.Error('error-room-not-found', 'The required "roomId" or "roomName" param provided does not match any channel'); @@ -472,8 +471,7 @@ API.v1.addRoute( const room = findChannelByIdOrName({ params: { - roomId: channelId, - roomName: channelName, + ...(channelId ? { roomId: channelId } : { roomName: channelName }), }, userId: this.userId, }); From a52871d9bc34ca701a33a0e6dbde0d8d6b4c1d43 Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Wed, 21 Sep 2022 16:04:25 -0300 Subject: [PATCH 07/12] Fix team name already taken test --- .../tests/end-to-end/api/02-channels.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/02-channels.js b/apps/meteor/tests/end-to-end/api/02-channels.js index eda83c3409801..dc51225457564 100644 --- a/apps/meteor/tests/end-to-end/api/02-channels.js +++ b/apps/meteor/tests/end-to-end/api/02-channels.js @@ -1938,7 +1938,7 @@ describe('[Channels]', function () { }); }); - it(`should successfully convert a channel to a team when the channel's name is sent as parameter`, (done) => { + it(`should return an error when the channel's name and id are sent as parameter`, (done) => { updatePermission('create-team', ['admin']).then(() => { updatePermission('edit-room', ['admin']).then(() => { request @@ -1953,10 +1953,14 @@ describe('[Channels]', function () { request .post(api('channels.convertToTeam')) .set(credentials) - .send({ channelName: this.newChannel.name }) - .expect(200) + .send({ + channelName: this.newChannel.name, + channelId: this.newChannel._id, + }) + .expect(400) .expect((res) => { - expect(res.body).to.have.a.property('success', true); + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error').include(`must match exactly one schema in oneOf`); }) .end(done); }); @@ -1964,7 +1968,7 @@ describe('[Channels]', function () { }); }); - it(`should return an error when the channel's name and id are sent as parameter`, (done) => { + it(`should successfully convert a channel to a team when the channel's name is sent as parameter`, (done) => { updatePermission('create-team', ['admin']).then(() => { updatePermission('edit-room', ['admin']).then(() => { request @@ -1979,14 +1983,10 @@ describe('[Channels]', function () { request .post(api('channels.convertToTeam')) .set(credentials) - .send({ - channelName: this.newChannel.name, - channelId: this.newChannel._id, - }) - .expect(400) + .send({ channelName: this.newChannel.name }) + .expect(200) .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('error').include(`must match exactly one schema in oneOf`); + expect(res.body).to.have.a.property('success', true); }) .end(done); }); From 36210b01f0d9a7d4872dcd3a19adcbad3d829bde Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Wed, 21 Sep 2022 16:23:07 -0300 Subject: [PATCH 08/12] Remove unnecessary permission updates --- .../tests/end-to-end/api/02-channels.js | 112 ++++++++---------- yarn.lock | 4 +- 2 files changed, 50 insertions(+), 66 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/02-channels.js b/apps/meteor/tests/end-to-end/api/02-channels.js index dc51225457564..e06c7417baa55 100644 --- a/apps/meteor/tests/end-to-end/api/02-channels.js +++ b/apps/meteor/tests/end-to-end/api/02-channels.js @@ -1907,91 +1907,75 @@ describe('[Channels]', function () { }); it('should fail to convert channel if lacking create-team permission', (done) => { - updatePermission('create-team', ['admin']).then(() => { - updatePermission('edit-room', []).then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(403) - .expect((res) => { - expect(res.body).to.have.a.property('success', false); - }) - .end(done); - }); - }); + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(403) + .expect((res) => { + expect(res.body).to.have.a.property('success', false); + }) + .end(done); }); it(`should successfully convert a channel to a team when the channel's id is sent as parameter`, (done) => { - updatePermission('create-team', ['admin']).then(() => { - updatePermission('edit-room', ['admin']).then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) - .end(done); - }); - }); + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .end(done); }); it(`should return an error when the channel's name and id are sent as parameter`, (done) => { - updatePermission('create-team', ['admin']).then(() => { - updatePermission('edit-room', ['admin']).then(() => { + request + .post(api('teams.convertToChannel')) + .set(credentials) + .send({ teamName: this.newChannel.name }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .then(() => { request - .post(api('teams.convertToChannel')) + .post(api('channels.convertToTeam')) .set(credentials) - .send({ teamName: this.newChannel.name }) - .expect(200) + .send({ + channelName: this.newChannel.name, + channelId: this.newChannel._id, + }) + .expect(400) .expect((res) => { - expect(res.body).to.have.a.property('success', true); + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error').include(`must match exactly one schema in oneOf`); }) - .then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ - channelName: this.newChannel.name, - channelId: this.newChannel._id, - }) - .expect(400) - .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('error').include(`must match exactly one schema in oneOf`); - }) - .end(done); - }); + .end(done); }); - }); }); it(`should successfully convert a channel to a team when the channel's name is sent as parameter`, (done) => { - updatePermission('create-team', ['admin']).then(() => { - updatePermission('edit-room', ['admin']).then(() => { + request + .post(api('teams.convertToChannel')) + .set(credentials) + .send({ teamName: this.newChannel.name }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); + }) + .then(() => { request - .post(api('teams.convertToChannel')) + .post(api('channels.convertToTeam')) .set(credentials) - .send({ teamName: this.newChannel.name }) + .send({ channelName: this.newChannel.name }) .expect(200) .expect((res) => { expect(res.body).to.have.a.property('success', true); }) - .then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelName: this.newChannel.name }) - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) - .end(done); - }); + .end(done); }); - }); }); it('should fail to convert channel without the required parameters', (done) => { diff --git a/yarn.lock b/yarn.lock index 6a7de33154dc1..b9d0338f82ebf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -24433,7 +24433,7 @@ __metadata: optional: true bin: lessc: ./bin/lessc - checksum: 61568b56b5289fdcfe3d51baf3c13e7db7140022c0a37ef0ae343169f0de927a4b4f4272bc10c20101796e8ee79e934e024051321bba93b3ae071f734309bd98 + checksum: c9b8c0e865427112c48a9cac36f14964e130577743c29d56a6d93b5812b70846b04ccaa364acf1e8d75cee3855215ec0a2d8d9de569c80e774f10b6245f39b7d languageName: node linkType: hard @@ -36132,7 +36132,7 @@ __metadata: languageName: node linkType: hard -"vm2@npm:^3.9.11": +"vm2@npm:^3.9.10": version: 3.9.11 resolution: "vm2@npm:3.9.11" dependencies: From 971f37c62f4a45e8e5a4ee37fec20298513174cf Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Wed, 21 Sep 2022 16:33:44 -0300 Subject: [PATCH 09/12] Improve request nesting --- apps/meteor/tests/end-to-end/api/02-channels.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/02-channels.js b/apps/meteor/tests/end-to-end/api/02-channels.js index e06c7417baa55..b0e29bc0f36c8 100644 --- a/apps/meteor/tests/end-to-end/api/02-channels.js +++ b/apps/meteor/tests/end-to-end/api/02-channels.js @@ -1891,8 +1891,9 @@ describe('[Channels]', function () { }); it('should fail to convert channel if lacking edit-room permission', (done) => { - updatePermission('create-team', []).then(() => { - updatePermission('edit-room', ['admin']).then(() => { + updatePermission('create-team', []) + .then(() => updatePermission('edit-room', ['admin'])) + .then(() => { request .post(api('channels.convertToTeam')) .set(credentials) From 80fa434daa541d877eb87af969433d4810304544 Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Wed, 21 Sep 2022 18:18:09 -0300 Subject: [PATCH 10/12] Fix tests order --- .../tests/end-to-end/api/02-channels.js | 57 +++++++++---------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/02-channels.js b/apps/meteor/tests/end-to-end/api/02-channels.js index b0e29bc0f36c8..03304344490e0 100644 --- a/apps/meteor/tests/end-to-end/api/02-channels.js +++ b/apps/meteor/tests/end-to-end/api/02-channels.js @@ -1904,54 +1904,51 @@ describe('[Channels]', function () { }) .end(done); }); - }); }); it('should fail to convert channel if lacking create-team permission', (done) => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(403) - .expect((res) => { - expect(res.body).to.have.a.property('success', false); - }) - .end(done); + updatePermission('create-team', ['admin']) + .then(() => updatePermission('edit-room', [])) + .then(() => { + request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(403) + .expect((res) => { + expect(res.body).to.have.a.property('success', false); + }) + .end(done); + }); }); - it(`should successfully convert a channel to a team when the channel's id is sent as parameter`, (done) => { + it(`should return an error when the channel's name and id are sent as parameter`, (done) => { request .post(api('channels.convertToTeam')) .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(200) + .send({ + channelName: this.newChannel.name, + channelId: this.newChannel._id, + }) + .expect(400) .expect((res) => { - expect(res.body).to.have.a.property('success', true); + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error').include(`must match exactly one schema in oneOf`); }) .end(done); }); - it(`should return an error when the channel's name and id are sent as parameter`, (done) => { - request - .post(api('teams.convertToChannel')) - .set(credentials) - .send({ teamName: this.newChannel.name }) - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) + it(`should successfully convert a channel to a team when the channel's id is sent as parameter`, (done) => { + updatePermission('create-team', ['admin']) + .then(() => updatePermission('edit-room', ['admin'])) .then(() => { request .post(api('channels.convertToTeam')) .set(credentials) - .send({ - channelName: this.newChannel.name, - channelId: this.newChannel._id, - }) - .expect(400) + .send({ channelId: this.newChannel._id }) + .expect(200) .expect((res) => { - expect(res.body).to.have.property('success', false); - expect(res.body).to.have.property('error').include(`must match exactly one schema in oneOf`); + expect(res.body).to.have.a.property('success', true); }) .end(done); }); From aaebe90bb2a1bbd72c0c2b0c33bd38849b9058ef Mon Sep 17 00:00:00 2001 From: matheusbsilva137 Date: Wed, 21 Sep 2022 20:57:31 -0300 Subject: [PATCH 11/12] Use async/await in new tests --- .../tests/end-to-end/api/02-channels.js | 96 +++++++++---------- 1 file changed, 44 insertions(+), 52 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/02-channels.js b/apps/meteor/tests/end-to-end/api/02-channels.js index 03304344490e0..17c1aa713969a 100644 --- a/apps/meteor/tests/end-to-end/api/02-channels.js +++ b/apps/meteor/tests/end-to-end/api/02-channels.js @@ -1890,35 +1890,31 @@ describe('[Channels]', function () { .then(() => done()); }); - it('should fail to convert channel if lacking edit-room permission', (done) => { - updatePermission('create-team', []) - .then(() => updatePermission('edit-room', ['admin'])) - .then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(403) - .expect((res) => { - expect(res.body).to.have.a.property('success', false); - }) - .end(done); + it('should fail to convert channel if lacking edit-room permission', async () => { + await updatePermission('create-team', []); + await updatePermission('edit-room', ['admin']); + + await request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(403) + .expect((res) => { + expect(res.body).to.have.a.property('success', false); }); }); - it('should fail to convert channel if lacking create-team permission', (done) => { - updatePermission('create-team', ['admin']) - .then(() => updatePermission('edit-room', [])) - .then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(403) - .expect((res) => { - expect(res.body).to.have.a.property('success', false); - }) - .end(done); + it('should fail to convert channel if lacking create-team permission', async () => { + await updatePermission('create-team', ['admin']); + await updatePermission('edit-room', []); + + await request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(403) + .expect((res) => { + expect(res.body).to.have.a.property('success', false); }); }); @@ -1938,41 +1934,37 @@ describe('[Channels]', function () { .end(done); }); - it(`should successfully convert a channel to a team when the channel's id is sent as parameter`, (done) => { - updatePermission('create-team', ['admin']) - .then(() => updatePermission('edit-room', ['admin'])) - .then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelId: this.newChannel._id }) - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) - .end(done); + it(`should successfully convert a channel to a team when the channel's id is sent as parameter`, async () => { + await updatePermission('create-team', ['admin']); + await updatePermission('edit-room', ['admin']); + + await request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelId: this.newChannel._id }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); }); }); - it(`should successfully convert a channel to a team when the channel's name is sent as parameter`, (done) => { - request + it(`should successfully convert a channel to a team when the channel's name is sent as parameter`, async () => { + await request .post(api('teams.convertToChannel')) .set(credentials) .send({ teamName: this.newChannel.name }) .expect(200) .expect((res) => { expect(res.body).to.have.a.property('success', true); - }) - .then(() => { - request - .post(api('channels.convertToTeam')) - .set(credentials) - .send({ channelName: this.newChannel.name }) - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) - .end(done); + }); + + await request + .post(api('channels.convertToTeam')) + .set(credentials) + .send({ channelName: this.newChannel.name }) + .expect(200) + .expect((res) => { + expect(res.body).to.have.a.property('success', true); }); }); From 7400c8bc31254330ac02e10f384cbbda936ebc54 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 1 Nov 2022 17:59:03 -0300 Subject: [PATCH 12/12] yarn.lock from develop --- yarn.lock | 2823 +++++++++++++++++------------------------------------ 1 file changed, 878 insertions(+), 1945 deletions(-) diff --git a/yarn.lock b/yarn.lock index b9d0338f82ebf..e4f77544c089c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -53,14 +53,7 @@ __metadata: languageName: node linkType: hard -"@babel/compat-data@npm:^7.13.11, @babel/compat-data@npm:^7.18.8": - version: 7.18.8 - resolution: "@babel/compat-data@npm:7.18.8" - checksum: 3096aafad74936477ebdd039bcf342fba84eb3100e608f3360850fb63e1efa1c66037c4824f814d62f439ab47d25164439343a6e92e9b4357024fdf571505eb9 - languageName: node - linkType: hard - -"@babel/compat-data@npm:^7.17.7, @babel/compat-data@npm:^7.19.1": +"@babel/compat-data@npm:^7.17.7, @babel/compat-data@npm:^7.18.8, @babel/compat-data@npm:^7.19.1": version: 7.19.1 resolution: "@babel/compat-data@npm:7.19.1" checksum: f985887ea08a140e4af87a94d3fb17af0345491eb97f5a85b1840255c2e2a97429f32a8fd12a7aae9218af5f1024f1eb12a5cd280d2d69b2337583c17ea506ba @@ -91,30 +84,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.1.0, @babel/core@npm:^7.12.10, @babel/core@npm:^7.12.3, @babel/core@npm:^7.18.9, @babel/core@npm:^7.7.2, @babel/core@npm:^7.7.5, @babel/core@npm:^7.8.0": - version: 7.18.9 - resolution: "@babel/core@npm:7.18.9" - dependencies: - "@ampproject/remapping": ^2.1.0 - "@babel/code-frame": ^7.18.6 - "@babel/generator": ^7.18.9 - "@babel/helper-compilation-targets": ^7.18.9 - "@babel/helper-module-transforms": ^7.18.9 - "@babel/helpers": ^7.18.9 - "@babel/parser": ^7.18.9 - "@babel/template": ^7.18.6 - "@babel/traverse": ^7.18.9 - "@babel/types": ^7.18.9 - convert-source-map: ^1.7.0 - debug: ^4.1.0 - gensync: ^1.0.0-beta.2 - json5: ^2.2.1 - semver: ^6.3.0 - checksum: 64b9088b03fdf659b334864ef93bed85d60c17b27fcbd72970f8eb9e0d3266ffa5a1926960f648f2db36b0bafec615f947ea5117d200599a0661b9f0a9cdf323 - languageName: node - linkType: hard - -"@babel/core@npm:^7.11.6, @babel/core@npm:^7.19.1": +"@babel/core@npm:^7.1.0, @babel/core@npm:^7.11.6, @babel/core@npm:^7.12.10, @babel/core@npm:^7.12.3, @babel/core@npm:^7.18.9, @babel/core@npm:^7.19.1, @babel/core@npm:^7.7.2, @babel/core@npm:^7.7.5, @babel/core@npm:^7.8.0": version: 7.19.1 resolution: "@babel/core@npm:7.19.1" dependencies: @@ -174,18 +144,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.12.5, @babel/generator@npm:^7.18.9, @babel/generator@npm:^7.7.2": - version: 7.18.9 - resolution: "@babel/generator@npm:7.18.9" - dependencies: - "@babel/types": ^7.18.9 - "@jridgewell/gen-mapping": ^0.3.2 - jsesc: ^2.5.1 - checksum: 1c271e0c6f33e59f7845d88a1b0b9b0dce88164e80dec9274a716efa54c260e405e9462b160843e73f45382bf5b24d8e160e0121207e480c29b30e2ed0eb16d4 - languageName: node - linkType: hard - -"@babel/generator@npm:^7.18.13, @babel/generator@npm:^7.19.0": +"@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.12.5, @babel/generator@npm:^7.18.13, @babel/generator@npm:^7.19.0, @babel/generator@npm:^7.7.2": version: 7.19.0 resolution: "@babel/generator@npm:7.19.0" dependencies: @@ -215,21 +174,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.13.0, @babel/helper-compilation-targets@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/helper-compilation-targets@npm:7.18.9" - dependencies: - "@babel/compat-data": ^7.18.8 - "@babel/helper-validator-option": ^7.18.6 - browserslist: ^4.20.2 - semver: ^6.3.0 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 2a9d71e124e098a9f45de4527ddd1982349d231827d341e00da9dfb967e260ecc7662c8b62abee4a010fb34d5f07a8d2155c974e0bc1928144cee5644910621d - languageName: node - linkType: hard - -"@babel/helper-compilation-targets@npm:^7.17.7, @babel/helper-compilation-targets@npm:^7.19.0, @babel/helper-compilation-targets@npm:^7.19.1": +"@babel/helper-compilation-targets@npm:^7.13.0, @babel/helper-compilation-targets@npm:^7.17.7, @babel/helper-compilation-targets@npm:^7.18.9, @babel/helper-compilation-targets@npm:^7.19.0, @babel/helper-compilation-targets@npm:^7.19.1": version: 7.19.1 resolution: "@babel/helper-compilation-targets@npm:7.19.1" dependencies: @@ -243,24 +188,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-create-class-features-plugin@npm:^7.16.7, @babel/helper-create-class-features-plugin@npm:^7.17.6, @babel/helper-create-class-features-plugin@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/helper-create-class-features-plugin@npm:7.18.6" - dependencies: - "@babel/helper-annotate-as-pure": ^7.18.6 - "@babel/helper-environment-visitor": ^7.18.6 - "@babel/helper-function-name": ^7.18.6 - "@babel/helper-member-expression-to-functions": ^7.18.6 - "@babel/helper-optimise-call-expression": ^7.18.6 - "@babel/helper-replace-supers": ^7.18.6 - "@babel/helper-split-export-declaration": ^7.18.6 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 4d6da441ce329867338825c044c143f0b273cbfc6a20b9099e824a46f916584f44eabab073f78f02047d86719913e8f1a8bd72f42099ebe52691c29fabb992e4 - languageName: node - linkType: hard - -"@babel/helper-create-class-features-plugin@npm:^7.19.0": +"@babel/helper-create-class-features-plugin@npm:^7.17.6, @babel/helper-create-class-features-plugin@npm:^7.18.6, @babel/helper-create-class-features-plugin@npm:^7.19.0": version: 7.19.0 resolution: "@babel/helper-create-class-features-plugin@npm:7.19.0" dependencies: @@ -277,19 +205,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-create-regexp-features-plugin@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/helper-create-regexp-features-plugin@npm:7.18.6" - dependencies: - "@babel/helper-annotate-as-pure": ^7.18.6 - regexpu-core: ^5.1.0 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 2d76e660cbfd0bfcb01ca9f177f0e9091c871a6b99f68ece6bcf4ab4a9df073485bdc2d87ecdfbde44b7f3723b26d13085d0f92082adb3ae80d31b246099f10a - languageName: node - linkType: hard - -"@babel/helper-create-regexp-features-plugin@npm:^7.19.0": +"@babel/helper-create-regexp-features-plugin@npm:^7.18.6, @babel/helper-create-regexp-features-plugin@npm:^7.19.0": version: 7.19.0 resolution: "@babel/helper-create-regexp-features-plugin@npm:7.19.0" dependencies: @@ -319,24 +235,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-define-polyfill-provider@npm:^0.3.1": - version: 0.3.1 - resolution: "@babel/helper-define-polyfill-provider@npm:0.3.1" - dependencies: - "@babel/helper-compilation-targets": ^7.13.0 - "@babel/helper-module-imports": ^7.12.13 - "@babel/helper-plugin-utils": ^7.13.0 - "@babel/traverse": ^7.13.0 - debug: ^4.1.1 - lodash.debounce: ^4.0.8 - resolve: ^1.14.2 - semver: ^6.1.2 - peerDependencies: - "@babel/core": ^7.4.0-0 - checksum: e3e93cb22febfc0449a210cdafb278e5e1a038af2ca2b02f5dee71c7a49e8ba26e469d631ee11a4243885961a62bb2e5b0a4deb3ec1d7918a33c953d05c3e584 - languageName: node - linkType: hard - "@babel/helper-define-polyfill-provider@npm:^0.3.3": version: 0.3.3 resolution: "@babel/helper-define-polyfill-provider@npm:0.3.3" @@ -353,7 +251,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-environment-visitor@npm:^7.18.6, @babel/helper-environment-visitor@npm:^7.18.9": +"@babel/helper-environment-visitor@npm:^7.18.9": version: 7.18.9 resolution: "@babel/helper-environment-visitor@npm:7.18.9" checksum: b25101f6162ddca2d12da73942c08ad203d7668e06663df685634a8fde54a98bc015f6f62938e8554457a592a024108d45b8f3e651fd6dcdb877275b73cc4420 @@ -369,17 +267,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-function-name@npm:^7.18.6, @babel/helper-function-name@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/helper-function-name@npm:7.18.9" - dependencies: - "@babel/template": ^7.18.6 - "@babel/types": ^7.18.9 - checksum: d04c44e0272f887c0c868651be7fc3c5690531bea10936f00d4cca3f6d5db65e76dfb49e8d553c42ae1fe1eba61ccce9f3d93ba2df50a66408c8d4c3cc61cf0c - languageName: node - linkType: hard - -"@babel/helper-function-name@npm:^7.19.0": +"@babel/helper-function-name@npm:^7.18.9, @babel/helper-function-name@npm:^7.19.0": version: 7.19.0 resolution: "@babel/helper-function-name@npm:7.19.0" dependencies: @@ -398,7 +286,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-member-expression-to-functions@npm:^7.18.6, @babel/helper-member-expression-to-functions@npm:^7.18.9": +"@babel/helper-member-expression-to-functions@npm:^7.18.9": version: 7.18.9 resolution: "@babel/helper-member-expression-to-functions@npm:7.18.9" dependencies: @@ -416,23 +304,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.12.1, @babel/helper-module-transforms@npm:^7.18.6, @babel/helper-module-transforms@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/helper-module-transforms@npm:7.18.9" - dependencies: - "@babel/helper-environment-visitor": ^7.18.9 - "@babel/helper-module-imports": ^7.18.6 - "@babel/helper-simple-access": ^7.18.6 - "@babel/helper-split-export-declaration": ^7.18.6 - "@babel/helper-validator-identifier": ^7.18.6 - "@babel/template": ^7.18.6 - "@babel/traverse": ^7.18.9 - "@babel/types": ^7.18.9 - checksum: af08c60ea239ff3d40eda542fceaab69de17e713f131e80ead08c975ba7a47dd55d439cb48cfb14ae7ec96704a10c989ff5a5240e52a39101cb44a49467ce058 - languageName: node - linkType: hard - -"@babel/helper-module-transforms@npm:^7.19.0": +"@babel/helper-module-transforms@npm:^7.12.1, @babel/helper-module-transforms@npm:^7.18.6, @babel/helper-module-transforms@npm:^7.18.9, @babel/helper-module-transforms@npm:^7.19.0": version: 7.19.0 resolution: "@babel/helper-module-transforms@npm:7.19.0" dependencies: @@ -464,35 +336,14 @@ __metadata: languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.13.0, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.16.7, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.18.9, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": - version: 7.18.9 - resolution: "@babel/helper-plugin-utils@npm:7.18.9" - checksum: ebae876cd60f1fe238c7210986093845fa5c4cad5feeda843ea4d780bf068256717650376d3af2a5e760f2ed6a35c065ae144f99c47da3e54aa6cba99d8804e0 - languageName: node - linkType: hard - -"@babel/helper-plugin-utils@npm:^7.19.0": +"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.13.0, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.16.7, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.18.9, @babel/helper-plugin-utils@npm:^7.19.0, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": version: 7.19.0 resolution: "@babel/helper-plugin-utils@npm:7.19.0" checksum: eedc996c633c8c207921c26ec2989eae0976336ecd9b9f1ac526498f52b5d136f7cd03c32b6fdf8d46a426f907c142de28592f383c42e5fba1e904cbffa05345 languageName: node linkType: hard -"@babel/helper-remap-async-to-generator@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/helper-remap-async-to-generator@npm:7.18.6" - dependencies: - "@babel/helper-annotate-as-pure": ^7.18.6 - "@babel/helper-environment-visitor": ^7.18.6 - "@babel/helper-wrap-function": ^7.18.6 - "@babel/types": ^7.18.6 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 83e890624da9413c74a8084f6b5f7bfe93abad8a6e1a33464f3086e2a1336751672e6ac6d74dddd35b641d19584cc0f93d02c52a4f33385b3be5b40942fe30da - languageName: node - linkType: hard - -"@babel/helper-remap-async-to-generator@npm:^7.18.9": +"@babel/helper-remap-async-to-generator@npm:^7.18.6, @babel/helper-remap-async-to-generator@npm:^7.18.9": version: 7.18.9 resolution: "@babel/helper-remap-async-to-generator@npm:7.18.9" dependencies: @@ -567,18 +418,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-wrap-function@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/helper-wrap-function@npm:7.18.6" - dependencies: - "@babel/helper-function-name": ^7.18.6 - "@babel/template": ^7.18.6 - "@babel/traverse": ^7.18.6 - "@babel/types": ^7.18.6 - checksum: b7a4f59b302ed77407e5c2005d8677ebdeabbfa69230e15f80b5e06cc532369c1e48399ec3e67dd3341e7ab9b3f84f17a255e2c1ec4e0d42bb571a4dac5472d6 - languageName: node - linkType: hard - "@babel/helper-wrap-function@npm:^7.18.9": version: 7.19.0 resolution: "@babel/helper-wrap-function@npm:7.19.0" @@ -591,18 +430,7 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.12.5, @babel/helpers@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/helpers@npm:7.18.9" - dependencies: - "@babel/template": ^7.18.6 - "@babel/traverse": ^7.18.9 - "@babel/types": ^7.18.9 - checksum: d0bd8255d36bfc65dc52ce75f7fea778c70287da2d64981db4c84fbdf9581409ecbd6433deff1c81da3a5acf26d7e4c364b3a4445efacf88f4f48e77c5b34d8d - languageName: node - linkType: hard - -"@babel/helpers@npm:^7.19.0": +"@babel/helpers@npm:^7.12.5, @babel/helpers@npm:^7.18.9, @babel/helpers@npm:^7.19.0": version: 7.19.0 resolution: "@babel/helpers@npm:7.19.0" dependencies: @@ -624,16 +452,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.12.11, @babel/parser@npm:^7.12.7, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.18.6, @babel/parser@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/parser@npm:7.18.9" - bin: - parser: ./bin/babel-parser.js - checksum: 81a966b334e3ef397e883c64026265a5ae0ad435a86f52a84f60a5ee1efc0738c1f42c55e0dc5f191cc6a83ba0c61350433eee417bf1dff160ca5f3cfde244c6 - languageName: node - linkType: hard - -"@babel/parser@npm:^7.18.10, @babel/parser@npm:^7.19.1": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.12.11, @babel/parser@npm:^7.12.7, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.18.10, @babel/parser@npm:^7.18.13, @babel/parser@npm:^7.19.1": version: 7.19.1 resolution: "@babel/parser@npm:7.19.1" bin: @@ -642,15 +461,6 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.18.13, @babel/parser@npm:^7.19.0": - version: 7.19.0 - resolution: "@babel/parser@npm:7.19.0" - bin: - parser: ./bin/babel-parser.js - checksum: af86d829bfeb60e0dcf54a43489c2514674b6c8d9bb24cf112706772125752fcd517877ad30501d533fa85f70a439d02eebeec3be9c2e95499853367184e0da7 - languageName: node - linkType: hard - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.18.6": version: 7.18.6 resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.18.6" @@ -675,20 +485,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-proposal-async-generator-functions@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/plugin-proposal-async-generator-functions@npm:7.18.6" - dependencies: - "@babel/helper-environment-visitor": ^7.18.6 - "@babel/helper-plugin-utils": ^7.18.6 - "@babel/helper-remap-async-to-generator": ^7.18.6 - "@babel/plugin-syntax-async-generators": ^7.8.4 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 3f708808ba6f8a9bd18805b1b22ab90ec0b362d949111a776e0bade5391f143f55479dcc444b2cec25fc89ac21035ee92e9a5ec37c02c610639197a0c2f7dcb0 - languageName: node - linkType: hard - "@babel/plugin-proposal-async-generator-functions@npm:^7.19.1": version: 7.19.1 resolution: "@babel/plugin-proposal-async-generator-functions@npm:7.19.1" @@ -1160,18 +956,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-typescript@npm:^7.16.7, @babel/plugin-syntax-typescript@npm:^7.7.2": - version: 7.16.7 - resolution: "@babel/plugin-syntax-typescript@npm:7.16.7" - dependencies: - "@babel/helper-plugin-utils": ^7.16.7 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 661e636060609ede9a402e22603b01784c21fabb0a637e65f561c8159351fe0130bbc11fdefe31902107885e3332fc34d95eb652ac61d3f61f2d61f5da20609e - languageName: node - linkType: hard - -"@babel/plugin-syntax-typescript@npm:^7.18.6": +"@babel/plugin-syntax-typescript@npm:^7.18.6, @babel/plugin-syntax-typescript@npm:^7.7.2": version: 7.18.6 resolution: "@babel/plugin-syntax-typescript@npm:7.18.6" dependencies: @@ -1228,25 +1013,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-classes@npm:^7.12.1, @babel/plugin-transform-classes@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/plugin-transform-classes@npm:7.18.9" - dependencies: - "@babel/helper-annotate-as-pure": ^7.18.6 - "@babel/helper-environment-visitor": ^7.18.9 - "@babel/helper-function-name": ^7.18.9 - "@babel/helper-optimise-call-expression": ^7.18.6 - "@babel/helper-plugin-utils": ^7.18.9 - "@babel/helper-replace-supers": ^7.18.9 - "@babel/helper-split-export-declaration": ^7.18.6 - globals: ^11.1.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: d7e953c0cf32af64e75db1277d2556c04635f32691ef462436897840be6f8021d4f85ee96134cb796a12dda549cf53346fedf96b671885f881bc4037c9d120ad - languageName: node - linkType: hard - -"@babel/plugin-transform-classes@npm:^7.19.0": +"@babel/plugin-transform-classes@npm:^7.12.1, @babel/plugin-transform-classes@npm:^7.19.0": version: 7.19.0 resolution: "@babel/plugin-transform-classes@npm:7.19.0" dependencies: @@ -1276,18 +1043,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-destructuring@npm:^7.12.1, @babel/plugin-transform-destructuring@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/plugin-transform-destructuring@npm:7.18.9" - dependencies: - "@babel/helper-plugin-utils": ^7.18.9 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 1a9b85dff67fd248fa8a2488ef59df3eb4dd4ca6007ff7db9f780c7873630a13bc16cfb2ad8f4c4ca966e42978410d1e4b306545941fe62769f2683f34973acd - languageName: node - linkType: hard - -"@babel/plugin-transform-destructuring@npm:^7.18.13": +"@babel/plugin-transform-destructuring@npm:^7.12.1, @babel/plugin-transform-destructuring@npm:^7.18.13": version: 7.18.13 resolution: "@babel/plugin-transform-destructuring@npm:7.18.13" dependencies: @@ -1418,21 +1174,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-modules-systemjs@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/plugin-transform-modules-systemjs@npm:7.18.9" - dependencies: - "@babel/helper-hoist-variables": ^7.18.6 - "@babel/helper-module-transforms": ^7.18.9 - "@babel/helper-plugin-utils": ^7.18.9 - "@babel/helper-validator-identifier": ^7.18.6 - babel-plugin-dynamic-import-node: ^2.3.3 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 6122d9901ed5dc56d9db843efc9249fe20d769a11989bbbf5a806ed4f086def949185198aa767888481babf70fc52b6b3e297a991e2b02b4f34ffb03d998d1e3 - languageName: node - linkType: hard - "@babel/plugin-transform-modules-systemjs@npm:^7.19.0": version: 7.19.0 resolution: "@babel/plugin-transform-modules-systemjs@npm:7.19.0" @@ -1460,18 +1201,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-named-capturing-groups-regex@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/plugin-transform-named-capturing-groups-regex@npm:7.18.6" - dependencies: - "@babel/helper-create-regexp-features-plugin": ^7.18.6 - "@babel/helper-plugin-utils": ^7.18.6 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: 6ef64aa3dad68df139eeaa7b6e9bb626be8f738ed5ed4db765d516944b1456d513b6bad3bb60fff22babe73de26436fd814a4228705b2d3d2fdb272c31da35e2 - languageName: node - linkType: hard - "@babel/plugin-transform-named-capturing-groups-regex@npm:^7.19.1": version: 7.19.1 resolution: "@babel/plugin-transform-named-capturing-groups-regex@npm:7.19.1" @@ -1612,19 +1341,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-spread@npm:^7.12.1, @babel/plugin-transform-spread@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/plugin-transform-spread@npm:7.18.9" - dependencies: - "@babel/helper-plugin-utils": ^7.18.9 - "@babel/helper-skip-transparent-expression-wrappers": ^7.18.9 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 59489dd6212bd21debdf77746d9fa02dfe36f7062dc08742b8841d04312a26ea37bc0d71c71a6e37c3ab81dce744faa7f23fa94b0915593458f6adc35c087766 - languageName: node - linkType: hard - -"@babel/plugin-transform-spread@npm:^7.19.0": +"@babel/plugin-transform-spread@npm:^7.12.1, @babel/plugin-transform-spread@npm:^7.19.0": version: 7.19.0 resolution: "@babel/plugin-transform-spread@npm:7.19.0" dependencies: @@ -1669,19 +1386,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-typescript@npm:^7.16.7": - version: 7.16.8 - resolution: "@babel/plugin-transform-typescript@npm:7.16.8" - dependencies: - "@babel/helper-create-class-features-plugin": ^7.16.7 - "@babel/helper-plugin-utils": ^7.16.7 - "@babel/plugin-syntax-typescript": ^7.16.7 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: a76d0afcbd550208cf2e7cdedb4f2d3ca3fa287640a4858a5ee0a28270b784d7d20d5a51b5997dc84514e066a5ebef9e0a0f74ed9fffae09e73984786dd08036 - languageName: node - linkType: hard - "@babel/plugin-transform-typescript@npm:^7.18.6": version: 7.19.1 resolution: "@babel/plugin-transform-typescript@npm:7.19.1" @@ -1706,17 +1410,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-unicode-escapes@npm:^7.18.6": - version: 7.18.6 - resolution: "@babel/plugin-transform-unicode-escapes@npm:7.18.6" - dependencies: - "@babel/helper-plugin-utils": ^7.18.6 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 297a03706723164a777263f76a8d89bccfb1d3fbc5e1075079dfd84372a5416d579da7d44c650abf935a1150a995bfce0e61966447b657f958e51c4ea45b72dc - languageName: node - linkType: hard - "@babel/plugin-transform-unicode-regex@npm:^7.18.6": version: 7.18.6 resolution: "@babel/plugin-transform-unicode-regex@npm:7.18.6" @@ -1729,92 +1422,7 @@ __metadata: languageName: node linkType: hard -"@babel/preset-env@npm:^7.12.11, @babel/preset-env@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/preset-env@npm:7.18.9" - dependencies: - "@babel/compat-data": ^7.18.8 - "@babel/helper-compilation-targets": ^7.18.9 - "@babel/helper-plugin-utils": ^7.18.9 - "@babel/helper-validator-option": ^7.18.6 - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ^7.18.6 - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": ^7.18.9 - "@babel/plugin-proposal-async-generator-functions": ^7.18.6 - "@babel/plugin-proposal-class-properties": ^7.18.6 - "@babel/plugin-proposal-class-static-block": ^7.18.6 - "@babel/plugin-proposal-dynamic-import": ^7.18.6 - "@babel/plugin-proposal-export-namespace-from": ^7.18.9 - "@babel/plugin-proposal-json-strings": ^7.18.6 - "@babel/plugin-proposal-logical-assignment-operators": ^7.18.9 - "@babel/plugin-proposal-nullish-coalescing-operator": ^7.18.6 - "@babel/plugin-proposal-numeric-separator": ^7.18.6 - "@babel/plugin-proposal-object-rest-spread": ^7.18.9 - "@babel/plugin-proposal-optional-catch-binding": ^7.18.6 - "@babel/plugin-proposal-optional-chaining": ^7.18.9 - "@babel/plugin-proposal-private-methods": ^7.18.6 - "@babel/plugin-proposal-private-property-in-object": ^7.18.6 - "@babel/plugin-proposal-unicode-property-regex": ^7.18.6 - "@babel/plugin-syntax-async-generators": ^7.8.4 - "@babel/plugin-syntax-class-properties": ^7.12.13 - "@babel/plugin-syntax-class-static-block": ^7.14.5 - "@babel/plugin-syntax-dynamic-import": ^7.8.3 - "@babel/plugin-syntax-export-namespace-from": ^7.8.3 - "@babel/plugin-syntax-import-assertions": ^7.18.6 - "@babel/plugin-syntax-json-strings": ^7.8.3 - "@babel/plugin-syntax-logical-assignment-operators": ^7.10.4 - "@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.3 - "@babel/plugin-syntax-numeric-separator": ^7.10.4 - "@babel/plugin-syntax-object-rest-spread": ^7.8.3 - "@babel/plugin-syntax-optional-catch-binding": ^7.8.3 - "@babel/plugin-syntax-optional-chaining": ^7.8.3 - "@babel/plugin-syntax-private-property-in-object": ^7.14.5 - "@babel/plugin-syntax-top-level-await": ^7.14.5 - "@babel/plugin-transform-arrow-functions": ^7.18.6 - "@babel/plugin-transform-async-to-generator": ^7.18.6 - "@babel/plugin-transform-block-scoped-functions": ^7.18.6 - "@babel/plugin-transform-block-scoping": ^7.18.9 - "@babel/plugin-transform-classes": ^7.18.9 - "@babel/plugin-transform-computed-properties": ^7.18.9 - "@babel/plugin-transform-destructuring": ^7.18.9 - "@babel/plugin-transform-dotall-regex": ^7.18.6 - "@babel/plugin-transform-duplicate-keys": ^7.18.9 - "@babel/plugin-transform-exponentiation-operator": ^7.18.6 - "@babel/plugin-transform-for-of": ^7.18.8 - "@babel/plugin-transform-function-name": ^7.18.9 - "@babel/plugin-transform-literals": ^7.18.9 - "@babel/plugin-transform-member-expression-literals": ^7.18.6 - "@babel/plugin-transform-modules-amd": ^7.18.6 - "@babel/plugin-transform-modules-commonjs": ^7.18.6 - "@babel/plugin-transform-modules-systemjs": ^7.18.9 - "@babel/plugin-transform-modules-umd": ^7.18.6 - "@babel/plugin-transform-named-capturing-groups-regex": ^7.18.6 - "@babel/plugin-transform-new-target": ^7.18.6 - "@babel/plugin-transform-object-super": ^7.18.6 - "@babel/plugin-transform-parameters": ^7.18.8 - "@babel/plugin-transform-property-literals": ^7.18.6 - "@babel/plugin-transform-regenerator": ^7.18.6 - "@babel/plugin-transform-reserved-words": ^7.18.6 - "@babel/plugin-transform-shorthand-properties": ^7.18.6 - "@babel/plugin-transform-spread": ^7.18.9 - "@babel/plugin-transform-sticky-regex": ^7.18.6 - "@babel/plugin-transform-template-literals": ^7.18.9 - "@babel/plugin-transform-typeof-symbol": ^7.18.9 - "@babel/plugin-transform-unicode-escapes": ^7.18.6 - "@babel/plugin-transform-unicode-regex": ^7.18.6 - "@babel/preset-modules": ^0.1.5 - "@babel/types": ^7.18.9 - babel-plugin-polyfill-corejs2: ^0.3.1 - babel-plugin-polyfill-corejs3: ^0.5.2 - babel-plugin-polyfill-regenerator: ^0.3.1 - core-js-compat: ^3.22.1 - semver: ^6.3.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 311002b9255d1aa261afe712ab73a93687652437804e2f44e6cc55438f8b199463f53bb2b8e0912b0034f208a42eee664a9e126a6061ca504a792ede97dd027e - languageName: node - linkType: hard - -"@babel/preset-env@npm:^7.19.1": +"@babel/preset-env@npm:^7.12.11, @babel/preset-env@npm:^7.18.9, @babel/preset-env@npm:^7.19.1": version: 7.19.1 resolution: "@babel/preset-env@npm:7.19.1" dependencies: @@ -1943,20 +1551,7 @@ __metadata: languageName: node linkType: hard -"@babel/preset-typescript@npm:^7.12.7": - version: 7.16.7 - resolution: "@babel/preset-typescript@npm:7.16.7" - dependencies: - "@babel/helper-plugin-utils": ^7.16.7 - "@babel/helper-validator-option": ^7.16.7 - "@babel/plugin-transform-typescript": ^7.16.7 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 44e2f3fa302befe0dc50a01b79e5aa8c27a9c7047c46df665beae97201173030646ddf7c83d7d3ed3724fc38151745b11693e7b4502c81c4cd67781ff5677da5 - languageName: node - linkType: hard - -"@babel/preset-typescript@npm:^7.18.6": +"@babel/preset-typescript@npm:^7.12.7, @babel/preset-typescript@npm:^7.18.6": version: 7.18.6 resolution: "@babel/preset-typescript@npm:7.18.6" dependencies: @@ -1993,25 +1588,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.14.5, @babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.4.4, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": - version: 7.18.6 - resolution: "@babel/runtime@npm:7.18.6" - dependencies: - regenerator-runtime: ^0.13.4 - checksum: 8b707b64ae0524db617d0c49933b258b96376a38307dc0be8fb42db5697608bcc1eba459acce541e376cff5ed5c5287d24db5780bd776b7c75ba2c2e26ff8a2c - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.18.9": - version: 7.18.9 - resolution: "@babel/runtime@npm:7.18.9" - dependencies: - regenerator-runtime: ^0.13.4 - checksum: 36dd736baba7164e82b3cc9d43e081f0cb2d05ff867ad39cac515d99546cee75b7f782018b02a3dcf5f2ef3d27f319faa68965fdfec49d4912c60c6002353a2e - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.6.2": +"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.14.5, @babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.18.9, @babel/runtime@npm:^7.4.4, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.6.2, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": version: 7.19.0 resolution: "@babel/runtime@npm:7.19.0" dependencies: @@ -2029,18 +1606,7 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.12.7, @babel/template@npm:^7.18.6, @babel/template@npm:^7.3.3": - version: 7.18.6 - resolution: "@babel/template@npm:7.18.6" - dependencies: - "@babel/code-frame": ^7.18.6 - "@babel/parser": ^7.18.6 - "@babel/types": ^7.18.6 - checksum: cb02ed804b7b1938dbecef4e01562013b80681843dd391933315b3dd9880820def3b5b1bff6320d6e4c6a1d63d1d5799630d658ec6b0369c5505e7e4029c38fb - languageName: node - linkType: hard - -"@babel/template@npm:^7.18.10": +"@babel/template@npm:^7.12.7, @babel/template@npm:^7.18.10, @babel/template@npm:^7.3.3": version: 7.18.10 resolution: "@babel/template@npm:7.18.10" dependencies: @@ -2051,43 +1617,7 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.1.6, @babel/traverse@npm:^7.12.11, @babel/traverse@npm:^7.12.9, @babel/traverse@npm:^7.13.0, @babel/traverse@npm:^7.18.6, @babel/traverse@npm:^7.18.9, @babel/traverse@npm:^7.7.2": - version: 7.18.9 - resolution: "@babel/traverse@npm:7.18.9" - dependencies: - "@babel/code-frame": ^7.18.6 - "@babel/generator": ^7.18.9 - "@babel/helper-environment-visitor": ^7.18.9 - "@babel/helper-function-name": ^7.18.9 - "@babel/helper-hoist-variables": ^7.18.6 - "@babel/helper-split-export-declaration": ^7.18.6 - "@babel/parser": ^7.18.9 - "@babel/types": ^7.18.9 - debug: ^4.1.0 - globals: ^11.1.0 - checksum: 0445a51952ea1664a5719d9b1f8bf04be6f1933bcf54915fecc544c844a5dad2ac56f3b555723bbf741ef680d7fd64f6a5d69cfd08d518a4089c79a734270162 - languageName: node - linkType: hard - -"@babel/traverse@npm:^7.18.13": - version: 7.19.0 - resolution: "@babel/traverse@npm:7.19.0" - dependencies: - "@babel/code-frame": ^7.18.6 - "@babel/generator": ^7.19.0 - "@babel/helper-environment-visitor": ^7.18.9 - "@babel/helper-function-name": ^7.19.0 - "@babel/helper-hoist-variables": ^7.18.6 - "@babel/helper-split-export-declaration": ^7.18.6 - "@babel/parser": ^7.19.0 - "@babel/types": ^7.19.0 - debug: ^4.1.0 - globals: ^11.1.0 - checksum: dcbd1316c9f4bf3cefee45b6f5194590563aa5d123500a60d3c8d714bef279205014c8e599ebafc469967199a7622e1444cd0235c16d4243da437e3f1281771e - languageName: node - linkType: hard - -"@babel/traverse@npm:^7.19.0, @babel/traverse@npm:^7.19.1": +"@babel/traverse@npm:^7.1.6, @babel/traverse@npm:^7.12.11, @babel/traverse@npm:^7.12.9, @babel/traverse@npm:^7.13.0, @babel/traverse@npm:^7.18.13, @babel/traverse@npm:^7.18.9, @babel/traverse@npm:^7.19.0, @babel/traverse@npm:^7.19.1, @babel/traverse@npm:^7.7.2": version: 7.19.1 resolution: "@babel/traverse@npm:7.19.1" dependencies: @@ -2105,17 +1635,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.11, @babel/types@npm:^7.12.7, @babel/types@npm:^7.18.6, @babel/types@npm:^7.18.9, @babel/types@npm:^7.2.0, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": - version: 7.18.9 - resolution: "@babel/types@npm:7.18.9" - dependencies: - "@babel/helper-validator-identifier": ^7.18.6 - to-fast-properties: ^2.0.0 - checksum: f0e0147267895fd8a5b82133e711ce7ce99941f3ce63647e0e3b00656a7afe48a8aa48edbae27543b701794d2b29a562a08f51f88f41df401abce7c3acc5e13a - languageName: node - linkType: hard - -"@babel/types@npm:^7.18.10, @babel/types@npm:^7.18.13, @babel/types@npm:^7.19.0": +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.11, @babel/types@npm:^7.12.7, @babel/types@npm:^7.18.10, @babel/types@npm:^7.18.13, @babel/types@npm:^7.18.6, @babel/types@npm:^7.18.9, @babel/types@npm:^7.19.0, @babel/types@npm:^7.2.0, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": version: 7.19.0 resolution: "@babel/types@npm:7.19.0" dependencies: @@ -2378,13 +1898,20 @@ __metadata: languageName: node linkType: hard -"@emotion/hash@npm:0.8.0, @emotion/hash@npm:^0.8.0": +"@emotion/hash@npm:0.8.0": version: 0.8.0 resolution: "@emotion/hash@npm:0.8.0" checksum: 4b35d88a97e67275c1d990c96d3b0450451d089d1508619488fc0acb882cb1ac91e93246d471346ebd1b5402215941ef4162efe5b51534859b39d8b3a0e3ffaa languageName: node linkType: hard +"@emotion/hash@npm:^0.9.0": + version: 0.9.0 + resolution: "@emotion/hash@npm:0.9.0" + checksum: b63428f7c8186607acdca5d003700cecf0ded519d0b5c5cc3b3154eafcad6ff433f8361bd2bac8882715b557e6f06945694aeb6ba8b25c6095d7a88570e2e0bb + languageName: node + linkType: hard + "@emotion/memoize@npm:0.7.4": version: 0.7.4 resolution: "@emotion/memoize@npm:0.7.4" @@ -2457,24 +1984,7 @@ __metadata: languageName: node linkType: hard -"@eslint/eslintrc@npm:^1.0.5, @eslint/eslintrc@npm:^1.3.0": - version: 1.3.0 - resolution: "@eslint/eslintrc@npm:1.3.0" - dependencies: - ajv: ^6.12.4 - debug: ^4.3.2 - espree: ^9.3.2 - globals: ^13.15.0 - ignore: ^5.2.0 - import-fresh: ^3.2.1 - js-yaml: ^4.1.0 - minimatch: ^3.1.2 - strip-json-comments: ^3.1.1 - checksum: a1e734ad31a8b5328dce9f479f185fd4fc83dd7f06c538e1fa457fd8226b89602a55cc6458cd52b29573b01cdfaf42331be8cfc1fec732570086b591f4ed6515 - languageName: node - linkType: hard - -"@eslint/eslintrc@npm:^1.3.2": +"@eslint/eslintrc@npm:^1.0.5, @eslint/eslintrc@npm:^1.3.2": version: 1.3.2 resolution: "@eslint/eslintrc@npm:1.3.2" dependencies: @@ -2609,14 +2119,14 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.10.4": - version: 0.10.4 - resolution: "@humanwhocodes/config-array@npm:0.10.4" +"@humanwhocodes/config-array@npm:^0.10.5": + version: 0.10.5 + resolution: "@humanwhocodes/config-array@npm:0.10.5" dependencies: "@humanwhocodes/object-schema": ^1.2.1 debug: ^4.1.1 minimatch: ^3.0.4 - checksum: d480e5d57e6d787565b6cff78e27c3d1b380692d4ffb0ada7d7f5957a56c9032f034da05a3e443065dbd0671ebf4d859036ced34e96b325bbc1badbae3c05300 + checksum: af4fa2633c57414be22ddba0a072cc611ef9a07104542fa24bde918a0153b89b6e08ca6a20ccc9079de6079e219e2406e38414d1b662db8bb59a3ba9d6eee6e3 languageName: node linkType: hard @@ -2663,6 +2173,15 @@ __metadata: languageName: node linkType: hard +"@internationalized/date@npm:3.0.2-nightly.3479+afb946c4a": + version: 3.0.2-nightly.3479 + resolution: "@internationalized/date@npm:3.0.2-nightly.3479" + dependencies: + "@babel/runtime": ^7.6.2 + checksum: 7610c2e62842e1dbda6d259c49652e1039b23718f757f8ebbd4c612ad88f7e22080691b5c0ef394dd42dda80ab905781b67abcd18ebe2063597c50337e552b90 + languageName: node + linkType: hard + "@internationalized/date@npm:^3.0.1": version: 3.0.1 resolution: "@internationalized/date@npm:3.0.1" @@ -2672,6 +2191,16 @@ __metadata: languageName: node linkType: hard +"@internationalized/message@npm:3.0.10-nightly.3479+afb946c4a": + version: 3.0.10-nightly.3479 + resolution: "@internationalized/message@npm:3.0.10-nightly.3479" + dependencies: + "@babel/runtime": ^7.6.2 + intl-messageformat: ^10.1.0 + checksum: de33df67325286925e7634479d0000c60395ce3c90c46a59e0e819ce5d93ed4bb42c785bc24c099855347493feab2625fcaf9da1046c60f9ce4d83013ae1a71d + languageName: node + linkType: hard + "@internationalized/message@npm:^3.0.9": version: 3.0.9 resolution: "@internationalized/message@npm:3.0.9" @@ -2682,6 +2211,15 @@ __metadata: languageName: node linkType: hard +"@internationalized/number@npm:3.1.2-nightly.3479+afb946c4a": + version: 3.1.2-nightly.3479 + resolution: "@internationalized/number@npm:3.1.2-nightly.3479" + dependencies: + "@babel/runtime": ^7.6.2 + checksum: 393480d3e784b719cd19231075deb65610c113da302620e1e3dd9ce4d48ef90113e6110c64274f2c453c96dc741b5c409d0677cf0eee6c0b1008a7ba59e72fc2 + languageName: node + linkType: hard + "@internationalized/number@npm:^3.1.1": version: 3.1.1 resolution: "@internationalized/number@npm:3.1.1" @@ -2691,6 +2229,15 @@ __metadata: languageName: node linkType: hard +"@internationalized/string@npm:3.0.1-nightly.3479+afb946c4a": + version: 3.0.1-nightly.3479 + resolution: "@internationalized/string@npm:3.0.1-nightly.3479" + dependencies: + "@babel/runtime": ^7.6.2 + checksum: 2d867fbfdec27379edab17643301ff61691d49fd696235f5126f5075d4a5a862819974248ea4f6019b71f0f8333cfe4e472aa32ed84f2e3dd90eb4238568b831 + languageName: node + linkType: hard + "@internationalized/string@npm:^3.0.0": version: 3.0.0 resolution: "@internationalized/string@npm:3.0.0" @@ -3249,17 +2796,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.0, @jridgewell/trace-mapping@npm:^0.3.7, @jridgewell/trace-mapping@npm:^0.3.9": - version: 0.3.13 - resolution: "@jridgewell/trace-mapping@npm:0.3.13" - dependencies: - "@jridgewell/resolve-uri": ^3.0.3 - "@jridgewell/sourcemap-codec": ^1.4.10 - checksum: e38254e830472248ca10a6ed1ae75af5e8514f0680245a5e7b53bc3c030fd8691d4d3115d80595b45d3badead68269769ed47ecbbdd67db1343a11f05700e75a - languageName: node - linkType: hard - -"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.14, @jridgewell/trace-mapping@npm:^0.3.15": +"@jridgewell/trace-mapping@npm:^0.3.0, @jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.14, @jridgewell/trace-mapping@npm:^0.3.15, @jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.15 resolution: "@jridgewell/trace-mapping@npm:0.3.15" dependencies: @@ -3269,10 +2806,10 @@ __metadata: languageName: node linkType: hard -"@juggle/resize-observer@npm:^3.3.1": - version: 3.3.1 - resolution: "@juggle/resize-observer@npm:3.3.1" - checksum: ddabc4044276a2cb57d469c4917206c7e39f2463aa8e3430e33e4eda554412afe29c22afa40e6708b49dad5d56768dc83acd68a704b1dcd49a0906bb96b991b2 +"@juggle/resize-observer@npm:^3.4.0": + version: 3.4.0 + resolution: "@juggle/resize-observer@npm:3.4.0" + checksum: 2505028c05cc2e17639fcad06218b1c4b60f932a4ebb4b41ab546ef8c157031ae377e3f560903801f6d01706dbefd4943b6c4704bf19ed86dfa1c62f1473a570 languageName: node linkType: hard @@ -4018,6 +3555,29 @@ __metadata: languageName: node linkType: hard +"@react-aria/color@npm:^3.0.0-beta.15": + version: 3.0.0-nightly.3479 + resolution: "@react-aria/color@npm:3.0.0-nightly.3479" + dependencies: + "@babel/runtime": ^7.6.2 + "@react-aria/i18n": 3.0.0-nightly.1779+afb946c4a + "@react-aria/interactions": 3.0.0-nightly.1779+afb946c4a + "@react-aria/slider": 3.2.2-nightly.3479+afb946c4a + "@react-aria/spinbutton": 3.0.0-nightly.1779+afb946c4a + "@react-aria/textfield": 3.0.0-nightly.1779+afb946c4a + "@react-aria/utils": 3.0.0-nightly.1779+afb946c4a + "@react-aria/visually-hidden": 3.0.0-nightly.1779+afb946c4a + "@react-stately/color": 3.1.2-nightly.3479+afb946c4a + "@react-types/color": 3.0.0-nightly.3479+afb946c4a + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + "@react-types/slider": 3.2.2-nightly.3479+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 7dcf6990059bac7c32712517b176a0e034889cf4c7058e55055c32c80ac66dfda9499056f0ad4e6a262d08a9b9ef2f9e7d4a2625e512692733fcb44a49406c14 + languageName: node + linkType: hard + "@react-aria/combobox@npm:^3.4.1": version: 3.4.1 resolution: "@react-aria/combobox@npm:3.4.1" @@ -4111,6 +3671,21 @@ __metadata: languageName: node linkType: hard +"@react-aria/focus@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-aria/focus@npm:3.0.0-nightly.1779" + dependencies: + "@babel/runtime": ^7.6.2 + "@react-aria/interactions": 3.0.0-nightly.1779+afb946c4a + "@react-aria/utils": 3.0.0-nightly.1779+afb946c4a + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + clsx: ^1.1.1 + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 402d801853ae800cf544a4d28cf7d6ed19014f373f1e762b74a68e87f8b2e080101d963c3423d39d7ffc548a51610cc5ceff9da24f37d04ba3b927e463b835c4 + languageName: node + linkType: hard + "@react-aria/focus@npm:^3.8.0": version: 3.8.0 resolution: "@react-aria/focus@npm:3.8.0" @@ -4171,6 +3746,24 @@ __metadata: languageName: node linkType: hard +"@react-aria/i18n@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-aria/i18n@npm:3.0.0-nightly.1779" + dependencies: + "@babel/runtime": ^7.6.2 + "@internationalized/date": 3.0.2-nightly.3479+afb946c4a + "@internationalized/message": 3.0.10-nightly.3479+afb946c4a + "@internationalized/number": 3.1.2-nightly.3479+afb946c4a + "@internationalized/string": 3.0.1-nightly.3479+afb946c4a + "@react-aria/ssr": 3.3.1-nightly.3479+afb946c4a + "@react-aria/utils": 3.0.0-nightly.1779+afb946c4a + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: a62aff47bab31ff4dee9b9f2b49217b33f3f3f1be43ee6331a8e8ce583fd49debcba6f3d5a2d3bcf63e2b1617cdfe1cc88c0ff06ec18d0a5cb6badb077f81e41 + languageName: node + linkType: hard + "@react-aria/i18n@npm:^3.6.0": version: 3.6.0 resolution: "@react-aria/i18n@npm:3.6.0" @@ -4189,6 +3782,19 @@ __metadata: languageName: node linkType: hard +"@react-aria/interactions@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-aria/interactions@npm:3.0.0-nightly.1779" + dependencies: + "@babel/runtime": ^7.6.2 + "@react-aria/utils": 3.0.0-nightly.1779+afb946c4a + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 043d85251cb599c1b1dced59e2de7dd1602187d50472b84b15855d491f4b41e3d8107950e80716e126dad05fab40bdaf74dad1236cad3d7d9e612e0c39620094 + languageName: node + linkType: hard + "@react-aria/interactions@npm:^3.11.0": version: 3.11.0 resolution: "@react-aria/interactions@npm:3.11.0" @@ -4202,6 +3808,20 @@ __metadata: languageName: node linkType: hard +"@react-aria/label@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-aria/label@npm:3.0.0-nightly.1779" + dependencies: + "@babel/runtime": ^7.6.2 + "@react-aria/utils": 3.0.0-nightly.1779+afb946c4a + "@react-types/label": 3.0.0-nightly.1779+afb946c4a + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 0f052ad25cb1d642f1a0255f2f61ec1c04dfab447fabed0bbb6f349666ce33563a03d9a14094bd9121aecf8793d295a928065434b41142b387ff3ab1b614a51f + languageName: node + linkType: hard + "@react-aria/label@npm:^3.4.1": version: 3.4.1 resolution: "@react-aria/label@npm:3.4.1" @@ -4252,6 +3872,15 @@ __metadata: languageName: node linkType: hard +"@react-aria/live-announcer@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-aria/live-announcer@npm:3.0.0-nightly.1779" + dependencies: + "@babel/runtime": ^7.6.2 + checksum: df72926efbefc0724c2bbeeed778541affb36aff468d5114383e206c2195d5575702a0fe532abd5d74348e867494172ed36d4a58d00fb6caa3e66c2b23002f82 + languageName: node + linkType: hard + "@react-aria/live-announcer@npm:^3.1.1": version: 3.1.1 resolution: "@react-aria/live-announcer@npm:3.1.1" @@ -4451,6 +4080,27 @@ __metadata: languageName: node linkType: hard +"@react-aria/slider@npm:3.2.2-nightly.3479+afb946c4a": + version: 3.2.2-nightly.3479 + resolution: "@react-aria/slider@npm:3.2.2-nightly.3479" + dependencies: + "@babel/runtime": ^7.6.2 + "@react-aria/focus": 3.0.0-nightly.1779+afb946c4a + "@react-aria/i18n": 3.0.0-nightly.1779+afb946c4a + "@react-aria/interactions": 3.0.0-nightly.1779+afb946c4a + "@react-aria/label": 3.0.0-nightly.1779+afb946c4a + "@react-aria/utils": 3.0.0-nightly.1779+afb946c4a + "@react-stately/radio": 3.0.0-nightly.1779+afb946c4a + "@react-stately/slider": 3.2.2-nightly.3479+afb946c4a + "@react-types/radio": 3.0.0-nightly.1779+afb946c4a + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + "@react-types/slider": 3.2.2-nightly.3479+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: ce1febd6e49dcb59b6f392bd4386ab32cdb83cbc1427256eb507ee6fe5a3b36ff4fbf96d5beb3403a84b73787b57649c0959800dc00a55a6b55942f62ddd1948 + languageName: node + linkType: hard + "@react-aria/slider@npm:^3.2.1": version: 3.2.1 resolution: "@react-aria/slider@npm:3.2.1" @@ -4472,6 +4122,23 @@ __metadata: languageName: node linkType: hard +"@react-aria/spinbutton@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-aria/spinbutton@npm:3.0.0-nightly.1779" + dependencies: + "@babel/runtime": ^7.6.2 + "@react-aria/i18n": 3.0.0-nightly.1779+afb946c4a + "@react-aria/live-announcer": 3.0.0-nightly.1779+afb946c4a + "@react-aria/utils": 3.0.0-nightly.1779+afb946c4a + "@react-types/button": 3.6.2-nightly.3479+afb946c4a + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 66413eb8a18964eac7c98a7db27dd5cac927d37a23a49bb358acee2c72571bce8f00100613b244e627127057e12797c62d46848a631f7a02363d0a43e3489494 + languageName: node + linkType: hard + "@react-aria/spinbutton@npm:^3.1.3": version: 3.1.3 resolution: "@react-aria/spinbutton@npm:3.1.3" @@ -4489,6 +4156,17 @@ __metadata: languageName: node linkType: hard +"@react-aria/ssr@npm:3.3.1-nightly.3479+afb946c4a": + version: 3.3.1-nightly.3479 + resolution: "@react-aria/ssr@npm:3.3.1-nightly.3479" + dependencies: + "@babel/runtime": ^7.6.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 6f2444178c250311a9fe92bd6064155521b60fb2733a33919375cf020abb1f50b88132fff390b803550246e93cfc06823d9a90b5ccd383e3a68e72ef9254df82 + languageName: node + linkType: hard + "@react-aria/ssr@npm:^3.3.0": version: 3.3.0 resolution: "@react-aria/ssr@npm:3.3.0" @@ -4559,6 +4237,22 @@ __metadata: languageName: node linkType: hard +"@react-aria/textfield@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-aria/textfield@npm:3.0.0-nightly.1779" + dependencies: + "@babel/runtime": ^7.6.2 + "@react-aria/focus": 3.0.0-nightly.1779+afb946c4a + "@react-aria/label": 3.0.0-nightly.1779+afb946c4a + "@react-aria/utils": 3.0.0-nightly.1779+afb946c4a + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + "@react-types/textfield": 3.0.0-nightly.1779+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 7604ab06dde0fa3cb4bac315d5c8d636644c6ea653a0d042f14fb5fee7739b2ab05303357e3e8de2dbf5ddd9a37306f4075a600123424c103288cfde9191fbbf + languageName: node + linkType: hard + "@react-aria/textfield@npm:^3.7.1": version: 3.7.1 resolution: "@react-aria/textfield@npm:3.7.1" @@ -4610,6 +4304,21 @@ __metadata: languageName: node linkType: hard +"@react-aria/utils@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-aria/utils@npm:3.0.0-nightly.1779" + dependencies: + "@babel/runtime": ^7.6.2 + "@react-aria/ssr": 3.3.1-nightly.3479+afb946c4a + "@react-stately/utils": 3.0.0-nightly.1779+afb946c4a + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + clsx: ^1.1.1 + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 0789be90f7e8598b7b6ce080546b1d8aa713e353a04087c8de081b0be2fdeaab7aaa8e4a2e39828ac3be89ba25714c75138e5835b28a860b69f7e1f82fd1bf68 + languageName: node + linkType: hard + "@react-aria/utils@npm:^3.13.3": version: 3.13.3 resolution: "@react-aria/utils@npm:3.13.3" @@ -4625,6 +4334,21 @@ __metadata: languageName: node linkType: hard +"@react-aria/visually-hidden@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-aria/visually-hidden@npm:3.0.0-nightly.1779" + dependencies: + "@babel/runtime": ^7.6.2 + "@react-aria/interactions": 3.0.0-nightly.1779+afb946c4a + "@react-aria/utils": 3.0.0-nightly.1779+afb946c4a + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + clsx: ^1.1.1 + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: b2d5eaf5afeced8f3555ddfdf644a08b450c4e79d34f13a19be2140d850a5500686b791a555084f8318d6a5f1ef20dedd1bc054b21b160a61e78cd31d8c97c67 + languageName: node + linkType: hard + "@react-aria/visually-hidden@npm:^3.4.1": version: 3.4.1 resolution: "@react-aria/visually-hidden@npm:3.4.1" @@ -4763,6 +4487,24 @@ __metadata: languageName: node linkType: hard +"@react-stately/color@npm:3.1.2-nightly.3479+afb946c4a": + version: 3.1.2-nightly.3479 + resolution: "@react-stately/color@npm:3.1.2-nightly.3479" + dependencies: + "@babel/runtime": ^7.6.2 + "@internationalized/number": 3.1.2-nightly.3479+afb946c4a + "@internationalized/string": 3.0.1-nightly.3479+afb946c4a + "@react-stately/slider": 3.2.2-nightly.3479+afb946c4a + "@react-stately/utils": 3.0.0-nightly.1779+afb946c4a + "@react-types/color": 3.0.0-nightly.3479+afb946c4a + "@react-types/numberfield": 3.3.4-nightly.3479+afb946c4a + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 48abd4a3a4b774f47f8346b0c6882d9b18718c6a6f1487b535996c45a79cf5e9075138c450dfa137817a21e1539c871744c667435736d2d83044b15ad81b5973 + languageName: node + linkType: hard + "@react-stately/combobox@npm:^3.2.1": version: 3.2.1 resolution: "@react-stately/combobox@npm:3.2.1" @@ -4780,6 +4522,18 @@ __metadata: languageName: node linkType: hard +"@react-stately/data@npm:^3.6.1": + version: 3.6.1 + resolution: "@react-stately/data@npm:3.6.1" + dependencies: + "@babel/runtime": ^7.6.2 + "@react-types/shared": ^3.14.1 + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 79c9eae2ff674453010ed9b37fc23de687fe9dd5413c2931cadd2b7d85bcd567ed45078c0234d1c5117677321ad3eaf34952af6113546033643a7e78dde23242 + languageName: node + linkType: hard + "@react-stately/datepicker@npm:^3.0.2": version: 3.0.2 resolution: "@react-stately/datepicker@npm:3.0.2" @@ -4898,6 +4652,20 @@ __metadata: languageName: node linkType: hard +"@react-stately/radio@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-stately/radio@npm:3.0.0-nightly.1779" + dependencies: + "@babel/runtime": ^7.6.2 + "@react-stately/utils": 3.0.0-nightly.1779+afb946c4a + "@react-types/radio": 3.0.0-nightly.1779+afb946c4a + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 9d31f9a3a5ae2fad7a09ad836a0c9f6efbaa85693c7744f9bf874d2d9cad6fac31272fad0d5734126ccd0acfaff6844acb66ec89cfc87a44dca3e408c78d0749 + languageName: node + linkType: hard + "@react-stately/radio@npm:^3.5.1": version: 3.5.1 resolution: "@react-stately/radio@npm:3.5.1" @@ -4957,6 +4725,22 @@ __metadata: languageName: node linkType: hard +"@react-stately/slider@npm:3.2.2-nightly.3479+afb946c4a": + version: 3.2.2-nightly.3479 + resolution: "@react-stately/slider@npm:3.2.2-nightly.3479" + dependencies: + "@babel/runtime": ^7.6.2 + "@react-aria/i18n": 3.0.0-nightly.1779+afb946c4a + "@react-aria/utils": 3.0.0-nightly.1779+afb946c4a + "@react-stately/utils": 3.0.0-nightly.1779+afb946c4a + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + "@react-types/slider": 3.2.2-nightly.3479+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 361210d065357c89dc430cc80810c66420093b6b3f7e75975641571f96d92112f284fef2ffe8612d6754155ee60128811f2b53f47e1930f3bd510b2370dcc218 + languageName: node + linkType: hard + "@react-stately/slider@npm:^3.2.1": version: 3.2.1 resolution: "@react-stately/slider@npm:3.2.1" @@ -5047,6 +4831,17 @@ __metadata: languageName: node linkType: hard +"@react-stately/utils@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-stately/utils@npm:3.0.0-nightly.1779" + dependencies: + "@babel/runtime": ^7.6.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 854565c041a9fad43832c5aa17173426fd8af60988f7491ab0c2a0976d974a8329e4fbd4e91095d97e0fa36c4086571d2a940371cb396452f4a81556a583b306 + languageName: node + linkType: hard + "@react-stately/utils@npm:^3.5.1": version: 3.5.1 resolution: "@react-stately/utils@npm:3.5.1" @@ -5083,6 +4878,17 @@ __metadata: languageName: node linkType: hard +"@react-types/button@npm:3.6.2-nightly.3479+afb946c4a": + version: 3.6.2-nightly.3479 + resolution: "@react-types/button@npm:3.6.2-nightly.3479" + dependencies: + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 27185cb3d668952943100d2fb8aa7513d84c658f9bf34d66eaca7620a20079ca7ffbd67b29c506dd2d0e710bb04675187a445f34ae2f469b5ccd7fb106f25a28 + languageName: node + linkType: hard + "@react-types/button@npm:^3.6.1": version: 3.6.1 resolution: "@react-types/button@npm:3.6.1" @@ -5117,6 +4923,18 @@ __metadata: languageName: node linkType: hard +"@react-types/color@npm:3.0.0-nightly.3479+afb946c4a": + version: 3.0.0-nightly.3479 + resolution: "@react-types/color@npm:3.0.0-nightly.3479" + dependencies: + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + "@react-types/slider": 3.2.2-nightly.3479+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: d15780af2435249447e9cfcc9767dd620bafa9b187d2dd3c2dddd00c4c631e6e8eb942a169b0d276f4409a251fefc09e4be14844eb5bf5f38f98fd790f76e028 + languageName: node + linkType: hard + "@react-types/combobox@npm:^3.5.3": version: 3.5.3 resolution: "@react-types/combobox@npm:3.5.3" @@ -5164,6 +4982,17 @@ __metadata: languageName: node linkType: hard +"@react-types/label@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-types/label@npm:3.0.0-nightly.1779" + dependencies: + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 5baee41ed6fb0d42afd4cffc25272b1d56bb7eb4dd7d2de6e019be490e64443a79ececc226637e402d26d19dd775373ef022f1ae6611ae310027bfae94a934b8 + languageName: node + linkType: hard + "@react-types/label@npm:^3.6.3": version: 3.6.3 resolution: "@react-types/label@npm:3.6.3" @@ -5234,6 +5063,17 @@ __metadata: languageName: node linkType: hard +"@react-types/numberfield@npm:3.3.4-nightly.3479+afb946c4a": + version: 3.3.4-nightly.3479 + resolution: "@react-types/numberfield@npm:3.3.4-nightly.3479" + dependencies: + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: cdb64e1fe98d7e8e1febcbaa150c27c975e4630577c10204757d501de6d0ac1320ca09fa5c86a6100eb87f116261854e60ff01b5b25fd09e9d14d2f9d8085120 + languageName: node + linkType: hard + "@react-types/numberfield@npm:^3.3.3": version: 3.3.3 resolution: "@react-types/numberfield@npm:3.3.3" @@ -5267,6 +5107,17 @@ __metadata: languageName: node linkType: hard +"@react-types/radio@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-types/radio@npm:3.0.0-nightly.1779" + dependencies: + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: d1e4c5ba39eb623b79a0d371941689d1e077ed416b164150234c621946162258bb4be5d4f29941975d76f761bc879859a8953cc4d0ad78eda3cc2c51cfb2a651 + languageName: node + linkType: hard + "@react-types/radio@npm:^3.2.3": version: 3.2.3 resolution: "@react-types/radio@npm:3.2.3" @@ -5301,6 +5152,15 @@ __metadata: languageName: node linkType: hard +"@react-types/shared@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-types/shared@npm:3.0.0-nightly.1779" + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 052ab5af714289fb1e5de63b0950a02dc2437ce572e550493c37acc77e3461818ddb2c9481d528191b730695f7b179ad765f8f285f366d5437331accae6dbce3 + languageName: node + linkType: hard + "@react-types/shared@npm:^3.14.1": version: 3.14.1 resolution: "@react-types/shared@npm:3.14.1" @@ -5310,6 +5170,17 @@ __metadata: languageName: node linkType: hard +"@react-types/slider@npm:3.2.2-nightly.3479+afb946c4a": + version: 3.2.2-nightly.3479 + resolution: "@react-types/slider@npm:3.2.2-nightly.3479" + dependencies: + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 13783fadcd78b719664144a9607a43a643bf246073ece1b0a647dbbed284ebf77d0375ea2f491021b03d2decf12338f0143181fd54921b3bed7c398f5190201c + languageName: node + linkType: hard + "@react-types/slider@npm:^3.2.1": version: 3.2.1 resolution: "@react-types/slider@npm:3.2.1" @@ -5356,6 +5227,17 @@ __metadata: languageName: node linkType: hard +"@react-types/textfield@npm:3.0.0-nightly.1779+afb946c4a": + version: 3.0.0-nightly.1779 + resolution: "@react-types/textfield@npm:3.0.0-nightly.1779" + dependencies: + "@react-types/shared": 3.0.0-nightly.1779+afb946c4a + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: 97eaec939484b5424098e5ddf5e91a189cd2d6311c1f50ddec964ee6fb60c04462a72a5221f14e59a781f172d86a5dece9f52416312d98888a62adc7ab45fdba + languageName: node + linkType: hard + "@react-types/textfield@npm:^3.5.3": version: 3.5.3 resolution: "@react-types/textfield@npm:3.5.3" @@ -5435,6 +5317,38 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/account-service@workspace:ee/apps/account-service": + version: 0.0.0-use.local + resolution: "@rocket.chat/account-service@workspace:ee/apps/account-service" + dependencies: + "@rocket.chat/core-typings": "workspace:^" + "@rocket.chat/emitter": 0.31.21 + "@rocket.chat/eslint-config": "workspace:^" + "@rocket.chat/model-typings": "workspace:^" + "@rocket.chat/models": "workspace:^" + "@rocket.chat/rest-typings": "workspace:^" + "@rocket.chat/string-helpers": 0.31.21 + "@types/bcrypt": ^5.0.0 + "@types/eslint": ^8 + "@types/node": ^14.18.21 + "@types/polka": ^0.5.4 + bcrypt: ^5.0.1 + ejson: ^2.2.2 + eslint: ^8.21.0 + eventemitter3: ^4.0.7 + fibers: ^5.0.3 + mem: ^8.1.1 + moleculer: ^0.14.21 + mongodb: ^4.3.1 + nats: ^2.4.0 + pino: ^8.4.2 + polka: ^0.5.2 + ts-node: ^10.9.1 + typescript: ~4.5.5 + uuid: ^9.0.0 + languageName: unknown + linkType: soft + "@rocket.chat/agenda@workspace:^, @rocket.chat/agenda@workspace:packages/agenda": version: 0.0.0-use.local resolution: "@rocket.chat/agenda@workspace:packages/agenda" @@ -5473,23 +5387,9 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/apps-engine@npm:1.34.0": - version: 1.34.0 - resolution: "@rocket.chat/apps-engine@npm:1.34.0" - dependencies: - adm-zip: ^0.5.9 - cryptiles: ^4.1.3 - lodash.clonedeep: ^4.5.0 - semver: ^5.7.1 - stack-trace: 0.0.10 - uuid: ^3.4.0 - checksum: e6bb12feb78d6f8a054a4197130dd8335eceb3885a801b21b833dca46c40af682a29d19bb4dc67b62d8f07a3946e999eb50a7c724cafc149715de825c93e1ca4 - languageName: node - linkType: hard - -"@rocket.chat/apps-engine@npm:^1.32.0": - version: 1.33.0 - resolution: "@rocket.chat/apps-engine@npm:1.33.0" +"@rocket.chat/apps-engine@npm:^1.32.0, @rocket.chat/apps-engine@npm:latest": + version: 1.35.0 + resolution: "@rocket.chat/apps-engine@npm:1.35.0" dependencies: adm-zip: ^0.5.9 cryptiles: ^4.1.3 @@ -5497,7 +5397,8 @@ __metadata: semver: ^5.7.1 stack-trace: 0.0.10 uuid: ^3.4.0 - checksum: d6182c86d88b2b06c2246937c86488663318966f653e17e089dbdd8e46799dec699a85f675dc0c2ec9c2ad9f195a4308443e8abbd2024f1f5ee9fa1b0a193f5d + vm2: ^3.9.11 + checksum: 36c1aeeca2163a0bcde0de8f28eceedccb2cb0a55f014487c4924b72ba00e0969d9a28797a70aa40f8a6e3856b541608a0af251292b077e173c9e4fd9d0010f1 languageName: node linkType: hard @@ -5515,6 +5416,35 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/authorization-service@workspace:ee/apps/authorization-service": + version: 0.0.0-use.local + resolution: "@rocket.chat/authorization-service@workspace:ee/apps/authorization-service" + dependencies: + "@rocket.chat/core-typings": "workspace:^" + "@rocket.chat/emitter": 0.31.21 + "@rocket.chat/eslint-config": "workspace:^" + "@rocket.chat/model-typings": "workspace:^" + "@rocket.chat/models": "workspace:^" + "@rocket.chat/rest-typings": "workspace:^" + "@rocket.chat/string-helpers": 0.31.21 + "@types/eslint": ^8 + "@types/node": ^14.18.21 + "@types/polka": ^0.5.4 + ejson: ^2.2.2 + eslint: ^8.21.0 + eventemitter3: ^4.0.7 + fibers: ^5.0.3 + mem: ^8.1.1 + moleculer: ^0.14.21 + mongodb: ^4.3.1 + nats: ^2.4.0 + pino: ^8.4.2 + polka: ^0.5.2 + ts-node: ^10.9.1 + typescript: ~4.5.5 + languageName: unknown + linkType: soft + "@rocket.chat/cas-validate@workspace:^, @rocket.chat/cas-validate@workspace:packages/cas-validate": version: 0.0.0-use.local resolution: "@rocket.chat/cas-validate@workspace:packages/cas-validate" @@ -5534,9 +5464,9 @@ __metadata: dependencies: "@rocket.chat/apps-engine": ^1.32.0 "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/icons": next - "@rocket.chat/message-parser": next - "@rocket.chat/ui-kit": next + "@rocket.chat/icons": 0.31.21 + "@rocket.chat/message-parser": 0.31.21 + "@rocket.chat/ui-kit": 0.31.21 eslint: ^8.20.0 mongodb: ^4.3.1 prettier: ^2.7.1 @@ -5544,25 +5474,25 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/css-in-js@npm:next, @rocket.chat/css-in-js@npm:~0.31.19-dev.19": - version: 0.31.19-dev.19 - resolution: "@rocket.chat/css-in-js@npm:0.31.19-dev.19" +"@rocket.chat/css-in-js@npm:0.31.21, @rocket.chat/css-in-js@npm:^0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/css-in-js@npm:0.31.21" dependencies: - "@emotion/hash": ^0.8.0 - "@rocket.chat/css-supports": ~0.31.19-dev.19 - "@rocket.chat/memo": ~0.31.19-dev.19 - "@rocket.chat/stylis-logical-props-middleware": ~0.31.19-dev.19 - stylis: ~4.0.13 - checksum: 1f0a1de2da1f7a50526b5f3a5bb33dc9cdaf53f450d6c6403c3460e15f308bd6e2eeb5e4ca219f909b99b8f94a1b1ded6c45578b424d3a4f5029820ed4880d1f + "@emotion/hash": ^0.9.0 + "@rocket.chat/css-supports": ^0.31.21 + "@rocket.chat/memo": ^0.31.21 + "@rocket.chat/stylis-logical-props-middleware": ^0.31.21 + stylis: ~4.1.3 + checksum: 4a40019c7fbce5175fd1bba02101ca9dce7fea74632853e992ef6da3f65d60b82c44ae5739fc8ec46ed6d4b3d51f6803ff5dbad41a47a8b93cddc7e878c3ee5d languageName: node linkType: hard -"@rocket.chat/css-supports@npm:~0.31.19-dev.19": - version: 0.31.19-dev.19 - resolution: "@rocket.chat/css-supports@npm:0.31.19-dev.19" +"@rocket.chat/css-supports@npm:^0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/css-supports@npm:0.31.21" dependencies: - "@rocket.chat/memo": ~0.31.19-dev.19 - checksum: ea8aaab14336894d028bb9ef86db2efa7df9252c403b6faac50276708431a2ffe29150acacf836f1e4aa05a2ac87c42a8e5821c0903bd42158e4c9adfc71e226 + "@rocket.chat/memo": ^0.31.21 + checksum: cb9873bd51fc6d11e77c2f0758342f47f207caf43c9d8f3784d65dcaef3ef5b45c90ba5838603e598af28ca8dc0ccd07787510140d995d0f44bbb857506ca3e9 languageName: node linkType: hard @@ -5572,17 +5502,17 @@ __metadata: dependencies: "@rocket.chat/apps-engine": ^1.32.0 "@rocket.chat/core-typings": "workspace:^" - "@rocket.chat/emitter": next + "@rocket.chat/emitter": 0.31.21 "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/model-typings": "workspace:^" "@rocket.chat/models": "workspace:^" "@rocket.chat/rest-typings": "workspace:^" - "@rocket.chat/string-helpers": next - "@rocket.chat/ui-contexts": "workspace:^" + "@rocket.chat/string-helpers": 0.31.21 "@types/ejson": ^2.2.0 "@types/eslint": ^8 "@types/meteor": 2.7.1 "@types/node": ^14.18.21 + "@types/polka": ^0.5.4 "@types/sharp": ^0.30.4 "@types/uuid": ^8.3.4 "@types/ws": ^8.5.3 @@ -5590,13 +5520,14 @@ __metadata: ejson: ^2.2.2 eslint: ^8.21.0 eventemitter3: ^4.0.7 - fibers: ^5.0.1 + fibers: ^5.0.3 jaeger-client: ^3.19.0 moleculer: ^0.14.21 mongodb: ^4.3.1 nats: ^2.4.0 pino: ^7.11.0 pino-pretty: ^7.6.1 + polka: ^0.5.2 sharp: ^0.30.7 ts-node: ^10.9.1 typescript: ~4.5.5 @@ -5606,10 +5537,10 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/emitter@npm:next": - version: 0.31.19-dev.7 - resolution: "@rocket.chat/emitter@npm:0.31.19-dev.7" - checksum: 328b0c061a831efe66a66f36189a9039ff5bfb9dd95d2a6d63cdc89798b8abd8f9de786b041b261c913c84190c410e39a2304cd909bc45f619e67ba82407c522 +"@rocket.chat/emitter@npm:0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/emitter@npm:0.31.21" + checksum: 5917051f7f435b39bc5f770b7c0feed4d3114523377591d50e6b30f8eb4c982331c22e790b638b334e4bba4337d6a9e30c952ad82b8457319be8ea3163adf2d3 languageName: node linkType: hard @@ -5712,35 +5643,35 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/fuselage-hooks@npm:next, @rocket.chat/fuselage-hooks@npm:~0.32.0-dev.64": - version: 0.32.0-dev.64 - resolution: "@rocket.chat/fuselage-hooks@npm:0.32.0-dev.64" +"@rocket.chat/fuselage-hooks@npm:0.31.21, @rocket.chat/fuselage-hooks@npm:^0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/fuselage-hooks@npm:0.31.21" dependencies: use-sync-external-store: ~1.2.0 peerDependencies: "@rocket.chat/fuselage-tokens": "*" react: ^17.0.2 - checksum: 0b474994184e05a6c0d3be4f72140fd6db12066c6a57bced560887e826a9da302557cf6690f2cf3a50a83664e657633981bebb291033f6fc4ff48a8e90b6dd46 + checksum: e95fc575fa9b4e349f8e07f6de04fc024971cf6c89e8733935fc1b69ce7463ed7dc134fc0a42749d625b2bc34f6b2f6894e157ce6233263dfd347add8bf07206 languageName: node linkType: hard -"@rocket.chat/fuselage-polyfills@npm:next": - version: 0.31.19-dev.19 - resolution: "@rocket.chat/fuselage-polyfills@npm:0.31.19-dev.19" +"@rocket.chat/fuselage-polyfills@npm:0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/fuselage-polyfills@npm:0.31.21" dependencies: - "@juggle/resize-observer": ^3.3.1 + "@juggle/resize-observer": ^3.4.0 clipboard-polyfill: ^3.0.3 - element-closest-polyfill: ^1.0.4 + element-closest-polyfill: ^1.0.5 focus-visible: ^5.2.0 focus-within-polyfill: ^5.2.1 new-event-polyfill: ^1.0.1 - checksum: 3ae50bd495c88f6ff74c88cc4ce9e3fa9d31be08bce94ee7769323c05aa544af8fc494088d31f2049eab8c953b55f0281823424c7f853cff6ce5427f9989092a + checksum: 7bcb8b0e62a6755b3e35335dee47b432cebdc15480880c8cd36cf5159571fed9235b5dbc42c41492787586a5356313e2ca3a0a3866849e5a30e5acabe7d9fbbe languageName: node linkType: hard -"@rocket.chat/fuselage-toastbar@npm:next": - version: 0.32.0-dev.125 - resolution: "@rocket.chat/fuselage-toastbar@npm:0.32.0-dev.125" +"@rocket.chat/fuselage-toastbar@npm:0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/fuselage-toastbar@npm:0.31.21" peerDependencies: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" @@ -5748,22 +5679,22 @@ __metadata: "@rocket.chat/styled": "*" react: ^17.0.2 react-dom: ^17.0.2 - checksum: 73d447a894080af1d174d6ee89f12b4b6c52b668e76bcd008b225b0aec16c9247b07553638e6c21cb5437dd8dcb83d6a051ce1f3ff6f2e7b26b2b8eb2b9e1efd + checksum: 1547f822fd2acf1431cd7282d0f447e55907523a6a31f354e83ba4edb2372a27b394565eedcd35e1ba17612bebaba665f86bd08004f8bdfe95942a0b41622c6c languageName: node linkType: hard -"@rocket.chat/fuselage-tokens@npm:next, @rocket.chat/fuselage-tokens@npm:~0.32.0-dev.101": - version: 0.32.0-dev.101 - resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.101" - checksum: 516aeecbfb84311bf819a867447a189467c7058cf65affe1e4b43ebde48b1d7db3714cbbcb4d1e8f4cc45369338f643ecd6d9e3d8b7b076ec12319492e1d8979 +"@rocket.chat/fuselage-tokens@npm:0.31.21, @rocket.chat/fuselage-tokens@npm:^0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/fuselage-tokens@npm:0.31.21" + checksum: 318d41ab4ef71d04cf5dcd685c90a4b627307818d4dcf331ac25ebec9d1aeffdc1c222d15f3d09fefd609fbe15ee1b201800371a7b5c89610a6df634d37f3d21 languageName: node linkType: hard -"@rocket.chat/fuselage-ui-kit@npm:next": - version: 0.32.0-dev.101 - resolution: "@rocket.chat/fuselage-ui-kit@npm:0.32.0-dev.101" +"@rocket.chat/fuselage-ui-kit@npm:0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/fuselage-ui-kit@npm:0.31.21" dependencies: - "@rocket.chat/ui-kit": ~0.32.0-dev.86 + "@rocket.chat/ui-kit": ^0.31.21 tslib: ^2.3.1 peerDependencies: "@rocket.chat/fuselage": "*" @@ -5773,7 +5704,7 @@ __metadata: "@rocket.chat/styled": "*" react: ^17.0.2 react-dom: ^17.0.2 - checksum: 806b0192e1c56c4309ebe5d00f710f09a52f3c8e110025741d684057afa46ca104872e7c8c58af5a543fc992537f9ff6fd2438982de40edcef96a4a065abab44 + checksum: 67a67b6b441b23c19e3ba935ce1ea962f98e7b16d9fd7ae4012168738994eb516702051f9937fa7129a02ca7ff630f0e6ee27c4e4d5db250e377677380b51071 languageName: node linkType: hard @@ -5783,13 +5714,13 @@ __metadata: dependencies: "@rocket.chat/apps-engine": ~1.30.0 "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage": next - "@rocket.chat/fuselage-hooks": next - "@rocket.chat/fuselage-polyfills": next - "@rocket.chat/icons": next + "@rocket.chat/fuselage": 0.31.21 + "@rocket.chat/fuselage-hooks": 0.31.21 + "@rocket.chat/fuselage-polyfills": 0.31.21 + "@rocket.chat/icons": 0.31.21 "@rocket.chat/prettier-config": next - "@rocket.chat/styled": next - "@rocket.chat/ui-kit": next + "@rocket.chat/styled": 0.31.21 + "@rocket.chat/ui-kit": 0.31.21 "@storybook/addon-essentials": ~6.5.10 "@storybook/addons": ~6.5.10 "@storybook/builder-webpack5": ~6.5.10 @@ -5823,17 +5754,19 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/fuselage@npm:next": - version: 0.32.0-dev.151 - resolution: "@rocket.chat/fuselage@npm:0.32.0-dev.151" +"@rocket.chat/fuselage@npm:0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/fuselage@npm:0.31.21" dependencies: - "@rocket.chat/css-in-js": ~0.31.19-dev.19 - "@rocket.chat/css-supports": ~0.31.19-dev.19 - "@rocket.chat/fuselage-tokens": ~0.32.0-dev.101 - "@rocket.chat/memo": ~0.31.19-dev.19 - "@rocket.chat/styled": ~0.31.19-dev.19 + "@rocket.chat/css-in-js": ^0.31.21 + "@rocket.chat/css-supports": ^0.31.21 + "@rocket.chat/fuselage-tokens": ^0.31.21 + "@rocket.chat/memo": ^0.31.21 + "@rocket.chat/styled": ^0.31.21 invariant: ^2.2.4 + react-aria: ~3.19.0 react-keyed-flatten-children: ^1.3.0 + react-stately: ~3.17.0 peerDependencies: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/fuselage-polyfills": "*" @@ -5841,7 +5774,7 @@ __metadata: react: ^17.0.2 react-dom: ^17.0.2 react-virtuoso: 1.2.4 - checksum: 9d9d278e47b3e07095d6fb3ff988c1aafa5da802444069d9898b5d6fc706685949a939fdd9f336c6eac6a7d853c83ec15762158a9a11faab3c1a44aedf2e4a77 + checksum: dae7a2d6aa33b9d9c339ade18376832f71f09dbb4c259e207050a512f8468201d3bc3205d80e5a02c32119afb47ad03221101704875aabc9faafb860e995acb7 languageName: node linkType: hard @@ -5852,11 +5785,11 @@ __metadata: "@babel/core": ^7.18.9 "@mdx-js/react": ^1.6.22 "@rocket.chat/core-typings": "workspace:^" - "@rocket.chat/css-in-js": next - "@rocket.chat/fuselage": next - "@rocket.chat/fuselage-tokens": next - "@rocket.chat/message-parser": next - "@rocket.chat/styled": next + "@rocket.chat/css-in-js": 0.31.21 + "@rocket.chat/fuselage": 0.31.21 + "@rocket.chat/fuselage-tokens": 0.31.21 + "@rocket.chat/message-parser": 0.31.21 + "@rocket.chat/styled": 0.31.21 "@rocket.chat/ui-client": "workspace:^" "@rocket.chat/ui-contexts": "workspace:^" "@storybook/addon-actions": ~6.5.10 @@ -5906,22 +5839,22 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/icons@npm:next": - version: 0.32.0-dev.130 - resolution: "@rocket.chat/icons@npm:0.32.0-dev.130" - checksum: e7dbbf45e7b7eeb81670746d2440cb55bbe750fe432f2ac81f8437e02c08ee9be5596828d65392eca2664b667e2c608b417daf0db70277fdd51efda33726cbe4 +"@rocket.chat/icons@npm:0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/icons@npm:0.31.21" + checksum: 8f5e92b26a679f3d5b86abec3b185b61f579d04c927c1e430c3172f9e462d2d6f00816b1e6faefeca08ac415e2b8520739a481a233462c5c09c30b2edbd5d4e2 languageName: node linkType: hard "@rocket.chat/layout@npm:next": - version: 0.32.0-dev.34 - resolution: "@rocket.chat/layout@npm:0.32.0-dev.34" + version: 0.32.0-dev.57 + resolution: "@rocket.chat/layout@npm:0.32.0-dev.57" peerDependencies: "@rocket.chat/fuselage": "*" react: 17.0.2 react-dom: 17.0.2 react-i18next: ~11.15.4 - checksum: 303c91323119322d0e97852e639f632a7baec7b1fd6ce2406df7b8df2ebf56f5451b788d060f074df29c2dec0232de465a0d1a2bab2be9fc2531670a656ab23f + checksum: ef1c1e10d6c7afad8e944ced7790c034396f1997a215b749cc53ab6dc73709e7876cc685d411241a468af6a6bd37c262dcb12b18f884c5d97da9c35daed09590 languageName: node linkType: hard @@ -5932,10 +5865,10 @@ __metadata: "@babel/eslint-parser": ^7.18.9 "@babel/preset-env": ^7.18.9 "@rocket.chat/eslint-config": ^0.4.0 - "@rocket.chat/fuselage-tokens": next - "@rocket.chat/logo": next + "@rocket.chat/fuselage-tokens": 0.31.21 + "@rocket.chat/logo": 0.31.21 "@rocket.chat/sdk": ^1.0.0-alpha.42 - "@rocket.chat/ui-kit": next + "@rocket.chat/ui-kit": 0.31.21 "@storybook/addon-actions": ~6.5.10 "@storybook/addon-backgrounds": ~6.5.10 "@storybook/addon-essentials": ~6.5.10 @@ -6008,31 +5941,31 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/logo@npm:next": - version: 0.32.0-dev.101 - resolution: "@rocket.chat/logo@npm:0.32.0-dev.101" +"@rocket.chat/logo@npm:0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/logo@npm:0.31.21" dependencies: - "@rocket.chat/fuselage-hooks": ~0.32.0-dev.64 - "@rocket.chat/styled": ~0.31.19-dev.19 + "@rocket.chat/fuselage-hooks": ^0.31.21 + "@rocket.chat/styled": ^0.31.21 tslib: ^2.3.1 peerDependencies: react: 17.0.2 react-dom: 17.0.2 - checksum: 857dead0323356f28a66d525331a7485d8401c896e7ac4bf8ab6c481cd6bbd4b3a1194079e48c48fa87bca93b9b2c0578e13e218ab6e0babc38e5fab89bb0a06 + checksum: 4d4c363d054bc3d696c50016a12da4926062cf7feed96b28c5f0b8c25a9e6800bacc7d91d5057c98cf94f2256a0c582d3d5fc4e7dd8de7b8b02c0e51297cf9af languageName: node linkType: hard -"@rocket.chat/memo@npm:next, @rocket.chat/memo@npm:~0.31.19-dev.19": - version: 0.31.19-dev.19 - resolution: "@rocket.chat/memo@npm:0.31.19-dev.19" - checksum: 90d66af5499c6d49ff64a695faaebf8ed5f073c78472ff8f5f3432697fc3ef6065914ac302f64cb88d840d0816cba7d0148461bd15157a1678f886fe3e5d7adf +"@rocket.chat/memo@npm:0.31.21, @rocket.chat/memo@npm:^0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/memo@npm:0.31.21" + checksum: e76efd3ac70d92a2a2ae897d06e8f8f0495040f0dfc460b8f60611dcc69838123080f15fe0b34b69a3f9ee86b60eeca2b4a8302a0eaf7c5ae55ddbe234efd62a languageName: node linkType: hard -"@rocket.chat/message-parser@npm:next": - version: 0.32.0-dev.99 - resolution: "@rocket.chat/message-parser@npm:0.32.0-dev.99" - checksum: 92f08cc2f04e995030a47e5de871eb6b1cb36e45253a63ea812d2adc331d9fba9dc68ca484a87cc010bea0e7b37d877f35fe86db6b809d2f008aee64b72c5d7e +"@rocket.chat/message-parser@npm:0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/message-parser@npm:0.31.21" + checksum: 396f69a9b8f24c06f0912c21ec8a447cc8ee67ade323a07accea8d536f827ef66d57a798c9d69591bb0b72ffa90c29749990702b8c3834d822d98afddda7ba1c languageName: node linkType: hard @@ -6057,42 +5990,44 @@ __metadata: "@nivo/line": 0.79.1 "@nivo/pie": 0.79.1 "@playwright/test": ^1.22.2 + "@react-aria/color": ^3.0.0-beta.15 "@rocket.chat/agenda": "workspace:^" "@rocket.chat/api-client": "workspace:^" - "@rocket.chat/apps-engine": 1.34.0 + "@rocket.chat/apps-engine": latest "@rocket.chat/cas-validate": "workspace:^" "@rocket.chat/core-typings": "workspace:^" - "@rocket.chat/css-in-js": next - "@rocket.chat/emitter": next + "@rocket.chat/css-in-js": 0.31.21 + "@rocket.chat/emitter": 0.31.21 "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/favicon": "workspace:^" "@rocket.chat/forked-matrix-appservice-bridge": ^4.0.1 "@rocket.chat/forked-matrix-bot-sdk": ^0.6.0-beta.2 - "@rocket.chat/fuselage": next - "@rocket.chat/fuselage-hooks": next - "@rocket.chat/fuselage-polyfills": next - "@rocket.chat/fuselage-toastbar": next - "@rocket.chat/fuselage-tokens": next - "@rocket.chat/fuselage-ui-kit": next + "@rocket.chat/fuselage": 0.31.21 + "@rocket.chat/fuselage-hooks": 0.31.21 + "@rocket.chat/fuselage-polyfills": 0.31.21 + "@rocket.chat/fuselage-toastbar": 0.31.21 + "@rocket.chat/fuselage-tokens": 0.31.21 + "@rocket.chat/fuselage-ui-kit": 0.31.21 "@rocket.chat/gazzodown": "workspace:^" - "@rocket.chat/icons": next + "@rocket.chat/icons": 0.31.21 "@rocket.chat/layout": next "@rocket.chat/livechat": "workspace:^" - "@rocket.chat/logo": next - "@rocket.chat/memo": next - "@rocket.chat/message-parser": next + "@rocket.chat/logo": 0.31.21 + "@rocket.chat/memo": 0.31.21 + "@rocket.chat/message-parser": 0.31.21 "@rocket.chat/model-typings": "workspace:^" "@rocket.chat/models": "workspace:^" "@rocket.chat/mp3-encoder": 0.24.0 - "@rocket.chat/onboarding-ui": next + "@rocket.chat/onboarding-ui": 0.31.21 "@rocket.chat/poplib": "workspace:^" "@rocket.chat/presence": "workspace:^" "@rocket.chat/rest-typings": "workspace:^" - "@rocket.chat/string-helpers": next + "@rocket.chat/string-helpers": 0.31.21 "@rocket.chat/ui-client": "workspace:^" "@rocket.chat/ui-composer": "workspace:^" "@rocket.chat/ui-contexts": "workspace:^" - "@rocket.chat/ui-kit": next + "@rocket.chat/ui-kit": 0.31.21 + "@rocket.chat/ui-theming": "workspace:^" "@rocket.chat/ui-video-conf": "workspace:^" "@settlin/spacebars-loader": ^1.0.9 "@slack/rtm-api": ^6.0.0 @@ -6124,6 +6059,7 @@ __metadata: "@types/cssom": ^0.4.1 "@types/dompurify": ^2.3.3 "@types/ejson": ^2.2.0 + "@types/emojione": ^2.2.6 "@types/express": ^4.17.13 "@types/express-rate-limit": ^5.1.3 "@types/fibers": ^3.1.1 @@ -6159,6 +6095,7 @@ __metadata: "@types/react": ~17.0.47 "@types/react-dom": ~17.0.17 "@types/rewire": ^2.5.28 + "@types/sanitize-html": ^2 "@types/semver": ^7.3.10 "@types/sharp": ^0.30.4 "@types/sinon": ^10.0.11 @@ -6237,7 +6174,7 @@ __metadata: fibers: ^5.0.1 file-type: ^16.5.3 filenamify: ^4.3.0 - filesize: ^3.6.1 + filesize: 9.0.11 google-libphonenumber: ^3.2.28 googleapis: ^104.0.0 grapheme-splitter: ^1.0.4 @@ -6323,6 +6260,7 @@ __metadata: react-virtuoso: ^1.11.1 redis: ^4.0.6 rewire: ^6.0.0 + sanitize-html: ^2.7.2 semver: ^7.3.7 sharp: ^0.30.7 sinon: ^14.0.0 @@ -6353,7 +6291,7 @@ __metadata: use-subscription: ~1.6.0 use-sync-external-store: ^1.2.0 uuid: ^8.3.2 - vm2: ^3.9.10 + vm2: ^3.9.11 webdav: ^4.11.0 webpack: ^4.46.0 xml-crypto: ^2.1.4 @@ -6400,12 +6338,12 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/onboarding-ui@npm:next": - version: 0.32.0-dev.151 - resolution: "@rocket.chat/onboarding-ui@npm:0.32.0-dev.151" +"@rocket.chat/onboarding-ui@npm:0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/onboarding-ui@npm:0.31.21" dependencies: - i18next: ~21.6.11 - react-hook-form: ~7.27.0 + i18next: ~21.6.16 + react-hook-form: ~7.27.1 tslib: ~2.3.1 peerDependencies: "@rocket.chat/fuselage": "*" @@ -6418,7 +6356,7 @@ __metadata: react: 17.0.2 react-dom: 17.0.2 react-i18next: ~11.15.4 - checksum: 60bc5b214020138de8991315342fe0ee8fcfbc5d08479ec37962953b8bc6cf800618967792bdf4c6c7095e1c6924419c7deb746f00b3e11668ec0ebaa0ea2564 + checksum: 99cc6504d3f1a31250317769c303d2b1e2d84884bca100d2ad4d8452108b6570cdfe3c502812a5a405de86bf4bc83d5262ba3cbdb93740d36a9a77cd8614066b languageName: node linkType: hard @@ -6438,17 +6376,20 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/presence-service@workspace:ee/apps/presence-service" dependencies: - "@rocket.chat/emitter": next + "@rocket.chat/core-typings": "workspace:^" + "@rocket.chat/emitter": 0.31.21 "@rocket.chat/eslint-config": "workspace:^" + "@rocket.chat/model-typings": "workspace:^" + "@rocket.chat/models": "workspace:^" "@rocket.chat/presence": "workspace:^" - "@rocket.chat/string-helpers": next + "@rocket.chat/string-helpers": 0.31.21 "@types/eslint": ^8 "@types/node": ^14.18.21 "@types/polka": ^0.5.4 ejson: ^2.2.2 eslint: ^8.21.0 eventemitter3: ^4.0.7 - fibers: ^5.0.1 + fibers: ^5.0.3 moleculer: ^0.14.21 mongodb: ^4.3.1 nats: ^2.4.0 @@ -6471,7 +6412,6 @@ __metadata: "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/models": "workspace:^" "@rocket.chat/rest-typings": "workspace:^" - "@rocket.chat/ui-contexts": "workspace:^" "@types/node": ^14.18.21 babel-jest: ^29.0.3 eslint: ^8.21.0 @@ -6497,8 +6437,8 @@ __metadata: "@rocket.chat/apps-engine": ^1.32.0 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/message-parser": next - "@rocket.chat/ui-kit": next + "@rocket.chat/message-parser": 0.31.21 + "@rocket.chat/ui-kit": 0.31.21 "@types/jest": ^27.4.1 ajv: ^8.11.0 eslint: ^8.20.0 @@ -6522,34 +6462,63 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/string-helpers@npm:next": - version: 0.31.19-dev.19 - resolution: "@rocket.chat/string-helpers@npm:0.31.19-dev.19" +"@rocket.chat/stream-hub-service@workspace:ee/apps/stream-hub-service": + version: 0.0.0-use.local + resolution: "@rocket.chat/stream-hub-service@workspace:ee/apps/stream-hub-service" + dependencies: + "@rocket.chat/core-typings": "workspace:^" + "@rocket.chat/emitter": 0.31.21 + "@rocket.chat/eslint-config": "workspace:^" + "@rocket.chat/model-typings": "workspace:^" + "@rocket.chat/models": "workspace:^" + "@rocket.chat/string-helpers": 0.31.21 + "@types/bcrypt": ^5.0.0 + "@types/eslint": ^8 + "@types/node": ^14.18.21 + "@types/polka": ^0.5.4 + ejson: ^2.2.2 + eslint: ^8.21.0 + eventemitter3: ^4.0.7 + fibers: ^5.0.3 + mem: ^8.1.1 + moleculer: ^0.14.21 + mongodb: ^4.3.1 + nats: ^2.4.0 + pino: ^8.4.2 + polka: ^0.5.2 + ts-node: ^10.9.1 + typescript: ~4.5.5 + languageName: unknown + linkType: soft + +"@rocket.chat/string-helpers@npm:0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/string-helpers@npm:0.31.21" dependencies: tslib: ^2.3.1 - checksum: 9546a53512c67367dda6c9afd0eac8a2d5eda6bbd5a590b32359223954d863a32639249fab6845c1bf16afb549d71835eef33bea89b7d347130e585414d11dbc + checksum: b244ca989e07be1ef3d3002312357e7bed5dbee3bba1469e547c3e3b9567e8c0e0b7f389d30b074790e60630df81032974e21a282d246037abc80ad7193edd21 languageName: node linkType: hard -"@rocket.chat/styled@npm:next, @rocket.chat/styled@npm:~0.31.19-dev.19": - version: 0.31.19-dev.19 - resolution: "@rocket.chat/styled@npm:0.31.19-dev.19" +"@rocket.chat/styled@npm:0.31.21, @rocket.chat/styled@npm:^0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/styled@npm:0.31.21" dependencies: - "@rocket.chat/css-in-js": ~0.31.19-dev.19 + "@rocket.chat/css-in-js": ^0.31.21 tslib: ^2.3.1 - checksum: 5f31d307c126aa003581fb6d2a3ac57d883268444bc02c7c9c4222f24747dadbbf84586b3fe28628f62e2f177311e0fc4a977e27fece162aa336aa53285c4596 + checksum: ba4a35ee8defb5ebf6e007df63b7e6f3b1ee2c709e0970e4d6f148b4bcb9f105661cbddb26e03edf62c2f14d2692bcf8d1533ceb65772fe4a68334304d3018f9 languageName: node linkType: hard -"@rocket.chat/stylis-logical-props-middleware@npm:~0.31.19-dev.19": - version: 0.31.19-dev.19 - resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.19-dev.19" +"@rocket.chat/stylis-logical-props-middleware@npm:^0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.21" dependencies: - "@rocket.chat/css-supports": ~0.31.19-dev.19 + "@rocket.chat/css-supports": ^0.31.21 tslib: ^2.3.1 peerDependencies: stylis: 4.0.10 - checksum: 9e78c7411de4c1f52b842a35c5060e8122814ccbcc5302878bbab5201baa5a6521478a0a70f31e7747b3782960d35c2f8ce39dee212e4270db2ab1b019766bce + checksum: dc511c0b19732f5a7615ba0d83516fda2fa3039c197bc1eaac0ce5e66ee8137b93196b5d6db48fd888583be2ce530fa691bcd3b5bb24e3ae105786501903140c languageName: node linkType: hard @@ -6557,10 +6526,10 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/ui-client@workspace:packages/ui-client" dependencies: - "@rocket.chat/css-in-js": next - "@rocket.chat/fuselage": next - "@rocket.chat/fuselage-hooks": next - "@rocket.chat/icons": next + "@rocket.chat/css-in-js": 0.31.21 + "@rocket.chat/fuselage": 0.31.21 + "@rocket.chat/fuselage-hooks": 0.31.21 + "@rocket.chat/icons": 0.31.21 "@rocket.chat/ui-contexts": "workspace:~" "@storybook/addon-actions": ~6.5.10 "@storybook/addon-docs": ~6.5.10 @@ -6606,8 +6575,8 @@ __metadata: dependencies: "@babel/core": ~7.18.13 "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage": next - "@rocket.chat/icons": next + "@rocket.chat/fuselage": 0.31.21 + "@rocket.chat/icons": 0.31.21 "@storybook/addon-actions": ~6.5.12 "@storybook/addon-docs": ~6.5.12 "@storybook/addon-essentials": ~6.5.12 @@ -6637,8 +6606,8 @@ __metadata: resolution: "@rocket.chat/ui-contexts@workspace:packages/ui-contexts" dependencies: "@rocket.chat/core-typings": "workspace:^" - "@rocket.chat/emitter": next - "@rocket.chat/fuselage-hooks": next + "@rocket.chat/emitter": 0.31.21 + "@rocket.chat/fuselage-hooks": 0.31.21 "@rocket.chat/rest-typings": "workspace:^" "@types/jest": ^27.4.1 "@types/react": ^17.0.47 @@ -6660,22 +6629,69 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/ui-kit@npm:next, @rocket.chat/ui-kit@npm:~0.32.0-dev.86": - version: 0.32.0-dev.86 - resolution: "@rocket.chat/ui-kit@npm:0.32.0-dev.86" - checksum: 234a8a384cdfd881074bfd357de7f3805a6af1798cc73d66fd89735abad7d6d0414f1bbe674cc805c0b8c6cf897364b257027c383cc3e8be4bb26207485332a7 +"@rocket.chat/ui-kit@npm:0.31.21, @rocket.chat/ui-kit@npm:^0.31.21": + version: 0.31.21 + resolution: "@rocket.chat/ui-kit@npm:0.31.21" + checksum: 05dadff647d75ae586217b36838b6b5dbc93b4d5dfa2c967306a4ccb238b9815d58d365ac9d4cc9d2ae5a6a46007285e8fd7781d118c59152319eb2a37b2f8eb languageName: node linkType: hard +"@rocket.chat/ui-theming@workspace:^, @rocket.chat/ui-theming@workspace:ee/packages/ui-theming": + version: 0.0.0-use.local + resolution: "@rocket.chat/ui-theming@workspace:ee/packages/ui-theming" + dependencies: + "@rocket.chat/css-in-js": 0.31.21 + "@rocket.chat/fuselage": 0.31.21 + "@rocket.chat/fuselage-hooks": 0.31.21 + "@rocket.chat/icons": 0.31.21 + "@rocket.chat/ui-contexts": "workspace:~" + "@storybook/addon-actions": ~6.5.10 + "@storybook/addon-docs": ~6.5.10 + "@storybook/addon-essentials": ~6.5.10 + "@storybook/addon-interactions": ~6.5.10 + "@storybook/addon-links": ~6.5.10 + "@storybook/addon-postcss": ~2.0.0 + "@storybook/builder-webpack4": ~6.5.10 + "@storybook/manager-webpack4": ~6.5.10 + "@storybook/react": ~6.5.10 + "@storybook/testing-library": ~0.0.13 + "@types/jest": ^27.4.1 + "@types/postcss-url": ^10 + "@types/react": ~17.0.47 + eslint: ^8.20.0 + eslint-plugin-anti-trojan-source: ^1.1.0 + eslint-plugin-react: ^7.30.1 + eslint-plugin-react-hooks: ^4.6.0 + eslint-plugin-testing-library: ^5.6.0 + jest: ^27.5.1 + postcss: ~8.4.16 + postcss-custom-properties: ~12.1.8 + postcss-easy-import: ~4.0.0 + postcss-load-config: ~4.0.1 + postcss-media-minmax: ~5.0.0 + postcss-nested: ~5.0.6 + postcss-url: ~10.1.3 + react: ~17.0.2 + ts-jest: ^27.1.4 + typescript: ~4.5.5 + peerDependencies: + "@rocket.chat/css-in-js": "*" + "@rocket.chat/fuselage": "*" + "@rocket.chat/fuselage-hooks": "*" + "@rocket.chat/icons": "*" + react: ~17.0.2 + languageName: unknown + linkType: soft + "@rocket.chat/ui-video-conf@workspace:^, @rocket.chat/ui-video-conf@workspace:packages/ui-video-conf": version: 0.0.0-use.local resolution: "@rocket.chat/ui-video-conf@workspace:packages/ui-video-conf" dependencies: - "@rocket.chat/css-in-js": next + "@rocket.chat/css-in-js": 0.31.21 "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage": next - "@rocket.chat/fuselage-hooks": next - "@rocket.chat/styled": next + "@rocket.chat/fuselage": 0.31.21 + "@rocket.chat/fuselage-hooks": 0.31.21 + "@rocket.chat/styled": 0.31.21 "@types/jest": ^27.4.1 eslint: ^8.20.0 eslint-plugin-react: ^7.30.1 @@ -6836,42 +6852,7 @@ __metadata: languageName: node linkType: hard -"@storybook/addon-actions@npm:6.5.10, @storybook/addon-actions@npm:~6.5.10": - version: 6.5.10 - resolution: "@storybook/addon-actions@npm:6.5.10" - dependencies: - "@storybook/addons": 6.5.10 - "@storybook/api": 6.5.10 - "@storybook/client-logger": 6.5.10 - "@storybook/components": 6.5.10 - "@storybook/core-events": 6.5.10 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/theming": 6.5.10 - core-js: ^3.8.2 - fast-deep-equal: ^3.1.3 - global: ^4.4.0 - lodash: ^4.17.21 - polished: ^4.2.2 - prop-types: ^15.7.2 - react-inspector: ^5.1.0 - regenerator-runtime: ^0.13.7 - telejson: ^6.0.8 - ts-dedent: ^2.0.0 - util-deprecate: ^1.0.2 - uuid-browser: ^3.1.0 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true - checksum: b864ceb0ec9aef76c438cfd55977946619954e07b2b822205e5209e3901cc9ae669babc9304026e48e3717e075212c9e5175d62fd63183cf696e3e196f1f6dd8 - languageName: node - linkType: hard - -"@storybook/addon-actions@npm:6.5.12, @storybook/addon-actions@npm:~6.5.12": +"@storybook/addon-actions@npm:6.5.12, @storybook/addon-actions@npm:~6.5.10, @storybook/addon-actions@npm:~6.5.12": version: 6.5.12 resolution: "@storybook/addon-actions@npm:6.5.12" dependencies: @@ -6906,36 +6887,7 @@ __metadata: languageName: node linkType: hard -"@storybook/addon-backgrounds@npm:6.5.10, @storybook/addon-backgrounds@npm:~6.5.10": - version: 6.5.10 - resolution: "@storybook/addon-backgrounds@npm:6.5.10" - dependencies: - "@storybook/addons": 6.5.10 - "@storybook/api": 6.5.10 - "@storybook/client-logger": 6.5.10 - "@storybook/components": 6.5.10 - "@storybook/core-events": 6.5.10 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/theming": 6.5.10 - core-js: ^3.8.2 - global: ^4.4.0 - memoizerific: ^1.11.3 - regenerator-runtime: ^0.13.7 - ts-dedent: ^2.0.0 - util-deprecate: ^1.0.2 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true - checksum: 665ff48ea7fcea2fd126218a6253171f222cc15290f18c0b84b1f2b6adfc333328b79db762d404ff9caf449776162e66532a5a39626b28bd168abff3b58afdd2 - languageName: node - linkType: hard - -"@storybook/addon-backgrounds@npm:6.5.12": +"@storybook/addon-backgrounds@npm:6.5.12, @storybook/addon-backgrounds@npm:~6.5.10": version: 6.5.12 resolution: "@storybook/addon-backgrounds@npm:6.5.12" dependencies: @@ -6964,34 +6916,6 @@ __metadata: languageName: node linkType: hard -"@storybook/addon-controls@npm:6.5.10": - version: 6.5.10 - resolution: "@storybook/addon-controls@npm:6.5.10" - dependencies: - "@storybook/addons": 6.5.10 - "@storybook/api": 6.5.10 - "@storybook/client-logger": 6.5.10 - "@storybook/components": 6.5.10 - "@storybook/core-common": 6.5.10 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/node-logger": 6.5.10 - "@storybook/store": 6.5.10 - "@storybook/theming": 6.5.10 - core-js: ^3.8.2 - lodash: ^4.17.21 - ts-dedent: ^2.0.0 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true - checksum: 3c8152e4a4be960a7376ab1b1dc405fb3b6eeab367684766330cfb260519420f693d19b46225fd66976b4fa16e2e888585bfa571436507b2bf10f9905dfa968e - languageName: node - linkType: hard - "@storybook/addon-controls@npm:6.5.12": version: 6.5.12 resolution: "@storybook/addon-controls@npm:6.5.12" @@ -7020,54 +6944,7 @@ __metadata: languageName: node linkType: hard -"@storybook/addon-docs@npm:6.5.10, @storybook/addon-docs@npm:~6.5.10": - version: 6.5.10 - resolution: "@storybook/addon-docs@npm:6.5.10" - dependencies: - "@babel/plugin-transform-react-jsx": ^7.12.12 - "@babel/preset-env": ^7.12.11 - "@jest/transform": ^26.6.2 - "@mdx-js/react": ^1.6.22 - "@storybook/addons": 6.5.10 - "@storybook/api": 6.5.10 - "@storybook/components": 6.5.10 - "@storybook/core-common": 6.5.10 - "@storybook/core-events": 6.5.10 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/docs-tools": 6.5.10 - "@storybook/mdx1-csf": ^0.0.1 - "@storybook/node-logger": 6.5.10 - "@storybook/postinstall": 6.5.10 - "@storybook/preview-web": 6.5.10 - "@storybook/source-loader": 6.5.10 - "@storybook/store": 6.5.10 - "@storybook/theming": 6.5.10 - babel-loader: ^8.0.0 - core-js: ^3.8.2 - fast-deep-equal: ^3.1.3 - global: ^4.4.0 - lodash: ^4.17.21 - regenerator-runtime: ^0.13.7 - remark-external-links: ^8.0.0 - remark-slug: ^6.0.0 - ts-dedent: ^2.0.0 - util-deprecate: ^1.0.2 - peerDependencies: - "@storybook/mdx2-csf": ^0.0.3 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - "@storybook/mdx2-csf": - optional: true - react: - optional: true - react-dom: - optional: true - checksum: 5fecd18ea3ddbe820c23c06f34a75e2f448315ee08e6ea0ae548db4705a8148ec57804916b2c571556282e507dd543f4538b189d0366da73a592c58caa89d3ab - languageName: node - linkType: hard - -"@storybook/addon-docs@npm:6.5.12, @storybook/addon-docs@npm:~6.5.12": +"@storybook/addon-docs@npm:6.5.12, @storybook/addon-docs@npm:~6.5.10, @storybook/addon-docs@npm:~6.5.12": version: 6.5.12 resolution: "@storybook/addon-docs@npm:6.5.12" dependencies: @@ -7114,67 +6991,7 @@ __metadata: languageName: node linkType: hard -"@storybook/addon-essentials@npm:~6.5.10": - version: 6.5.10 - resolution: "@storybook/addon-essentials@npm:6.5.10" - dependencies: - "@storybook/addon-actions": 6.5.10 - "@storybook/addon-backgrounds": 6.5.10 - "@storybook/addon-controls": 6.5.10 - "@storybook/addon-docs": 6.5.10 - "@storybook/addon-measure": 6.5.10 - "@storybook/addon-outline": 6.5.10 - "@storybook/addon-toolbars": 6.5.10 - "@storybook/addon-viewport": 6.5.10 - "@storybook/addons": 6.5.10 - "@storybook/api": 6.5.10 - "@storybook/core-common": 6.5.10 - "@storybook/node-logger": 6.5.10 - core-js: ^3.8.2 - regenerator-runtime: ^0.13.7 - ts-dedent: ^2.0.0 - peerDependencies: - "@babel/core": ^7.9.6 - peerDependenciesMeta: - "@storybook/angular": - optional: true - "@storybook/builder-manager4": - optional: true - "@storybook/builder-manager5": - optional: true - "@storybook/builder-webpack4": - optional: true - "@storybook/builder-webpack5": - optional: true - "@storybook/html": - optional: true - "@storybook/vue": - optional: true - "@storybook/vue3": - optional: true - "@storybook/web-components": - optional: true - lit: - optional: true - lit-html: - optional: true - react: - optional: true - react-dom: - optional: true - svelte: - optional: true - sveltedoc-parser: - optional: true - vue: - optional: true - webpack: - optional: true - checksum: 968286922924840bd00221d17e0499b98c153677ea9e220e07ab2e34d17d76670d4549dbb517cc35326b890723cc08d7b138a22662aa508e51d864e1f7b6975b - languageName: node - linkType: hard - -"@storybook/addon-essentials@npm:~6.5.12": +"@storybook/addon-essentials@npm:~6.5.10, @storybook/addon-essentials@npm:~6.5.12": version: 6.5.12 resolution: "@storybook/addon-essentials@npm:6.5.12" dependencies: @@ -7325,30 +7142,6 @@ __metadata: languageName: node linkType: hard -"@storybook/addon-measure@npm:6.5.10": - version: 6.5.10 - resolution: "@storybook/addon-measure@npm:6.5.10" - dependencies: - "@storybook/addons": 6.5.10 - "@storybook/api": 6.5.10 - "@storybook/client-logger": 6.5.10 - "@storybook/components": 6.5.10 - "@storybook/core-events": 6.5.10 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - core-js: ^3.8.2 - global: ^4.4.0 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true - checksum: 7a6be7fc80be358c329694ab5eb75a027210afaa8185c04774c741fdca4871b90937d46d3cd16f66d195dd78bb20d3f8734f3aa0863636119895f9c6253e834a - languageName: node - linkType: hard - "@storybook/addon-measure@npm:6.5.12": version: 6.5.12 resolution: "@storybook/addon-measure@npm:6.5.12" @@ -7373,32 +7166,6 @@ __metadata: languageName: node linkType: hard -"@storybook/addon-outline@npm:6.5.10": - version: 6.5.10 - resolution: "@storybook/addon-outline@npm:6.5.10" - dependencies: - "@storybook/addons": 6.5.10 - "@storybook/api": 6.5.10 - "@storybook/client-logger": 6.5.10 - "@storybook/components": 6.5.10 - "@storybook/core-events": 6.5.10 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - core-js: ^3.8.2 - global: ^4.4.0 - regenerator-runtime: ^0.13.7 - ts-dedent: ^2.0.0 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true - checksum: 8d3e12a612fd51b3b8c49f6ff6ac145f510cfba85b00e08b0df625b99f9677c0532060bd8a132ea70e8052d9c09847bdba27caa1b69e51dd6d7845d38621dccf - languageName: node - linkType: hard - "@storybook/addon-outline@npm:6.5.12": version: 6.5.12 resolution: "@storybook/addon-outline@npm:6.5.12" @@ -7438,29 +7205,6 @@ __metadata: languageName: node linkType: hard -"@storybook/addon-toolbars@npm:6.5.10": - version: 6.5.10 - resolution: "@storybook/addon-toolbars@npm:6.5.10" - dependencies: - "@storybook/addons": 6.5.10 - "@storybook/api": 6.5.10 - "@storybook/client-logger": 6.5.10 - "@storybook/components": 6.5.10 - "@storybook/theming": 6.5.10 - core-js: ^3.8.2 - regenerator-runtime: ^0.13.7 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true - checksum: 49c44596fdee713703ed69c47895a21151892d48af27d859f0c8c1b8be0b08be7e4945fadcb9053f6025c29dba93f0d5cd8ba34f090bd025e0d9ef5859e5bc75 - languageName: node - linkType: hard - "@storybook/addon-toolbars@npm:6.5.12": version: 6.5.12 resolution: "@storybook/addon-toolbars@npm:6.5.12" @@ -7484,34 +7228,7 @@ __metadata: languageName: node linkType: hard -"@storybook/addon-viewport@npm:6.5.10, @storybook/addon-viewport@npm:~6.5.10": - version: 6.5.10 - resolution: "@storybook/addon-viewport@npm:6.5.10" - dependencies: - "@storybook/addons": 6.5.10 - "@storybook/api": 6.5.10 - "@storybook/client-logger": 6.5.10 - "@storybook/components": 6.5.10 - "@storybook/core-events": 6.5.10 - "@storybook/theming": 6.5.10 - core-js: ^3.8.2 - global: ^4.4.0 - memoizerific: ^1.11.3 - prop-types: ^15.7.2 - regenerator-runtime: ^0.13.7 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true - checksum: 6cbd32053d2b4947942b0bab0ab016817988192d52361b4f2e08420f6d94128174974a0ec9b7ee4167de8f7cb91b3a3a8c8336a398a21cb567ba633efbf9e2cf - languageName: node - linkType: hard - -"@storybook/addon-viewport@npm:6.5.12": +"@storybook/addon-viewport@npm:6.5.12, @storybook/addon-viewport@npm:~6.5.10": version: 6.5.12 resolution: "@storybook/addon-viewport@npm:6.5.12" dependencies: @@ -7538,7 +7255,7 @@ __metadata: languageName: node linkType: hard -"@storybook/addons@npm:6.5.10, @storybook/addons@npm:~6.5.10": +"@storybook/addons@npm:6.5.10": version: 6.5.10 resolution: "@storybook/addons@npm:6.5.10" dependencies: @@ -7560,7 +7277,7 @@ __metadata: languageName: node linkType: hard -"@storybook/addons@npm:6.5.12": +"@storybook/addons@npm:6.5.12, @storybook/addons@npm:~6.5.10": version: 6.5.12 resolution: "@storybook/addons@npm:6.5.12" dependencies: @@ -7582,28 +7299,6 @@ __metadata: languageName: node linkType: hard -"@storybook/addons@npm:6.5.9": - version: 6.5.9 - resolution: "@storybook/addons@npm:6.5.9" - dependencies: - "@storybook/api": 6.5.9 - "@storybook/channels": 6.5.9 - "@storybook/client-logger": 6.5.9 - "@storybook/core-events": 6.5.9 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/router": 6.5.9 - "@storybook/theming": 6.5.9 - "@types/webpack-env": ^1.16.0 - core-js: ^3.8.2 - global: ^4.4.0 - regenerator-runtime: ^0.13.7 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 50e0579df27aa7d405e25c0f057e4cd2d37c091ee4b88ab7969238255738ab5eb7f8c5af3100eaeaea74f916288ed862291f517b8a05e30578d7d1fd254d9f8c - languageName: node - linkType: hard - "@storybook/api@npm:6.5.10": version: 6.5.10 resolution: "@storybook/api@npm:6.5.10" @@ -7660,96 +7355,7 @@ __metadata: languageName: node linkType: hard -"@storybook/api@npm:6.5.9": - version: 6.5.9 - resolution: "@storybook/api@npm:6.5.9" - dependencies: - "@storybook/channels": 6.5.9 - "@storybook/client-logger": 6.5.9 - "@storybook/core-events": 6.5.9 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/router": 6.5.9 - "@storybook/semver": ^7.3.2 - "@storybook/theming": 6.5.9 - core-js: ^3.8.2 - fast-deep-equal: ^3.1.3 - global: ^4.4.0 - lodash: ^4.17.21 - memoizerific: ^1.11.3 - regenerator-runtime: ^0.13.7 - store2: ^2.12.0 - telejson: ^6.0.8 - ts-dedent: ^2.0.0 - util-deprecate: ^1.0.2 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 72d720eba7a5f6645c92a18884e267b57d4ba145d9aafd891f3a9c7651e8ea1418ada7cf7f6d5d963db100526103d5fceac8fb0a82e8099478b02dc8f33a1fd7 - languageName: node - linkType: hard - -"@storybook/builder-webpack4@npm:6.5.10, @storybook/builder-webpack4@npm:~6.5.10": - version: 6.5.10 - resolution: "@storybook/builder-webpack4@npm:6.5.10" - dependencies: - "@babel/core": ^7.12.10 - "@storybook/addons": 6.5.10 - "@storybook/api": 6.5.10 - "@storybook/channel-postmessage": 6.5.10 - "@storybook/channels": 6.5.10 - "@storybook/client-api": 6.5.10 - "@storybook/client-logger": 6.5.10 - "@storybook/components": 6.5.10 - "@storybook/core-common": 6.5.10 - "@storybook/core-events": 6.5.10 - "@storybook/node-logger": 6.5.10 - "@storybook/preview-web": 6.5.10 - "@storybook/router": 6.5.10 - "@storybook/semver": ^7.3.2 - "@storybook/store": 6.5.10 - "@storybook/theming": 6.5.10 - "@storybook/ui": 6.5.10 - "@types/node": ^14.0.10 || ^16.0.0 - "@types/webpack": ^4.41.26 - autoprefixer: ^9.8.6 - babel-loader: ^8.0.0 - case-sensitive-paths-webpack-plugin: ^2.3.0 - core-js: ^3.8.2 - css-loader: ^3.6.0 - file-loader: ^6.2.0 - find-up: ^5.0.0 - fork-ts-checker-webpack-plugin: ^4.1.6 - glob: ^7.1.6 - glob-promise: ^3.4.0 - global: ^4.4.0 - html-webpack-plugin: ^4.0.0 - pnp-webpack-plugin: 1.6.4 - postcss: ^7.0.36 - postcss-flexbugs-fixes: ^4.2.1 - postcss-loader: ^4.2.0 - raw-loader: ^4.0.2 - stable: ^0.1.8 - style-loader: ^1.3.0 - terser-webpack-plugin: ^4.2.3 - ts-dedent: ^2.0.0 - url-loader: ^4.1.1 - util-deprecate: ^1.0.2 - webpack: 4 - webpack-dev-middleware: ^3.7.3 - webpack-filter-warnings-plugin: ^1.2.1 - webpack-hot-middleware: ^2.25.1 - webpack-virtual-modules: ^0.2.2 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 26921bbc477b8cc69a9515996f4e4a4b79ba43f783dab96930067c48ca6d127397ab7a461c25e3120468b99cad1cb641fbb85a0cd6ecf25661e2da2c182a97e6 - languageName: node - linkType: hard - -"@storybook/builder-webpack4@npm:6.5.12, @storybook/builder-webpack4@npm:~6.5.12": +"@storybook/builder-webpack4@npm:6.5.12, @storybook/builder-webpack4@npm:~6.5.10, @storybook/builder-webpack4@npm:~6.5.12": version: 6.5.12 resolution: "@storybook/builder-webpack4@npm:6.5.12" dependencies: @@ -7940,17 +7546,6 @@ __metadata: languageName: node linkType: hard -"@storybook/channels@npm:6.5.9": - version: 6.5.9 - resolution: "@storybook/channels@npm:6.5.9" - dependencies: - core-js: ^3.8.2 - ts-dedent: ^2.0.0 - util-deprecate: ^1.0.2 - checksum: b51767553a3e00f4da8e9684c798348c230d5553a43886ca560c7e2f249e15ab9e3d7bbeb947d394413505261806c79c629551f9d722f83f00e15d9e19b6617c - languageName: node - linkType: hard - "@storybook/client-api@npm:6.5.10": version: 6.5.10 resolution: "@storybook/client-api@npm:6.5.10" @@ -8023,7 +7618,7 @@ __metadata: languageName: node linkType: hard -"@storybook/client-logger@npm:6.5.12": +"@storybook/client-logger@npm:6.5.12, @storybook/client-logger@npm:^6.4.0": version: 6.5.12 resolution: "@storybook/client-logger@npm:6.5.12" dependencies: @@ -8033,16 +7628,6 @@ __metadata: languageName: node linkType: hard -"@storybook/client-logger@npm:6.5.9, @storybook/client-logger@npm:^6.4.0": - version: 6.5.9 - resolution: "@storybook/client-logger@npm:6.5.9" - dependencies: - core-js: ^3.8.2 - global: ^4.4.0 - checksum: 5b72d93a57fae8d188bb40db0a3af3ce9f3ccc58751e90d38e0786b58f26a5358d10339916455646a8d60e2cc749d761990927fdeb06e5f09e68d48fe50a5de7 - languageName: node - linkType: hard - "@storybook/components@npm:6.5.10": version: 6.5.10 resolution: "@storybook/components@npm:6.5.10" @@ -8297,78 +7882,6 @@ __metadata: languageName: node linkType: hard -"@storybook/core-events@npm:6.5.9": - version: 6.5.9 - resolution: "@storybook/core-events@npm:6.5.9" - dependencies: - core-js: ^3.8.2 - checksum: b28af71de1e7f66a6fdf26c384c976640220ea1a6d807523ec368ecdc1b9dd3c87d5e1fcc5bd443d1059c408c17288afb415f8160e69ebb6cb2f3914a2db5f1d - languageName: node - linkType: hard - -"@storybook/core-server@npm:6.5.10": - version: 6.5.10 - resolution: "@storybook/core-server@npm:6.5.10" - dependencies: - "@discoveryjs/json-ext": ^0.5.3 - "@storybook/builder-webpack4": 6.5.10 - "@storybook/core-client": 6.5.10 - "@storybook/core-common": 6.5.10 - "@storybook/core-events": 6.5.10 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/csf-tools": 6.5.10 - "@storybook/manager-webpack4": 6.5.10 - "@storybook/node-logger": 6.5.10 - "@storybook/semver": ^7.3.2 - "@storybook/store": 6.5.10 - "@storybook/telemetry": 6.5.10 - "@types/node": ^14.0.10 || ^16.0.0 - "@types/node-fetch": ^2.5.7 - "@types/pretty-hrtime": ^1.0.0 - "@types/webpack": ^4.41.26 - better-opn: ^2.1.1 - boxen: ^5.1.2 - chalk: ^4.1.0 - cli-table3: ^0.6.1 - commander: ^6.2.1 - compression: ^1.7.4 - core-js: ^3.8.2 - cpy: ^8.1.2 - detect-port: ^1.3.0 - express: ^4.17.1 - fs-extra: ^9.0.1 - global: ^4.4.0 - globby: ^11.0.2 - ip: ^2.0.0 - lodash: ^4.17.21 - node-fetch: ^2.6.7 - open: ^8.4.0 - pretty-hrtime: ^1.0.3 - prompts: ^2.4.0 - regenerator-runtime: ^0.13.7 - serve-favicon: ^2.5.0 - slash: ^3.0.0 - telejson: ^6.0.8 - ts-dedent: ^2.0.0 - util-deprecate: ^1.0.2 - watchpack: ^2.2.0 - webpack: 4 - ws: ^8.2.3 - x-default-browser: ^0.4.0 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - "@storybook/builder-webpack5": - optional: true - "@storybook/manager-webpack5": - optional: true - typescript: - optional: true - checksum: 0359f8cf68e2a207d07ec631d0615c30991c78bcbe3ebe50cb8df8dd5159ab939d52789b84a50e074c027c253f74f813f745b4a002a5cf945de50a0069e0e758 - languageName: node - linkType: hard - "@storybook/core-server@npm:6.5.12": version: 6.5.12 resolution: "@storybook/core-server@npm:6.5.12" @@ -8432,27 +7945,6 @@ __metadata: languageName: node linkType: hard -"@storybook/core@npm:6.5.10": - version: 6.5.10 - resolution: "@storybook/core@npm:6.5.10" - dependencies: - "@storybook/core-client": 6.5.10 - "@storybook/core-server": 6.5.10 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - webpack: "*" - peerDependenciesMeta: - "@storybook/builder-webpack5": - optional: true - "@storybook/manager-webpack5": - optional: true - typescript: - optional: true - checksum: ee80fa596cfc305138089757b1f095a0b44ed403ff1db727e99190a5d04cca84614faa816ed881b60c7ed91a4d268ee91632cb7bcaa7f2a2127424acd66a2c96 - languageName: node - linkType: hard - "@storybook/core@npm:6.5.12": version: 6.5.12 resolution: "@storybook/core@npm:6.5.12" @@ -8474,33 +7966,6 @@ __metadata: languageName: node linkType: hard -"@storybook/csf-tools@npm:6.5.10": - version: 6.5.10 - resolution: "@storybook/csf-tools@npm:6.5.10" - dependencies: - "@babel/core": ^7.12.10 - "@babel/generator": ^7.12.11 - "@babel/parser": ^7.12.11 - "@babel/plugin-transform-react-jsx": ^7.12.12 - "@babel/preset-env": ^7.12.11 - "@babel/traverse": ^7.12.11 - "@babel/types": ^7.12.11 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/mdx1-csf": ^0.0.1 - core-js: ^3.8.2 - fs-extra: ^9.0.1 - global: ^4.4.0 - regenerator-runtime: ^0.13.7 - ts-dedent: ^2.0.0 - peerDependencies: - "@storybook/mdx2-csf": ^0.0.3 - peerDependenciesMeta: - "@storybook/mdx2-csf": - optional: true - checksum: 9bb4b61822760520c91da78b734a05c1f5145ad2e91f73cfe03aa900a6f40fd455c1fc2c3b1529a97a5e33246efb44462c68ad72b8dbf8f0b1811b7491411267 - languageName: node - linkType: hard - "@storybook/csf-tools@npm:6.5.12": version: 6.5.12 resolution: "@storybook/csf-tools@npm:6.5.12" @@ -8546,21 +8011,6 @@ __metadata: languageName: node linkType: hard -"@storybook/docs-tools@npm:6.5.10": - version: 6.5.10 - resolution: "@storybook/docs-tools@npm:6.5.10" - dependencies: - "@babel/core": ^7.12.10 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/store": 6.5.10 - core-js: ^3.8.2 - doctrine: ^3.0.0 - lodash: ^4.17.21 - regenerator-runtime: ^0.13.7 - checksum: 7fe14992ba94c31879964001a192f338bd53399a9582c598ab1681a05efb30999059329b1f7a4cbd33947778f17e6929d0f983cf54c36cb9e371414044f5dd89 - languageName: node - linkType: hard - "@storybook/docs-tools@npm:6.5.12": version: 6.5.12 resolution: "@storybook/docs-tools@npm:6.5.12" @@ -8576,7 +8026,7 @@ __metadata: languageName: node linkType: hard -"@storybook/instrumenter@npm:6.5.10": +"@storybook/instrumenter@npm:6.5.10, @storybook/instrumenter@npm:^6.4.0": version: 6.5.10 resolution: "@storybook/instrumenter@npm:6.5.10" dependencies: @@ -8589,69 +8039,7 @@ __metadata: languageName: node linkType: hard -"@storybook/instrumenter@npm:^6.4.0": - version: 6.5.9 - resolution: "@storybook/instrumenter@npm:6.5.9" - dependencies: - "@storybook/addons": 6.5.9 - "@storybook/client-logger": 6.5.9 - "@storybook/core-events": 6.5.9 - core-js: ^3.8.2 - global: ^4.4.0 - checksum: 90b83a30177794cbbd9e388b4ee68ee6c86c28d5bbb4c992607f3e5ed189abdb8191cfa392d912a45b6a42e5eb603e90a853032205a4b9a4388f3af8f49d5064 - languageName: node - linkType: hard - -"@storybook/manager-webpack4@npm:6.5.10, @storybook/manager-webpack4@npm:~6.5.10": - version: 6.5.10 - resolution: "@storybook/manager-webpack4@npm:6.5.10" - dependencies: - "@babel/core": ^7.12.10 - "@babel/plugin-transform-template-literals": ^7.12.1 - "@babel/preset-react": ^7.12.10 - "@storybook/addons": 6.5.10 - "@storybook/core-client": 6.5.10 - "@storybook/core-common": 6.5.10 - "@storybook/node-logger": 6.5.10 - "@storybook/theming": 6.5.10 - "@storybook/ui": 6.5.10 - "@types/node": ^14.0.10 || ^16.0.0 - "@types/webpack": ^4.41.26 - babel-loader: ^8.0.0 - case-sensitive-paths-webpack-plugin: ^2.3.0 - chalk: ^4.1.0 - core-js: ^3.8.2 - css-loader: ^3.6.0 - express: ^4.17.1 - file-loader: ^6.2.0 - find-up: ^5.0.0 - fs-extra: ^9.0.1 - html-webpack-plugin: ^4.0.0 - node-fetch: ^2.6.7 - pnp-webpack-plugin: 1.6.4 - read-pkg-up: ^7.0.1 - regenerator-runtime: ^0.13.7 - resolve-from: ^5.0.0 - style-loader: ^1.3.0 - telejson: ^6.0.8 - terser-webpack-plugin: ^4.2.3 - ts-dedent: ^2.0.0 - url-loader: ^4.1.1 - util-deprecate: ^1.0.2 - webpack: 4 - webpack-dev-middleware: ^3.7.3 - webpack-virtual-modules: ^0.2.2 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 954f93dded7a2294cdbd7c7df93fcf1addb34d5daf46d58d8bf64d0a7e83664e34f32cd905b2b2ec771a551869e497c12f8d659a358ac079d815ca02baede6e6 - languageName: node - linkType: hard - -"@storybook/manager-webpack4@npm:6.5.12, @storybook/manager-webpack4@npm:~6.5.12": +"@storybook/manager-webpack4@npm:6.5.12, @storybook/manager-webpack4@npm:~6.5.10, @storybook/manager-webpack4@npm:~6.5.12": version: 6.5.12 resolution: "@storybook/manager-webpack4@npm:6.5.12" dependencies: @@ -8778,7 +8166,7 @@ __metadata: languageName: node linkType: hard -"@storybook/node-logger@npm:6.5.12": +"@storybook/node-logger@npm:6.5.12, @storybook/node-logger@npm:^6.1.14": version: 6.5.12 resolution: "@storybook/node-logger@npm:6.5.12" dependencies: @@ -8791,28 +8179,6 @@ __metadata: languageName: node linkType: hard -"@storybook/node-logger@npm:^6.1.14": - version: 6.5.9 - resolution: "@storybook/node-logger@npm:6.5.9" - dependencies: - "@types/npmlog": ^4.1.2 - chalk: ^4.1.0 - core-js: ^3.8.2 - npmlog: ^5.0.1 - pretty-hrtime: ^1.0.3 - checksum: 3f4d236d19f4e99ea75acd405377f7b1a6217964d176c6a3702cfba51ae1ba129d12e66536688457a6c93045f882142a03c87609554f10d8d6c8af4f0ebf9303 - languageName: node - linkType: hard - -"@storybook/postinstall@npm:6.5.10": - version: 6.5.10 - resolution: "@storybook/postinstall@npm:6.5.10" - dependencies: - core-js: ^3.8.2 - checksum: ee6355953cb0d4c49392f59502465f967846253afed6df24c845d028e51c0a4b19dadc092a837b29ba8c7fea6529b1ca757b86e579deac7fc3decac2dd8d0247 - languageName: node - linkType: hard - "@storybook/postinstall@npm:6.5.12": version: 6.5.12 resolution: "@storybook/postinstall@npm:6.5.12" @@ -8894,72 +8260,7 @@ __metadata: languageName: node linkType: hard -"@storybook/react@npm:~6.5.10": - version: 6.5.10 - resolution: "@storybook/react@npm:6.5.10" - dependencies: - "@babel/preset-flow": ^7.12.1 - "@babel/preset-react": ^7.12.10 - "@pmmmwh/react-refresh-webpack-plugin": ^0.5.3 - "@storybook/addons": 6.5.10 - "@storybook/client-logger": 6.5.10 - "@storybook/core": 6.5.10 - "@storybook/core-common": 6.5.10 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/docs-tools": 6.5.10 - "@storybook/node-logger": 6.5.10 - "@storybook/react-docgen-typescript-plugin": 1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0 - "@storybook/semver": ^7.3.2 - "@storybook/store": 6.5.10 - "@types/estree": ^0.0.51 - "@types/node": ^14.14.20 || ^16.0.0 - "@types/webpack-env": ^1.16.0 - acorn: ^7.4.1 - acorn-jsx: ^5.3.1 - acorn-walk: ^7.2.0 - babel-plugin-add-react-displayname: ^0.0.5 - babel-plugin-react-docgen: ^4.2.1 - core-js: ^3.8.2 - escodegen: ^2.0.0 - fs-extra: ^9.0.1 - global: ^4.4.0 - html-tags: ^3.1.0 - lodash: ^4.17.21 - prop-types: ^15.7.2 - react-element-to-jsx-string: ^14.3.4 - react-refresh: ^0.11.0 - read-pkg-up: ^7.0.1 - regenerator-runtime: ^0.13.7 - ts-dedent: ^2.0.0 - util-deprecate: ^1.0.2 - webpack: ">=4.43.0 <6.0.0" - peerDependencies: - "@babel/core": ^7.11.5 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - require-from-string: ^2.0.2 - peerDependenciesMeta: - "@babel/core": - optional: true - "@storybook/builder-webpack4": - optional: true - "@storybook/builder-webpack5": - optional: true - "@storybook/manager-webpack4": - optional: true - "@storybook/manager-webpack5": - optional: true - typescript: - optional: true - bin: - build-storybook: bin/build.js - start-storybook: bin/index.js - storybook-server: bin/index.js - checksum: 4459ee91ec8aa0159d51e9fae2d0a7bde1be4ff6fd84ae0c1a414feed2d1797e7c8b9f38b256177e3b451142ebbb64a26ac1960a15a5689ae25dbffd3fb1a7b2 - languageName: node - linkType: hard - -"@storybook/react@npm:~6.5.12": +"@storybook/react@npm:~6.5.10, @storybook/react@npm:~6.5.12": version: 6.5.12 resolution: "@storybook/react@npm:6.5.12" dependencies: @@ -9056,22 +8357,6 @@ __metadata: languageName: node linkType: hard -"@storybook/router@npm:6.5.9": - version: 6.5.9 - resolution: "@storybook/router@npm:6.5.9" - dependencies: - "@storybook/client-logger": 6.5.9 - core-js: ^3.8.2 - memoizerific: ^1.11.3 - qs: ^6.10.0 - regenerator-runtime: ^0.13.7 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 10acf6d67fa245ca10d8e377d593405ab1505d22b3bb2e7ce7dc45bc5be2074d7bb89f9266b7550b84063c907e2188742b355fc8af05f7cf4554a0770915d12e - languageName: node - linkType: hard - "@storybook/semver@npm:^7.3.2": version: 7.3.2 resolution: "@storybook/semver@npm:7.3.2" @@ -9084,28 +8369,7 @@ __metadata: languageName: node linkType: hard -"@storybook/source-loader@npm:6.5.10, @storybook/source-loader@npm:~6.5.10": - version: 6.5.10 - resolution: "@storybook/source-loader@npm:6.5.10" - dependencies: - "@storybook/addons": 6.5.10 - "@storybook/client-logger": 6.5.10 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - core-js: ^3.8.2 - estraverse: ^5.2.0 - global: ^4.4.0 - loader-utils: ^2.0.0 - lodash: ^4.17.21 - prettier: ">=2.2.1 <=2.3.0" - regenerator-runtime: ^0.13.7 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 77d7a0255cace96fc9953518fe54162ce4b2167b53eb744f498cf2098ba4af8074d75f572940621675303043b69e2281e8a5479ce2d331d47aa86c189cdd53bb - languageName: node - linkType: hard - -"@storybook/source-loader@npm:6.5.12": +"@storybook/source-loader@npm:6.5.12, @storybook/source-loader@npm:~6.5.10": version: 6.5.12 resolution: "@storybook/source-loader@npm:6.5.12" dependencies: @@ -9178,26 +8442,6 @@ __metadata: languageName: node linkType: hard -"@storybook/telemetry@npm:6.5.10": - version: 6.5.10 - resolution: "@storybook/telemetry@npm:6.5.10" - dependencies: - "@storybook/client-logger": 6.5.10 - "@storybook/core-common": 6.5.10 - chalk: ^4.1.0 - core-js: ^3.8.2 - detect-package-manager: ^2.0.1 - fetch-retry: ^5.0.2 - fs-extra: ^9.0.1 - global: ^4.4.0 - isomorphic-unfetch: ^3.1.0 - nanoid: ^3.3.1 - read-pkg-up: ^7.0.1 - regenerator-runtime: ^0.13.7 - checksum: 774acc7f5d91b855be3ec1e2ae5a13b61e3eb9db2c2284ee54d788a701e637a86d4ca14597a027d32555f74392e4c99f47e886bc7729a7222e4e8159c492e054 - languageName: node - linkType: hard - "@storybook/telemetry@npm:6.5.12": version: 6.5.12 resolution: "@storybook/telemetry@npm:6.5.12" @@ -9231,7 +8475,7 @@ __metadata: languageName: node linkType: hard -"@storybook/theming@npm:6.5.10, @storybook/theming@npm:~6.5.10": +"@storybook/theming@npm:6.5.10": version: 6.5.10 resolution: "@storybook/theming@npm:6.5.10" dependencies: @@ -9246,7 +8490,7 @@ __metadata: languageName: node linkType: hard -"@storybook/theming@npm:6.5.12": +"@storybook/theming@npm:6.5.12, @storybook/theming@npm:~6.5.10": version: 6.5.12 resolution: "@storybook/theming@npm:6.5.12" dependencies: @@ -9261,21 +8505,6 @@ __metadata: languageName: node linkType: hard -"@storybook/theming@npm:6.5.9": - version: 6.5.9 - resolution: "@storybook/theming@npm:6.5.9" - dependencies: - "@storybook/client-logger": 6.5.9 - core-js: ^3.8.2 - memoizerific: ^1.11.3 - regenerator-runtime: ^0.13.7 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 0c0d034864bcf7289778aa549dd9d830c75b90e416cbd2ee8bc9be946f1699141a7b695916aa134c38d156edcfac3a1378e3490ac02b470b89d168625618d073 - languageName: node - linkType: hard - "@storybook/ui@npm:6.5.10": version: 6.5.10 resolution: "@storybook/ui@npm:6.5.10" @@ -9334,8 +8563,8 @@ __metadata: linkType: hard "@tanstack/react-query@npm:^4.0.10": - version: 4.0.10 - resolution: "@tanstack/react-query@npm:4.0.10" + version: 4.2.1 + resolution: "@tanstack/react-query@npm:4.2.1" dependencies: "@tanstack/query-core": ^4.0.0-beta.1 "@types/use-sync-external-store": ^0.0.3 @@ -9349,7 +8578,7 @@ __metadata: optional: true react-native: optional: true - checksum: b5f7501f977f4262fe80e510f5d58f3b49163ff7232603a839b7184431db7309c38ab55c5856a9d31a3c5219dd5031f9174e9dfcc78408300d0424b3000b9034 + checksum: bbf3a808645c26c649971dc182bb9a7ed7a1d89f6456b60685c6081b8be6ae84ae83b39c7eacb96c4f3b6677ca001d8114037329951987b7a8d65de53b28c862 languageName: node linkType: hard @@ -9724,23 +8953,20 @@ __metadata: languageName: node linkType: hard -"@types/eslint-scope@npm:^3.7.0": - version: 3.7.4 - resolution: "@types/eslint-scope@npm:3.7.4" - dependencies: - "@types/eslint": "*" - "@types/estree": "*" - checksum: ea6a9363e92f301cd3888194469f9ec9d0021fe0a397a97a6dd689e7545c75de0bd2153dfb13d3ab532853a278b6572c6f678ce846980669e41029d205653460 +"@types/emojione@npm:^2.2.6": + version: 2.2.6 + resolution: "@types/emojione@npm:2.2.6" + checksum: 5a049b57ea99eb88359b257256cdb74f048f8cfddc58a7ea9a50ba5d937f9414025c0616205b67f63512fcbbba44471901209d8f3c7fb5a9741fb6d3038eb864 languageName: node linkType: hard -"@types/eslint-scope@npm:^3.7.3": - version: 3.7.3 - resolution: "@types/eslint-scope@npm:3.7.3" +"@types/eslint-scope@npm:^3.7.0, @types/eslint-scope@npm:^3.7.3": + version: 3.7.4 + resolution: "@types/eslint-scope@npm:3.7.4" dependencies: "@types/eslint": "*" "@types/estree": "*" - checksum: 6772b05e1b92003d1f295e81bc847a61f4fbe8ddab77ffa49e84ed3f9552513bdde677eb53ef167753901282857dd1d604d9f82eddb34a233495932b2dc3dc17 + checksum: ea6a9363e92f301cd3888194469f9ec9d0021fe0a397a97a6dd689e7545c75de0bd2153dfb13d3ab532853a278b6572c6f678ce846980669e41029d205653460 languageName: node linkType: hard @@ -9777,7 +9003,7 @@ __metadata: languageName: node linkType: hard -"@types/express-serve-static-core@npm:*": +"@types/express-serve-static-core@npm:*, @types/express-serve-static-core@npm:^4.17.18": version: 4.17.31 resolution: "@types/express-serve-static-core@npm:4.17.31" dependencies: @@ -9788,17 +9014,6 @@ __metadata: languageName: node linkType: hard -"@types/express-serve-static-core@npm:^4.17.18": - version: 4.17.28 - resolution: "@types/express-serve-static-core@npm:4.17.28" - dependencies: - "@types/node": "*" - "@types/qs": "*" - "@types/range-parser": "*" - checksum: 826489811a5b371c10f02443b4ca894ffc05813bfdf2b60c224f5c18ac9a30a2e518cb9ef9fdfcaa2a1bb17f8bfa4ed1859ccdb252e879c9276271b4ee2df5a9 - languageName: node - linkType: hard - "@types/express@npm:*, @types/express@npm:^4.17.13, @types/express@npm:^4.17.8": version: 4.17.13 resolution: "@types/express@npm:4.17.13" @@ -10385,33 +9600,22 @@ __metadata: linkType: hard "@types/react-dom@npm:^18": - version: 18.0.5 - resolution: "@types/react-dom@npm:18.0.5" + version: 18.0.6 + resolution: "@types/react-dom@npm:18.0.6" dependencies: "@types/react": "*" - checksum: cd48b81950f499b52a3f0c08261f00046f9b7c96699fa249c9664e257e820daf6ecac815cd1028cebc9d105094adc39d047d1efd79214394b8b2d515574c0787 - languageName: node - linkType: hard - -"@types/react@npm:*, @types/react@npm:^17, @types/react@npm:^17.0.47, @types/react@npm:~17.0.47": - version: 17.0.47 - resolution: "@types/react@npm:17.0.47" - dependencies: - "@types/prop-types": "*" - "@types/scheduler": "*" - csstype: ^3.0.2 - checksum: 2e7fe0eb630cb77da03b6da308c58728c01b38e878118e9ff5cd8045181c8d4f32dc936e328f46a62cadb56e1fe4c5a911b5113584f93a99e1f35df7f059246b + checksum: db571047af1a567631758700b9f7d143e566df939cfe5fbf7535347cc0c726a1cdbb5e3f8566d076e54cf708b6c1166689de194a9ba09ee35efc9e1d45911685 languageName: node linkType: hard -"@types/react@npm:~17.0.39": - version: 17.0.48 - resolution: "@types/react@npm:17.0.48" +"@types/react@npm:*, @types/react@npm:^17, @types/react@npm:^17.0.47, @types/react@npm:~17.0.39, @types/react@npm:~17.0.47": + version: 17.0.50 + resolution: "@types/react@npm:17.0.50" dependencies: "@types/prop-types": "*" "@types/scheduler": "*" csstype: ^3.0.2 - checksum: b683fa33f751ced0b8c8715df9f40de15513c1d7ce66064a75cdfb8805cc913b0b214a2e7022ef0b724bd62a1e8651d040cd265dd0452bde03cca9b8e495742d + checksum: b5629dff7c2f3e9fcba95a19b2b3bfd78d7cacc33ba5fc26413dba653d34afcac3b93ddabe563e8062382688a1eac7db68e93739bb8e712d27637a03aaafbbb8 languageName: node linkType: hard @@ -10438,6 +9642,15 @@ __metadata: languageName: node linkType: hard +"@types/sanitize-html@npm:^2": + version: 2.6.2 + resolution: "@types/sanitize-html@npm:2.6.2" + dependencies: + htmlparser2: ^6.0.0 + checksum: 08b43427427cbd8acd2843bbf9e00576c06e3916fc523d27fd9016f39563f7999f78b632ff473ef83a77f86bdea9286de2f81e3a8f8a05af6721687651c84f1c + languageName: node + linkType: hard + "@types/scheduler@npm:*": version: 0.16.2 resolution: "@types/scheduler@npm:0.16.2" @@ -10922,7 +10135,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.30.7, @typescript-eslint/utils@npm:^5.10.0, @typescript-eslint/utils@npm:^5.13.0": +"@typescript-eslint/utils@npm:5.30.7": version: 5.30.7 resolution: "@typescript-eslint/utils@npm:5.30.7" dependencies: @@ -10938,7 +10151,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.36.2": +"@typescript-eslint/utils@npm:5.36.2, @typescript-eslint/utils@npm:^5.10.0, @typescript-eslint/utils@npm:^5.13.0": version: 5.36.2 resolution: "@typescript-eslint/utils@npm:5.36.2" dependencies: @@ -12667,19 +11880,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-polyfill-corejs2@npm:^0.3.1": - version: 0.3.1 - resolution: "babel-plugin-polyfill-corejs2@npm:0.3.1" - dependencies: - "@babel/compat-data": ^7.13.11 - "@babel/helper-define-polyfill-provider": ^0.3.1 - semver: ^6.1.1 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: ca873f14ccd6d2942013345a956de8165d0913556ec29756a748157140f5312f79eed487674e0ca562285880f05829b3712d72e1e4b412c2ce46bd6a50b4b975 - languageName: node - linkType: hard - "babel-plugin-polyfill-corejs2@npm:^0.3.3": version: 0.3.3 resolution: "babel-plugin-polyfill-corejs2@npm:0.3.3" @@ -12705,18 +11905,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-polyfill-corejs3@npm:^0.5.2": - version: 0.5.2 - resolution: "babel-plugin-polyfill-corejs3@npm:0.5.2" - dependencies: - "@babel/helper-define-polyfill-provider": ^0.3.1 - core-js-compat: ^3.21.0 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 2f3184c73f80f00ac876a5ebcad945fd8d2ae70e5f85b7ab6cc3bc69bc74025f4f7070de7abbb2a7274c78e130bd34fc13f4c85342da28205930364a1ef0aa21 - languageName: node - linkType: hard - "babel-plugin-polyfill-corejs3@npm:^0.6.0": version: 0.6.0 resolution: "babel-plugin-polyfill-corejs3@npm:0.6.0" @@ -12729,17 +11917,6 @@ __metadata: languageName: node linkType: hard -"babel-plugin-polyfill-regenerator@npm:^0.3.1": - version: 0.3.1 - resolution: "babel-plugin-polyfill-regenerator@npm:0.3.1" - dependencies: - "@babel/helper-define-polyfill-provider": ^0.3.1 - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: f1473df7b700d6795ca41301b1e65a0aff15ce6c1463fc0ce2cf0c821114b0330920f59d4cebf52976363ee817ba29ad2758544a4661a724b08191080b9fe1da - languageName: node - linkType: hard - "babel-plugin-polyfill-regenerator@npm:^0.4.1": version: 0.4.1 resolution: "babel-plugin-polyfill-regenerator@npm:0.4.1" @@ -13435,22 +12612,7 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.0.0, browserslist@npm:^4.12.0, browserslist@npm:^4.14.5, browserslist@npm:^4.20.2, browserslist@npm:^4.20.3": - version: 4.20.4 - resolution: "browserslist@npm:4.20.4" - dependencies: - caniuse-lite: ^1.0.30001349 - electron-to-chromium: ^1.4.147 - escalade: ^3.1.1 - node-releases: ^2.0.5 - picocolors: ^1.0.0 - bin: - browserslist: cli.js - checksum: 0e56c42da765524e5c31bc9a1f08afaa8d5dba085071137cf21e56dc78d0cf0283764143df4c7d1c0cd18c3187fc9494e1d93fa0255004f0be493251a28635f9 - languageName: node - linkType: hard - -"browserslist@npm:^4.21.3": +"browserslist@npm:^4.0.0, browserslist@npm:^4.12.0, browserslist@npm:^4.14.5, browserslist@npm:^4.21.3": version: 4.21.3 resolution: "browserslist@npm:4.21.3" dependencies: @@ -13956,14 +13118,7 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001109, caniuse-lite@npm:^1.0.30001349": - version: 1.0.30001378 - resolution: "caniuse-lite@npm:1.0.30001378" - checksum: 19f1774da1f62d393ddde55dc091eb3e4f5c5b0ce43f9a9d20e75307a0f329cf8591c836a35a9f6f9fd7c27db7a75e0682245a194acec2e2ba1bc25ef1c3300c - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001370": +"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001109, caniuse-lite@npm:^1.0.30001370": version: 1.0.30001399 resolution: "caniuse-lite@npm:1.0.30001399" checksum: dd105b06fbbdc89867780a2f4debc3ecb184cff82f35b34aaac486628fcc9cf6bacf37573a9cc22dedc661178d460fa8401374a933cb9d2f8ee67316d98b2a8f @@ -14585,14 +13740,7 @@ __metadata: languageName: node linkType: hard -"clsx@npm:^1.0.4": - version: 1.1.1 - resolution: "clsx@npm:1.1.1" - checksum: ff052650329773b9b245177305fc4c4dc3129f7b2be84af4f58dc5defa99538c61d4207be7419405a5f8f3d92007c954f4daba5a7b74e563d5de71c28c830063 - languageName: node - linkType: hard - -"clsx@npm:^1.1.1": +"clsx@npm:^1.0.4, clsx@npm:^1.1.1": version: 1.2.1 resolution: "clsx@npm:1.2.1" checksum: 30befca8019b2eb7dbad38cff6266cf543091dae2825c856a62a8ccf2c3ab9c2907c4d12b288b73101196767f66812365400a227581484a05f968b0307cfaf12 @@ -15140,17 +14288,7 @@ __metadata: languageName: node linkType: hard -"core-js-compat@npm:^3.21.0, core-js-compat@npm:^3.22.1, core-js-compat@npm:^3.8.1": - version: 3.22.8 - resolution: "core-js-compat@npm:3.22.8" - dependencies: - browserslist: ^4.20.3 - semver: 7.0.0 - checksum: 0c82d9110dcb267c2f5547c61b62f8043793d203523048169176b8badf0b73f3792624342b85d9c923df8eb8971b4aa468b160abb81a023d183c5951e4f05a66 - languageName: node - linkType: hard - -"core-js-compat@npm:^3.25.1": +"core-js-compat@npm:^3.25.1, core-js-compat@npm:^3.8.1": version: 3.25.1 resolution: "core-js-compat@npm:3.25.1" dependencies: @@ -16982,13 +16120,6 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.4.147": - version: 1.4.152 - resolution: "electron-to-chromium@npm:1.4.152" - checksum: d1e3405adc8a8ddbcf5a91f33739f2f3f5fa7612a4e2b6cc6a85d9ebccc87f59cf9e99d2de93c7959b34aa7c633c6c162d912bf895a0e4b79d0c2ce35594948f - languageName: node - linkType: hard - "electron-to-chromium@npm:^1.4.202": version: 1.4.249 resolution: "electron-to-chromium@npm:1.4.249" @@ -16996,7 +16127,7 @@ __metadata: languageName: node linkType: hard -"element-closest-polyfill@npm:^1.0.4": +"element-closest-polyfill@npm:^1.0.5": version: 1.0.5 resolution: "element-closest-polyfill@npm:1.0.5" checksum: baadc55f03035a8ffbcde818d3b4892de31fabe94d69c01d627522f4d306bf971300b5863e24c9774840877c7418802bd7e4538fe6142aee85f893694fb0c4c5 @@ -17180,16 +16311,6 @@ __metadata: languageName: node linkType: hard -"enhanced-resolve@npm:^5.9.3": - version: 5.9.3 - resolution: "enhanced-resolve@npm:5.9.3" - dependencies: - graceful-fs: ^4.2.4 - tapable: ^2.2.0 - checksum: 64c2dbbdd608d1a4df93b6e60786c603a1faf3b2e66dfd051d62cf4cfaeeb5e800166183685587208d62e9f7afff3f78f3d5978e32cd80125ba0c83b59a79d78 - languageName: node - linkType: hard - "enquirer@npm:2.3.6, enquirer@npm:^2.3.5": version: 2.3.6 resolution: "enquirer@npm:2.3.6" @@ -17613,18 +16734,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-testing-library@npm:^5.5.1": - version: 5.5.1 - resolution: "eslint-plugin-testing-library@npm:5.5.1" - dependencies: - "@typescript-eslint/utils": ^5.13.0 - peerDependencies: - eslint: ^7.5.0 || ^8.0.0 - checksum: 558994da12e6a9ff0c4f71c2e63a23746b6323d171062032843591e0fca6ce3811f979cf82e11db003c8b4f1d9842cb75301bfaa9e88d1a399b11ea6686aadcc - languageName: node - linkType: hard - -"eslint-plugin-testing-library@npm:^5.6.0": +"eslint-plugin-testing-library@npm:^5.5.1, eslint-plugin-testing-library@npm:^5.6.0": version: 5.6.0 resolution: "eslint-plugin-testing-library@npm:5.6.0" dependencies: @@ -17756,61 +16866,12 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.20.0, eslint@npm:^8.21.0": - version: 8.21.0 - resolution: "eslint@npm:8.21.0" - dependencies: - "@eslint/eslintrc": ^1.3.0 - "@humanwhocodes/config-array": ^0.10.4 - "@humanwhocodes/gitignore-to-minimatch": ^1.0.2 - ajv: ^6.10.0 - chalk: ^4.0.0 - cross-spawn: ^7.0.2 - debug: ^4.3.2 - doctrine: ^3.0.0 - escape-string-regexp: ^4.0.0 - eslint-scope: ^7.1.1 - eslint-utils: ^3.0.0 - eslint-visitor-keys: ^3.3.0 - espree: ^9.3.3 - esquery: ^1.4.0 - esutils: ^2.0.2 - fast-deep-equal: ^3.1.3 - file-entry-cache: ^6.0.1 - find-up: ^5.0.0 - functional-red-black-tree: ^1.0.1 - glob-parent: ^6.0.1 - globals: ^13.15.0 - globby: ^11.1.0 - grapheme-splitter: ^1.0.4 - ignore: ^5.2.0 - import-fresh: ^3.0.0 - imurmurhash: ^0.1.4 - is-glob: ^4.0.0 - js-yaml: ^4.1.0 - json-stable-stringify-without-jsonify: ^1.0.1 - levn: ^0.4.1 - lodash.merge: ^4.6.2 - minimatch: ^3.1.2 - natural-compare: ^1.4.0 - optionator: ^0.9.1 - regexpp: ^3.2.0 - strip-ansi: ^6.0.1 - strip-json-comments: ^3.1.0 - text-table: ^0.2.0 - v8-compile-cache: ^2.0.3 - bin: - eslint: bin/eslint.js - checksum: 1d39ddb08772ea230cb7d74f7f81f85b9d46965d3600725c7eb39a27bcdaf28cb2a780dacf6cfa1cfbf2da606b57a5e7e3ab373ab474cbcf0ba042076821f501 - languageName: node - linkType: hard - -"eslint@npm:^8.22.0": - version: 8.23.1 - resolution: "eslint@npm:8.23.1" +"eslint@npm:^8.20.0, eslint@npm:^8.21.0, eslint@npm:^8.22.0": + version: 8.24.0 + resolution: "eslint@npm:8.24.0" dependencies: "@eslint/eslintrc": ^1.3.2 - "@humanwhocodes/config-array": ^0.10.4 + "@humanwhocodes/config-array": ^0.10.5 "@humanwhocodes/gitignore-to-minimatch": ^1.0.2 "@humanwhocodes/module-importer": ^1.0.1 ajv: ^6.10.0 @@ -17850,7 +16911,7 @@ __metadata: text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: a727e15492786a03b438bcf021db49f715680679846a7b8d79b98ad34576f2a570404ffe882d3c3e26f6359bff7277ef11fae5614bfe8629adb653f20d018c71 + checksum: ca293ce7116599b742d7ab4d43db469beec22f40dd272092d809498be3cff3a7c567769f9763bdf6799aac13dd53447b93a99629b7b54092783046eb57eaced6 languageName: node linkType: hard @@ -17910,18 +16971,7 @@ __metadata: languageName: node linkType: hard -"espree@npm:^9.3.0, espree@npm:^9.3.2, espree@npm:^9.3.3": - version: 9.3.3 - resolution: "espree@npm:9.3.3" - dependencies: - acorn: ^8.8.0 - acorn-jsx: ^5.3.2 - eslint-visitor-keys: ^3.3.0 - checksum: 33e8a36fc15d082e68672e322e22a53856b564d60aad8f291a667bfc21b2c900c42412d37dd3c7a0f18b9d0d8f8858dabe8776dbd4b4c2f72c5cf4d6afeabf65 - languageName: node - linkType: hard - -"espree@npm:^9.4.0": +"espree@npm:^9.3.0, espree@npm:^9.4.0": version: 9.4.0 resolution: "espree@npm:9.4.0" dependencies: @@ -18493,14 +17543,7 @@ __metadata: languageName: node linkType: hard -"fast-redact@npm:^3.0.0": - version: 3.1.1 - resolution: "fast-redact@npm:3.1.1" - checksum: e486cc9990b5c9724f39bf4e392c1b250c8fd5e8c0145be80c73de3461fc390babe7b48f35746b50bf3cbcd917e093b5685ae66295162c7d9b686a761d48e989 - languageName: node - linkType: hard - -"fast-redact@npm:^3.1.1": +"fast-redact@npm:^3.0.0, fast-redact@npm:^3.1.1": version: 3.1.2 resolution: "fast-redact@npm:3.1.2" checksum: a30eb6b6830333ab213e0def55f46453ca777544dbd3a883016cb590a0eeb95e6fdf546553c1a13d509896bfba889b789991160a6d0996ceb19fce0a02e8b753 @@ -18619,12 +17662,12 @@ __metadata: languageName: node linkType: hard -"fibers@npm:^5.0.1": - version: 5.0.1 - resolution: "fibers@npm:5.0.1" +"fibers@npm:^5.0.1, fibers@npm:^5.0.3": + version: 5.0.3 + resolution: "fibers@npm:5.0.3" dependencies: detect-libc: ^1.0.3 - checksum: 823d148cb993c5aeb7e05e7ed289b9a6073b821bc124c70ac5c6dfee850dc0df65d680a10ce3fb6c37e4705115dcb2d98dad25abde26a2437ada86c5f21be11c + checksum: d66c5e18a911aab3480b846e1c837e5c7cfacb27a2a5fe512919865eaecef33cdd4abc14d777191a6a93473dc52356d48549c91a2a7b8b3450544c44104b23f3 languageName: node linkType: hard @@ -18798,10 +17841,10 @@ __metadata: languageName: node linkType: hard -"filesize@npm:^3.6.1": - version: 3.6.1 - resolution: "filesize@npm:3.6.1" - checksum: 9ba47e9df90cd6bb6c0434418123facf9dafbe92c850f29ed50bfa42d60d00f8501a8a9b962f77ec7d1ba30190d5dbda5f6f56c5e56bce9e09729988bf0613c4 +"filesize@npm:9.0.11": + version: 9.0.11 + resolution: "filesize@npm:9.0.11" + checksum: 7e8a9f9a4089e3ee29de64c241b50db8db4008351ace959873cb950bac0c2e1e09f4b45f42eaed8acd589a895dde978ed199e7a9982902fa06ca0be48e5ea92d languageName: node linkType: hard @@ -20598,14 +19641,7 @@ __metadata: languageName: node linkType: hard -"highlight.js@npm:^11.5.1": - version: 11.5.1 - resolution: "highlight.js@npm:11.5.1" - checksum: bff556101d7691c6275ad19318e368fc971cd0621ef3d86222f5373df7d8191a2fc1ffd47f118138cbcf85e5fe91cfeefaecd6184f49a3ec18090955efc9edef - languageName: node - linkType: hard - -"highlight.js@npm:^11.6.0": +"highlight.js@npm:^11.5.1, highlight.js@npm:^11.6.0": version: 11.6.0 resolution: "highlight.js@npm:11.6.0" checksum: 3908eb34a4b442ca1e20c1ae6415ea935fbbcdb2b532a89948d82b0fa4ad41fc5de3802a0de4e88a0bcb7d97d4445579048cd2aab1d105ac47f59dd58a9a98ae @@ -21126,12 +20162,12 @@ __metadata: languageName: node linkType: hard -"i18next@npm:~21.6.11": - version: 21.6.14 - resolution: "i18next@npm:21.6.14" +"i18next@npm:~21.6.16": + version: 21.6.16 + resolution: "i18next@npm:21.6.16" dependencies: "@babel/runtime": ^7.17.2 - checksum: bc6e117874d9b69a39d6ad322851d25f75908c7fa977c8771b98ba7b0273aceba96e82326ed0855b8db098b1490c5a0decbe62b4f61dac84fdc677c2fdc52bb8 + checksum: f210130fd835ebd90bfdc6a497d3c1d992261174e030e995a03d070b099acba680e495a376eb9255bb8eb68b4e518fe8ea96ec71507e194fd043aecb3397c9a2 languageName: node linkType: hard @@ -24433,7 +23469,7 @@ __metadata: optional: true bin: lessc: ./bin/lessc - checksum: c9b8c0e865427112c48a9cac36f14964e130577743c29d56a6d93b5812b70846b04ccaa364acf1e8d75cee3855215ec0a2d8d9de569c80e774f10b6245f39b7d + checksum: 61568b56b5289fdcfe3d51baf3c13e7db7140022c0a37ef0ae343169f0de927a4b4f4272bc10c20101796e8ee79e934e024051321bba93b3ae071f734309bd98 languageName: node linkType: hard @@ -25469,16 +24505,7 @@ __metadata: languageName: node linkType: hard -"memfs@npm:^3.1.2": - version: 3.4.6 - resolution: "memfs@npm:3.4.6" - dependencies: - fs-monkey: ^1.0.3 - checksum: 0164d79c5da42809d9590125ee713aac59b1c1e16c61d4b264460366514342da2867ac64874f098af348e13eadde4c6d8fb8188b16e766029d67adf8ec153b4c - languageName: node - linkType: hard - -"memfs@npm:^3.2.2": +"memfs@npm:^3.1.2, memfs@npm:^3.2.2": version: 3.4.7 resolution: "memfs@npm:3.4.7" dependencies: @@ -26277,14 +25304,7 @@ __metadata: languageName: node linkType: hard -"moment@npm:>= 2.9.0, moment@npm:^2.10.2, moment@npm:^2.29.1": - version: 2.29.3 - resolution: "moment@npm:2.29.3" - checksum: 2e780e36d9a1823c08a1b6313cbb08bd01ecbb2a9062095820a34f42c878991ccba53abaa6abb103fd5c01e763724f295162a8c50b7e95b4f1c992ef0772d3f0 - languageName: node - linkType: hard - -"moment@npm:^2.29.4": +"moment@npm:>= 2.9.0, moment@npm:^2.10.2, moment@npm:^2.29.1, moment@npm:^2.29.4": version: 2.29.4 resolution: "moment@npm:2.29.4" checksum: 0ec3f9c2bcba38dc2451b1daed5daded747f17610b92427bebe1d08d48d8b7bdd8d9197500b072d14e326dd0ccf3e326b9e3d07c5895d3d49e39b6803b76e80e @@ -26909,13 +25929,6 @@ __metadata: languageName: node linkType: hard -"node-releases@npm:^2.0.5": - version: 2.0.5 - resolution: "node-releases@npm:2.0.5" - checksum: e85d949addd19f8827f32569d2be5751e7812ccf6cc47879d49f79b5234ff4982225e39a3929315f96370823b070640fb04d79fc0ddec8b515a969a03493a42f - languageName: node - linkType: hard - "node-releases@npm:^2.0.6": version: 2.0.6 resolution: "node-releases@npm:2.0.6" @@ -29602,7 +28615,7 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.0.0, postcss@npm:^8.2.15, postcss@npm:~8.4.16": +"postcss@npm:^8.0.0, postcss@npm:^8.2.15, postcss@npm:^8.3.11, postcss@npm:^8.4.14, postcss@npm:~8.4.14, postcss@npm:~8.4.16": version: 8.4.16 resolution: "postcss@npm:8.4.16" dependencies: @@ -29613,17 +28626,6 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.3.11, postcss@npm:^8.4.14, postcss@npm:~8.4.14": - version: 8.4.14 - resolution: "postcss@npm:8.4.14" - dependencies: - nanoid: ^3.3.4 - picocolors: ^1.0.0 - source-map-js: ^1.0.2 - checksum: fe58766ff32e4becf65a7d57678995cfd239df6deed2fe0557f038b47c94e4132e7e5f68b5aa820c13adfec32e523b693efaeb65798efb995ce49ccd83953816 - languageName: node - linkType: hard - "postis@npm:^2.2.0": version: 2.2.0 resolution: "postis@npm:2.2.0" @@ -30516,7 +29518,7 @@ __metadata: languageName: node linkType: hard -"react-aria@npm:^3.19.0": +"react-aria@npm:^3.19.0, react-aria@npm:~3.19.0": version: 3.19.0 resolution: "react-aria@npm:3.19.0" dependencies: @@ -30645,7 +29647,7 @@ __metadata: languageName: node linkType: hard -"react-hook-form@npm:~7.27.0": +"react-hook-form@npm:~7.27.1": version: 7.27.1 resolution: "react-hook-form@npm:7.27.1" peerDependencies: @@ -30769,6 +29771,37 @@ __metadata: languageName: node linkType: hard +"react-stately@npm:~3.17.0": + version: 3.17.0 + resolution: "react-stately@npm:3.17.0" + dependencies: + "@react-stately/calendar": ^3.0.2 + "@react-stately/checkbox": ^3.2.1 + "@react-stately/collections": ^3.4.3 + "@react-stately/combobox": ^3.2.1 + "@react-stately/data": ^3.6.1 + "@react-stately/datepicker": ^3.0.2 + "@react-stately/list": ^3.5.3 + "@react-stately/menu": ^3.4.1 + "@react-stately/numberfield": ^3.2.1 + "@react-stately/overlays": ^3.4.1 + "@react-stately/radio": ^3.5.1 + "@react-stately/searchfield": ^3.3.1 + "@react-stately/select": ^3.3.1 + "@react-stately/selection": ^3.10.3 + "@react-stately/slider": ^3.2.1 + "@react-stately/table": ^3.4.0 + "@react-stately/tabs": ^3.2.1 + "@react-stately/toggle": ^3.4.1 + "@react-stately/tooltip": ^3.2.1 + "@react-stately/tree": ^3.3.3 + "@react-types/shared": ^3.14.1 + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 + checksum: da233f06f0c4a2b821755cde7b484b8cc07743b075224225a7213be1b62cf1db0966216528775d755fe83cb2a5eeda43c59684bbba47fcf2652f465557f8f4d2 + languageName: node + linkType: hard + "react-transition-group@npm:^4.3.0": version: 4.4.2 resolution: "react-transition-group@npm:4.4.2" @@ -30903,14 +29936,12 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:*, readable-stream@npm:^3.0.6, readable-stream@npm:^3.1.1, readable-stream@npm:^3.4.0, readable-stream@npm:^3.5.0, readable-stream@npm:^3.6.0": - version: 3.6.0 - resolution: "readable-stream@npm:3.6.0" +"readable-stream@npm:*, readable-stream@npm:^4.0.0": + version: 4.1.0 + resolution: "readable-stream@npm:4.1.0" dependencies: - inherits: ^2.0.3 - string_decoder: ^1.1.1 - util-deprecate: ^1.0.1 - checksum: d4ea81502d3799439bb955a3a5d1d808592cf3133350ed352aeaa499647858b27b1c4013984900238b0873ec8d0d8defce72469fb7a83e61d53f5ad61cb80dc8 + abort-controller: ^3.0.0 + checksum: ff2bb513af6fb43618c8360211b5b9052e25a59e6626d3669c7ba060d021dfffa43c43832e11b18acd6aac15b057c6deae1c41004c1731688c95c455ad02f982 languageName: node linkType: hard @@ -30953,12 +29984,14 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:^4.0.0": - version: 4.1.0 - resolution: "readable-stream@npm:4.1.0" +"readable-stream@npm:^3.0.6, readable-stream@npm:^3.1.1, readable-stream@npm:^3.4.0, readable-stream@npm:^3.5.0, readable-stream@npm:^3.6.0": + version: 3.6.0 + resolution: "readable-stream@npm:3.6.0" dependencies: - abort-controller: ^3.0.0 - checksum: ff2bb513af6fb43618c8360211b5b9052e25a59e6626d3669c7ba060d021dfffa43c43832e11b18acd6aac15b057c6deae1c41004c1731688c95c455ad02f982 + inherits: ^2.0.3 + string_decoder: ^1.1.1 + util-deprecate: ^1.0.1 + checksum: d4ea81502d3799439bb955a3a5d1d808592cf3133350ed352aeaa499647858b27b1c4013984900238b0873ec8d0d8defce72469fb7a83e61d53f5ad61cb80dc8 languageName: node linkType: hard @@ -31752,14 +30785,14 @@ __metadata: dependencies: "@rocket.chat/apps-engine": ^1.32.0 "@rocket.chat/core-typings": "workspace:^" - "@rocket.chat/emitter": next - "@rocket.chat/icons": next - "@rocket.chat/message-parser": next + "@rocket.chat/emitter": 0.31.21 + "@rocket.chat/icons": 0.31.21 + "@rocket.chat/message-parser": 0.31.21 "@rocket.chat/model-typings": "workspace:^" "@rocket.chat/models": "workspace:^" "@rocket.chat/rest-typings": "workspace:^" - "@rocket.chat/string-helpers": next - "@rocket.chat/ui-kit": next + "@rocket.chat/string-helpers": 0.31.21 + "@rocket.chat/ui-kit": 0.31.21 "@types/cookie": ^0.5.1 "@types/cookie-parser": ^1.4.3 "@types/ejson": ^2.2.0 @@ -31923,9 +30956,9 @@ __metadata: languageName: node linkType: hard -"sanitize-html@npm:^2.6.1": - version: 2.7.0 - resolution: "sanitize-html@npm:2.7.0" +"sanitize-html@npm:^2.6.1, sanitize-html@npm:^2.7.2": + version: 2.7.2 + resolution: "sanitize-html@npm:2.7.2" dependencies: deepmerge: ^4.2.2 escape-string-regexp: ^4.0.0 @@ -31933,7 +30966,7 @@ __metadata: is-plain-object: ^5.0.0 parse-srcset: ^1.0.2 postcss: ^8.3.11 - checksum: 73a4d66f69578bace3506519ca0734279b7117e15c33c7e4d075cdb483b1586261a18acd35934f6c6109f3b2a4a82f82c242171a94d5dc23fba5b09b01ea5b22 + checksum: 4c15e87a411420d670412de2beb29386c8307210c170ceb716d93b4010dcf6a8ae39408d7d863752ee84cc65f5995633c7089789c5f8c0de478a7023d93a53ec languageName: node linkType: hard @@ -32176,15 +31209,6 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.0.0": - version: 7.0.0 - resolution: "semver@npm:7.0.0" - bin: - semver: bin/semver.js - checksum: 272c11bf8d083274ef79fe40a81c55c184dff84dd58e3c325299d0927ba48cece1f020793d138382b85f89bab5002a35a5ba59a3a68a7eebbb597eb733838778 - languageName: node - linkType: hard - "semver@npm:7.x, semver@npm:^7.2, semver@npm:^7.2.1, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7": version: 7.3.7 resolution: "semver@npm:7.3.7" @@ -33848,10 +32872,10 @@ __metadata: languageName: node linkType: hard -"stylis@npm:~4.0.13": - version: 4.0.13 - resolution: "stylis@npm:4.0.13" - checksum: 8ea7a87028b6383c6a982231c4b5b6150031ce028e0fdaf7b2ace82253d28a8af50cc5a9da8a421d3c7c4441592f393086e332795add672aa4a825f0fe3713a3 +"stylis@npm:~4.1.3": + version: 4.1.3 + resolution: "stylis@npm:4.1.3" + checksum: d04dbffcb9bf2c5ca8d8dc09534203c75df3bf711d33973ea22038a99cc475412a350b661ebd99cbc01daa50d7eedcf0d130d121800eb7318759a197023442a6 languageName: node linkType: hard @@ -34245,7 +33269,7 @@ __metadata: languageName: node linkType: hard -"terser-webpack-plugin@npm:^5.0.3": +"terser-webpack-plugin@npm:^5.0.3, terser-webpack-plugin@npm:^5.1.3": version: 5.3.5 resolution: "terser-webpack-plugin@npm:5.3.5" dependencies: @@ -34267,28 +33291,6 @@ __metadata: languageName: node linkType: hard -"terser-webpack-plugin@npm:^5.1.3": - version: 5.3.3 - resolution: "terser-webpack-plugin@npm:5.3.3" - dependencies: - "@jridgewell/trace-mapping": ^0.3.7 - jest-worker: ^27.4.5 - schema-utils: ^3.1.1 - serialize-javascript: ^6.0.0 - terser: ^5.7.2 - peerDependencies: - webpack: ^5.1.0 - peerDependenciesMeta: - "@swc/core": - optional: true - esbuild: - optional: true - uglify-js: - optional: true - checksum: 4b8d508d8a0f6e604addb286975f1fa670f8c3964a67abc03a7cfcfd4cdeca4b07dda6655e1c4425427fb62e4d2b0ca59d84f1b2cd83262ff73616d5d3ccdeb5 - languageName: node - linkType: hard - "terser@npm:^4.1.2, terser@npm:^4.6.3": version: 4.8.0 resolution: "terser@npm:4.8.0" @@ -34302,7 +33304,7 @@ __metadata: languageName: node linkType: hard -"terser@npm:^5.10.0, terser@npm:^5.14.1": +"terser@npm:^5.10.0, terser@npm:^5.14.1, terser@npm:^5.3.4": version: 5.14.2 resolution: "terser@npm:5.14.2" dependencies: @@ -34316,20 +33318,6 @@ __metadata: languageName: node linkType: hard -"terser@npm:^5.3.4, terser@npm:^5.7.2": - version: 5.14.1 - resolution: "terser@npm:5.14.1" - dependencies: - "@jridgewell/source-map": ^0.3.2 - acorn: ^8.5.0 - commander: ^2.20.0 - source-map-support: ~0.5.20 - bin: - terser: bin/terser - checksum: 7b0e51f3d193a11cad82f07e3b0c1d62122eec786f809bdf2a54b865aaa1450872c3a7b6c33b5a40e264834060ffc1d4e197f971a76da5b0137997d756eb7548 - languageName: node - linkType: hard - "test-exclude@npm:^6.0.0": version: 6.0.0 resolution: "test-exclude@npm:6.0.0" @@ -34858,7 +33846,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:2.4.0, tslib@npm:^2.1.0": +"tslib@npm:2.4.0, tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.2.0, tslib@npm:^2.3.0, tslib@npm:^2.3.1": version: 2.4.0 resolution: "tslib@npm:2.4.0" checksum: 8c4aa6a3c5a754bf76aefc38026134180c053b7bd2f81338cb5e5ebf96fefa0f417bff221592bf801077f5bf990562f6264fecbc42cd3309b33872cb6fc3b113 @@ -34872,7 +33860,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.2.0, tslib@npm:^2.3.0, tslib@npm:^2.3.1, tslib@npm:~2.3.1": +"tslib@npm:~2.3.1": version: 2.3.1 resolution: "tslib@npm:2.3.1" checksum: de17a98d4614481f7fcb5cd53ffc1aaf8654313be0291e1bfaee4b4bb31a20494b7d218ff2e15017883e8ea9626599b3b0e0229c18383ba9dce89da2adf15cb9 @@ -35986,6 +34974,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:^9.0.0": + version: 9.0.0 + resolution: "uuid@npm:9.0.0" + bin: + uuid: dist/bin/uuid + checksum: 8dd2c83c43ddc7e1c71e36b60aea40030a6505139af6bee0f382ebcd1a56f6cd3028f7f06ffb07f8cf6ced320b76aea275284b224b002b289f89fe89c389b028 + languageName: node + linkType: hard + "v8-compile-cache-lib@npm:^3.0.1": version: 3.0.1 resolution: "v8-compile-cache-lib@npm:3.0.1" @@ -36132,7 +35129,7 @@ __metadata: languageName: node linkType: hard -"vm2@npm:^3.9.10": +"vm2@npm:^3.9.11, vm2@npm:^3.9.8": version: 3.9.11 resolution: "vm2@npm:3.9.11" dependencies: @@ -36144,18 +35141,6 @@ __metadata: languageName: node linkType: hard -"vm2@npm:^3.9.8": - version: 3.9.9 - resolution: "vm2@npm:3.9.9" - dependencies: - acorn: ^8.7.0 - acorn-walk: ^8.2.0 - bin: - vm2: bin/vm2 - checksum: ea4859565668918b53cf8c087bc18e2a9506f9f4ef919528707a6fecf50a110a2a8c48bc0c7a754c9d12b97cd16775f005b2b941e99d3a52aadfaac5ce77e04d - languageName: node - linkType: hard - "void-elements@npm:3.1.0": version: 3.1.0 resolution: "void-elements@npm:3.1.0" @@ -36523,44 +35508,7 @@ __metadata: languageName: node linkType: hard -"webpack@npm:>=4.43.0 <6.0.0": - version: 5.73.0 - resolution: "webpack@npm:5.73.0" - dependencies: - "@types/eslint-scope": ^3.7.3 - "@types/estree": ^0.0.51 - "@webassemblyjs/ast": 1.11.1 - "@webassemblyjs/wasm-edit": 1.11.1 - "@webassemblyjs/wasm-parser": 1.11.1 - acorn: ^8.4.1 - acorn-import-assertions: ^1.7.6 - browserslist: ^4.14.5 - chrome-trace-event: ^1.0.2 - enhanced-resolve: ^5.9.3 - es-module-lexer: ^0.9.0 - eslint-scope: 5.1.1 - events: ^3.2.0 - glob-to-regexp: ^0.4.1 - graceful-fs: ^4.2.9 - json-parse-even-better-errors: ^2.3.1 - loader-runner: ^4.2.0 - mime-types: ^2.1.27 - neo-async: ^2.6.2 - schema-utils: ^3.1.0 - tapable: ^2.1.1 - terser-webpack-plugin: ^5.1.3 - watchpack: ^2.3.1 - webpack-sources: ^3.2.3 - peerDependenciesMeta: - webpack-cli: - optional: true - bin: - webpack: bin/webpack.js - checksum: aa434a241bad6176b68e1bf0feb1972da4dcbf27cb3d94ae24f6eb31acc37dceb9c4aae55e068edca75817bfe91f13cd20b023ac55d9b1b2f8b66a4037c9468f - languageName: node - linkType: hard - -"webpack@npm:^5.9.0": +"webpack@npm:>=4.43.0 <6.0.0, webpack@npm:^5.9.0": version: 5.74.0 resolution: "webpack@npm:5.74.0" dependencies: @@ -37002,22 +35950,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.2.3": - version: 8.8.0 - resolution: "ws@npm:8.8.0" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 6ceed1ca1cb800ef60c7fc8346c7d5d73d73be754228eb958765abf5d714519338efa20ffe674167039486eb3a813aae5a497f8d319e16b4d96216a31df5bd95 - languageName: node - linkType: hard - -"ws@npm:^8.8.1": +"ws@npm:^8.2.3, ws@npm:^8.8.1": version: 8.8.1 resolution: "ws@npm:8.8.1" peerDependencies: